text
stringlengths
2.85k
2.55M
label
class label
11 classes
ExprGAN: Facial Expression Editing with Controllable Expression Intensity Hui Ding,1 Kumar Sricharan2 , Rama Chellappa3 arXiv:1709.03842v2 [cs.CV] 13 Sep 2017 1,3 University of Maryland, College Park 2 PARC, Palo Alto Abstract Facial expression editing is a challenging task as it needs a high-level semantic understanding of the input face image. In conventional methods, either paired training data is required or the synthetic face’s resolution is low. Moreover, only the categories of facial expression can be changed. To address these limitations, we propose an Expression Generative Adversarial Network (ExprGAN) for photo-realistic facial expression editing with controllable expression intensity. An expression controller module is specially designed to learn an expressive and compact expression code in addition to the encoder-decoder network. This novel architecture enables the expression intensity to be continuously adjusted from low to high. We further show that our ExprGAN can be applied for other tasks, such as expression transfer, image retrieval, and data augmentation for training improved face expression recognition models. To tackle the small size of the training database, an effective incremental learning scheme is proposed. Quantitative and qualitative evaluations on the widely used Oulu-CASIA dataset demonstrate the effectiveness of ExprGAN. Introduction Facial expression editing is the task that transforms the expression of a given face image to a target one without affecting the identity properties. It has applications in facial animation, human-computer interactions, entertainment, etc. The area has been attracting considerable attention both from academic and industrial research communities. Existing methods that address expression editing can be divided into two categories. One category tries to manipulate images by reusing parts of existing ones (Yang et al. 2011; Mohammed, Prince, and Kautz 2009; Yeh et al. 2016) while the other resorts to synthesis techniques to generate a face image with the target expression (Susskind et al. 2008; Reed et al. 2014; Cheung et al. 2014). In the first category, traditional methods (Yang et al. 2011) often make use of the expression flow map to transfer an expression by image warping. Recently, Yeh et al. (2016) applies the idea to a variational autoencoder to learn the flow field. Although the generated face image has high resolution, paired data where one subject has different expressions are needed to train the model. In the second category, deep learning-based methods are mainly used. The early work by Susskind et al. (2008) uses a deep belief network to generate emotional faces, which can be controlled by the Facial Action Coding System (FACS) labels. In (Reed et al. 2014), a three-way gated Boltzmann machine is employed to model the relationships between the expression and identity. However, the synthesized image of these methods has low resolution (48 x 48), lacking fine details and tending to be blurry. Moreover, existing works can only transform the expression to different classes, like Angry or Happy. However, in reality, the intensity of facial expression is often displayed over a range. For example, humans can express the Happy expression either with a huge grin or by a gentle smile. Thus it is appealing if both the type of the expression and its intensity can be controlled simultaneously. Motivated by this, in this paper, we present a new expression editing model, Expression Generative Adversarial Network (ExprGAN) which has the unique property that multiple diverse styles of the target expression can be synthesized where the intensity of the generated expression is able to be controlled continuously from weak to strong, without the need for training data with intensity values. To achieve this goal, we specially design an expression controller module. Instead of feeding in a deterministic onehot vector label like previous works, the expression code generated by the expression controller module is used. It is a real-valued vector conditioned on the label, thus more complex information such as expression intensity can be described. Moreover, to force each dimension of the expression code to capture a different factor of the intensity variations, the conditional mutual information between the generated image and the expression code is maximized by a regularizer network. Our work is inspired by the recent success of the image generative model, where a generative adversarial network (Goodfellow et al. 2014) learns to produce samples similar to a given data distribution through a two-player game between a generator and a discriminator. Our ExprGAN also adopts the generator and discriminator framework in addition to the expression controller module and regularizer network. However, to facilitate image editing, the generator is composed of an encoder and a decoder. The input of the encoder is a face image, the output of the decoder is a reconstructed one, and the learned identity and expression representations bridge the encoder and decoder. To preserve the most prominent facial structure, we adopt a multi-layer perceptual loss (Johnson, Alahi, and Fei-Fei 2016) in the feature space in addition to the pixel-wise L1 loss. Moreover, to make the synthesized image look more photo-realistic, two adversarial networks are imposed on the encoder and decoder, respectively. Because it is difficult to directly train our model on the small training set, a threestage incremental learning algorithm is also developed. The main contributions of our work are as follows: • We propose a novel model called ExprGAN that can change a face image to a target expression with multiple styles, where the expression intensity can also be controlled continuously. • We show that the synthesized face images have high perceptual quality, which can be used to improve the performance of an expression classifier. • Our identity and expression representations are explicitly disentangled which can be exploited for tasks such as expression transfer, image retrieval, etc. • We develop an incremental training strategy to train the model on a relative small dataset without the rigid requirement of paired samples. Related Works Deep Generative Model Deep generative models have achieved impressive success in recent years. There are two major approaches: generative adversarial network (GAN) (Goodfellow et al. 2014) and variational autoencoder (VAE) (Kingma and Welling 2014). GAN is composed of a generator and a discriminator, where the training is carried out with a minimax two-player game. GAN has been used for image synthesis (Radford, Metz, and Chintala 2016), image superresolution (Ledig et al. 2017), etc. One interesting extension of GAN is Conditional GAN (CGAN) (Mirza and Osindero 2014) where the generated image can be controlled by the condition variable. On the other hand, VAE is a probabilistic model with an encoder to map an image to a latent representation and a decoder to reconstruct the image. A reparametrization trick is proposed which enables the model to be trained by backpropogation (Rumelhart et al. 1988). One variant of VAE is Adversarial Autoencoder (Makhzani et al. 2016), where an adversarial network is adopted to regularize the latent representation to conform to a prior distribution. Our ExprGAN also adopts an autoencoder structure, but there are two main differences: First, an expression controller module is specially designed, so a face with different types of expressions across a wide range of intensities can be generated. Second, to improve the generated image quality, a face identity preserving loss and two adversarial losses are incorporated. Facial Expression Editing Facial expression editing has been actively investigated in computer graphics. Traditional approaches include 3D model-based (Blanz et al. 2003), 2D expression mapping-based (Liu, Shan, and Zhang 2001) and flow-based (Yang et al. 2011). Recently, deep learningbased methods have been proposed. Susskind et al. (2008) studied a deep belief network to generate facial expression given high-level identity and facial action unit (AU) labels. In (Reed et al. 2014), a higher-order Boltzman machine with multiplicative interactions was proposed to model the distinct factors of variation. Cheung et al. (2014) proposed a decorrelating regularizer to disentangle the variations between identity and expression in an unsupervised manner. However, the generated image is low resolution with size of 48 x 48, which is not visually satisfying. Recently, Yeh et al. (2016) proposed to edit the facial expression by image warping with appearance flow. Although the model can generate high-resolution images, paired samples as well as the labeled query image are required. The most similar work to ours is CFGAN (Kaneko, Hiramatsu, and Kashino 2017), which uses a filter module to control the generated face attributes. However, there are two main differences: First, CFGAN adopts the CGAN architecture where an encoder needs to be trained separately for image editing. While for the proposed ExprGAN, the encoder and the decoder are constructed in a unified framework. Second, the attribute filter of CFGAN is mainly designed for a single class, while our expression controller module works for multiple categories. Most recently, Zhang, Song, and Qi (2017) proposed a conditional AAE (CAAE) for face aging, which can also be applied for expression editing. Compared with these studies, our ExprGAN has two main differences: First, in addition to transforming a given face image to a new facial expression, our model can also control the expression intensity continuously without the intensity training labels; Second, photo-realistic face images with new identities can be generated for data augmentation, which is found to be useful to train an improved expression classifier. Proposed Method In this section, we describe our Expression Generative Adversarial Network (ExprGAN). We first describe the Conditional Generative Adversarial Network (CGAN) (Mirza and Osindero 2014) and Adversarial Autoencoder (AAE) (Makhzani et al. 2016), which form the basis of ExprGAN. Then the formulation of ExprGAN is explained. The architectures of the three models are shown in Fig. 1. Conditional Generative Adversarial Network CGAN is an extension of a GAN (Goodfellow et al. 2014) for conditional image generation. It is composed of two networks: a generator network G and a discriminator network D that compete in a two-player minimax game. Network G is trained to produce a synthetic image x̂ = G(z, y) to fool D to believe it is an actual photograph, where z and y are the random noise and condition variable, respectively. D tries to distinguish the real image x and the generated one x̂. Mathematically, the objective function for G and D can be written as follows: min max Ex,y∼Pdata (x,y) [log D(x, y)] G D + Ez∼Pz (z),y∼Py (y) [log(1 − D(G(z, y), y))] (1) 𝑒𝑥𝑝𝑟𝑒𝑠𝑠𝑖𝑜𝑛 = 𝑐F … 𝑟𝑒𝑎𝑙/𝑓𝑎𝑘𝑒 𝑟𝑒𝑎𝑙/𝑓𝑎𝑘𝑒 𝐷 𝐷 𝑥" 𝐷@AB /𝑄 𝑔(𝑥) 𝐺,)+ 𝑥 𝑒𝑥𝑝𝑟𝑒𝑠𝑠𝑖𝑜𝑛 = 𝑐G 𝑟𝑒𝑎𝑙/𝑓𝑎𝑘𝑒 𝑥" 𝑥" 𝑥 𝑧 𝐺,)+ 𝑧 𝑃. (𝑧) 𝐺)*+ 𝐹+9:; 𝑐𝑙𝑎𝑠𝑠  𝑦 𝑥 𝑛𝑜𝑖𝑠𝑒  𝑧 (a) Conditional GAN (b) Adversarial Autoencoder 𝑐𝑙𝑎𝑠𝑠  𝑦 𝑛𝑜𝑖𝑠𝑒  𝑧? 𝑔(𝑥) 𝐷. 𝑟𝑒𝑎𝑙/𝑓𝑎𝑘𝑒 𝐺 𝑒𝑥𝑝𝑟𝑒𝑠𝑠𝑖𝑜𝑛  𝑐 𝐺)*+ 𝑥 (c) ExprGAN Figure 1: Comparison of previous GAN architectures and our proposed ExprGAN. Adversarial Autoencoder AAE (Makhzani et al. 2016) is a probabilistic autoencoder which consists of an encoder Genc , a decoder Gdec and a discriminator D. Apart from the reconstruction loss, the hidden code vector g(x) = Genc (x) is also regularized by an adversarial network to impose a prior distribution Pz (z). Network D aims to discriminate g(x) from z ∼ Pz (z), while Genc is trained to generate g(x) that could fool D. Thus, the AAE objective function becomes: min Genc ,Gdec max Lp (Gdec (Genc (x)), x) D + Ez∼Pz (z) [log D(z)] + Ex∼Pdata (x) [log(1 − D(Genc (x))] (2) where Lp (, ) is the pth norm: Lp (x0 , x) = ||x0 − x||pp Expression Generative Adversarial Network Given a face image x with expression label y, the objective of our learning problem is to edit the face to display a new type of expression at different intensities. Our approach is to train a ExprGAN conditional on the original image x and the expression label y with its architecture illustrated in Fig. 1 (c). Network Architecture ExprGAN first applies an encoder Genc to map the image x to a latent representation g(x) that preserves identity. Then, an expression controller module Fctrl is adopted to convert the one-hot expression label y to a more expressive expression code c. To further constrain the elements of c to capture the various aspects of the represented expression, a regularizer Q is exploited to maximize the conditional mutual information between c and the generated image. Finally, the decoder Gdec generates a reconstructed image x̂ combining the information from g(x) and c. To further improve the generated image quality, a discriminator Dimg on the decoder Gdec is used to refine the synthesized image x̂ to have photo-realistic textures. Moreover, to better capture the face manifold, a discriminator Dz on the encoder Genc is applied to ensure the learned identity representation is filled and exhibits no “holes” (Makhzani et al. 2016). Expression Controller Networks Fctrl and Q In previous conditional image generation methods (Tran, Yin, and Liu 2017; Zhang, Song, and Qi 2017), a binary one-hot vector is usually adopted as the condition variable. This is enough for generating images corresponding to different categories. However, for our problem, a stronger control over the synthesized facial expression is needed: we want to change the expression intensity in addition to generating different types of expressions. To achieve this goal, an expression controller module Fctrl is designed to ensure the expression code c can describe the property of the expression intensity except the category information. Furthermore, a regularizer network Q is proposed to enforce the elements of c to capture the multiple levels of expression intensity comprehensively. Expression Controller Module Fctrl To enhance the description capability, Fctrl transforms the binary input y to a continuous representation c by the following operation: ci = Fctrl (yi , zy ) = |zy | · (2yi − 1) i = 1, 2, . . . , K (3) where the inputs are the expression label y ∈ {0, 1}K and uniformly distributed zy ∼ U (−1, 1)d , while the output is the expression code c = [cT1 , . . . , cTK ]T ∈ RKd , K is the number of classes. If the ith class expression is present, i.e., yi = 1, ci ∈ Rd is set to be a positive vector within 0 and 1, while cj , j 6= i has negative values from -1 to 0. Thus, in testing, we can manipulate the elements of c to generate the desired expression type. This flexibility greatly increases the controllability of c over synthesizing diverse styles and intensities of facial expressions. Regularizer on Expression Code Q It is desirable if each dimension of c could learn a different factor of the expression intensity variations. Then faces with a specific intensity level can be generated by manipulating the corresponding expression code. To enforce this constraint, we impose a regularization on c by maximizing the conditional mutual information I(c; x̂|y) between the generated image x̂ and the expression code c. This ensures that the expression type and intensity encoded in c is reflected in the image generated by the decoder. The direct computation of I is hard since it requires the posterior P (c|x̂, y), which is generally intractable. Thus, a lower bound is derived with variational inference which extends (Chen et al. 2016) to the conditional setting: I(c; x̂|y) = H(c|y) − H(c|x̂, y) = Ex̂∼Gdec (g(x),c) [Ec0 ∼P (c0 |x̂,y) [log P (c0 |x̂, y)]] + H(c|y) Discriminator on Identity Representation Dz It is a well known fact that face images lie on a manifold (He et al. 2005; Lee et al. 2003). To ensure that face images generated by interpolating between arbitrary identity representations do not deviate from the face manifold (Zhang, Song, and Qi 2017), we impose a uniform distribution on g(x), forcing it to populate the latent space evenly without “holes”. This is achieved through an adversarial training process where the training objective is: min max Lzadv =Ez∼Pz (z) [log Dz (z)] Genc Dz + Ex∼Pdata (x) [log(1 − Dz (Genc (x))] (8) Discriminator on Image Dimg Similar to existing methods (Huang et al. 2017; Tran, Yin, and Liu 2017), an adversarial loss between the generated image x̂ and the real image x is further adopted to improve the photorealism: min = Ex̂∼Gdec (g(x),c) [DKL (P (·|x̂, y)||Q(·|x̂, y))+ Ex,y∼Pdata (x,y),zy ∼Pzy (zy ) Ec0 ∼P (c0 |x̂,y) [log Q(c0 |x̂, y)]] + H(c|y) [log(1 − Dimg (Gdec (Genc (x), Fctrl (zy , y)), y))] (9) ≥ Ex̂∼Gdec (g(x),c) [Ec0 ∼P (c0 |x̂,y) [log Q(c0 |x̂, y)]] + H(c|y) = Ec∼P (c|y),x̂∼Gdec (g(x),c) [log Q(c|x̂, y)] + H(c|y) (4) For simplicity, the distribution of c is fixed, thus H(c|y) is treated as a constant. Here the auxiliary distribution Q is parameterized as a neural network, thus the final loss function is defined as follows: min LQ = −Ec∼P (c|y),x̂∼Gdec (g(x),c) [log Q(c|x̂, y)] (5) Q Generator Network G The generator network G = (Genc , Gdec ) adopts the autoencoder structure where the encoder Genc first transforms the input image x to a latent representation that preserves as much identity information as possible. After obtaining the identity code g(x) and the expression code c, the decoder Gdec then generates a synthetic image x̂ = Gdec (Genc (x), c) which should be identical as x. For this purpose, a pixel-wise image reconstruction loss is used: min Genc ,Gdec Lpixel = L1 (Gdec (Genc (x), c), x) (6) To further preserve the face identity between x and x̂, a pre-trained discriminative deep face model is leveraged to enforce the similarity in the feature space: X βl L1 (φl (Gdec (Genc (x), c)), φl (x)) min Lid = Genc ,Gdec max Limg adv = Ex,y∼Pdata (x,y) [log Dimg (x, y)]+ Genc ,Gdec Dimg l (7) where φl are the lth layer feature maps of a face recognition network, and βl is the corresponding weight. We use the activations at the conv1 2, conv2 2, conv3 2, conv4 2 and conv5 2 layer of the VGG face model (Parkhi et al. 2015). Overall Objective Function The final training loss function is a weighted sum of all the losses defined above: min max LExprGAN = Lpixel + λ1 Lid + λ2 LQ Genc ,Gdec ,Q Dimg ,Dz z + λ3 Limg adv + λ4 Ladv + λ5 Ltv (10) We also impose a total variation regularization Ltv (Mahendran and Vedaldi 2015) on the reconstructed image to reduce spike artifacts. Incremental Training Empirically we find that jointly training all the subnetworks yields poor results as we have multiple loss functions. It is difficult for the model to learn all the functions at one time considering the small size of the dataset. Therefore, we propose an incremental training algorithm to train the proposed ExprGAN. Overall our incremental training strategy can be seen as a form of curriculum learning, and includes three stages: controller learning stage, image reconstruction stage and image refining stage. First, we teach the network to generate the image conditionally by training Gdec , Q and Dimg where the loss function only includes LQ and Limg adv . g(x) is set to be random noise in this stage. After the training finishes, we then teach the network to learn the disentangled representations by reconstructing the input image with Genc and Gdec . To ensure that the network does not forget what is already learned, Q is also trained but with a decreased weight. So the loss function has three parts: Lpixel , Lid and LQ . Finally, we train the whole network to refine the image to be more photo-realistic by adding Dimg and Dz with the loss function defined in (10). We find in our experiments that stage-wise training is crucial to learn the desired model on the small dataset. Experiments We first describe the experimental setup then three main applications: expression editing with continuous control over intensity, facial expression transfer and conditional face image generation for data augmentation . GT ExprGAN Happy CAAE Dataset We evaluated the proposed ExprGAN on the widely used Oulu-CASIA (Zhao et al. 2011) dataset. Oulu-CASIA has 480 image sequences taken under Dark, Strong, Weak illumination conditions. In this experiment, only videos with Strong condition captured by a VIS camera are used. There are 80 subjects and six expressions, i.e., Angry, Disgust, Fear, Happy, Sad and Surprise. The first frame is always neutral while the last frame has the peak expression. Only the last three frames are used, and the total number of images is 1440. Training and testing sets are divided based on identity, with 1296 for training and 144 for testing. We aligned the faces using the landmarks detected from (Zhang et al. 2016), then cropped and resized the images to dimension of 128 x 128. Lastly, we normalized the pixel values into range of [-1, 1]. To alleviate overfitting, we augmented the training data with random flipping. GT ExprGAN Sad CAAE GT ExprGAN Fear CAAE Input Angry Disgust Fear Happy Sad Surprise Implementation Details The ExprGAN mainly builds on multiple upsampling and downsampling blocks. The upsampling block consists of the nearest-neighbor upsampling followed by a 3 x 3 stride 1 convolution. The downsampling block consists of a 5 x 5 stride 2 convolution. Specifically, Genc has 5 downsampling blocks where the numbers of channels are 64, 128, 256, 512, 1024 and one FC layer to get the identity representation g(x). For Gdec , it has 7 upsampling blocks with 512, 256, 128, 64, 32, 16, 3 channels. Dz consists of 4 FC layers with 64, 32, 16, 1 channels. We model Q(c|x̂, y) as a factored Gaussian, and share many parts of Q with Dimg to reduce computation cost. The shared parts have 4 downsampling blocks with 16, 32, 64, 128 channels and one FC layer to output a 1024-dim representation. Then it is branched into two heads, one for Dimg and one for Q. Q has K branches {Qi }K i=1 where each Qi has two individual FC layers with 64, d channels to predict the expression code ci . Leaky ReLU (Maas, Hannun, and Ng 2013) and batch normalization (Ioffe and Szegedy 2015) are applied to Dimg and Dz , while ReLU (Krizhevsky, Sutskever, and Hinton 2012) activation is used in Genc and Gdec . The random noise z is uniformly distributed from -1 to 1. We fixed the dimensions of g(x) and c to be 50 and 30, and found this configuration sufficient for representing the identity and expression variations. We train the networks using the Adam optimizer (Kingma and Ba 2014), with learning rate of 0.0002, β1 = 0.5, β2 = 0.999 and mini-batch size of 48. In the image refining stage, we empirically set λ1 = 1, λ2 = 1, λ3 = 0.01, λ4 = 0.01, λ5 = 0.001. The model is implemented using Tensorflow (Abadi et al. 2016). Figure 2: Visual comparison of facial expression editing results. For each input, we compare the ground truth images (top), the synthetic images of ExprGAN (middle) and CAAE (bottom). Zoom in for details. Facial Expression Editing In this part, we demonstrate our model’s ability to edit the expression of a given face image. To do this, we first input the image to Genc to obtain an identity representation g(x). Then with the decoder Gdec , a face image of the desired expression i can be generated by setting ci to be positive and cj , j 6= i to be negative. A positive (negative) value indicates the represented expression is present (absent). Here 1 and -1 are used. Some example results are shown in Fig. 2. The left column contains the original input images, while the middle row in the right column contains the synthesized faces corresponding to six different expressions. For comparison, the ground truth images and the results from the recent proposed CAAE (Zhang, Song, and Qi 2017) are also shown in the first and third row, respectively. We can see faces generated by our ExprGAN preserve the identities well. Even some subtle details like the transparent eyeglasses are also kept. Moreover, the synthesized expressions look natural. While CAAE failed to transform the input faces to new expressions with fine details, and the generated faces are blurry. We now demonstrate that our model can transform a face image to new types of expressions with continuous intensity. This is achieved by exploiting the fact that each dimension of the expression code captures a specific level of expression intensity. In particular, to vary the intensity of the desired Disgust Sad Weak Strong Angry Disgust Fear Happy Sad Surprise Neutral Angry Disgust Fear Happy Sad Surprise Neutral Figure 3: Face images are transformed to new expressions with different intensity levels. The top row contains the input faces with the original expressions, and the rest rows are the synthesized results. Each column corresponds to a new expression with five intensity levels from weak to strong. The Neutral expression which is not in the training data is also able to be generated. class i, we set the individual element of the expression code ci to be 1, while the other dimensions of ci and all other cj , j 6= i to be -1. The generated results are shown in Fig. 3. Take the Happy expression in the forth column as an example. The face in the first row which corresponds to the first element of ci being 1 displays a gentle smile with mouth closed, while a big smile with white teeth is synthesized in the last row that corresponds to the fifth element of ci being 1. Moreover, when we set all ci to be -1, a Neutral expression is able to be generated even though this expression class is not present in the training data. This validates that the expression code discovers the diverse spectrum of expression intensity in an unsupervised way, i.e., without the training data containing explicit labels for intensity levels. Facial Expression Transfer In this part, we demonstrate our model’s ability to transfer the expression of another face image xB to a given face image xA . To do this, we first input xA to Genc to get the identity representation g(xA ). Then we train an expression classifier to predict the expression label yB of xB . With yB and xB , the expression code cB can be obtained from Q. Finally, we can get an image with identity A and expression B from Gdec (g(xA ), cB ). The generated images are shown in Fig. 4. We observe that faces having the source identities and expressions similar to the target ones can be synthesized even for some very challenging cases. For example, when the expression Happy is transferred to an Angry face, the teeth region which does not exist in the source image is also able to be generated. IdA ExprB IdA+ExprB IdA ExprB IdA+ExprB Figure 4: Facial expression transfer. Expressions from the middle column are transferred to faces in the left column. The results are shown in the right column. Face Image Generation for Data Augmentation In this part, we first show our model’s ability to generate high-quality face images controlled by the expression label, then quantitatively demonstrate the usefulness of the synthesized images. To generate faces with new identities, we feed in random noise and expression code to Gdec . The results are shown in Fig. 5. Each column shows the same subject displaying different expressions. We can see the synthesized face images look realistic. Moreover, because of the design of the expression controller module, the generated expressions for the same class are also diverse. For example, for the class Happy, there are big smile with teeth and slight smile with mouth closed. We further demonstrate that the images synthesized by our model can be used for data augmentation to train a ro- Disgust Angry Fear Happy Sad Figure 6: Identity feature space. Each color represents a different identity and the images for one identity are labeled. Surprise Figure 5: Random generated subjects displaying six categories of expressions. Table 1: Comparison of expression recognition accuracy with different numbers of synthesized images. # Syn. Images 0 3K 6K 30K 60K Accuracy (%) 77.78 78.47 81.94 84.72 84.72 bust expression classifier. Specifically, for each expression category, we generate 0.5K, 1K, 5K, and 10K images, respectively. The classifier has the same network architecture as Genc except one additional FC layer with six neurons is added. The results are shown in Table 1. We can see by only adding 3K synthetic images, the improvement is marginal, with an accuracy of 78.47% vs. 77.78%. However, when the number is increased to 30K, the recognition accuracy is improved significantly, reaching to 84.72% with a relative error reduction by 31.23%. The performance starts to saturate when more images (60K) are utilized. This validates the synthetic face images have high perceptual quality. same expression. While the images retrieved by y do not always have the same style of expressions as the queries. For example, the query face in the second row shows a big smile with teeth, but the retrieved image by y only has a mild smile with mouth closed. However, with the expression code c, we observe that face images with similar expressions are always retrieved. This validates that the expression code learns a rich and diverse feature representation. Query 𝑐 𝑦 𝑥 Figure 7: Expression-based image retrieval. First column shows query images. Other columns show top one retrieval based on c, y and x. Feature Visualization In this part, we demonstrate that the identity g(x) and expression c representations learned by our model are disentangled. To show this, we first use t-SNE (Maaten and Hinton 2008) to visualize the 50-dim identity feature g(x) on a two dimensional space. The results are shown in Fig. 6. We can see that most of the subjects are well separated, which confirms the latent identity features g(x) learn to preserve the identity information. To demonstrate that the expression code c captures the high-level expression semantics, we perform image retrieval experiment based on c in terms of Euclidean distance. For comparison, the results with expression label y and image pixel space x are also provided in Fig. 7. As expected, the pixel space x sometimes fails to retrieve images from the Conclusions This paper presents ExprGAN for facial expression editing. To the best of our knowledge, it is the first GAN-based model that can transform the face image to a new expression where the expression intensity is allowed to be controlled continuously. The proposed model learns the disentangled identity and expression representations explicitly, allowing for a wide variety of applications, including expression editing, expression transfer, and data augmentation for training improved face expression recognition models. We further develop an incremental learning scheme to train the model on small datasets. Our future work will explore how to apply ExprGAN to a larger and more unconstrained facial expression dataset. References [Abadi et al. 2016] Abadi, M.; Agarwal, A.; Barham, P.; Brevdo, E.; Chen, Z.; Citro, C.; Corrado, G. S.; Davis, A.; Dean, J.; Devin, M.; et al. 2016. Tensorflow: Largescale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467. [Blanz et al. 2003] Blanz, V.; Basso, C.; Poggio, T.; and Vetter, T. 2003. Reanimating faces in images and video. In Computer graphics forum, volume 22, 641–650. Wiley Online Library. [Chen et al. 2016] Chen, X.; Duan, Y.; Houthooft, R.; Schulman, J.; Sutskever, I.; and Abbeel, P. 2016. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2172–2180. [Cheung et al. 2014] Cheung, B.; Livezey, J. A.; Bansal, A. K.; and Olshausen, B. A. 2014. Discovering hidden factors of variation in deep networks. arXiv preprint arXiv:1412.6583. [Goodfellow et al. 2014] Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; and Bengio, Y. 2014. Generative adversarial nets. In NIPS, 2672–2680. [He et al. 2005] He, X.; Yan, S.; Hu, Y.; Niyogi, P.; and Zhang, H.-J. 2005. Face recognition using laplacianfaces. IEEE TPAMI 27(3):328–340. [Huang et al. 2017] Huang, R.; Zhang, S.; Li, T.; and He, R. 2017. Beyond face rotation: Global and local perception gan for photorealistic and identity preserving frontal view synthesis. ICCV. [Ioffe and Szegedy 2015] Ioffe, S., and Szegedy, C. 2015. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 448–456. [Johnson, Alahi, and Fei-Fei 2016] Johnson, J.; Alahi, A.; and Fei-Fei, L. 2016. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 694–711. Springer. [Kaneko, Hiramatsu, and Kashino 2017] Kaneko, T.; Hiramatsu, K.; and Kashino, K. 2017. Facial expression editing in video using a temporally-smooth factorization. In CVPR. IEEE. [Kingma and Ba 2014] Kingma, D., and Ba, J. 2014. Adam: A method for stochastic optimization. ICLR. [Kingma and Welling 2014] Kingma, D. P., and Welling, M. 2014. Auto-encoding variational bayes. NIPS. [Krizhevsky, Sutskever, and Hinton 2012] Krizhevsky, A.; Sutskever, I.; and Hinton, G. E. 2012. Imagenet classification with deep convolutional neural networks. In NIPS, 1097–1105. [Ledig et al. 2017] Ledig, C.; Theis, L.; Huszár, F.; Caballero, J.; Cunningham, A.; Acosta, A.; Aitken, A.; Tejani, A.; Totz, J.; Wang, Z.; et al. 2017. Photo-realistic single image super-resolution using a generative adversarial network. CVPR. [Lee et al. 2003] Lee, K.-C.; Ho, J.; Yang, M.-H.; and Kriegman, D. 2003. Video-based face recognition using probabilistic appearance manifolds. In CVPR, volume 1, I–I. IEEE. [Liu, Shan, and Zhang 2001] Liu, Z.; Shan, Y.; and Zhang, Z. 2001. Expressive expression mapping with ratio images. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques, 271–276. ACM. [Maas, Hannun, and Ng 2013] Maas, A. L.; Hannun, A. Y.; and Ng, A. Y. 2013. Rectifier nonlinearities improve neural network acoustic models. In ICML, volume 30. [Maaten and Hinton 2008] Maaten, L. v. d., and Hinton, G. 2008. Visualizing data using t-sne. JMLR 9(Nov):2579– 2605. [Mahendran and Vedaldi 2015] Mahendran, A., and Vedaldi, A. 2015. Understanding deep image representations by inverting them. In CVPR, 5188–5196. [Makhzani et al. 2016] Makhzani, A.; Shlens, J.; Jaitly, N.; Goodfellow, I.; and Frey, B. 2016. Adversarial autoencoders. ICLR Workshop. [Mirza and Osindero 2014] Mirza, M., and Osindero, S. 2014. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784. [Mohammed, Prince, and Kautz 2009] Mohammed, U.; Prince, S. J.; and Kautz, J. 2009. Visio-lization: generating novel facial images. In ACM TOG, volume 28, 57. ACM. [Parkhi et al. 2015] Parkhi, O. M.; Vedaldi, A.; Zisserman, A.; et al. 2015. Deep face recognition. In BMVC, volume 1, 6. [Radford, Metz, and Chintala 2016] Radford, A.; Metz, L.; and Chintala, S. 2016. Unsupervised representation learning with deep convolutional generative adversarial networks. ICLR. [Reed et al. 2014] Reed, S.; Sohn, K.; Zhang, Y.; and Lee, H. 2014. Learning to disentangle factors of variation with manifold interaction. In ICML, 1431–1439. [Rumelhart et al. 1988] Rumelhart, D. E.; Hinton, G. E.; Williams, R. J.; et al. 1988. Learning representations by back-propagating errors. Cognitive modeling 5(3):1. [Susskind et al. 2008] Susskind, J. M.; Hinton, G. E.; Movellan, J. R.; and Anderson, A. K. 2008. Generating facial expressions with deep belief nets. In Affective Computing. InTech. [Tran, Yin, and Liu 2017] Tran, L.; Yin, X.; and Liu, X. 2017. Disentangled representation learning gan for poseinvariant face recognition. In CVPR, volume 4, 7. [Yang et al. 2011] Yang, F.; Wang, J.; Shechtman, E.; Bourdev, L.; and Metaxas, D. 2011. Expression flow for 3daware face component transfer. In ACM TOG, volume 30, 60. ACM. [Yeh et al. 2016] Yeh, R.; Liu, Z.; Goldman, D. B.; and Agarwala, A. 2016. Semantic facial expression editing using autoencoded flow. arXiv preprint arXiv:1611.09961. [Zhang et al. 2016] Zhang, K.; Zhang, Z.; Li, Z.; and Qiao, Y. 2016. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Process. Lett. 23(10):1499–1503. [Zhang, Song, and Qi 2017] Zhang, Z.; Song, Y.; and Qi, H. 2017. Age progression/regression by conditional adversarial autoencoder. CVPR. [Zhao et al. 2011] Zhao, G.; Huang, X.; Taini, M.; Li, S. Z.; and Pietikäinen, M. 2011. Facial expression recognition from near-infrared videos. Image and Vision Computing 29(9):607–619.
1cs.CV
arXiv:1703.01654v2 [math.ST] 2 Jul 2017 Une alternative robuste au maximum de vraisemblance : la ρ-estimation Yannick Baraud et Lucien Birgé 1er juillet 2017 Résumé Cet article est fondé sur les notes du mini-cours que nous avons donné le 5 janvier 2017 à l’Institut Henri Poincaré à l’occasion d’une journée organisée par la Société Française de Statistique et consacrée à la Statistique Mathématique. Il vise à donner un aperçu de la méthode de ρ-estimation comme alternative à celle du maximum de vraisemblance, ainsi que des propriétés d’optimalité et de robustesse des ρ-estimateurs. Cette méthode s’inscrit dans une longue lignée de recherche initiée par de célèbres statisticiens tels que Sir Ronald Fisher, avec le maximum de vraisemblance dans les années 20, ou Lucien Le Cam, avec des estimateurs fondés sur des tests entre boules de Hellinger dans les années 70, et dont l’objectif a été de produire des méthodes d’estimation possédant de bonnes propriétés pour un ensemble de cadres statistiques aussi vaste que possible. Plus récemment, Birgé avec les d- puis T-estimateurs, a étendu les résultats de Le Cam dans diverses directions, en particulier la robustesse et l’adaptation. Nous mettrons en lumière les liens forts qui existent entre les ρ-estimateurs et ces prédécesseurs, notamment les estimateurs du maximum de vraisemblance, mais montrerons également, au travers d’exemples choisis, que les ρ-estimateurs les surpassent par bien des aspects. 1 Bref historique Il y a bien longtemps que les statisticiens ont cherché une méthode générale pour construire, dans des contextes divers, des estimateurs disposant de bonnes propriétés, en particulier asymptotiques. En régression, il y a eu le minimum ℓ1 attribué à Pierre Simon de Laplace et les moindres carrés (minimum ℓ2 ) de Carl Friedrich Gauß autour des années 1800. Pour des modèles paramétriques généraux sur variables i.i.d. la méthode des moments est connue depuis longtemps et celle 1 du maximum de vraisemblance, développée et popularisée d’abord par Sir Ronald Fisher dans les années 1920, a connu un succès considérable et elle est, aujourd’hui encore, très largement utilisée. L’estimateur du maximum de vraisemblance (en abrégé e.m.v.) est, en un certain sens, le premier estimateur à visées “universelles” dans la mesure où il s’applique à de très nombreux modèles statistiques et permet aussi de retrouver, en régression, la méthode des moindres carrés (maximum de vraisemblance pour des erreurs gaussiennes) ou du minimum ℓ1 (lorsque les erreurs ont une loi de Laplace). L’e.m.v., qui a d’excellentes propriétés asymptotiques dans les modèles paramétriques réguliers, sous réserve de consistance, souffre néanmoins, dans un cadre général, de certains défauts connus depuis longtemps et mis en évidence par des statisticiens tels que Bahadur dès 1958 — cf. Bahadur (1958) — ou Le Cam — cf. Le Cam (1990) —, entre autres. Il n’est pas possible de construire une théorie générale de consistance des estimateurs du maximum de vraisemblance sans utiliser des hypothèses relativement fortes comme on peut le voir par exemple dans le livre de van der Vaart (1998). Le problème est encore plus délicat si l’on veut étudier les vitesses de convergence des e.m.v. Le Cam en était très conscient, cela apparaı̂t dans ses écrits et il s’est efforcé de résoudre le problème en construisant — cf. Le Cam (1973) et (1975) — un estimateur qui est automatiquement consistant sous des hypothèses relativement faibles. C’était là une nouvelle tentative, plus féconde, pour fabriquer une méthode d’estimation “universelle”, au moins pour les modèles en variables indépendantes. C’est en se fondant sur ces travaux de Le Cam en vue de généraliser les choses à des variables non nécessairement indépendantes, en recherchant des vitesses de convergence et en étudiant leur optimalité éventuelle et leur robustesse, que le second auteur de cet article a construit ce qu’il a appelé les d-estimateurs dans Birgé (1983). Plus tard ceux-ci se sont transformés en T-estimateurs par l’adjonction de pénalités qui ont conduit à la sélection de modèle et l’adaptativité dans Birgé (2006). Néanmoins, les T-estimateurs, tout comme leurs prédécesseurs, souffrent encore de diverses limitations, en particulier la nécessité de travailler avec des modèles compacts, ce qui s’avère bien trop restrictif pour les applications à la régression. Il est important de noter ici que ces différentes constructions, celle de Le Cam comme celles de Birgé, reposent sur la construction de familles de tests robustes (tests entre deux boules de Hellinger initialement). On peut d’ailleurs aussi interpréter le maximum de vraisemblance comme le résultat de la combinaison de nombreux tests de rapport de vraisemblances comme nous le verrons plus loin. C’est en partant d’une idée originale du premier auteur pour construire de nouvelles familles de tests — cf. Baraud (2011) — qu’est venue l’idée des ρ-estimateurs. Ces nouveaux tests sont fondés sur l’idée suivante : étant donné trois lois de pro- 2 babilité P , Q et R et X1 , . . . , Xn i.i.d. de loi P , on peut déduire un test entre Q et R (comme meilleur approximant de P ) d’une estimation du signe de la différence h2 (P, Q) − h2 (P, R) où h désigne la distance de Hellinger. Dans le cas de modèles compacts, les ρ-estimateurs peuvent être vus comme une variante des T-estimateurs fondés également sur des tests robustes, mais ils permettent en outre de traiter des problèmes à modèles non compacts comme la régression linéaire en plan fixe ou aléatoire, avec des erreurs de lois très variées, ou des problèmes d’estimation de densités sous contraintes de forme. Comme les T-estimateurs ils sont robustes et permettent de considérer de nombreux modèles simultanément, d’où leurs propriétés d’adaptation, mais leurs performances vont très au-delà et permettent bien davantage que les T-estimateurs, par exemple l’estimation d’une densité unimodale sur R de mode et support inconnus. Enfin, comme nous le verrons, dans des situations favorables, l’e.m.v. est un ρ-estimateur ; la ρ-estimation peut donc, dans une certaine mesure, être considérée comme une manière de rendre robuste la célèbre procédure introduite il y a près d’un siècle par Sir Ronald Fisher. Ce qui va suivre peut être considéré comme une introduction (voire une incitation) à la lecture des articles suivants : Baraud, Birgé et Sart (2017), Baraud et Birgé (2016a) et Baraud et Birgé (2016b). 2 2.1 Quelques problèmes liés à l’utilisation des estimateurs du maximum de vraisemblance Instabilité de la méthode du maximum de vraisemblance On dispose d’un million d’observations X1 , . . . , X106 que l’on suppose i.i.d. de loi uniforme sur [0, θ], de paramètre inconnu θ > 0 et que l’on modélise donc comme telles. L’e.m.v. relatif à ce modèle est θb = maxi=1,...,106 Xi . Si toutes les observations suivent effectivement ce modèle avec θ = 1 sauf une seule d’entre elles qui, suite à une erreur de manipulation ou de transcription, vaut 100, alors le maximum de vraisemblance vaut 100 et l’erreur d’estimation de θ sera d’au moins 99. Il suffit donc d’une seule observation aberrante parmi un million pour rendre l’e.m.v. inopérant dans ce cadre. Le même problème se pose pour l’estimation du paramètre de centrage θ de la gaussienne N (θ, 1) par la moyenne empirique, qui est aussi l’e.m.v. ; une seule observation aberrante peut conduire à une erreur d’estimation considérable, autre3 ment dit l’e.m.v. n’est absolument pas robuste. Pour plus de détails sur la notion de robustesse, on pourra se référer à l’excellent livre de Peter Huber — Huber (1981) — et à sa bibliographie. La détection d’une valeur aberrante en dimension 1 (ou 2) est en général relativement facile car on peut visualiser les données. En revanche, les choses se compliquent sérieusement en grande dimension ! 2.2 Non-existence de l’estimateur du maximum de vraisemblance Soit la densité p sur R définie par   p(x) = (1/6) |x|−1/2 1l(0,1] (|x|) + x−2 1l]1;+∞[ (|x|) , (1) laquelle est symétrique, mais discontinue et non bornée en 0. Si l’on considère la famille de translation {pθ (x), θ ∈ Θ} où pθ (x) = p(x − θ) et Θ est un intervalle compact de R, la vraisemblance s’écrit p(X1 − θ) × . . . × p(Xn − θ) et tend vers l’infini dès que θ → Xi , quel que soit i. On ne peut donc définir un e.m.v. Le même phénomène se produit pour tout modèle de translation pour lequel la densité p n’est pas bornée. Dans le cas où p est donnée par (1), il est néanmoins facile de montrer que la médiane empirique va converger vers θ à vitesse 1/n. On peut même construire des intervalles de confiance non-asymptotiques pour θ ; ce n’est donc pas le problème qui est difficile à résoudre mais plutôt la méthode du maximum de vraisemblance qui est inadaptée à celui-ci. Néanmoins, si l’on remplace le modèle initial {pθ , θ ∈ Θ} par le modèle approché {pθ , θ ∈ Θ′ } où Θ′ est une discrétisation finie de l’intervalle Θ, l’e.m.v. relatif à Θ′ sera bien défini. 2.3 Le risque quadratique de l’e.m.v. peut être bien plus grand que le risque minimax Soit X = (X0 , . . . , Xk ) un vecteur gaussien (k+1)-dimensionnel de loi N (θ, Ik+1), où Ik+1 est la matrice identité de dimension k + 1. Étant donné un vecteur θ = (θ0 , . . . , θk ) de Rk+1 , on note θ′ = (θ1 , . . . , θk ) sa projection sur le sous-espace vectoriel de dimension k engendré par les k dernières coordonnées, kθk sa norme euclidienne et Eθ l’espérance quand θ est la vraie valeur du paramètre. Proposition 1. Supposons que k ≥ 128 et considérons l’espace de paramètres   Θ = θ ∈ Rk+1 |θ0 | ≤ k 1/4 et kθ′ k ≤ 2 1 − k −1/4 |θ0 | . 4 Le risque quadratique de l’e.m.v. θb et le risque minimax sur Θ vérifient respectivement h i h i √ 2 2 b e sup Eθ kθ − θk ≥ (3/4) k + 3 et inf sup Eθ kθ − θk ≤ 5. (2) θe θ∈Θ θ∈Θ On voit que le risque quadratique de l’e.m.v. sur Θ peut être beaucoup plus grand que le risque minimax. La démonstration se trouve dans Birgé (2006). Pour obtenir la borne supérieure du risque quadratiquedans (2) il suffit de remplacer le modèle initial Θ par le modèle approché Θ′ = (θ0 , 0) ∈ Rk+1 θ0 ∈ R et de construire l’e.m.v. sur Θ′ ce qui donne θe = (θe0 , 0) = (X0 , 0). On vérifie alors que i h   e 2 = E0 (θ0 − X0 )2 + kθ′ k2 ≤ 1 + 4 = 5 pour tout θ ∈ Θ. Eθ kθ − θk 2.4 La valeur et les performances de l’e.m.v. dépendent du choix de la famille des densités Que la valeur de l’e.m.v. dépende du choix que l’on fait des densités par rapport à une mesure dominante est à peu près évident et connu depuis longtemps. Qu’un choix inadapté puisse mener à des résultats catastrophiques, comme le montre l’exemple suivant, l’est sans doute nettement moins. Proposition 2. Soit une suite (Xk )k≥1 de v.a.r. i.i.d. de loi Pθ = N (θ, 1) pour un réel θ inconnu. Pour tout θ ∈ R, fixons la version pθ de la densité dPθ /dP0 de Pθ par rapport à la mesure de référence P0 = N (0, 1) de la manière suivante :  exp [θx − (θ2 /2)] si x 6= θ ou θ ≤ 0, (3) pθ (x) = 2 2 2 exp [θx − (θ /2) + (θ /2) exp (x )] sinon. Alors, quelle que soit la vraie valeur de θ ∈ R, sur un ensemble dont la Pθ -probabilité tend vers 1 quand n tend vers l’infini, l’e.m.v. s’écrit θbn = X(n) = max{X1 , . . . , Xn } et n’est donc pas consistant. On trouvera la preuve de cette assertion dans Baraud et Birgé (2016b). Si l’on remplace le modèle initial avec θ ∈ R par sa restriction à θ ∈ Q et si l’on accepte de prendre pour maximum de vraisemblance un point maximisant la vraisemblance appproximativement seulement, le problème ne se posera plus. 2.5 Construction de l’e.m.v. sur un modèle approché Nous venous de remarquer que certains des problèmes rencontrés par l’e.m.v. pouvaient être résolus en construisant l’estimateur non pas sur l’ensemble initial 5 des paramètres Θ mais sur un sous-ensemble Θ′ de Θ ayant de bonnes qualités d’approximation par rapport aux élements de Θ. Maleureusement, l’utilisation de tels sous-ensembles approchants peut aussi conduire à d’autres ennuis comme le montre l’exemple suivant. Considérons le problème d’estimation du paramètre θ ∈ R à partir de l’observation d’un n-échantillon X1 , . . . , Xn dont la loi appartient à l’ensemble de probabilités Pε = {Pα,θ , (α, θ) ∈ [0, ε] × R} avec 0 ≤ ε < 1/2 et Pα,θ = (1 − α) U([θ, θ + 1]) + α U([100 + θ, 101 + θ], où U([a, b]) désigne la loi uniforme sur l’intervalle [a, b] pour a < b. Si ε est petit le modèle plus simple P0 ⊂ Pε des lois uniformes sur [θ, θ + 1] avec θ ∈ R fournit une bonne approximation de Pε . Comme la loi Pα,θ est un mélange de deux lois uniformes sur deux intervalles disjoints, la vraisemblance sur le modèle P0 est constamment nulle sauf si toutes les observations appartiennent à l’un ou l’autre de ces deux intervalles ce qui arrive avec une probabilité (1 − α)n + αn ≤ exp[−nα] + αn . Lorsque α est grand devant 1/n et petit devant 1/2, cette probabilité est petite. Donc, en dehors de cet événement de petite probabilité, la méthode du maximum de vraisemblance sur le modèle approché P0 ne fournit aucune estimation de θ. 2.6 Les modèles approchés Si nous considérons les exemples précédents, nous pouvons constater que les problèmes liés à l’utilisation de l’e.m.v. sur un modèle statistique donné par une famille de lois {Pθ , θ ∈ Θ} peuvent souvent être en partie résolus en remplaçant le modèle initial par un modèle approché {Pθ , θ ∈ Θ′ }. Pour obtenir un résultat général fondé sur l’estimation sur des modèles approchés, il convient de s’assurer que, si l’on utilise comme modèle une famille de lois P = {Pθ , θ ∈ Θ′ } et si la vraie loi P des observations est proche d’un élément de P, le comportement de l’estimateur construit sur P est à peu près le même que ce qu’il serait si P appartenait effectivement à P, c’est-à-dire que l’estimateur est robuste. Malheureusement l’e.m.v. ne l’est pas toujours, d’où la nécessité de le remplacer par un estimateur robuste permettant de travailler avec des modèles approchés de manière systématique. 6 3 Comment résoudre les problèmes précédents : une heuristique Plaçons-nous ici dans le cadre d’un n-échantillon X = (X1 , . . . , Xn ) et d’une famille S de densités par rapport à une mesure de référence µ avec Pt = t · µ pour t ∈ S . Notons Pt [A] la probabilité de l’évènement A quand les Xi ont la loi Pt , la vraisemblance de t par VX (t) = n Y t(Xi ), donc  log VX (t) = i=1 n X i=1  log t(Xi ) , et supposons, pour simplifier les choses, que Ps [VX (t) = VX (u)] = 0, quels que soient s, t, u ∈ S et t 6= u. Alors on sait que, si Ps 6= Pt Ps [VX (t) > VX (s)] ≤ ρn (Ps , Pt ), avec (4) Z p ρ(Ps , Pt ) = s(x)t(x) dµ(x) < 1. La quantité ρ(Ps , Pt ), dénommée affinité de Hellinger entre Ps et Pt , est seulement fonction des deux lois Ps et Pt et non pas du choix de la mesure dominante µ ni de celui des versions des densités dPs /dµ et dPt /dµ. Comme ρ(Ps , Pt ) < 1, ρn (Ps , Pt ) tend vers 0 quand n tend vers l’infini et l’on voit bien qu’en choisissant en fonction de X celle des deux lois qui a la plus grande vraisemblance, on trouvera asymptotiquement la vraie loi des Xi . On contrôle même les probabilités d’erreurs du test pour n fixé : max {Ps [VX (t) > VX (s)] , Pt [VX (t) < VX (s)]} ≤ ρn (Ps , Pt ), puisque VX (t) 6= VX (s) presque sûrement. Le résultat s’étend immédiatement au cas d’un modèle S fini et identifiable. En effet, pour tout s ∈ S ,   X X ρn (Ps , Pt ), Ps [VX (t) > VX (s)] ≤ Ps sup VX (t) > VX (s) ≤ t∈S t∈S , t6=s t∈S , t6=s donc, si b tn (X) = argmax VX (t) = argmax t∈S alors t∈S " n X log t(Xi ) i=1   sup Ps b tn (X) 6= s −→ 0. n→+∞ s∈S 7 #  , Remarquons ici que la recherche de b tn revient à faire simultanément tous les tests de rapport de vraisemblances entre les paires (t, u) de S 2 avec t 6= u en comparant VX (t) à VX (u), ce qui revient à étudier le signe de log  VX (t) VX (u)  = n X i=1 log  t(Xi ) u(Xi )  et à choisir l’élément de S accepté par tous ces tests simultanément, lequel existe toujours sous nos hypothèses. Malheureusement, ce résultat ne s’étend pas sans hypothèses fortes au cas d’un ensemble S infini ni à celui d’une vraie loi P ⋆ des Xi n’appartenant pas à {Pt , t ∈ S }, même lorsque P ⋆ est très proche de l’ensemble en question. Une des raisons de cet échec est liée au fait que la fonction log n’est pas bornée comme le montre l’exemple de la section 2.2. Les tests de rapport de vraisemblances évoqués ci-dessus reposent sur l’évaluation des Pnrapports VX (t)/VX (u) ou, de manière équivalente, sur les signes des quantités i=1 log t(Xi )/u(Xi ) . Mais il faut noter que c’est la propriété magique de la fonction log : log(a/b) = log a−log b qui fait que trouver un   point b tn de S tel que log VX (b tn )/VX (u) > 0 pour tout u 6= b tn équivaut à chercher  Pn le point b tn qui maximise sur S la fonction u 7→ i=1 log u(Xi ) . Les fonctions de la forme α log avec α > 0 sont les seules qui possèdent cette propriété mais elles ne sont pas bornées ce qui explique certains des problèmes que l’on rencontre avec la méthode du maximum de vraisemblance. Néanmoins, l’idée même de rapport de vraisemblances nous dit que Pt est d’autant plus vraisemblable comparé  à Pu que le rapport VX (t)/VX (u) est plus P grand ou que ni=1 log t(Xi )/u(Xi ) l’est. De manière heuristique, la valeur de s !   n n X X t(Xi ) t(Xi ) log log =2 (5) u(Xi ) u(Xi ) i=1 i=1 permet de comparer la qualité de t par rapport à celle de u. Soit alors ψ une fonction strictement croissante, bornée et telle que ψ(1) = 0. On peut envisager de comparer, de manière analogue, la qualité de t par rapport à celle de u en remplaçant dans (5), s s ! ! n n X X t(Xi ) t(Xi ) log par ψ , u(X ) u(X ) i i i=1 i=1 de sorte que l’on puisse dire que la loi Pu est d’autant moins bonne au vu des observations X1 , . . . , Xn que s ! n X t(Xi ) est grand. sup ψ u(Xi ) t∈S i=1 8 Comme le meilleur u est aussi le moins mauvais, on peut penser à choisir comme estimateur de P ⋆ la loi Pten avec s " !# n X t(X i) e tn (X) = argmin sup , (6) ψ u(X ) u∈S t∈S i i=1 en supposant ici, pour simplifier l’exposé, que l’argmin existe (mais n’est pas nécessairement unique). Lorsque ψ est la fonction log et b tn l’e.m.v., s !# " n X t(Xi ) argmin sup log u(Xi ) u∈S t∈S i=1 " ! # n n X X   1 sup log t(Xi ) − log u(Xi ) = argmin 2 u∈S t∈S i=1 i=1 " n # n X  X  1 = argmin log b tn (Xi ) − log u(Xi ) 2 u∈S i=1 # "i=1 n n X X   1 log u(Xi ) − log b tn (Xi ) = argmax 2 u∈S i=1 i=1 = argmax u∈S n X i=1  log u(Xi ) = b tn (X). On retrouve ainsi le maximum de vraisemblance parce que log(a/b) = log a − log b, mais cet argument ne fonctionne plus avec une fonction ψ 6= α log parce qu’alors s ! n n n p  X p  X X t(Xi ) ψ ne s’écrit pas ψ t(Xi ) − ψ u(Xi ) . u(Xi ) i=1 i=1 i=1 Dans ce cas, on ne peut plus caractériser e tn (X) défini par (8) comme # " n  X p t(Xi ) . argmax ψ t∈S 4 4.1 i=1 Les fondamentaux des ρ-estimateurs Cadre statistique et définitions Comme nous voulons que ce qui va suivre s’applique aussi à des problèmes de régression pour lesquels les observations ne sont pas nécessairement i.i.d., nous allons 9 travailler dans le cadre plus général suivant, en omettant délibérément un certain nombre de points techniques (en particulier liés à des problèmes de mesurabilité) qui ne pourraient que nuire à la clarté de cette présentation. Q ∈ Xi sont indépenOn observe X = (X1 , . . . , Xn ) ∈ X = ni=1 Xi et les v.a. Xi N dantes, de lois respectives Pi⋆ , donc le vecteur X a pour loi P⋆ = ni=1 Pi⋆ . Pour Nnesti⋆ mer P à partir = i=1 µi Nµ Nn de X on se donne un modèle statistique P dominé par n avec Q = i=1 Qi pour tout Q ∈ P , Qi = qi · µi et dQ/dµ = q = i=1 qi µ-p.p., les versions des densités pouvant être choisies de manière arbitraire. On associe ainsi à P un ensemble Q de densités q par rapport à µ et P = {Q = q · µ, q ∈ Q}. Clairement, étant donné P , l’ensemble des fonctions q n’est pas unique mais nous passerons ici sur cet aspect technique comme indiqué précédemment, les résultats que nous présenterons ne dépendant pas du choix que l’on fait des versions de ces densités. Il est important de noter que nous ne supposons pas que P⋆ ∈ P mais seulement qu’il s’agit d’une loi produit. On se donne sur [0, +∞] une fonction ψ vérifiant ψ(1) = 0 et l’on considère la famille de statistiques s ! n ′ X q (X ) i i T(X, q, q′ ) = ψ pour tous les q, q′ ∈ Q. (7) q (X ) i i i=1 b par On définit alors un estimateur P b =p b·µ = P n O i=1 (b pi · µ i ) avec b = argmin sup T(X, q, q′ ). p q∈Q (8) q′ ∈Q Pour simplifier, ici comme dans toute la suite, nous supposerons que l’argmin est b existe. Notons qu’il n’est pas nécessairement unique. Dans le cas atteint donc que p b un élément de Q qui minimise supq′ ∈Q T(X, q, q′) général, il suffit de choisir pour p approximativement. Remarque . Comme ψ(1) = 0, T(X, q, q) = 0, donc min sup T(X, q, q′) ≥ 0 q∈Q q′ ∈Q et si l’on trouve un élément q de Q tel que supq′ ∈Q T(X, q, q′) = 0, alors c’est un ρ-estimateur. 4.2 Choix de la fonction de perte Pour évaluer les performances d’un estimateur de P⋆ , nous utiliserons des fonctions de perte liées à la distance de Hellinger. 10 Définition 1. Étant donné deux probabilités P et Q et une mesure arbitraire ν qui domine P et Q on définit la distance de Hellinger h et l’affinité de Hellinger ρ entre P et Q par r !2 Z r Z r 1 dP dP dP dQ 2 − dν et ρ(P, Q) = dν. h (P, Q) = 2 dν dν dν dν On notera que ces deux quantités ne dépendent ni du choix de ν ni de celui des versions des deux densités dP/dν et dQ/dν et que  h2 (P, Q) = 1 − ρ(P, Q) et ρ P ⊗n , Q⊗n = ρn (P, Q). N N Dans le cas des lois produits qui nous intéressent, soit P = ni=1 Pi et Q = ni=1 Qi , nous considérerons la distance H (également appelée ici distance de Hellinger, bien que H(P, Q) 6= h(P, Q)) définie par 2 H (P, Q) = n X i=1 h2 (Pi , Qi ) ∈ [0, n]. b La qualité d’un estimateur Q(X) de la vraie loi P⋆ sera mesurée par son risque quadratique h  i 2 b ⋆ ⋆ EP H Q(X), P . Un cas particulier important est celui de lois produits correspondant à des v.a. i.i.d. : P = P ⊗n et Q = Q⊗n pour lequel H 2 (P, Q) = nh2 (P, Q). 4.3 Quelles conditions sur la fonction ψ ? Comme nous l’avons expliqué, l’idée de cette construction est de remplacer, dans le calcul de la log-vraisemblance, la fonction log par une fonction ψ bornée. Néanmoins, afin de préserver certaines des propriétés du log, en particulier d’obtenir un analogue de (4), il convient que la fonction ψ ait certaines similitudes avec la fonction log. Nous demanderons donc que ψ soit continue et strictement croissante avec ψ(1/x) = −ψ(x). Comme elle est bornée et continue, la fonction ψ vérifie ψ(+∞) = lim ψ(x) = lim ψ(1/y) = − lim ψ(y) = −ψ(0). x→+∞ y→0 y→0 Le remplacement de ψ par αψ avec α > 0 ne modifiant pas la valeur des ρestimateurs, nous conviendrons de fixer ψ(0) = −1 donc ψ(+∞) = 1 et, comme nous voulons utiliser la distance de Hellinger pour mesurer les performances des ρ-estimateurs, nous imposerons les relations suivantes : 11 Quelles que soient les densités q, q′ ∈ Q, la probabilité R ∈ P et i ∈ {1, . . . , n}, s ! Z qi′ dRi ≤ a0 h2 (Ri , Qi ) − a1 h2 (Ri , Q′i ) (9) ψ q i Xi et Z ψ2 Xi s !   qi′ dRi ≤ a22 h2 (Ri , Qi ) + h2 (Ri , Q′i ) , qi (10) où les constantes a0 , a1 et a2 satisfont aux relations a0 ≥ 1 ≥ a1 ≥ 0 et a22 ≥ 1 ∨ (6a1 ). Pour que les rapports qi′ /qi soient toujours bien définis, nous utilisons les conventions 0/0 = 1 et a/0 = +∞ pour tout a > 0. La relation (9) montre que si Ri est la vraie loi de Xi et Qi est bien plus ′ proche p de Ri que ne l’est Qi alors l’intégrale de gauche qui est l’espérance de ψ qi′ (Xi )/qi (Xi ) est négative. Quant à (10) elle permet de contrôler la variance de la même quantité. Comme la fonction ψ est bornée, on peut en déduire des inégalités de déviations de type Bernstein pour T(X, q, q′) qui est une somme de variables indépendantes, bornées et dont on contrôle la variance. D’où l’importance de cette bornitude. Dans la situation idéale où l’on aurait a0 = a1 = 1, on déduirait de (9) que s ! n Z X qi′ dPi⋆ ≤ H 2 (P⋆ , Q) − H 2 (P⋆ , Q′ ) ψ EP⋆ [T(X, q, q′ )] = qi i=1 Xi et, en inversant les rôles de Q et Q′ , que s ! r  n Z n Z X X qi′ qi ⋆ dPi = ψ dPi⋆ = EP⋆ [T(X, q′ , q)] − ψ ′ q q i i i=1 Xi i=1 Xi ≤ H 2 (P⋆ , Q′ ) − H 2 (P⋆ , Q), parce que ψ(1/x) = −ψ(x). Finalement, comme [T(X, q′, q)] = − [T(X, q, q′)],   − H 2 (P⋆ , Q′ ) − H 2 (P⋆ , Q) ≤ EP⋆ [T(X, q, q′)] ≤ H 2 (P⋆ , Q) − H 2 (P⋆ , Q′ ), donc EP⋆ [T(X, q, q′ )] = H 2 (P⋆ , Q) − H 2 (P⋆ , Q′ ). De même    VarP⋆ T(X, q, q′ ) ≤ a2 H 2 (P⋆ , Q) + H 2 (P⋆ , Q′ ) . 12 La première égalité est à rapprocher, dans le cadre i.i.d., de s !# " n X q ′ (Xi ) EP⋆ log q(Xi ) i=1 s s !# !# " n " n X X p⋆ (Xi ) p⋆ (Xi ) = EP⋆ − EP⋆ log log q(X ) q ′ (Xi ) i i=1 i=1 = (n/2) [K(P ⋆ , Q) − K(P ⋆ , Q′ )] , pourvu que les deux divergences de Kullback-Leibler, K(P ⋆ , Q) et K(P ⋆ , Q′ ), soient finies, ce qui n’est absolument pas garanti, P ⋆ étant inconnue. Nous ignorons combien de fonctions satisfont aux relations (9) et (10) mais nous n’en connaissons que deux : x−1 x−1 et ψ2 (x) = √ ψ1 (x) = , x+1 x2 + 1 la première fonction ψ1 (x) étant la plus simple et très proche de la fonction x 7→ (1/2) log(x) au voisinage de 1 puisque 0, 96 < ψ1 (x) ≤ 1 pour 1/2 ≤ x ≤ 2 (log x)/2 et ψ1 (x) ≤ 1 pour 1/4 ≤ x ≤ 4. (log x)/2 √ Pour la fonction ψ1 , a0 = √ 4, a1 = 3/8 et a22 = 3 2, et pour la fonction ψ2 , a0 = 4, 97, a1 = 0, 083 et a22 = 3 + 2 2. 0, 86 < 5 5.1 Les performances des ρ-estimateurs Un résultat général b défini par (8), mesurée par son risque quadratique Lahqualité P  d’un ρ-estimateur i b EP⋆ H 2 P(X), P⋆ , ne dépend que du modèle P choisi et de la vraie loi P⋆ . Plus précisément, N Théorème 1. Pour toute mesure-produit P⋆ = ni=1 Pi⋆ , toute probabilité P ∈ P et tout réel positif ξ, h  2 ⋆ i 2 ⋆ b P ⋆ ⋆ PP H (P , P) ≤ C H (P , P) + Dn (P , P) + ξ ≥ 1 − e−ξ , (11) où C ≥ 1 est une constante numérique universelle (on peut prendre C = 26350) et DnP (P⋆ , P) ∈ [1, n] un terme de dimension locale (relative à P) du modèle P . 13 1, En intégrant par rapport à ξ l’inégalité précédente, on obtient, puisque DnP (P⋆ , P) ≥ h i  b ≤ C inf H 2 (P⋆, P) + D P (P⋆ , P) + 1 EP⋆ H 2 (P⋆, P) n P∈P  2 ⋆ ≤ C inf H (P , P) + 2DnP (P⋆ , P) . (12) P∈P Dans la suite, C désignera une constante numérique qui pourra changer de ligne en ligne. La dimension DnP (P⋆ , P) est définie à partir des fluctuations du processus T(X, p, q) pour q ∈ Q autour de son espérance sous P⋆ . Dans un grand nombre de situations (mais pas toujours), on peut borner cette dimension uniformément en P et P⋆ par une quantité Dn (P ) qui ne dépend que du modèle que l’on utilise. Dans ce cas, la borne (12) devient h i   b ≤ C H 2 (P⋆ , P ) + Dn (P ) , EP⋆ H 2 (P⋆ , P) (13) avec H 2 (P⋆ , P ) = inf H 2 (P⋆ , P). P∈P En particulier, sup E P⋆ P⋆ ∈P h i 2 ⋆ b H (P , P) ≤ CDn (P ). (14) On retrouve dans (13) une majoration classique du risque par la somme d’un terme d’approximation H 2 (P⋆ , P ) et d’un terme de dimension Dn (P ), lequel caractérise la “taille” du modèle P . Cette formule met clairement en évidence la robustesse d’un tel estimateur à un écart possible de la vraie loi au modèle : si P⋆ appartient au modèle P le risque est majoré par la dimension de P qui permet de contrôler le risque maximum sur P par (14), sinon il faut y ajouter un terme d’approximation proportionnel à H 2 (P⋆ , P ) traduisant le fait que le modèle P est inexact. Si l’erreur de modélisation est suffisamment faible, ce terme sera petit et la borne de risque comparable à celle que l’on obtient lorsque le modèle est exact. 5.2 Quelques cas particuliers — Dans le cadre de l’estimation d’une densité à partir de n observations i.i.d. de densité p⋆ avec P⋆ = (p⋆ · µ)⊗n et d’un modèle P = {P ⊗n , P ∈ P}, les ρb = Pb⊗n avec Pb ∈ P et la borne de risque (13) estimateurs prennent la forme P s’écrit alors h i   EP⋆ h2 (P ⋆ , Pb) ≤ C h2 (P ⋆ , P) + n−1 Dn (P ) . (15) — Lorsque le modèle (P , H) est de dimension métrique finie majorée par D, ce qui signifie que l’on peut recouvrir toute boule de P de rayon xη (avec x ≥ 2) par 14  un nombre de boules de rayon η majoré par exp Dx2 , alors DnP (P⋆ , P) ≤ CD. Dans ce cas, les ρ-estimateurs ont les mêmes performances que les T-estimateurs de Birgé (2006) mais, comme dans le cas des T-estimateurs, l’hypothèse de dimension métrique finie nécessite que l’espace métrique (P , H) soit compact. — Dans un cadre de régression à “plan fixé” pour lequel Xi = (wi , Yi ), λ est la mesure de Lebesgue sur R et Yi = f ⋆ (wi ) + εi avec εi de loi s · λ, on utilise un modèle correspondant aux lois possibles des Yi donné par Yi = f (wi ) + εi avec εi de loi r · λ, où r est une densité fixée et f ∈ F . Si la famille F est incluse dans un espace vectoriel de dimension k et la densité r est unimodale, on peut montrer que DnP (P⋆ , P) ≤ Ck log n en utilisant des arguments de classes de Vapnik. On perd alors un facteur log n dans les bornes de risque mais on s’est débarassé des hypothèses de compacité puisque F peut être un espace vectoriel. Nous ignorons si un tel facteur logarithmique est nécessaire ou non si l’on se restreint à des estimateurs robustes au sens ci-dessus. 6 Liens entre ρ-estimateurs et e.m.v. Considérons un modéle paramétrique très simple dans lequel les Xi sont supposées i.i.d. et uniformes sur [θ − 1, θ + 1]. On peut montrer dans ce cas que, si le modèle est exact, c’est-à-dire si les Xi sont effectivement i.i.d.  et uniformes sur [θ⋆ − 1, θ⋆ + 1] pour un θ⋆ ∈ R, alors l’estimateur X(1) + X(n) /2, qui est un estimateur du maximum de vraisemblance, est aussi un ρ-estimateur. La différence entre l’e.m.v. et le ρ-estimateur est que, si le modèle est légèrement inexact, le ρ-estimateur donnera un résultat sensé, c’est-à-dire une estimation par une loi unie e forme sur [θ−1, θ+1] proche de la vraie loi, alors que le maximum de vraisemblance peut fort bien ne pas exister, par exemple si X(n) − X(1) > 2. Dans un modèle paramétrique très régulier {pθ , θ ∈ [0, 1]} avec des observations i.i.d., si les estimateurs du maximum de vraisemblance pθbn sont consistants alors ce sont aussi des ρ-estimateurs avec une probabilité tendant vers 1 lorsque n → +∞ — cf. le théorème 19 de Baraud, Birgé and Sart (2017) —. Toujours dans un cadre i.i.d., si le modèle consiste en un ensemble convexe Q de densités par rapport à une mesure de référence µ, et que la fonction ψ vaut ψ1 ou ψ2 , alors l’application s ! n X t(Xi ) (u, t) 7→ ψ u(Xi ) i=1 15 p p admet un point selle sur Q × Q car l’application (x, y) 7→ ψ( x/y) = −ψ( y/x) est concave en x pour y > 0 fixé et convexe en y pour x > 0 fixé. Ce point selle est à la fois un ρ-estimateur et l’e.m.v. sur Q. Ce résultat, qui repose sur un argument dû à Su Weijie (2016, communication personnelle), est démontré dans la section 6 de Baraud et Birgé (2016b). Une telle situation, pour laquelle l’e.m.v. est un ρ-estimateur et en a donc toutes les propriétés, se retrouve dans les exemples suivants : a) l’ensemble des densités sur X qui sont constantes par morceaux sur une partition fixée de X de cardinal D. Dans ce cas, notons que l’e.m.v. est alors l’histogramme associé à cette partition ; b) l’ensemble des densités décroissantes sur [0, +∞) ou croissantes sur (−∞, 0] ou unimodales sur R avec un mode en 0. En particulier, l’estimateur de Grenander pour les densités décroissantes sur R+ , qui est l’e.m.v., est un ρ-estimateur ; c) l’enveloppe convexe d’une nombre fini de densités (estimateurs préliminaires obtenus à partir d’un échantillon indépendant), ce qui nous fournit le cadre de l’agrégation convexe. Un résultat analogue pour des cadres statistiques plus généraux que l’estimation de densité a été montré par Mathieu Sart (2017, communication personnelle). En résumé, sous des conditions convenables, le maximum de vraisemblance est un ρ-estimateur, exactement (cadre convexe) ou asymptotiquement (modèle paramétrique suffisamment régulier). En revanche, si la vraie loi dévie un peu du modèle, il se peut, lorsque l’on ne se trouve pas dans le cadre de variables i.i.d. et d’un modèle convexe, que le maximum de vraisemblance en soit gravement affecté alors que les ρ-estimateurs ne le seront que faiblement. Pour en revenir à l’exemple de la section 2.3, nous allons vérifier que le ρestimateur sur le modèle associé à l’espace des paramètres Θ′ est l’estimateur du maximum de vraisemblance θe = (X0 , 0). Donc que son risque quadratique est borné par 5. En choisissant comme mesure de réference la mesure µ ayant pour densité (par rapport à la mesure de Lebesgue sur Rk+1) la fonction    (x0 , x′ ) 7→ (2π)−(k+1)/2 exp − x20 /2 + kx′ k2 /2 , les lois du modèle statistique {Pθ , θ ∈ Θ′ } = {P(θ0 ,0) , θ0 ∈ R} ont pour densités respectives (par rapport à µ) pθ0 : (x0 , x′ ) 7→ exp [−x0 θ0 + (θ02 /2)] de sorte que le ρ-estimateur θb0 du paramètre θ0 , au vu de la seule observation X = (X0 , . . . , Xk ), 16 ce qui correspond à n = 1 dans (7), minimise l’application s      pθ0′ (X) 1 ′ ′ 2 2   θ0 7→ sup ψ = sup ψ . exp −2X0 θ0 + (θ0 ) − −2X0 θ0 + θ0 pθ0 (X) 4 θ0′ ∈R θ0′ ∈R La fonction ψ étant strictement croissante, le maximum, pour un θ0 fixé, est atteint lorsque θ0′ = X0 (indépendamment de θ0 ) et le minimum en θ0 atteint au point θb0 = X0 . Le ρ-estimateur du paramètre θ = (θ0 , θ′ ) est donc l’estimateur du maximum e de vraisemblance θ. 7 Extension Afin de rendre cette présentation aussi simple que possible, nous nous sommes contentés jusqu’ici d’exposer la construction des ρ-estimateurs sur un seul modèle P mais, comme dans le cadre des T-estimateurs ou autres, il est possible de travailler avec une famille dénombrable {Pm , m ∈ M} de modèles simultanément en ajoutant à la statistique T une pénalité. Comme précédemment, chaque modèle Pm est décrit par un ensemble Qm de densités par rapport à µ, c’est-à-dire que Pm = {Q = q · µ, q ∈ Qm } pour tout m. En outre, Pm est affecté d’un poids exp[−∆(m)] avec X e−∆(m) = 1, (16) m∈M de sorte que cette famille de poids peut être considérée comme une loi a priori sur l’ensemble des modèles. Pour simplifier la présentation et bien que ceci ne soit en aucun cas nécessaire, nous supposerons que tous nos modèles sont disjoints de sorte S qu’à chaque loi Q ∈ P = m∈M Pm correspond un unique m tel que Q ∈ Pm . On associe alors à chaque Q ∈ P une pénalité pen(Q) ≥ 0 telle que, pour tout P∈P,   (17) G(P⋆, P) + pen(Q) ≥ κ DnPm (P⋆ , P) + ∆(m) pour tout Q ∈ Pm , où κ est une constante numérique et G(P⋆ , ·) une fonction sur P . Notons que si l’on ne dispose que d’un seul modèle P0 , c’est-à-dire si M = {0}, on peut fixer ∆(0) = 0 = pen(Q) pour tout Q ∈ P0 et G(P⋆ , P) = κDnP0 (P⋆ , P). Dans la situation type où DnPm (P⋆, P) = Dn (Pm ) ne dépend que du modèle Pm , on peut prendre la fonction G identiquement nulle et pen(Q) = κ [Dn (Pm ) + ∆(m)] pour tout Q ∈ Pm , 17 (18) c’est-à-dire une pénalité constante sur chaque modèle. Dans ce cadre, la définition des ρ-estimateurs doit être modifiée comme suit. L’on définit Υ(X, q) = sup [T(X, q, q′ ) − pen(Q′ )] + pen(Q) pour tout q ∈ Q (19) q′ ∈Q b = p b · µ avec p b = argminq∈Q Υ(X, q). Tout ρet un ρ-estimateur s’écrit P b satisfait alors au résultat suivant. estimateur P N Théorème 2. Pour toute mesure-produit P⋆ = ni=1 Pi⋆ , toute probabilité P ∈ P et tout réel positif ξ, h  i b ≤ C H 2 (P⋆ , P) + G(P⋆ , P) + pen(P) + ξ ≥ 1 − e−ξ , (20) PP⋆ H 2 (P⋆ , P) où C = C(a0 , a1 , a2 ) ≥ 1 dépend uniquemement de a0 , a1 et a2 . Dans la suite, comme ici, nous désignerons par C des quantités qui peuvent dépendre de certains paramètres correspondant aux hypothèses que nous ferons, afin de les distinguer des constantes universelles notées C ou C ′ . Lorsque la fonction G est nulle et la pénalité est donnée par (18), (20) devient    2 ⋆  2 ⋆ b PP⋆ H (P , P) ≤ C inf H (P , Pm ) + Dn (Pm ) + ∆(m) + ξ ≥ 1 − e−ξ , m∈M et, après intégration par rapport à ξ > 0, h i   b ≤ C inf H 2 (P⋆ , Pm ) + Dn (Pm ) + ∆(m) . EP⋆ H 2 (P⋆ , P) m∈M Notons que si l’on utilisait le seul modèle m, on déduirait de (13) que h i   b ≤ C H 2 (P⋆ , Pm ) + Dn (Pm ) , EP⋆ H 2 (P⋆, P) (21) (22) et l’inégalité (21) conduirait alors à un analogue de (13) avec un terme supplémentaire ∆(m). Si ∆(m) est au plus du même ordre de grandeur que Dn (Pm ) pour tout m ∈ M, on obtient l’exact analogue de (13) à la constante C près et la sélection de modèle ne coûte rien au sens où la borne de risque obtenue n’est jamais beaucoup plus grande que celle que l’on obtiendrait en faisant un choix a priori d’un modèle dans la famille. Cette borne est en fait du même ordre de grandeur que celle que l’on obtiendrait en utilisant seulement le “meilleur” modèle, c’est-à-dire celui qui minimise en m la quantité H 2 (P⋆ , Pm ) + Dn (Pm ) et optimise ainsi la borne (22). 18 8 Introduction aux propriétés des ρ-estimateurs Considérons d’abord ici la situation d’un seul modèle P pour lequel la borne (12) est valide, c’est-à-dire que h i  2 ⋆ b ⋆ EP H (P , P) ≤ C inf H 2 (P⋆ , P) + DnP (P⋆ , P) . P∈P La quantité DnP (P⋆ , P) dépend en théorie de la loi P⋆ des observations mais dans toutes les situations que nous avons étudiées il est possible de la majorer par une quantité DnP (P) qui ne dépend que du modèle P et de P. Dans ce cas, notre borne de risque devient h i   b ≤ C H 2 (P⋆ , P) + D P (P) pour tout P ∈ P . EP⋆ H 2 (P⋆ , P) (23) n Lorsque P⋆ est un élément P de P la borne devient i h i h b ≤ CD P (P). b = E H 2 (P, P) EP⋆ H 2 (P⋆ , P) n P D’après (23), si P⋆ 6= P, la borne ne se détériore pas plus que d’une quantité CH 2 (P⋆ , P), ce qui signifie en particulier que la borne de risque reste stable (comme fonction de P⋆ ) au voisinage de chaque point P du modèle. Il s’agit là de la propriété fondamentale des ρ-estimateurs que nous allons à présent illustrer. Pour ce faire, il conviendra de bien distinguer la vraie loi P⋆ des observations X du modèle statistique P que nous introduisons pour construire nos estimateurs. La seule hypothèse que nous faisons sur P⋆ est que c’est une loi produit (qui n’appartient pas nécessairement au modèle). Le choix du modèle est fondé sur certaines hypothèses dont on espère seulement qu’elles ne sont pas trop erronées si l’on veut que P⋆ ne soit pas trop loin de P . Tous les modèles statistiques que nous considérerons dans la suite supposent les observations i.i.d. (alors qu’elles ne le sont pas forcément). Cela revient à choisir un modèle statistique P pour la loi marginale des observations de sorte que P=P ⊗n avec P ∈ P pour tout P ∈ P . b = Pb⊗n avec Pb ∈ P alors que P⋆ = Un ρ-estimateur s’écrit donc P 9 9.1 Nn i=1 Pi⋆ . Robustesse Robustesse à l’hypothèse d’équidistribution Nous supposons ici qu’il existe une loi marginale P ∈ P telle que Pi⋆ = P pour tous les indices i ∈ {1, . . . , n} \ I où I est un sous-ensemble de {1, . . . , n} et si i ∈ I, 19 la loi Pi⋆ est arbitraire. Par exemple, si pour tout i ∈ I, Pi⋆ = δxi (mesure de Dirac au point xi ) où les xi sont des points arbitraires, cela signifie que notre supposé n-échantillon contient en fait |I| valeurs atypiques (où |I| désigne le cardinal de l’ensemble I). Nous pouvons alors écrire que X b ≥ h2 (Pi⋆ , Pb) = (n − |I|)h2 (P , Pb) H 2 (P⋆ , P) i6∈I et H 2 (P⋆ , P) = X h2 (Pi⋆, P ) + i6∈I X i∈I h2 (Pi⋆ , P ) ≤ |I|. Il découle donc de (23) que i h |I| + DnP (P) EP⋆ h2 (P , Pb) ≤ C . n − |I| a) Lorsque I = ∅, c’est-à-dire lorsque les observations sont vraiment i.i.d. et que le modèle est exact, on obtient la borne CDnP (P)/n comme attendu. b) Si les données ne sont pas exactement i.i.d., c’est-à-dire si I 6= ∅, mais que son cardinal n’est pas trop grand devant DnP (P) ≤ n, nous obtenons une borne de risque du même ordre de grandeur que la précédente. En particulier, le risque de l’estimateur reste stable à un possible écart à l’hypothèse d’équidistribution et notamment à la présence de quelques valeurs atypiques. 9.2 Robustesse à la contamination Supposons à présent que les données sont vraiment i.i.d. et qu’il existe une loi P ∈ P et un nombre ε ∈ [0, 1] (typiquement petit) tels que Pi⋆ = P ⋆ = (1 − ε)P + εQ pour tout i ∈ {1, . . . , n}, où Q est une loi arbitraire. Cela revient à supposer qu’une proportion 1 − ε de l’échantillon est correctement modélisée par une loi P du modèle, qu’une proportion ε est distribuée selon une loi Q quelconque et que ce dernier échantillon vient contaminer le premier. Comme h2 (P, R) ≤ kP − Rk où kP − Rk désigne la distance en variation totale,   h2 P ⋆ , P = h2 (1 − ε)P + εQ, P ≤ ε(Q − P ) ≤ ε, de sorte que H 2 (P⋆ , P) = nh2 (P ⋆ , P ) ≤ nε 20 et (23) conduit alors à la borne de risque   h i DnP (P) 2 ⋆ b EP⋆ h (P , P ) ≤ C ε + . n Cette borne reste donc stable à une contamination possible des données dans une proportion ε, tant que celle-ci n’est pas trop grande par rapport à DnP (P)/n. 10 Deux exemples Nous allons à présent considérer deux types de modèles statistiques particuliers et étudier les propriétés des ρ-estimateurs pour chacun d’eux. Nous ne reviendrons plus dans la suite sur les propriétés de robustesse vues ci-dessus. 10.1 Modèles de densités sous contrainte de forme Nous supposerons ici que les variables Xi sont i.i.d. de densité s⋆ par rapport à la mesure de Lebesgue λ sur R de sorte que P⋆ = Ps⋆ = (s⋆ · λ)⊗n et H 2 (Ps⋆ , Ps ) = nh2 (s⋆ · λ, s · λ) avec Ps = (s · λ)⊗n . Pour simplifier, nous noterons h(s⋆ , s) pour h(s⋆ · λ, s · λ). Le modèle statistique consiste à supposer que s⋆ appartient à une famille S de densités définies par des propriétés qualitatives. Par exemple, S est l’ensemble des densités décroissantes sur [0, +∞). Nous allons montrer comment on peut analyser les performances du ρ-estimateur de s⋆ sur ce type de modèles qui sont en général très gros (non-compacts pour la distance H) et pour lesquels il n’existe pas de vitesse d’estimation minimax. Nous n’allons en fait pas traiter l’exemple typique des densités décroissantes sur [0, +∞) puisque, comme nous l’avons dit précédemment, Su Weijie a démontré que dans cette situation le ρ-estimateur coı̈ncide exactement avec l’estimateur du maximum de vraisemblance, c’est-à-dire l’estimateur de Grenander, bien connu et très abondamment étudié — cf. par exemple Birgé (1989) et les références incluses dans cet article —. Nous allons plutôt nous intéresser à un problème plus complexe en choisissant pour S l’ensemble de toutes les densités qui sont monotones sur une demi-droite et nulles ailleurs. Cet ensemble contient les densités précédentes et plus généralement toutes les densités décroissantes sur un intervalle de la forme [a, +∞), mais aussi toutes celles qui sont croissantes sur un intervalle de la forme (−∞, a] ainsi que 21 toutes les densités des lois uniformes sur un intervalle compact. L’ensemble S est stable par translation et changement d’échelle. Notre modèle statistique est donc P = {Ps = (s · λ)⊗n , s ∈ S}. Bien que ce modèle soit très riche (il n’existe pas de vitesse minimax sur un tel b = Psb sur P n’est pas dégénéré, comme nous allons ensemble), le ρ-estimateur P le voir, et nous allons pouvoir étudier ses propriétés à partir de l’inégalité (23). Certains sous-ensembles de S vont jouer un rôle tout à fait particulier dans l’analyse de b s. Ce sont les suivants : pour d ≥ 1, soit Sd l’ensemble des densités de S qui sont constantes sur une partition de R contenant au plus d + 2 intervalles. Le “+2” correspond au fait qu’une densité constante par morceaux sur R est nécessairement nulle sur les deux intervalles non bornés de la partition ; l’entier d est donc le nombre maximal d’intervalles sur lesquels s est non nulle. Notons que les ensembles (Sd )d≥1 sont croissants pour l’inclusion, contiennent donc tous S1 qui est l’ensemble des densités uniformes sur un intervalle, et qu’ils sont stables par translation et changement d’échelle. Ils ne sont, en particulier, pas compacts. Le résultat suivant est démontré dans Baraud et Birgé (2016a) : Proposition 3. Quelle que soit la densité s ∈ Sd , n où log+ (u) = max{1, log u}, DnP (Ps ) ≤ d log3+ d donc, en notant Es⋆ pour EP⋆ , sup E s⋆ ∈Sd s⋆  n d 3 . h (s , sb) ≤ C log+ n d 2 ⋆  On a ainsi obtenu une borne de risque uniforme sur chaque ensemble Sd , ce qui signifie que si s⋆ ∈ Sd , b s converge vers s⋆ (dans le gros espace S) quand n → +∞ à vitesse √ (en termes de distance de Hellinger) presque paramétrique, c’est-à-dire en 1/ n au facteur logarithmique près. Notons que cette vitesse ne dépend que du nombre de morceaux d et non de leur longueur : on estime donc aussi bien une densité sur [0, 1] qu’une densité sur [0, 106] ou sur [0, 10−6 ], puisque l’espace Sd est stable par changement d’échelle. La vitesse ne dépend pas davantage de la norme infinie de la densité s⋆ . La vitesse est (probablement) approximativement minimax et le facteur log nécessaire (mais peut-être pas à cette puissance). En effet, il est connu que le risque minimax sur l’ensemble des densités sur [0, 1], constantes par morceaux avec d morceaux est au moins C(d/n) log+ (n/d) — cf. Birgé et Massart (1998) — et il est peu probable que la contrainte de monotonie permette de supprimer le log. 22 La propriété fondamentale de stabilité exprimée par (23) (en prenant P = Ps avec s ∈ Sd ) dit que   n   2 ⋆  d 3 2 ⋆ Es⋆ h (s , b s) ≤ C h (s , s) + log+ . n d Comme d et s dans Sd sont arbitraires, on conclut que   n   2 ⋆  d 3 2 ⋆ . Es⋆ h (s , b s) ≤ C inf h (s , Sd ) + log+ d≥1 n d (24) Donc, si s⋆ est proche d’une densité s ∈ Sd pour un certain d, la borne de risque précédente est pratiquement la même que celle que l’on obtiendrait pour s⋆ = s ∈ Sd . Nous allons utiliser ce dernier résultat pour aller plus loin dans l’analyse des performances de sb. Pour M ≥ 0, soit S(M) l’ensemble des densités s de S à support sur un intervalle compact Is (pouvant donc dépendre de s) et telles que   λ(Is ) sup s − inf s ≤ M. Is Is L’ensemble S(M) est encore stable par translation et changement d’échelle et contient toutes les lois uniformes (correspondant à M = 0). On établit dans Baraud et Birgé (2016a) le résultat d’approximation suivant. Proposition 4. Pour tout s ∈ S(M) et d ≥ 1 h2 (s, Sd ) ≤ M ∧ 1. 4d2 Il découle alors de (24) que, si s⋆ ∈ S(M),    n   2 ⋆  M d 3 Es⋆ h (s , b s) ≤ C inf ∧ 1 + log+ d≥1 4d2 n d  1/3  3 log+ (n) M 2 ′ ≤ C max , log n, n2/3 n ce qui conduit à des bornes de risque de sb uniformes sur les sous-ensembles S(M) ⊂ S. Si s⋆ n’est pas dans S(M) mais est proche d’un élément s de S(M) alors le risque en s⋆ est majoré par    1/3  2 ⋆  log3+ (n) M 2 2 ⋆ . log n, Es⋆ h (s , b s) ≤ C h (s , s) + max n2/3 n 23 Comme M et s dans S(M) et sont arbitraires, on en déduit que    1/3  2 ⋆  log3+ (n) M 2 2 ⋆ Es⋆ h (s , b s) ≤ C inf h (s , S(M)) + max . log n, M ≥0 n2/3 n (25) On peut poursuivre l’analyse de notre borne de risque pour les ρ-estimateurs si l’on a de l’information sur la manière dont les espaces S(M) approximent la densité inconnue s⋆ . Supposons, par exemple, que s⋆ (x) = θ exp [−θx] 1lR+ (x) pour un certain θ > 0, donc s⋆ ∈ S. Pour tout T > 0, on peut l’approximer par la densité sT (x) = Comme " T sup sT − inf sT [0,T ] [0,T ] sT ∈ S(θT ). De plus, ρ(Ps⋆ , PsT ) = # Z 0 donc θe−θx 1l[0,T ] . 1 − e−θT  θe−θT θ − =T 1 − e−θT 1 − e−θT T √  = θT, p θe−θx dx = 1 − e−θT , 1 − e−θT p h (s , sT ) = 1 − 1 − e−θT = e−θT √ ≤ e−θT . −θT 1+ 1−e Il découle alors de (25) que, puisque T est arbitraire, donc M = θT également,   1/3   2 ⋆  log3+ (n) M 2 −M + max Es⋆ h (s , b s) ≤ C inf e . log n, M ≥0 n2/3 n 2 ⋆ En choisissant M = (2/3) log n, on obtient finalement une borne de risque   log7/3 n Es⋆ h2 (s⋆ , sb) ≤ C 2/3 n qui est indépendante de θ > 0, ce qui montre que sb converge à vitesse n−1/3 log7/6 n uniformément sur l’ensemble de toutes les lois exponentielles bien que l’estimateur n’ait pas été particulièrement conçu pour estimer de telles lois. Le résultat demeure valable pour les lois exponentielles translatées de densités θ exp [−θ(x − a)] 1l[a,+∞) (x) avec a ∈ R. La démarche précédente n’est pas spécifique à l’ensemble S et l’on peut considérer d’autres exemples de familles de densités définies par des contraintes de forme et pour lesquelles les choses se passent à peu près de la même manière. On peut en particulier étudier — cf. Baraud et Birgé (2016a) — : 24 a) l’ensemble des densités monotones sur chaque élément d’une partition de R en au plus k intervalles ; b) l’ensemble des densités dont la racine carrée est convexe ou concave sur chaque élément d’une partition de R en au plus k intervalles ; c) l’ensemble des densités qui sont log-concaves sur R, c’est-à-dire de la forme eg 1lI où I est un intervalle de R et g une fonction concave. Par exemple, les lois gaussiennes, expontielles, de Laplace ou uniformes sont log-concaves. Dans ce cas ce sont les densités de la forme eg 1lI avec g linéaire par morceaux qui vont jouer le rôle des fonctions constantes par morceaux de l’exemple précédent. En particulier, on peut montrer que le ρ-estimateur défini sur ce gros espace de densités va converger à vitesse paramétrique (à des facteurs logarithmiques près) vers toutes les lois uniformes, exponentielles, ou de Laplace (pour lesquelles g est effectivement linéaire par morceaux). 10.2 Le modèle de régression à plan aléatoire 10.2.1 Estimation sur un modèle Nous supposons ici que les observations Xi , i ∈ {1, . . . , n} sont indépendantes et de la forme (Wi , Yi ) ∈ W × R et que notre modèle statistique est défini sur la base des hypothèses suivantes : (i) les Wi sont i.i.d. de loi PW inconnue ; (ii) il existe une fonction f ⋆ dans un espace vectoriel F de dimension d telle que Yi = f ⋆ (Wi ) + εi pour tout i ∈ {1, . . . , n}, (26) et les v.a.r. εi sont i.i.d. de densité unimodale q par rapport à la mesure de Lebesgue λ sur R. Ceci signifie que le modèle que l’on va utiliser pour estimer la loi P⋆ de X est de la forme P = {Pf = Pf⊗n , f ∈ F } avec, pour tout f ∈ F , Pf = qf · (PW ⊗ λ) qf (w, y) = q(y − f (w)). et b = P ⊗n ne dépend que Comme le critère permettant de calculer le ρ-estimateur P fb des rapports qf /qf ′ pour f, f ′ ∈ F , il n’est pas nécessaire de connaitre la loi PW des Wi pour le calculer. Sous l’hypothèse que q est unimodale et que F un espace vectoriel de dimension d ≤ n, on peut montrer que DnP (P) ≤ Cd log(en/d) pour tout P ∈ P . 25 On peut même remplacer l’hypothèse “unimodale” par “k-modale” (qui a au plus k modes) et F par une classe de fonctions VC-subgraph d’indice d ≥ 1 et obtenir la même inégalité avec une constante C dépendant alors de k. Dans cette situation, il découle de (23) que  h  i  en  2 ⋆ 2 ⋆ . EP⋆ H P , Pfb ≤ C inf H (P , Pf ) + d log f ∈F d (27) Pour analyser cette inégalité, notamment ce qu’elle dit de l’estimation d’une fonction de régression, et la comparer aux résultats habituels, il convient de supposer que le modèle de régression (26) est exact à ceci près que f ⋆ n’appartient pas nécessairement à F et que les εi n’ont pas nécessairement la densité q mais une densité p, ce qui revient à dire que, pour tout i ∈ {1, . . . , n}, Pi⋆ = pf ⋆ · (PW ⊗ λ) avec pf ⋆ (w, y) = p(y − f ⋆ (w)). Pour relier aisément la distance H à une distance entre les fonctions de régression nous ferons maintenant l’hypothèse que f ⋆ ainsi que tous les éléments de F sont bornés par une constante B et que la densité q est telle que  Z  2  p p −r 1 |u| q(y) − q(y − u) dy −→ A ∈ (0, +∞) pour un r ∈ (0, 2], u→0 2 R c’est-à-dire que le carré de la distance de Hellinger entre les densités q et q(·−u) est équivalent à A|u|r lorsque u → 0. On sait que si le modèle de translation associé à q est régulier (densités gaussienne, de Cauchy, de Laplace, etc.) alors r = 2 et que r = 1 si q est la densité uniforme sur un intervalle. Dans ces conditions, on peut montrer que, pour tout f ∈ F ,  H 2 (P⋆ , Pf )    c kf ⋆ − f krr + h2 (p, q) ≤ ≤ c kf ⋆ − f krr + h2 (p, q) n (28) avec des quantités c et c dépendant de nos hypothèses et Z r ⋆ |f ⋆ (w) − f (w)|r dPW (w). kf − f kr = W Comme les paires (f, q) et (f ⋆ , p) jouent des rôles symétriques pour le calcul de H 2 (P⋆ , Pf ), (28) demeure vraie si, pour un r ∈ (0, 2],  Z  2  p p −r 1 p(y) − p(y − u) dy −→ A ∈ (0, +∞). (29) |u| u→0 2 R Théorème 3. Si la relation (28) est satisfaite, alors   en  h ri d r 2 ⋆ ⋆ b . ≤ C inf kf − f kr + h (p, q) + log EP⋆ f − f f ∈F n d r 26 (30) Ce résultat appelle quelques remarques : a) il ne suppose rien sur la loi PW des Wi ; b) il ne suppose rien non plus sur l’intégrabilité des erreurs et l’on peut parfaitement prendre par exemple la loi de Cauchy pour modéliser la loi des εi , de même que la vraie densité p des erreurs peut être la loi de Cauchy ; c) les termes inf f ∈F kf ⋆ − f krr et h2 (p, q) montrent que la borne reste stable à une possible erreur de spécification du modèle. Pour analyser la borne de risque fournie par le Théorème 3, nous allons supposer que p = q, f ⋆ ∈ F (c’est-à-dire que notre modèle est exact) et que F est une partie d’un sous-espace vectoriel F de dimension d engendré par les fonctions ϕ1 , . . . , ϕd de sorte que d d X X ⋆ ⋆ b f = βj ϕj et f= βbj ϕj . j=1 j=1 Dans ce cas, en vertu de (30), EP⋆ h f ⋆ − fb ri r ≤C  en  d . log n d Donc, par l’inégalité de Markov, avec une probabilité proche de 1, f − fb ⋆ r   en 1/r d ≤C log n d et, comme sur l’espace vectoriel F toutes les normes sont équivalentes, cette relation implique que, avec une probabilité proche de 1, 1/r  log n ⋆ b , max βj − βj ≤ C 1≤j≤d n où la quantité C dépend aussi√de d. Si r = 2 on retrouve une vitesse de convergence paramétrique classique en 1/ n (au facteur logarithmique près) mais la vitesse de convergence est plus rapide si r < 2. Par exemple, dans le cas d’erreurs de loi uniforme pour lequel r = 1, le ρ-estimateur converge à vitesse 1/n (au facteur√log près) quand l’estimateur des moindres carrés ordinaire converge lui à vitesse 1/ n. Si la densité des erreurs n’est pas bornée, r < 1 et la convergence est encore plus rapide. Nous insisterons ici sur le fait que les hypothèses que nous avons utilisées pour obtenir la borne générale (27) sont extrêmement faibles : aucune pour la loi PW ni la structure de l’espace vectoriel F et une simple hypothèse d’unimodalité sur la densité des erreurs εi (que l’on peut d’ailleurs remplacer par une borne sur le 27 nombre de modes de cette densité). Ceci contraste avec les hypothèses que l’on rencontre d’ordinaire pour traiter ce problème, en particulier pour contrôler le risque des estimateurs des moindres carrés. En contrepartie, on peut regretter la présence du facteur logarithmique dans nos bornes de risque puisque, dans certaines situations, on obtient, mais au prix d’hypothèses nettement plus fortes, des vitesses analogues sans le facteur logarithmique. En contrepartie, notre estimateur est robuste et ses performances ne seront que légèrement affectées par un petit nombre (petit devant n) d’observations (Wi , Yi ) aberrantes. A contrario, une seule paire (Wi , Yi ) suffisamment exotique peut complètement dérégler le comportement des estimateurs des moindres carrés. 10.2.2 Plusieurs modèles Il est évidemment assez restrictif de ne travailler qu’avec une seule densité q et un seul modèle F mais, comme indiqué à la section 7, nous pouvons en fait utiliser plusieurs modèles simultanément de manière à faire varier la densité q ainsi que l’espace F . Nous pouvons considérer des ρ-estimateurs construits à partir de familles dénombrables de densités q pour modéliser p et plusieurs familles d’espaces fonctionnels F pour modéliser f ⋆ . Nous pouvons, par exemple, utiliser une famille {Fd , d ∈ N \ {0}} où Fd est un sous-ensemble d’un espace vectoriel Fd de dimension d ainsi qu’une famille dénombrable {qk , k ∈ K ⊂ N} de densités, ce qui fournit une famille de modèles de la forme (Fd , qk ) indexés par (d, k), un tel modèle correspondant à l’hypothèse (a priori inexacte) que Yi = f ⋆ (Wi ) + εi pour tout i ∈ {1, . . . , n}, f ⋆ ∈ Fd et εi ∼ qk · λ. S Dans ce cadre, un ρ-estimateur aura la forme P(fb,bq) avec fb ∈ d≥1 Fd et qb = qbk , b k ∈ N. Comme nous l’avons vu, pour un modèle (Fd , qk ), DnP (P) ≤ C0 d log(en/d) pour tout P ∈ (Fd , qk ). P Soit alors une suite (ak )k∈K de nombres positifs tels que k∈K e−ak = e − 1. Si nous fixons ∆(d, k) = d + ak , nous trouvons que ! ! +∞ X +∞ X +∞ X X X X e−∆(d,k) = e−(d+ak ) = e−d e−ak d=1 k∈K d=1 k∈K −1 = d=1 k∈K e (e − 1) = 1. 1 − e−1 Nous pouvons donc fixer la pénalité de la manière suivante : pen(Q) = κ [C0 d log(en/d) + d + ak ] 28 pour tout Q ∈ (Fd , qk ). Un ρ-estimateur (fb, qb) construit sur une telle famille de modèles aura alors un risque borné par   h  i  en  2 ⋆ 2 ⋆ + ak . EP⋆ H P , P(fb,bq) ≤ C inf inf H (P , P(f,qk ) ) + d log (d,k) f ∈Fd d S Notons que, si f ⋆ et tous les éléments de d≥1 Fd sont uniforméments bornés par B et si la densité S p vérifie la condition (29), les inégalités (28) seront satisfaites pour tout f ∈ d≥1 Fd , ce qui conduira à une borne de risque de la forme i h r EP⋆ f ⋆ − fb + h2 (p, qb)   r  en   2  d r ⋆ ≤ C inf inf kf − f kr + log + inf h (p, qk ) + ak . k f ∈Fd d n d 11 Conclusion L’intérêt principal des ρ-estimateurs réside dans leur robustesse, comme le montre la borne (12), ce qui permet de travailler systématiquement avec des modèles approchés et de se protéger contre la présence éventuelle d’observations atypiques. Cette robustesse permet également de remplacer un modèle complexe par un ou plusieurs modèles plus simples de manière à optimiser le compromis entre l’erreur d’approximation et l’erreur d’estimation liée à la complexité du modèle sur lequel l’estimateur est construitet d’atteindre ainsi la vitesse optimale d’estimation (éventuellement à un facteur logarithmique près). De plus le ρ-estimateur s’appuie sur des modèles de probabilités et ses performances ne dépendent ni de la mesure dominante ni du choix des densités. Comme nous l’avons vu dans la section 2, toutes ces qualités ne sont pas partagées par l’estimateur du maximum de vraisemblance ou l’estimateur des moindres carrés en régression. En revanche le ρ-estimateur, qui coı̈ncide (asymptotiquement ou non) avec l’estimateur du maximum de vraisemblance dans un certain nombre de situations, bénéficie alors de ses propriétés d’optimalité. Dans la section 2.5, nous avons mis en évidence un problème lié à l’utilisation du maximum de vraisemblance sur un modèle approché, nous allons voir à présent, en guise de conclusion, ce qui se passe si l’on remplace le maximum de vraisemblance par un ρ-estimateur construit sur ce même modèle approché. Retour sur l’exemple de la section 2.5. Nous avons vu que la méthode du maximum de vraisemblance sur le modèle approchant P0 ne fournissait, avec une probabilité proche de un, aucune estimation de θ. Une question naturelle est de savoir ce qui se passe si nous utilisons un ρ-estimateur et quelles sont alors ses 29 performances. Si l’on note pθ la densité 1l[θ,θ+1] (x) de la loi uniforme sur [θ, θ + 1], le ρ-estimateur θbn de θ minimise sur R l’application s ! n X pθ′ (Xi ) (31) θ 7→ sup ψ pθ (Xi ) θ ′ ∈R i=1 avec ψ(1/0) = ψ(+∞) = 1 = −ψ(0) et ψ(1) = 0. Or, pour tout θ, θ′ ∈ R et x ∈ R,  s ! 1 si x ∈ [θ′ , θ′ + 1] \ [θ, θ + 1],  pθ′ (x) ψ = 0 si x ∈ [θ′ , θ′ + 1] ∩ [θ, θ + 1],  pθ (x)  −1 si x ∈ [θ, θ + 1] \ [θ′ , θ′ + 1], p  donc ψ pθ′ (x)/pθ (x) = 1l[θ′ ,θ′ +1] (x) − 1l[θ,θ+1] (x) et n X ψ i=1 s pθ′ (Xi ) pθ (Xi ) ! = n X i=1 1l[θ′ ,θ′ +1] (Xi ) − n X 1l[θ,θ+1] (Xi ). i=1 Alors sup n X θ ′ ∈R i=1 ψ s pθ′ (Xi ) pθ (Xi ) ! " = sup n X θ ′ ∈R i=1 # 1l[θ′ ,θ′+1] (Xi ) − n X 1l[θ,θ+1] (Xi ) i=1 et un ρ-estimateur θbn est n’importe quel élément maximisant l’application θ 7→ n X 1l[θ,θ+1] (Xi ). i=1 En d’autres termes, calculer un ρ-estimateur revient à rechercher un paramètre θ maximisant le nombre de données Xi tombant dans l’intervalle [θ, θ + 1] quand l’e.m.v. recherche un paramètre θ pour lequel toutes les données X1 , . . . , Xn appartiennent à [θ, θ + 1]. Mais un tel paramètre n’existe pas dès que l’on observe une valeur aberrante. Étudions à présent les performances de θbn . Soit θ0 ∈ R et α ∈ [0, ε] avec ε < 1/2 les vraies valeurs des paramètres de la loi de l’observation X = (X1 , . . . , Xn ). Notre objectif est d’évaluer la probabilité h i pour 0 < c < n. Pα,θ0 |θ0 − θbn | > c/n Notons que sous Pα,θ0 , la loi jointe des variables Xi − θ0 est indépendante de θ0 et la valeur d’un ρ-estimateur θbn = θbn (X1 , . . . , Xn ) construit à partir des observations X1 , . . . , Xn s’écrit sous la forme θ0 + θen où θen est un ρ-estimateur construit à partir 30 des observations X1 − θ0 , . . . , Xn − θ0 de sorte qu’il nous suffit d’étudier le cas θ0 = 0. Sous Pα,0 , le nombre Nn de Xi appartenant à l’intervalle [0, 1] suit une loi binomiale de paramètres n et 1 − α et deux situations peuvent alors se produire : soit Nn ≤ n/2, ce qui arrive avec une probabilité   Pα,0 [Nn ≤ n/2] = Pα,0 [Nn − n(1 − α) ≤ −(n/2)(1 − 2α)] ≤ exp −n(1 − 2α)2 /2 , d’après l’inégalité de Hoeffding, soit Nn > n/2 auquel cas un ρ-estimateur θbn est un point arbitraire de [X(n) − 1, X(1) ] où X(1) = mini=1,...,n Xi et X(n) est le plus grand des Xi appartenant à l’intervalle [0, 1]. Sur l’évènement {Nn > n/2}, X(n) = maxi=1,...,n Xi 1lXi ∈[0,1] . Par des calculs classiques,  n   n c(1 − α) Pα,0 X(1) > c/n = Pα,0 [X1 > c/n] = 1 − ≤ e−(1−α)c n et    n Pα,0 X(n) − 1 < −c/n, Nn > n/2 ≤ Pα,0 X1 1l[0,1] (X1 ) < 1 − c/n ≤ (Pα,0 [{0 ≤ X1 < 1 − c/n} ∪ {X1 > 1}])n n  (1 − α)c ≤ e−(1−α)c . = 1− n Ainsi, pour tout ρ-estimateur θbn , h i h i Pα,0 |θbn | > c/n ≤ Pα,0 [Nn ≤ n/2] + Pα,0 Nn > n/2, |θbn | > c/n   ≤ Pα,0 [Nn ≤ n/2] + Pα,0 X(1) > c/n   + Pα,0 Nn > n/2, X(n) − 1 < −c/n 2 /2 ≤ e−n(1−2α) + 2e−(1−α)c . Ce résultat montre que pour toute loi Pα,θ0 ∈ Pε , le ρ-estimateur de θ construit sur le sous-modèle P0 converge à la vitesse 1/n dès que ε < 1/2 alors même que, si α n’est pas nul, la distance de Hellinger entre la vraie loi Pα,θ0 et le modèle P0 est strictement positive et indépendante de n. En plus d’illustrer la robustesse du ρ-estimateur, cet exemple montre qu’une inégalité telle que (15) sur le risque du ρ-estimateur en distance de Hellinger peut s’avérer pessimiste dans des cadres paramétriques pour lesquels notre objectif n’est pas d’estimer la loi de l’observation mais simplement son paramètre pour la perte euclidienne usuelle. Références Bahadur, R. (1958). Examples of inconsistency of maximum likelihood estimates. Sankhya Ser.A, 20 :207–210. 31 Baraud, Y. (2011). Estimator selection with respect to Hellinger-type risks. Probab. Theory Related Fields, 151(1-2) :353–401. Baraud, Y. and Birgé, L. (2016a). Rho-estimators for shape restricted density estimation. Stochastic Process. Appl., 126(12) :3888–3912. Baraud, Y. and Birgé, L. (2016b). Rho-estimators revisited : General theory and applications. Technical report, http://arxiv.org/abs/1605.05051. Baraud, Y., Birgé, L., and Sart, M. (2017). A new method for estimation and model selection :ρ-estimation. Invent. Math., 207(2) :425–517. Birgé, L. (1983). Approximation dans les espaces métriques et théorie de l’estimation. Z. Wahrsch. Verw. Gebiete, 65(2) :181–237. Birgé, L. (1989). The Grenander estimator : a nonasymptotic approach. Ann. Statist., 17(4) :1532–1549. Birgé, L. (2006). Model selection via testing : an alternative to (penalized) maximum likelihood estimators. Ann. Inst. H. Poincaré Probab. Statist., 42(3) :273– 325. Birgé, L. and Massart, P. (1998). Minimum contrast estimators on sieves : exponential bounds and rates of convergence. Bernoulli, 4(3) :329–375. Huber, P. J. (1981). Robust Statistics. John Wiley & Sons, Inc., New York. Wiley Series in Probability and Mathematical Statistics. Le Cam, L. (1973). Convergence of estimates under dimensionality restrictions. Ann. Statist., 1 :38–53. Le Cam, L. (1975). On local and global properties in the theory of asymptotic normality of experiments. In Stochastic processes and related topics (Proc. Summer Res. Inst. Statist. Inference for Stochastic Processes, Indiana Univ., Bloomington, Ind., 1974, Vol. 1 ; dedicated to Jerzy Neyman), pages 13–54. Academic Press, New York. Le Cam, L. (1990). Maximum likelihood : An introduction. Inter. Statist. Review, 58(2) :153–171. van der Vaart, A. W. (1998). Asymptotic statistics, volume 3 of Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, Cambridge. 32
10math.ST
arXiv:1706.02932v2 [cs.CV] 18 Nov 2017 Unsupervised learning of object frames by dense equivariant image labelling James Thewlis1 Hakan Bilen2 Visual Geometry Group University of Oxford {jdt,vedaldi}@robots.ox.ac.uk 1 Andrea Vedaldi1 2 School of Informatics University of Edinburgh [email protected] Abstract One of the key challenges of visual perception is to extract abstract models of 3D objects and object categories from visual measurements, which are affected by complex nuisance factors such as viewpoint, occlusion, motion, and deformations. Starting from the recent idea of viewpoint factorization, we propose a new approach that, given a large number of images of an object and no other supervision, can extract a dense object-centric coordinate frame. This coordinate frame is invariant to deformations of the images and comes with a dense equivariant labelling neural network that can map image pixels to their corresponding object coordinates. We demonstrate the applicability of this method to simple articulated objects and deformable objects such as human faces, learning embeddings from random synthetic transformations or optical flow correspondences, all without any manual supervision. 1 Introduction Humans can easily construct mental models of complex 3D objects and object categories from visual observations. This is remarkable because the dependency between an object’s appearance and its structure is tangled in a complex manner with extrinsic nuisance factors such as viewpoint, illumination, and articulation. Therefore, learning the intrinsic structure of an object from images requires removing these unwanted factors of variation from the data. The recent work of [37] has proposed an unsupervised approach to do so, based on on the concept of viewpoint factorization. The idea is to learn a deep Convolutional Neural Network (CNN) that can, given an image of the object, detect a discrete set of object landmarks. Differently from traditional approaches to landmark detection, however, landmarks are neither defined nor supervised manually. Instead, the detectors are learned using only the requirement that the detected points must be equivariant (consistent) with deformations of the input images. The authors of [37] show that this constraint is sufficient to learn landmarks that are “intrinsic” to the objects and hence capture their structure; remarkably, due to the generalization ability of CNNs, the landmark points are detected consistently not only across deformations of a given object instance, which are observed during training, but also across different instances. This behaviour emerges automatically from training on thousands of single-instance correspondences. In this paper, we take this idea further, moving beyond a sparse set of landmarks to a dense model of the object structure (section 3). Our method relates each point on an object to a point in a low dimensional vector space in a way that is consistent across variation in motion and in instance identity. This gives rise to an object-centric coordinate system, which allows points on the surface of an object to be indexed semantically (figure 1). As an illustrative example, take the object category of a face and the vector space R3 . Our goal is to semantically map out the object such that any point on a face, such as the left eye, lives at a canonical position in this “label space”. We train a CNN to learn the function that projects any face image into this space, essentially “coloring” each pixel with its 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: Dense equivariant image labelling. Left: Given an image x of an object or object category and no other supervision, our goal is to find a common latent space Z, homeomorphic to a sphere, which attaches a semantically-consistent coordinate frame to the object points. This is done by learning a dense labelling function that maps image pixels to their corresponding coordinate in the Z space. This mapping function is equivariant (compatible) with image warps or object instance variations. Right: An equivariant dense mapping learned in an unsupervised manner from a large dataset of faces. (Results of S IMPLE network, Ldist , γ = 0.5) corresponding label. As a result of our learning formulation, the label space has the property of being locally smooth: points nearby in the image are nearby in the label space. In an ideal case, we could imagine the surface of an object to be mapped to a sphere. In order to achieve these results, we contribute several technical innovations (section 3.2). First, we show that, in order to learn a non-trivial object coordinate frame, the concept of equivariance must be complemented with the one of distinctiveness of the embedding. Then, we propose a CNN implementation of this concept that can explicitly express uncertainty in the labelling of the object points. The formulation is used in combination with a probabilistic loss, which is augmented with a robust geometric distance to encourage better alignment of the object features. We show that this framework can be used to learn meaningful object coordinate frames in a purely unsupervised manner, by analyzing thousands of deformations of visual objects. While [37] proposed to use Thin Plate Spline image warps for training, here we also consider simple synthetic articulated objects having frames related by known optical flow (section 4). We conclude the paper with a summary of our finding (section 5). 2 Related Work Learning the structure of visual objects. Modeling the structure of visual objects is a widelystudied (e.g. [6, 7, 11, 39, 12]) computer vision problem with important applications such as facial landmark detection and human body pose estimation. Much of this work is supervised and aimed at learning detectors of objects or their parts, often using deep learning. A few approaches such as spatial transformer networks [20] can learn geometric transformations without explicit geometric supervision, but do not build explicit geometric models of visual objects. More related to our work, WarpNet [21] and geometric matching networks [34] learn a neural network that predicts Thin Plate Spline [3] transformations between pairs of images of an object, including synthetic warps. Deep Deformation Network [42] improves WarpNet by using a Point Transformer Network to refine the computed landmarks, but it requires manual supervision. None of these works look at the problem of learning an invariant geometric embedding for the object. Our work builds on the idea of viewpoint factorization (section 3.1), recently introduced in [37, 31]. However, we extend [37] in several significant ways. First, we construct a dense rather than discrete embedding, where all pixels of an object are mapped to an invariant object-centric coordinate instead of just a small set of selected landmarks. Second, we show that the equivariance constraint proposed in [37] is not quite enough to learn such an embedding; it must be complemented with the concept of a distinctive embedding (section 3.1). Third, we introduce a new neural network architecture and corresponding training objective that allow such an embedding to be learned in practice (section 3.2). Optical/semantic flow. A common technique to find correspondences between temporally related video frames is optical flow [18]. The state-of-the-art methods [14, 38, 19] typically employ convolu2 tional neural networks to learn pairwise dense correspondences between the same object instances at subsequent frames. The SIFT Flow method [25] extends the between-instance correspondences to cross-instance mappings by matching SIFT features [27] between semantically similar object instances. Learned-Miller [24] extends the pairwise correspondences to multiple images by posing a problem of alignment among the images of a set. Collection Flow [22] and Mobahi et al. [29] project objects onto a low-rank space that allow for joint alignment. FlowWeb [50], and Zhou et al. [49] construct fully connected graphs to maximise cycle consistency between each image pair and synthethic data as an intermediary by training a CNN. In our experiments (section 4) flow is known from synthetic warps or motion, but our work could build on any unsupervised optical flow method. Unsupervised learning. Classical unsupervised learning methods such as autoencoders [4, 2, 17] and denoising autoencoders aim to learn useful feature representations from an input by simply reconstructing it after a bottleneck. Generative adversarial networks [16] target producing samples of realistic images by training generative models. These models when trained joint with image encoders are also shown to learn good feature representations [9, 10]. More recently several studies have emerged that train neural networks by learning auxiliary or pseudo tasks. These methods exploit typically some existing information in input as “self-supervision” without any manual labeling by removing or perturbing some information from an input and requiring a network to reconstruct it. For instance, Doersch et al. [8], and Noroozi and Favaro [30] train a network to predict the relative locations of shuffled image patches. Other self-supervised tasks include colorizing images [44], inpainting [33], ranking frames of a video in temporally correct order [28, 13]. More related to our approach, Agrawal et al. [1] use egomotion as supervisory signal to learn feature representations in a Siamese network by predicting camera transformations from image pairs, [32] learn to group pixels that move together in a video. [48, 15] use a warping-based loss to learn depth from video. 3 Method This section discusses our method in detail, first introducing the general idea of dense equivariant labelling (section 3.1), and then presenting a concrete implementation of the latter using a novel deep CNN architecture (section 3.2). 3.1 Dense equivariant labelling Consider a 3D object S ⊂ R3 or a class of such objects S that are topologically isomorphic to a sphere Z ⊂ R3 (i.e. the objects are simple closed surfaces without holes). We can construct a homeomorphism p = πS (q) mapping points of the sphere q ∈ Z to points p ∈ S of the objects. Furthermore, if the objects belong to the same semantic category (e.g. faces), we can assume that these isomorphisms are semantically consistent, in the sense that πS 0 ◦ πS−1 : S → S 0 maps points of object S to semantically-analogous points in object S 0 (e.g. for human faces the right eye in one face should be mapped to the right eye in another [37]). While this construction is abstract, it shows that we can endow the object (or object category) with a spherical reference system Z. The authors of [37] build on this construction to define a discrete system of object landmarks by considering a finite number of points zk ∈ Z. Here, we take the geometric embedding idea more literally and propose to explicitly learn a dense mapping from images of the object to the object-centric coordinate space Z. Formally, we wish to learn a labelling function Φ : (x, u) 7→ z that takes a RGB image x : Λ → R3 , Λ ⊂ R3 and a pixel u ∈ Λ to the object point z ∈ Z which is imaged at u (figure 1). Similarly to [37], this mapping must be compatible or equivariant with image deformations. Namely, let g : Λ → Λ be a deformation of the image domain, either synthetic or due to a viewpoint change or other motion. Furthermore, let gx = x ◦ g −1 be the action of g on the image (obtained by inverse warp). Barring occlusions and boundary conditions, pixel u in image x must receive the same label as pixel gu in image gx, which results in the invariance constraint: ∀x, u : Φ(x, u) = Φ(gx, gu). (1) Equivalently, we can view the network as a functional x 7→ Φ(x, ·) that maps the image to a corresponding label map. Since the label map is an image too, g acts on it by inverse warp.1 Using 1 In the sense that gΦ(x, ·) = Φ(x, ·) ◦ g −1 . 3 this, the constraint (1) can be rewritten as the equivariance relation gΦ(x, ·) = Φ(gx, ·). This can be visualized by noting that the label image deforms in the same way as the input image, as show for example in figure 3. For learning, constraint (1) can be incorporated in a loss function as follows: Z 1 2 L(Φ|α) = kΦ(x, u) − Φ(gx, gu)k du. |Λ| Λ However, minimizing this loss has the significant drawback that a global optimum is obtained by simply setting Φ(x, u) = const. The reason for this issue is that (1) is not quite enough to learn a useful object representation. In order to do so, we must require the labels not only to be equivariant, but also distinctive, in the sense that Φ(x, u) = Φ(gx, v) ⇔ v = gu. We can encode this requirement as a loss in different ways. For example, by using the fact that points Φ(x, u) are on the unit sphere, we can use the loss: Z 1 2 kgu − argmaxv hΦ(x, u), Φ(gx, v)ik du. (2) L0 (Φ|x, g) = |Λ| Λ By doing so, the labels Φ(x, u) must be able to discriminate between different object points, so that a constant labelling would receive a high penalty. Relationship with learning invariant visual descriptors. As an alternative to loss (2), we could have used a pairwise loss2 to encourage the similarity hΦ(x, u), Φ(x0 , gu)i of the labels assigned to corresponding pixels u and gu to be larger than the similarity hΦ(x, u), Φ(x0 , v)i of the labels assigned to pixels u and v that do not correspond. Formally, this would result in a pairwise loss similar to the ones often used to learn invariant visual descriptors for image matching. The reason why our method learns an object representation instead of a generic visual descriptor is that the dimensionality of the label space Z is just enough to represent a point on a surface. If we replace Z with a larger space such as Rd , d  2, we can expect Φ(x, u) to learn to extract generic visual descriptors like SIFT instead. This establishes an interesting relationship between visual descriptors and object-specific coordinate vectors and suggests that it is possible to transition between the two by controlling their dimensionality. 3.2 Concrete learning formulation In this section we introduce a concrete implementation of our method (figure 2). For the mapping Φ, we use a CNN that receives as input an image tensor x ∈ RH×W ×C and produces as output a label tensor z ∈ RH×W ×L . We use the notation Φu (x) to indicate the L-dimensional label vector extracted at pixel u from the label image computed by the network. The dimension of the label vectors is set to L = 3 (instead of L = 2) in order to allow the network to express uncertainty about the label assigned to a pixel. The network can do so by modulating the norm of Φu (x). In fact, correspondences are expressed probabilistically by computing the inner product of label vectors followed by the softmax operator. Formally, the probability that pixel v in image x0 corresponds to pixel u in image x is expressed as: 0 ehΦu (x),Φv (x )i p(v|u; x, x0 , Φ) = P hΦ (x),Φ (x0 )i . u z ze (3) In this manner, a shorter vector Φu results in a more diffuse probability distribution. Next, we wish to define a loss function for learning Φ from data. To this end, we consider a triplet α = (x, x0 , g), where x0 = gx is an image that corresponds to x up to transformation g (the nature 2 Formally, this is achieved by the loss Z n o 1 L00 (Φ|x, g) = max 0, max ∆(u, v) + hΦ(x, u), Φ(gx, v)i − hΦ(x, u), Φ(gx, gu)i du, v |Λ| Λ where ∆(u, v) ≥ 0 is an error-dependent margin. 4 Optical flow Figure 2: Unsupervised dense correspondence network. From left to right: The network Φ extracts label maps Φu (x) and Φv (x0 ) from the image pair x and x0 . An optical flow module (or ground truth for synthetic transformation) computes the warp (correspondence field) g such that x0 = gx. Then the label of each point u in the first image is correlated to each point v in the second, obtaining a number of score maps. The loss evaluates how well the score maps predict the warp g. of the data is discussed below). We then assess the performance of the network Φ on the triplet α using two losses. The first loss is the negative log-likelihood of the ground-truth correspondences: 1 X Llog (Φ|x, x0 , g) = − log p(gu|u; x, x0 , Φ). (4) HW u This loss has the advantage that it explicitly learns (3) as the probability of a match. However, it is not sensitive to the size of a correspondence error v − gu. In order to address this issue, we also consider the loss 1 XX Ldist (Φ|x, x0 , g) = kv − gukγ2 p(v|u; x, x0 , Φ). (5) HW u v Here γ > 0 is an exponent used to control the robustness of the distance measure, which we set to γ = 0.5, 1. Nework details. We test two architecture. The first one, denoted S IMPLE, is the same as [47, 37] and is a chain (5, 20)+ , (2, mp), ↓2 , (5, 48)+ , (3, 64)+ , (3, 80)+ , (3, 256)+ , (1, 3) where (h, c) is a bank of c filters of size h × h, + denotes ReLU, (h, mp) is h × h max-pooling, ↓s is s× downsampling. Better performance can be obtained by increasing the support of the filters in the network; for this, we consider a second network D ILATIONS (5, 20)+ , (2, mp), ↓2 , (5, 48)+ , (5, 64, 2)+ , (3, 80, 4)+ , (3, 256, 2)+ , (1, 3) where (h, c, d) is a filter with ×d dilation [41]. 3.3 Learning from synthetic and true deformations Losses (4) and (5) learn from triplets α = (x, x0 , g). Here x0 can be either generated synthetically by applying a random transformation g to a natural image x [37, 21], or it can be obtained by observing image pairs (x, x0 ) containing true object deformations arising from a viewpoint change or an object motion or deformation. The use of synthetic transformations enables training even on static images and was considered in [37], who showed it to be sufficient to learn meaningful landmarks for a number of real-world object such as human and cat faces. Here, in addition to using synthetic deformations, we also consider using animated image pairs x and x0 . In principle, the learning formulation can be modified so that knowledge of g is not required; instead, images and their warps can be compared and aligned directly based on the brightness constancy principle. In our toy video examples we obtain g from the rendering engine, but it can in theory be obtained using an off-the-shelf optical flow algorithm which would produce a noisy version of g. 4 Experiments This section assesses our unsupervised method for dense object labelling on two representative tasks: two toy problems (sections 4.1 and 4.2) and human and cat faces (section 4.3). 5 Figure 3: Roboarm equivariant labelling. Top: Original video frames of a simple articulated object. Middle and bottom: learned labels, which change equivariantly with the arm, learned using Llog and Ldist , respectively. Different colors denote different points of the spherical object frame. 4.1 Roboarm example In order to illustrate our method we consider a toy problem consisting of a simple articulated object, namely an animated robotic arm (figure 3) created using a 2D physics engine [36]. We do so for two reasons: to show that the approach is capable of labelling correctly deformable/articulated objects and to show that the spherical model Z is applicable also to thin objects, that have mainly a 1D structure. Dataset details. The arm is anchored to the bottom left corner and is made up of colored capsules connected with joints having reasonable angle limits to prevent unrealistic contortion and selfocclusion. Motion is achieved by varying the gravity vector, sampling each element from a Gaussian with standard deviation 15 m s−2 every 100 iterations. Frames x of size 90 × 90 pixels and the corresponding flow fields g : x 7→ x0 are saved every 20 iterations. We also save the positions of the capsule centers. The final dataset has 23999 frames. Learning. Using the correspondences α = (x, x0 , g) provided by the flow fields, we use our method to learn an object centric coordinate frame Z and its corresponding labelling function Φu (x). We test learning Φ using the probabilistic loss (4) and distance-based loss (5). In the loss we ignore areas with zero flow, which automatically removes the background. We use the S IMPLE network architecture (section 3.2). Results. Figure 3 provides some qualitative results, showing by means of colormaps the labels Φu (x) associated to different pixels of each input image. It is easy to see that the method attaches consistent labels to the different arm elements. The distance-based loss produces a more uniform embedding, as may be expected. The embeddings are further visualized in Figure 4 by projecting a number of video frames back to the learned coordinate spaces Z. It can be noted that the space is invariant, in the sense that the resulting figure is approximately the same despite the fact that the object deforms significantly in image space. This is true for both embeddings, but the distance-based ones are geometrically more consistent. 2 2 2 1 1 1 0 0 0 -1 -1 -1 -2 -2 -4 -2 0 2 4 -2 -4 -2 0 2 4 2 2 2 1 1 1 0 0 0 -1 -1 -1 -2 -2 -4 -2 0 2 4 -4 -2 0 2 4 -4 -2 0 2 4 -2 -4 -2 0 2 4 Figure 4: Invariance of the object-centric coordinate space for Roboarm. The plot projects frames 3,6,9 of figure 3 on the object-centric coordinate space Z, using the embedding functions learned by means of the probabilistic (top) and distance (bottom) based losses. The sphere is then unfolded, plotting latitude and longitude (in radians) along the vertical and horizontal axes. 6 Log Dist 0.5 Dist 1 Ground truth Figure 5: Left: Embedding spaces of different dimension. Spherical embedding (from the 3D embedding function Φu (x) ∈ R3 ) learned using the distance loss compared to a circular embedding with one dimension less. Right: Capsule center prediction for different losses. Predicting capsule centers. We evaluate quantitatively the ability of our object frames to localise the capsule centers. If our assumption is correct and a coordinate system intrinsic to the object has been learned, then we should expect there to be a specific 3-vector in Z corresponding to each center, and our job is to find these vectors. Various strategies could be used, such as averaging the object-centric coordinates given to the centers over the training set, but we choose to incorporate the problem into the learning framework. This is done using the negative log-likelihood in much the same way as (4), limiting our vectors u to the centers. This is done as an auxiliary layer with no backpropagation to the rest of the network, so that the embedding remains unsupervised. The error reported is the Euclidean distance as a percentage of the image width. Results are given for the different loss functions used for unsupervised training in Table 1 and visualized in Figure 5 right, showing that the object centers can be located to a high degree of accuracy. The negative log likelihood performs best while the two losses incorporating distance perform similarly. We also perform experiments varying the dimensionality L of the label space Z (Table 2). Perhaps most interestingly, given the almost one-dimensional nature of the arm, is the case of L = 2, which would correspond to an approximately circular space (since the length of vectors is used to code for uncertainty). As seen in the right of Figure 5 left, the segments are represented almost perfectly on the boundary of a circle, with the exception of the bifurcation which it is unable to accurately represent. This is manifested by the light blue segment trying, and failing, to be in two places at once. Unsupervised Loss Error Llog 0.97 % Ldist , γ = 1 1.13 % Ldist , γ = 0.5 1.14 % Table 1: Predicting capsule centers. Error as percent of image width. 4.2 Textured sphere example Descriptor Dimension 2 3 5 20 Error 1.29 % 1.14 % 1.16 % 1.28 % Table 2: Descriptor dimension (Ldist , γ = 0.5). L>3 shows no improvement, suggesting L=3 is the natural manifold of the arm. The experiment of Figure 6 tests the ability of the method to understand a complete rotation of a 3D object, a simple textured sphere. Despite the fact that the method is trained on pairs of adjacent video frames (and corresponding optical flow), it still learns a globally-consistent embedding. However, this required switching from from the S IMPLE to the D ILATIONS architecture (section 3.2). 4.3 Faces After testing our method on a toy problem, we move to a much harder task and apply our method to generate an object-centric reference frame Z for the category of human faces. In order to generate an image pair and corresponding flow field for training we warp each face synthetically using Thin Plate Spline warps in a manner similar to [37]. We train our models on the extensive CelebA [26] dataset of over 200k faces as in [37], excluding MAFL [47] test overlap from the given training split. It has annotations of the eyes, nose and mouth corners. Note that we do not use these to train our model. We also use AFLW [23], testing on 2995 faces [47, 40, 46] with 5 landmarks. Like [37] we use 10,122 faces for training. We additionally evaluate qualitatively on a dataset of cat faces [45], using 8609 images for training. Qualitative assessment. We find that for network S IMPLE the negative log-likelihood loss, while performing best for the simple example of the arm, performs poorly on faces. Specifically, this model 7 Figure 6: Sphere equivariant labelling. Top: video frames of a rotating textured sphere. Middle: learned dense labels, which change equivariantly with the sphere. Bottom: re-projection of the video frames on the object frame (also spherical). Except for occlusions, the reprojections are approximately invariant, correctly mapping the blue and orange sides to different regions of the label space fails to disambiguate the left and right eye, as shown in Figure 9 (right). The distance-based loss (5) produces a more coherent embedding, as seen in Figure 9 (left). Using D ILATIONS this problem disappears, giving qualitatively smooth and unambiguous labels for both the distance loss (Figure 7) and the log-likelihood loss (Figure 8). For cats our method is able to learn a consistent object frame despite large variations in appearance (Figure 8). Figure 7: Faces. D ILATIONS network with Ldist , γ = 0.5. Top: Input images, Middle: Predicted dense labels mapped to colours, Bottom: Image pixels mapped to label sphere and flattened. Figure 8: Cats. D ILATIONS network with Llog . Top: Input images, Middle: Labels mapped to colours, Bottom: Images mapped to the spherical object frames. 8 Figure 9: Annotated landmark prediction from the shown unsupervised label maps (S IMPLE network). Left: Trained with Ldist , γ = 0.5, Right: Failure to disambiguate eyes with Llog . (Prediction: green, Ground truth: Blue) Regressing semantic landmarks. We would like to quantify the accuracy of our model in terms of ability to consistently locate manually annotated points, specifically the eyes, nose, and mouth corners given in the CelebA dataset. We use the standard test split for evaluation of the MAFL dataset [47], containing 1000 images. We also use the MAFL training subset of 19k images for learning to predict the ground truth landmarks, which gives a quantitative measure of the consistency of our object frame for detecting facial features. These are reported as Euclidean error normalized as a percentage of inter-ocular distance. In order to map the object frame to the semantic landmarks, as in the case of the robot arm centers, we learn the vectors zk ∈ Z corresponding to the position of each point in our canonical reference space and then, for any given image, find the nearest z and its corresponding pixel location u. We report the localization performance of this model in Table 3 (“Error Nearest”). We empirically validate that with the S IMPLE network the negative log-likelihood is not ideal for this task (Figure 9) and we obtain higher performance for the robust distance with power 0.5. However, after switching to D ILATIONS to increase the receptive field both methods perform comparably. The method of [37] learns to regress P ground truth coordinates based on M > P unsupervised landmarks. By regressing from multiple points it is not limited to integer pixel coordinates. While we are not predicting landmarks as network output, we can emulate this method by allowing multiple points in our object coordinate space to be predictive for a single ground truth landmark. We learn one regressor per ground truth point, each formulated as a linear regressor R2M → R2 on top of coordinates from M = 50 learned intermediate points. This allows the regression to say which points in Z are most useful for predicting each ground truth point. We also report results after unsupervised finetuning of a CelebA network to the more challenging AFLW followed by regressor training on AFLW. As shown in Tables 3 and 4, we outperform other unsupervised methods on both datasets, and are comparable to fully supervised methods. Network Unsup. Loss S IMPLE S IMPLE S IMPLE Llog Ldist , γ = 1 Ldist , γ = 0.5 Llog Ldist , γ = 0.5 Error Nearest — 7.94 % 7.18 % D ILATIONS 5.83 % D ILATIONS 5.87 % [37] 6.67 % Table 3: Nearest neighbour and regression landmark prediction on MAFL 5 75.02 % 14.57 % 13.29 % 11.05 % 10.53 % Error Regress Method Error RCPR [5] 11.6 % Cascaded CNN [35] 8.97 % CFAN [43] 10.94 % TCDCN [47] 7.65 % RAR [40] 7.23 % Unsup. Landmarks [37] 10.53 % D ILATIONS Ldist , γ = 0.5 8.80 % Table 4: Comparison with supervised and unsupervised methods on AFLW Conclusions Building on the idea of viewpoint factorization, we have introduce a new method that can endow an object or object category with an invariant dense geometric embedding automatically, by simply observing a large dataset of unlabelled images. Our learning framework combines in a novel way the concept of equivariance with the one of distinctiveness. We have also proposed a concrete implementation using novel losses to learn a deep dense image labeller. We have shown empirically that the method can learn a consistent geometric embedding for a simple articulated synthetic robotic arm as well as for a 3D sphere model and real faces. The resulting embeddings are invariant to deformations and, importantly, to intra-category variations. Acknowledgments: This work acknowledges the support of the AIMS CDT (EPSRC EP/L015897/1) and ERC 677195-IDIU. Clipart: FreePik. 9 References [1] Pulkit Agrawal, Joao Carreira, and Jitendra Malik. Learning to see by moving. In Proc. ICCV, 2015. [2] Yoshua Bengio. Learning deep architectures for AI. Foundations and trends in Machine Learning, 2009. [3] Fred L. Bookstein. Principal Warps: Thin-Plate Splines and the Decomposition of Deformations. PAMI, 1989. [4] H Bourlard and Y Kamp. Auto-Association by Multilayer Perceptrons and Singular Value Decomposition. Biological Cybernetics, 1988. [5] Xavier P. Burgos-Artizzu, Pietro Perona, and Piotr Dollár. Robust face landmark estimation under occlusion-supp. mat. In Proc. ICCV, 2013. [6] T F Cootes, C J Taylor, D H Cooper, and J Graham. Active shape models: their training and application. CVIU, 1995. [7] Navneet Dalal and Bill Triggs. Histograms of Oriented Gradients for Human Detection. In Proc. CVPR, 2005. [8] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised Visual Representation Learning by Context Prediction. In Proc. ICCV, 2015. [9] Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. Proc. ICLR, 2017. [10] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. Proc. ICLR, 2017. [11] Pedro F. Felzenszwalb, Ross B. Girshick, David McAllester, and Deva Ramanan. Object Detection with Discriminatively Trained Part Based Models. PAMI, 2010. [12] Rob Fergus, Pietro Perona, and Andrew Zisserman. Object class recognition by unsupervised scale-invariant learning. In Proc. CVPR, 2003. [13] Basura Fernando, Hakan Bilen, Efstratios Gavves, and Stephen Gould. Self-supervised video representation learning with odd-one-out networks. In Proc. CVPR, 2017. [14] Philipp Fischer, Alexey Dosovitskiy, Eddy Ilg, Philip Häusser, Caner Hazırbaş, Vladimir Golkov, Patrick van der Smagt, Daniel Cremers, and Thomas Brox. FlowNet: Learning Optical Flow with Convolutional Networks. In Proc. ICCV, 2015. [15] Ravi Garg, Gustavo Carneiro, and Ian Reid. Unsupervised cnn for single view depth estimation: Geometry to the rescue. In Proc. ECCV, pages 740–756, 2016. [16] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook.org. [17] G E Hinton and R R Salakhutdinov. Reducing the Dimensionality of Data with Neural Networks. Science, 2006. [18] Berthold K.P. Horn and Brian G. Schunck. Determining optical flow. Artificial Intelligence, 1981. [19] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks. arXiv preprint arXiv:1612.01925, 2016. [20] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial Transformer Networks. In Proc. NIPS, 2015. [21] A. Kanazawa, D. W. Jacobs, and M. Chandraker. WarpNet: Weakly supervised matching for single-view reconstruction. In Proc. CVPR, 2016. [22] Ira Kemelmacher-Shlizerman and Steven M. Seitz. Collection flow. In Proc. CVPR, 2012. [23] Martin Koestinger, Paul Wohlhart, Peter M. Roth, and Horst Bischof. Annotated facial landmarks in the wild: A large-scale, real-world database for facial landmark localization. In First 10 IEEE International Workshop on Benchmarking Facial Image Analysis Technologies, 2011. [24] Erik G Learned-Miller. Data driven image models through continuous joint alignment. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006. [25] Ce Liu, Jenny Yuen, and Antonio Torralba. SIFT Flow: Dense correspondence across scenes and its applications. PAMI, 2011. [26] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proc. ICCV, 2015. [27] David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004. [28] Ishan Misra, C Lawrence Zitnick, and Martial Hebert. Shuffle and learn: unsupervised learning using temporal order verification. In Proc. ECCV, 2016. [29] Hossein Mobahi, Ce Liu, and William T. Freeman. A Compositional Model for LowDimensional Image Set Representation. Proc. CVPR, 2014. [30] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Proc. ECCV, 2016. [31] D. Novotny, D. Larlus, and A. Vedaldi. Learning 3d object categories by looking around them. In Proc. ICCV, 2017. [32] Deepak Pathak, Ross Girshick, Piotr Dollár, Trevor Darrell, and Bharath Hariharan. Learning features by watching objects move. In Proc. CVPR, 2017. [33] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context Encoders: Feature Learning by Inpainting. In Proc. CVPR, 2016. [34] I. Rocco, R. Arandjelović, and J. Sivic. Convolutional neural network architecture for geometric matching. In Proc. CVPR, 2017. [35] Yi Sun, Xiaogang Wang, and Xiaoou Tang. Deep convolutional network cascade for facial point detection. In Proc. CVPR, 2013. [36] Yuval Tassa. CapSim - the MATLAB physics engine. https://mathworks.com/ matlabcentral/fileexchange/29249-capsim-the-matlab-physics-engine. [37] James Thewlis, Hakan Bilen, and Andrea Vedaldi. Unsupervised learning of object landmarks by factorized spatial embeddings. In Proc. ICCV, 2017. [38] James Thewlis, Shuai Zheng, Philip H. S. Torr, and Andrea Vedaldi. Fully-Trainable Deep Matching. In Proc. BMVC, 2016. [39] Markus Weber, Max Welling, and Pietro Perona. Towards automatic discovery of object categories. In Proc. CVPR, 2000. [40] Shengtao Xiao, Jiashi Feng, Junliang Xing, Hanjiang Lai, Shuicheng Yan, and Ashraf Kassim. Robust Facial Landmark Detection via Recurrent Attentive-Refinement Networks. In Proc. ECCV, 2016. [41] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. In Proc. ICLR, 2016. [42] Xiang Yu, Feng Zhou, and Manmohan Chandraker. Deep Deformation Network for Object Landmark Localization. In Proc. ECCV, Cham, 2016. [43] Jie Zhang, Shiguang Shan, Meina Kan, and Xilin Chen. Coarse-to-fine auto-encoder networks (CFAN) for real-time face alignment. In Proc. ECCV, 2014. [44] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful Image Colorization. In Proc. ECCV, 2016. [45] Weiwei Zhang, Jian Sun, and Xiaoou Tang. Cat head detection - How to effectively exploit shape and texture features. In Proc. ECCV, 2008. [46] Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Facial landmark detection by deep multi-task learning. In Proc. ECCV, 2014. 11 [47] Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Learning Deep Representation for Face Alignment with Auxiliary Attributes. PAMI, 2016. [48] Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised learning of depth and ego-motion from video. In Proc. CVPR, 2017. [49] Tinghui Zhou, Philipp Krähenbühl, Mathieu Aubry, Qixing Huang, and Alexei A. Efros. Learning Dense Correspondences via 3D-guided Cycle Consistency. In Proc. CVPR, 2016. [50] Tinghui Zhou, Yong Jae Lee, Stella X. Yu, and Alexei A. Efros. FlowWeb: Joint image set alignment by weaving consistent, pixel-wise correspondences. In Proc. CVPR, 2015. 12
1cs.CV
Skeletal Program Enumeration for Rigorous Compiler Testing Qirun Zhang Chengnian Sun Zhendong Su University of California, Davis, United States arXiv:1610.03148v4 [cs.PL] 11 Jul 2017 {qrzhang, cnsun, su}@ucdavis.edu Abstract developer productivity as it is difficult to determine whether an execution failure is caused by defects in the application or the compiler. In addition, defects in compilers may silently affect all programs that they compile. Therefore, improving compiler correctness is crucial. The predominant approach to validating production compilers consists of various forms of testing. An important, challenging problem in compiler testing is input generation: How to effectively generate “good” test programs? Intuitively, a good test program is productive (i.e., it triggers latent compiler defects) and thorough (i.e., it stress tests the internal passes of a compiler). Besides manually created validation suites (e.g., Plum Hall [3] and Perennial [2]), the main techniques for input program generation can be categorized as program generation or program mutation. Program generation constructs fresh test programs guided by a language’s syntax and semantics. For example, Csmith is the most wellrecognized random program generator for testing C compilers [9, 57]. Program mutation, on the other hand, focuses on systematically transforming existing programs. Equivalence Modulo Input (EMI) has been the most representative mutation-based approach by randomly inserting or deleting code [32, 33, 53]. Both approaches are opportunistic because the typical search space is unbounded, and they tend to favor large and complex programs. A program can be viewed as a syntactic structure P (syntactic skeleton) parameterized by a collection of identifiers V (variable names). This paper introduces the skeletal program enumeration (SPE) problem: Given a syntactic skeleton P and a set of variables V , enumerate a set of programs P exhibiting all possible variable usage patterns within P. It proposes an effective realization of SPE for systematic, rigorous compiler testing by leveraging three important observations: (1) Programs with different variable usage patterns exhibit diverse control- and data-dependence, and help exploit different compiler optimizations; (2) most real compiler bugs were revealed by small tests (i.e., small-sized P) — this “small-scope” observation opens up SPE for practical compiler validation; and (3) SPE is exhaustive w.r.t. a given syntactic skeleton and variable set, offering a level of guarantee absent from all existing compiler testing techniques. The key challenge of SPE is how to eliminate the enormous amount of equivalent programs w.r.t. α-conversion. Our main technical contribution is a novel algorithm for computing the canonical (and smallest) set of all non-αequivalent programs. To demonstrate its practical utility, we have applied the SPE technique to test C/C++ compilers using syntactic skeletons derived from their own regression test-suites. Our evaluation results are extremely encouraging. In less than six months, our approach has led to 217 confirmed GCC/Clang bug reports, 119 of which have already been fixed, and the majority are long latent despite extensive prior testing efforts. Our SPE algorithm also provides six orders of magnitude reduction. Moreover, in three weeks, our technique has found 29 CompCert crashing bugs and 42 bugs in two Scala optimizing compilers. These results demonstrate our SPE technique’s generality and further illustrate its effectiveness. Skeletal Program Enumeration. This paper explores a different, much less explored approach of skeletal program enumeration (SPE) for compiler testing. Rather than randomly generating or mutating large and complex programs, is it possible to fully exploit small programs to obtain bounded guarantees w.r.t. these small programs? Specifically, we view every program P as a syntactic skeleton P with placeholders (or holes) for a variables set V . Given small sets of P and V , we obtain new programs P by exhaustively enumerating all variable usage patterns to fill the holes in P. This paper demonstrates its strong practical utility for compiler testing. Three key observations underlie our SPE realization: CCS Concepts • Software and its engineering → Software testing and debugging; Source code generation; • Mathematics of computing → Enumeration Keywords Program enumeration, compiler testing • Most compiler bugs can be exploited through small test 1. Introduction programs. According to a recent large-scale study on GCC and Clang’s bug repositories, each reduced test case in the bug reports contains fewer than 30 lines of code on average [54]. Moreover, in our empirical evaluation based on the c-torture test-suite from GCC-4.8.5, each Compilers are among the most fundamental programming tools for building software. A compiler bug may result in unintended program executions and lead to catastrophic consequences for safety-critical applications. It may also hamper 1 2017/7/13 1 2 3 4 5 int a,b=1; b = b-a; if(a) a = a-b; ... (a) Program P1 1 2 3 4 5 int a,b=1; a = b-b; if(a) a = a-b; ... (b) Program P2 1 2 3 4 5 grams in P. To this end, we formulate SPE as a set partition problem and tackle the unique challenge of dealing with variable scoping. As an application of our SPE technique, we implement and apply it to test the development versions of GCC and Clang/LLVM, two popular open-source C/C++ compilers. In less than six months, we have found and reported 217 bugs, most of which are long latent (e.g., more than two thirds of the GCC bugs affect at least three recent stable releases). About half the bugs concern C++, an extremely complex language, making our work the first successful exhaustive technique for testing compilers’ C++ support. To further demonstrate its efficiency, we have applied the SPE technique to test CompCert [35] and two Scala compilers [1, 4]. Our three-week testing efforts also yield promising results. Furthermore, to quantify the effectiveness of our enumeration scheme, we also apply both our approach and the naïve approach to GCC-4.8.5’s test-suite. In particular, we use the enumerated programs to test the stable releases of GCC4.8.5 and Clang-3.6. Besides finding 11 bugs in both compilers, more importantly, our approach achieves six orders of size reduction over the naïve enumeration approach. Approximately, our approach can process all programs in less than one month, while the naïve approach would need more than 40K years to process the same set of test programs. int a,b=1; a = b-b; if(b) a = b-b; ... (c) Program P3 Figure 1. Illustrative example for skeletal program enumeration, where we assume that the code snippets are parts of a function. function contains only 3 variables with 7 use-def sites on average.1 • Different variable usage patterns trigger various compiler optimization passes. Consider the programs based on different variable usage patterns in Figure 1. Note that the programs share the same program skeleton. In P1 , a compiler may issue a warning on the uninitialized variable a. In P2 , due to the constant propagation of b = 1, variable a is folded to 0 on line 3. Therefore, an optimizing compiler performs a dead code elimination of the if statement. Finally, in P3 , variable b is folded to 1 on line 3. An optimizing compiler then performs constant propagation for variable a on lines 2 and 4. Section 2 illustrates SPE for compiler testing via concrete bugs. • Exhaustive enumeration provides relative guarantees. Given a small syntactic skeleton P with k variables, our approach produces input programs for compiler testing by enumerating all instances of P exhibiting different variable usage patterns. For any programming language, it is also possible to enumerate all syntactically valid token sequences (i.e., the syntactic skeletons P) up to a given bounded length. Our skeletal program enumeration establishes the first step toward realizing bounded verification of compilers.2 Contributions. Our main contributions follow: • We formulate the problem of skeletal program enumeration to aid compiler testing. Unlike existing approaches based on random program generation or mutation, our approach exhaustively considers all variable usage patterns for small programs; • We propose an efficient combinatorial approach to program enumeration. In our empirical evaluation, our algorithm reduces the search space by six orders of magnitude over naïve enumeration when processing compiler test-suites; and • We apply our SPE technique to test GCC, Clang/LLVM, CompCert and two Scala compilers. In less than six months, we have found and reported 217 bugs in GCC and Clang. In about three weeks, we have also found 29 CompCert crashing bugs, and 42 bugs in the production Scala compiler [4] and the Dotty [1] research compiler. These bugs have been actively addressed by developers. For instance, as of November 2016, among our reported GCC bugs, 68% have already been fixed, 66% are long latent and 10% are release-blocking. 25 CompCert bugs have been fixed and all 27 Dotty bugs have been confirmed. The essence of SPE is, given a skeleton P and a set of variables V , producing a set of programs P by instantiating each placeholder in the skeleton P with a concrete variable v ∈ V . Given a set of k variables and a P with n placeholders, a naïve approach produces the SPE set P with k n programs. However, most of the programs in P are αequivalent, i.e., there exists an α-conversion between any two α-equivalent programs. Since α-equivalent programs always exploit the same control- and data-dependence information, it is redundant to enumerate them for most purposes and especially for compiler validation. Generating only and all non-α-equivalent programs makes SPE a unique and challenging combinatorial enumeration problem. Existing techniques for enumeration are inefficient to deal with αequivalence in SPE (please refer to Section 4.3 for a detailed discussion). This paper presents the first practical combinatorial approach for SPE that generates only non-α-equivalent pro- Generality. Beyond compiler testing, skeletal program enumeration suggests a general strategy for approaching various enumeration problems. Indeed, rather than enumerating suitable structures from scratch w.r.t. syntax or semantics, it can be more profitable to enumerate w.r.t. skeletons derived from existing structures, which are arguably more interesting and lead to a more feasible process. Algorithmically, our technique of casting SPE as the set partition problem and 1 GCC’s c-torture test-suite consists of (small) test programs that broke the compiler in the past. 2 For languages that allow undefined behaviors, such as C/C++, we assume reliable oracles exist for detecting undefined behaviors (cf. Section 5.4). 2 2017/7/13 1 2 int a = 0; extern int b __attribute__ ((alias (''a''))); 1 2 3 4 5 6 7 8 3 int main () { int *p = &a, *q = &b; *p = 1; *q = 2; 4 5 6 7 8 9 10 11 12 struct s { char c[1]; }; struct s a, b, c; int d; int e; 9 //return b; return a; // Bug: the program exits with 1 } void bar (void) { //e ? (d==0 ? b : c).c : (e==0 ? b : c).c; e ? (d==0 ? b : c).c : (d==0 ? b : c).c; } Figure 3. This test program crashes the development trunk of GCC (revision 233377) at all optimization levels. The bug has been marked as release-blocking. Figure 2. This test program is miscompiled by multiple GCC versions from GCC 4.4 to revision 233678. This bug affected revision 104500 in September 2005, and had been latent for over ten years until we discovered it via SPE. The program is expected to return 2, but incorrectly returns 1 instead. canonicalize two declarations that share the same memory address (i.e., a and b in this example) into a single one, thus compromising the soundness of its alias analysis. This test program is enumerated using a skeleton from GCC’s own test-suite by replacing the original variable b with a on line 11. The program in Figure 2 is simplified for presentation purposes. The original program is slightly larger, and a naïve program enumeration approach generates 3,125 programs. In constrast, our approach only enumerates 52 non-α-equivalent programs, and exposes the bug. how to support variable scoping may be adapted to enumeration problems where such information is relevant, such as functional program enumeration, quantified formula enumeration, and other domain-specific settings. Paper Organization. The rest of the paper is structured as follows. Section 2 motivates our work via concrete examples, and Section 3 defines the SPE problem and program α-equivalence. We present our combinatorial program enumeration algorithm in Section 4 and experimental results in Section 5. Finally, Section 6 surveys related work, and Section 7 concludes. Bug 69801 : GCC Internal Compiler Crash. Figure 3 shows another bug example found by SPE. The test program crashes the development trunk of GCC at all optimization levels, including -O0. The reported bug has been marked as release-blocking by the GCC developers. The program is quite simple. Line 8 tries to access the field c via nested conditional expressions. This line is also the key to trigger the bug in the GCC’s constant folding pass. GCC crashes when it is checking whether the second operand (d == 0 ? b : c) and the third operand (d == 0 ? b : c) are equal in the function operand_equal_p. This function recursively checks whether each component of the two operands are the same. When it is checking the integer constant 0 of the binary expression d == 0, an assertion is violated because operand_equal_p is instructed to use the addresses of the integer constants to test the equality, which is undefined. In the bug fix, a flag is set to instruct operand_equal_p to check integer equality via value comparison. This test program is also enumerated from GCC’s own test-suite. The difference between them is shown on line 7. The test program is derived by replacing e with d in the third operand of the whole conditional expression. This replacement makes the second and third operands identical, triggering the bug in the function operand_equal_p. 2. Motivating Examples This section motivates our work using two real compiler bugs found via SPE: a wrong code bug and a crash bug. A wrong code bug is a compiler miscompilation, i.e., the compiler silently produces a wrong executable, whose behavior is unintended and different from that of the original source program. A crash bug refers to the compiler crashing when processing an input program. The wrong code bug is an example latent bug, and the crash bug was classified as releaseblocking by the GCC developers. Bug 69951 : GCC Miscompilation. Figure 2 shows a test program that triggers a miscompilation in a series of GCC versions, ranging from GCC-4.4 to the latest development trunk (revision 233678). The bug affects as early as revision 104500 from September 2005, and had been in GCC even before this revision. For over ten years, from then to March 2016, when we found and reported this bug, it had slipped through various compiler testing techniques and thorough inhouse testing. This program is expected to exit with 2. The attribute annotation on line 2 declares that the variable b is an alias of a. As pointers p and q point to a and b respectively, they essentially represent the same memory region (i.e., variable a). The last write to a is 2 through the pointer q on line 8, hence the exit code of this program should be 2. However, the buggy version of GCC optimizes the code as if p and q were not aliases, and thus the exit code of this program becomes 1 instead. The cause of this bug is that GCC did not 3. SPE Problem Formulation This section formalizes skeletal program enumeration. 3.1 Problem Statement As mentioned in Section 1, a program P comprises of two parts: a syntactic skeleton with placeholders for variables, and a set of variables. We define every usage of a variable in program P as a hole, and denote it as . In particular, let us consider a W HILE-style language shown in Figure 4. Figure 4(a) gives the syntax rules for the W HILE language 3 2017/7/13 3.2 Program α-Equivalence a ::= x | n | a1 op a a2 b ::= true | false | not b | b1 op b b2 | a1 op r a2 S ::= x := a | S1 ; S2 | while(b) do S | if(b) then S1 else S2 (a) Syntax rules for P . JaK ::=  | n | Ja1 K op a Ja2 K JbK ::= true | false | not JbK | Jb1 K op b Jb2 K | Ja1 K op r Ja2 K JSK ::=  := JaK | JS1 K ; JS2 K | while(JbK) do JSK | if(JbK) then JS1 K else JS2 K The naïve approach to SPE produces an overwhelming amount of programs, where most of the enumerated instances are equivalent w.r.t. α-conversion. The α-equivalent programs always exhibit the same control- and data-dependence information. In this paper, we describe a combinatorial approach to exhaustively enumerate only non-α-equivalent programs in P. Section 3.2.1 formally defines α-equivalence using W HILE programs, and Section 3.2.2 discusses αequivalence of practical C programs with scope information. (b) Syntax rules for transformed P. Figure 4. Hole transformation for the W HILE language. a := 10; b := 1; while(a) do a := a − b;  := 10;  := 1; while() do  :=  − ; b := 10; a := 1; while(b) do b := b − a; a := 10; b := 1; while(b) do b := a − b; (a) Program P (b) Skeleton P (c) Program P1 (d) Program P2 3.2.1 α-Equivalent Programs Let us consider two W HILE programs P and P1 in Figure 5. The characteristic vectors are sP = ha, b, a, a, a, bi and sP1 = hb, a, b, b, b, ai, respectively. As mentioned in Example 1, both P and P1 belong to the SPE solution P in Figure 5. Particularly, we can transform P to P1 by replacing all occurrences of variables a and b in P with b and a, respectively. The idea behind the transformation is quite similar to the concept of α-conversion in lambda calculus. It is clear in Figure 5 that P exhibits the same control- and datadependence information as P1 . Consequently, if P is already enumerated, there is no need to consider P1 . Let V be the set of all variables in a W HILE program P with n holes. Since the W HILE language does not have lexical scopes, the set V is the same as the hole variable set vi for each hole i , i.e., V = v1 = · · · = vi , for all i ∈ [1, n]. Let α : V → V be a permutation of set V . Given P , V and α, we define an α-renaming such that it replaces each occurrence of variable v in P with α(v) for all v ∈ V . The α-renaming transforms a program P to P ′ , α denoted as P − → P ′ . For example, in Figure 5, we have α V = {a, b}, α = ( ab ab ), and P − → P1 . Formally, we define α-equivalence below. Figure 5. Program enumeration for the W HILE language. which has been widely used in the program analysis literature [43]. In particular, the nonterminals S, a and b denote statements, arithmetic and Boolean expressions, respectively. The W HILE language plays a pivotal role in explaining the basic ideas of our work. Note that the simple W HILE language does not have scope constraints, and thus every variable is considered global. To obtain a program with holes, we recursively apply a hole transformation JK to the W HILE grammar. Figure 4(b) gives the transformed grammar. For any W HILE program P , we say P is a skeleton of P iff TP = JTP K where TP and TP are the respective abstract syntax trees of P and P . Every hole i in P is associated with a hole variable set vi . The set vi describes all variables that belong to the lexical scope of i . Therefore, replacing all i s in P with variables v ∈ vi emits a syntactically valid W HILE program P ′ . We say v ∈ vi fills i , and P ′ realizes P. A skeleton P with n holes can be represented as a characteristic vector sP = h1 , 2 , . . . , n i. Therefore, a program P ′ that realizes P can also be represented as a vector sP ′ = hv1 , v2 , . . . , vn i such that vi ∈ vi fills i in sP for all i ∈ [1, n]. D EFINITION 2 (Program α-Equivalence). Two programs P1 and P2 are α-equivalent, denoted as P1 ∼ = P2 , iff: (i). Both P1 and P2 realize the same P; and α (ii). There exists an α-renaming such that P1 − → P2 . D EFINITION 1 (Skeletal Program Enumeration). Given a skeleton P and the hole variable sets vi for each i , skeletal program enumeration (SPE) exhaustively computes a set of programs P, such that each P ∈ P realizes P. E XAMPLE 2. Consider Figure 5 again. P and P1 are α-equivalent. However, P and P2 are non-α-equivalent programs since their characteristic vectors are sP = ha, b, a, a, a, bi and sP2 = ha, b, b, b, a, bi, respectively. It is obvious that there exists no αrenaming between them. E XAMPLE 1. Consider the example in Figure 5. Figure 5(a) shows a W HILE program P , and Figure 5(b) its skeleton P with 6 holes. Since both a and b are global variables, we have v1 = v2 = · · · v6 = {a, b}. The program P1 in Figure 5(c) realizes P with sP1 = hb, a, b, b, b, ai. Moreover, the program P2 in Figure 5(d) realizes P with sP2 = ha, b, b, b, a, bi. Therefore, in the program enumeration of this example, we have P, P1 , P2 ∈ P. For α-equivalent programs P1 and P2 , the α-renaming maps the output value of any variable a in P1 to the variable α(a) in P2 for any fixed inputs. Therefore, the α-equivalent W HILE programs are semantically equivalent. As a result, we can safely eliminate those α-equivalent programs in program enumeration, and thus reduce the solution set. For a skeleton P with n holes, program enumeration essentially generates the n-ary Cartesian product over sets v1 , v2 , . . . , vn . As a result, the search Qn space for generating all possible solutions in P is i=1 |vi |, which is clearly exponential in terms of n. For instance, the skeleton P in Figure 5 realizes 26 = 64 programs, i.e., |P| = 64. 3.2.2 α-Equivalence with Scope Information The W HILE language in Figure 5 does not take lexical scoping into account. The lexical scope information can reduce the size of the SPE set P, even for the naïve approach. In the remaining sections of this paper, we discuss using C pro4 2017/7/13 4. SPE Algorithm int main(){ int a=1, b=0; if(a){ int c=3, d=5; b = c + d; } printf("%d", a); printf("%d", b); return 0; } (a) Program P . int main(){ int c=1, b=0; if(c){ int a=3, d=5; b = a + d; } printf("%d", c); printf("%d", b); return 0; } (c) Program P1 int main(){ int =1, =0; if(){ int =3, =5;  =  + ; } printf("%d", ); printf("%d", ); return 0; } This section presents our combinatorial program enumeration approach. Our approach only enumerates non-α-equivalent programs. Section 4.1 describes the main idea based on programs without scope information. Section 4.2 extends the idea to handle scope information. Section 4.3 provides further relevant discussions. (b) Skeleton P 4.1 Basic Idea In the SPE problem, the inputs are a syntactic skeleton P and a set of hole variables vi . Let us revisit the example in Figure 5. The skeleton P in Figure 5(b) has 6 holes. Each hole is associated with the same hole variable set vi = {a, b} for all i ∈ [1, 6]. Therefore, there are 26 ways to fill in these holes using a naïve approach. As discussed in Section 3.2, the α-equivalent programs are redundant for SPE. Having a representative program for all its α-equivalent variants helps reduce the size of the SPE solution P. Therefore, in our approach, we seek to compute an SPE set P ′ of all non-α-equivalent programs, i.e., P1 ≇ P2 for all distinct P1 , P2 ∈ P ′ . To realize this, we formulate SPE as a set partition problem. In particular, we view the n holes in P as a set H = {1, . . . , n} of n elements. Filling a hole with a variable v ∈ vi can also be considered as partitioning an element h ∈ H into a subset that corresponds to v. For example, the skeleton P in Figure 5(b) with 6 holes can be represented as set H = {1, . . . , 6}. Let variable a be the first subset and b the second subset to partition. The characteristic vector sP1 = hb, a, b, b, b, ai of P1 in Figure 5(c) can be represented as a set partition {{1, 3, 4, 5}, {2, 6}} of set HP1 , where the first subset represents the holes filled with b and the second subset the holes filled with a. Due to the α-equivalence property mentioned in Section 3.2.1, the variable names are of no importance. Therefore, the partition {{1, 3, 4, 5}, {2, 6}} is equivalent to {{2, 6}, {1, 3, 4, 5}}. On the other hand, the partitions are sensitive to the elements in set H such that partition {{1, 3, 4, 5}, {2, 6}} is different from {{2, 3, 4, 5}, {1, 6}}. As a result, given a skeleton P with n elements and a hole variable set vi , where |vi | = k for all i ∈ [1, n], the SPE problem can be reduced to a combinatorial problem. int main(){ int b=1, a=0; if(b){ int d=3, c=5; a = d + c; } printf("%d", b); printf("%d", a); return 0; } (d) Program P2 Figure 6. α-equivalent C programs. grams. However, the conceptual idea is general and can be adapted to any imperative language. Let us consider the C programs in Figure 6. Given a program P in Figure 6(a), we can construct a skeleton P shown in Figure 6(b) and a variable set vi = {a, b, c, d} for all i ∈ [1, 10]. The construction treats all variables as if they were global variables. According to Definition 1, SPE computes 410 = 1, 048, 576 programs. However, the variables a and b in P are global variables, while the variables c and d belong to the local scope of the if statement. Therefore, the variable a can be used to fill any hole that belongs to c, but not vice versa. With the scope information, a naïve approach only needs to enumerate 25 · 45 = 32, 768 programs in P. To cope with lexical scopes in C programs, we extend α-renaming such that it only maps variables of the same scope. We define the extended renaming map as a compact α-renaming. Moreover, when transforming a C program P to P, we also associate each hole i and its hole variable set vi in P with the corresponding scope information in P . Therefore, a hole i can only be filled with the variables available at the current scope. The variable types can also be handled by extending the compact α-renaming in a similar way. Finally, it is clear that the compact α-renaming still preserves semantic equivalence. Enumerate the ways to partition a set of n elements into k subsets. E XAMPLE 4. Consider the skeleton P in Figure 6. The characteristic set of P is ha, b, a, c, d, b, c, d, a, bi. The corresponding set partition is {{1, 3, 9}, {2, 6, 10}, {4, 7}, {5, 8}}. P , P1 and P2 are α-equivalent, therefore, they have the same set partition. T HEOREM 1. Given a compact α-renaming, and two C programs P1 and P2 , (P1 ∼ = P2 ) =⇒ (P1 ≡ P2 ). 4.1.1 Number of Partitions E XAMPLE 3. In Figure 6, P , P1 and P2 are α-equivalent proα1 grams. In particular, we have P −−→ P1 using an α-renaming α 2 α1 = ( ac bb ac dd ), and P −−→ P2 using a compact α-renaming α2 = ( ab ab dc dc ). They are all semantically equivalent, generating the same output “18”. Moreover, for the compact α-renaming, we have vi = {a, b} and vj = {a, b, c, d}, where i ∈ {1, 2, 3, 9, 10} and j ∈ {4, 5, 6, 7, 8}. As metioned above, the SPE w.r.t. compact α-renamings computes 32 times fewer programs. In combinatorics, the set partition problems are also known as the twelvefold way, since there are twelve ways to classify all related problems [29]. When the set elements are labeled and the subsets unlabeled, the number of ways to partition a set of n elements into k non-empty subsets is denoted by the Stirling number of the second denoted as nk n kind[29], n for k 6 n. For k > n, we let k = n , i.e., we consider 5 2017/7/13 v1 = {c, d} v1 = {c, d} 1 2 Giving a skeleton P and hole variable sets vi with scope information, we depict the set partition problem using a figure with circle and squares, where each labeled circle denotes the corresponding i ∈ P and the squares represent the scope information. In particular, according to the compact α-renaming described in Section 3.2.2, each hole (circle) can only be filled with the variables from a valid scope (square). We use the notations vg and vl to represent the sets of global variables and the variables declared in scope l, respectively. Consider the example in Figure 7(a). We have vg = {a, b}, and v1 = {c, d} for the first local scope. It is clear from the figure that hole 2 can be filled with v ∈ v2 = vg whereas hole 4 can be filled with v ∈ v4 = vg ∪ v1 . It is also clear that a naïve approach generates 23 · 42 solutions. vg = {a, b} vg = {a, b} 3 4 5 1 (a) Set partition illustration. 2 5 3 4 (b) Corresponding normal form. Figure 7. Set partition illustration and its normal form. at most n partitions. For our SPE problem, let S denote the number of all partitions, and we have S= k   X n i=1 i (1) 4.2.1 Set Partition for Skeletal Program Enumeration For fixed value of k, one asymptotic of the  estimation n Stirling number of the second kind is nk ∼ kk! [44, §26.8]. Therefore, we estimate the SPE solution set as follows: S∼ Unlike the standard set partition problem discussed in Section 4.1, the new enumeration problem essentially considers the set partition of a set H with constraints on each element h ∈ H. This section formalizes this new partition problem. Consider a program skeleton P with n holes, and t scopes. Each hole i ∈ P can be either global or local. The global hole gi can be filled with only global variables, i.e., vi = vg whereas the local hole li can be filled with additional local variables defined in scope l, i.e., vi = vg ∪ vl and l ∈ [1, t]. The set partition problem for SPE can be described as follows: 1n 2n kn knk nk + +· · · , + = O( ) = O( ) (2) 1! 2! k! k! (k − 1)! The overall complexity of our combinatorial approach is still exponential. However, it reduces the entire solution set by a notable constant factor of (k − 1)!. In practice, it improves the feasibility of skeletal program enumeration. Given a set H of n elements, and pre-defined sets vi ⊆ {1, . . . , k} for all i ∈ [1, n]. Each element i ∈ H can be partitioned to a subset labeled by v ∈ vi and v1 ∪ v2 ∪ . . . ∪ vi = {1, . . . , k}. Enumerate the ways to partition H into k subsets. 4.1.2 Partition Enumeration We adopt the standard approach to enumerate all set partitions in lexicographic order [29, 30]. The conventional approach to encode a unique set partition is using a restricted growth string [29, 30]. For a set of n elements, a restricted growth string a1 a2 . . . an of length n satisfies the following: 4.2.2 Partitions with Scopes A straightforward approach to compute partitions with scopes is computing a local set partition solution Sl for each scope, respectively. Then, obtain the final solution S by computing the Cartesian product over all local solutions Sl together with the solution of global holes Sg , i.e., S = Sg × S1 × · · · × St . However, the set partitions obtained are not the global solution among all elements. For example, consider the holes 3 and 4 in Figure 7(a), where we have v3 = v4 = vg ∪ v1 . The local solution for them contains two partitions: {{3, 4}} and {{3}, {4}}. Since the number of holes is smaller than the number of hole variables, we pick two variables and let v3 = v4 = {b, c}. Locally, the variable names are unimportant in set partition problems. Therefore, for partition {{3}, {4}}, filling variables 3 ← b and 4 ← c is equivalent to 3 ← c and 4 ← b. On the other hand, combining the two solutions with the remaining holes filled with ha, a, bi obtains two solutions ha, a, b, c, bi and ha, a, c, b, bi. Clearly, they are two unique solutions since they have different restrict growth strings “00121” and “00122”, respectively. To obtain the global solution, the key idea in our partition algorithm is to choose some local holes by considering all combinations of the local holes. Then, the chosen ones are a1 = 0 and ai+1 6 1 + max(a1 , . . . , ai ) if i ∈ [1, n) The intuitive meaning of a restricted growth string is that, each element h in H is partitioned to a subset numbered by ai , where i represents the index of h in H. Moreover, suppose that m elements in H have already been partitioned, if the new element m + 1 belongs to a new partition, we always assign the smallest available number to am+1 . E XAMPLE 5. Consider the skeleton P in Figure 5. The characteristic set of P is ha, b, a, a, a, bi. The corresponding restricted growth string is “010001”. Since P1 and P are α-equivalent, their strings are the same. For P2 , we have sP2 = ha, b, b, b, a, bi and the corresponding string is “011101”. 4.2 Taming Scopes The most significant challenge of skeletal program enumeration is to handle variable scopes. Taking the scope information into consideration, each hole in the syntactic skeleton P can be filled with different sets of variables. As a result, computing the non-α-equivalent programs becomes more difficult. The corresponding set partition problem of skeletal program enumeration with scope information is unique and has not been studied in the literature. 6 2017/7/13 promoted to be global. Finally, we obtain the solution by computing the Cartesian product of the global holes and the remaining local holes. Algorithm 1: Skeletal program enumeration algorithm. Input :A program skeleton P and hole variable set vi ; Output : a set of programs P. 1 Procedure PartitionScope(SL, G, li ). 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 u ← |li | and v ← |vi | foreach k ∈ [0, u − 1] do result ← C OMBINATIONS (li , k) foreach variable set l ∈ result do G←G∪l l ← li \ l foreach j ∈ [1, v] do Sli ← PARTITIONS′ (l, j) ′ SL ← SL if SL is empty then SL ← Sli else SL ← SL × Sli if i is not the last scope then ParititionScope (SL , G, l(i+1) ) else SG ← PARTITIONS′ (G, |vg |) Sf ← Sf ∪ {SG × SL } 4 5 6 7 8 9 foreach function f ∈ P do Normalize function f Sf′ ← PARTITIONS (Hf , |vf |) Sf ← ∅ and SL ← ∅ ParititionScope (SL , Gf , l1 ) Sf ← Sf ∪ Sf′ S ← S × Sf foreach characteristic vector s ∈ S do Generating a program P using P and s in order. For example, Figure 7(b) gives the normal form of the holes in Figure 7(a). Let Gf and li be the sets of the global holes in f and the local holes in scope i, respectively. Algorithm 1 computes the partitions for function f as follows. It normalizes f (line 2) and computes a partial solution for f (line 3) without taking scopes into consideration. It then computes a solution Sf by recursively processing each scope on lines 4-5. Moreover, the global solution of function f is obtained by combining both Sf and Sf′ on line 6. The global solution of P is obtained by computing the Cartesian product of each function on line 7. Finally, we enumerate the programs according to the solutions in S. ′ SL ← SL G←G\l Handling one scope. Procedure PartitionScope(SL , G, li ) describes the major steps for handling scope i, where SL represents the set of all local solutions, G denotes the set of the global holes and li the set of the local holes of  scope i. The routine C OMBINATIONS(Q, k) returns |Q| differk ent ways of selecting k elements from the set Q. The routine PARTITIONS (Q, k) partitions the set Q into k subsets in Pk |Q| ways. Moreover, the routine PARTITIONS′ (Q, k) i=1 k  partitions the set Q into k non-empty subsets in |Q| ways. k PartitionScope handles a scope i as follows: • Promoting k holes from scope i. Line 1 obtains the cardinalities of sets li and vi . On line 3, we choose k holes from li and promote them as global holes G on line 5. The set of remaining holes is denoted as l on line 6. • Computing local solution for scope i. Lines 8-10 computes the local set partition Sli of scope i and combines it with the current local solution SL . If i is not the last scope, it recursively handles the next scope i + 1 on line 12. • Obtaining the final solution. If i is the last scope, it computes the solution SG of global holes G (line 14), combines it with the current local solution SL and appends it to the final solution Sf (line 15). On line 16 and 17, the information on G and SL is restored for subsequent recursive calls to Procedure PartitionScope. E XAMPLE 6. Consider the normal form in Figure 7(b). Algorithm 1 computes set partitions as follows. Computing Sf′ : 5 the 5 There are  2 + 1 = 16 partitions; Promoting either 3 or 4: There are 42 × 11 =7 partitions  foreach hole; Promoting neither 3 nor 4: There are 32 × ( 22 + 21 ) = 6 partitions; Final solution: SPE algorithm computes (16 + 2 · 7 + 6) = 36 partitions. However, the naïve approach computes (23 · 42 ) = 128 partitions. 4.3 Discussions Granularity of enumeration. Algorithm 1 obtains the SPE solution S of a skeleton P by computing the Cartesian product w.r.t. each local solution Sf of function f . We say that Algorithm 1 computes the intra-procedural enumeration. Since each function can also be considered as a local scope w.r.t. a program, the intra-procedural enumeration approximates the global solution, where we call the global solution as the interprocedural enumeration. Algorithm 1 can be easily extended to obtain the inter-procedural enumeration. The key extension is to replace the foreach loop on lines 1-7 with a call to Procedure PartitionScope, where l1 represents the first function scope instead. To handle additional scopes, one can processes all scopes in a bottom-up fashion w.r.t. the scope hierarchy. It is a practical design choice of enabling intraor inter-procedural enumerations. The intra-procedural enumeration — though being an approximation — enumerates fewer variants of a single test program P than the interprocedural counterpart. Thus, given a fixed budget on the total number of enumerated variants, the intra-procedural enumeration is able to process more test programs. It would be interesting to investigate different enumeration granularities and find the most cost-effective enumeration scheme for practical use. Program enumeration algorithm. Algorithm 1 describes our combinatorial SPE algorithm. For each function f in skeleton P, we consider its characteristic vector sf = h1, . . . , ni. Within a function f , the global variable set vf contains the global variables in P, function parameters and function-wise variables. Moreover, the set of global holes, denoted as Hf , contains the holes that can be filled with v ∈ vf . For t local scopes, we rearrange the vector to be of the normal form hg , .., g , 1 , .., 1 , . . . , t , .., t i, i.e., we pull all global holes to the front and arrange local holes 7 2017/7/13 Enumeration vs. counting. We have discussed the SPE set partition problem, and proposed an enumeration algorithm. An interesting open problem is to investigate the corresponding counting counterpart of the enumeration problem in Section 4.2.1. Specifically, fixing i and k in an SPE problem, the counting problem is to determine the number of non-αequivalent programs for a syntactic skeleton P with n holes. In Section 4.1.1, we discussed the counting problem of the SPE problem without scope information, based on the traditional analysis of set partition problems [29, 30]. However, developing an asymptotic estimation of the SPE problem defined in Section 4.2.1 is nontrivial, as the analytics with the variable set vi constraints becomes more complex. A promising direction may be counting the enumeration set using the technique based on e-restricted growth functions [38, 39]. cedure PartitionScope. Our algorithm handles functions at different granularities. In Algorithm 1, the input function f is in the normal form. Recall that each hole i in the skeleton P corresponds to an element i ∈ H. In the normal form, the elements can been filled with both global (vg ) and local (vl ) variables. We define the configuration of the normal form to be a map c : H → {g, l} for all variables i ∈ H. It is then sufficient and necessary to show that: (1) procedure PartitionScope computes unique nonα-equivalent partitions for each configuration; and (2) procedure PartitionScope finds all configurations in function f. • Part (1). The configure c maps i ∈ H to either l and g, and it leads to two cases. In the first case, all elements are global. Therefore, the SPE problem becomes the standard set partition problem. Procedure PartitionScope calls procedure PARTITIONS to compute the set partitions of size j. In the second case, some elements i representing local holes l are mapped to l. In this case, the partition problems of the global and local elements become independent. Procedure PartitionScope computes respectively the set partitions for elements that representing both g s and l s, and obtains the global solution by computing their Cartesian product. • Part (2). Procedure PartitionScope calls procedure C OMBINATIONS to find all configurations of function f ’s normal form by exhaustively selecting the combinators of local holes. Other enumeration techniques. Algorithm 1 solves the SPE problem based on the combinatorial algorithms for generating set partitions and combinations. In the literature, there has been an extensive body of work that exhaustively generates input structures for software testing. This line of work typically specifies the invariant property and enumerates the structures declaratively [7, 19, 28, 50], imperatively [12, 31, 49, 56] or in a hybrid fashion [20, 48]. Unfortunately, these approaches are inefficient to automatically leverage the invariant for the SPE problem. The key challenge of adopting the existing enumeration techniques is to encode the invariant. Specifically, the declarative enumeration techniques specify the invariant and typically use generate-and-test approaches. Our combinatorial SPE algorithm maintains the invariant of the non-α-equivalence. Let P1 and P2 be two programs of the SPE set P. The invariant is: P1 ≇ P2 for all distinct P1 , P2 ∈ P. Therefore, to Qngenerate |P| non-α-equivalent programs, it needs to test i=1 |vi | programs as a naïve SPE solution discussed in Section 3.1. In addition, the imperative enumeration frameworks are capable of enumerating only valid inputs w.r.t. the invariant. However, our SPE algorithm solves a combinatorial problem rather than generating combinatorial structures (e.g., red-black trees, graphs and algebraic representations). Even though it might be feasible to encode the SPE algorithm using the primitive enumerators in the imperative enumeration frameworks, the realization is strictly less efficient than directly applying our combinatorial SPE algorithm in the first place. Another relevant problem is enumerating lambda terms exhaustively up to a given size [21, 36, 55]. Most of the work enumerates lambda terms using the standard “nameless” de Bruijn representation [14]. These approaches consider a rather different enumeration problem as the lambda terms have distinct syntactic structures and semantics. Specifically, the essential enumeration problem concerns with various unary-binary tree structures [22, 36, 55]. However, in our set partition setting, there is no dependence among set elements. 5. Evaluation To evaluate the effectiveness of skeletal program enumeration, we conduct two sets of experiments. In the first experiment, we enumerate skeletons derived from GCC-4.8.5’s test-suite, and test two stable compiler releases, GCC-4.8.5 and Clang-3.6.1. We aim to demonstrate the benefits of combinatorial SPE. In the second experiment, we use a set of small programs to test the trunk versions of GCC and Clang, as well as CompCert and two Scala compilers, to demonstrate the bug-hunting capabilities of SPE. 5.1 Experimental Setup Our implementation contains two components, i.e., skeleton generation and program enumeration. The skeleton generation component recursively traverses the ASTs to obtain the scope and type information for each variable, and build a skeleton P for each test program P . The program enumeration component realizes the enumeration algorithm described in Algorithm 1. We compute the intra-procedural enumeration as mentioned in Section 4.3. Given a set of programs P, we directly feed those programs to the compilers under testing. For GCC and Clang, we use two optimization levels (i.e., -O0 and -O3) and two machine modes (i.e., 32- and 64-bits) for finding crashes. For wrong code bugs, we investigate the program P with CompCert’s reference interpreter [35] and additional manual efforts to ensure that it is free of undefined behaviors. All ex- Algorithm correctness. Algorithm 1 invokes procedure PartitionScope to compute the scoped set partitions for each function f . We briefly discuss the correctness of pro8 2017/7/13 Approach Naive Our Original Test-Suite Total Size Avg. Size 5.24 × 10163 2.49 × 10159 1.48 × 1079 7.05 × 1074 #Files 20,978 20,978 Enumerated Test-Suite Total Size Avg. Size 1,310,943,547,383 69,538,698.7 2,050,671 108.8 #Files 18,852 18,852 Table 1. Evaluation results on size reduction. The “total size” column shows the total numbers of enumerated programs, and the “avg. size” the average numbers of the enumerated programs for each test program. The size of the enumerated test-suite is related to a threshold discussed in Section 5.2.1. periments were conducted on a server and a desktop running Ubuntu-14.04. The server has Intel Xeon X7542 CPUs and 128GB RAM, while the desktop has an Intel i7-4770 CPU and 16GB RAM. Test-Suite Original Enumerated #Holes 7.34 3.84 #Scopes 2.77 1.85 #Funcs 1.85 1.50 #Types 1.38 1.29 #Vars 3.46 1.60 Table 2. Characteristics of the GCC-4.8.5 test-suite. The first four columns display the average counts of holes, scopes, functions and variable types in each file, respectively. The last column displays the variable counts for each hole. 5.2 Experiments on Stable Releases In our first experiment, we evaluate the SPE technique on stable releases of two popular C compilers, specifically GCC4.8.5 and Clang-3.6.1. We choose GCC-4.8.5 since it is the default C compiler in the long term support version of Ubuntu (14.04), and Clang-3.6.1 was released about the same time as the chosen GCC. We implemented both our combinatorial program enumeration described in Algorithm 1 and a naïve enumeration algorithm mentioned in Section 3.1. We apply the two implementations on the default test-suite which has been shipped with GCC-4.8.5. Most of the test programs belong to the ctorture suite, which contains the code snippets that have historically broken previous releases.3 According to the GCC’s release criteria, any released version must pass the test-suite distributed in the source code. We are particularly interested in understanding the following research questions: • What is the size reduction achieved by our SPE approach? • Given the fact that the test-suite contains many programs once broke previous GCCs, what are the characteristics of these programs? • Can SPE find bugs in the stable GCC and Clang releases using their own regression test-suite? tion over the naïve approach. Specifically, for each test program, the solution of our SPE approach contains merely 109 files on average. In practical settings, suppose that we could process each program in one second, it takes less than one month to handle all enumerated programs. However, for the naïve approach, it takes about 40K years to process the same test programs. Finally, Figure 8 describes size reduction in terms of different program enumeration sets P. 5.2.2 Test-Suite Characteristics Table 2 gives an overview of the test programs in GCC-4.8.5 test-suite. It also describes the programs used in our evaluation based on the aforementioned 10K threshold. It is interesting to observe that most of the programs are quite small even though most of them have triggered bugs in previous versions of GCC. Indeed, this observation has motivated our current program enumeration work. The programs used in our evaluation are smaller due to the 10K threshold setting w.r.t. our combinatorial enumeration algorithm. Recall that these programs represent 90% of the programs in the original test-suite. It clearly demonstrates that it is feasible to apply combinatorial SPE on practical test-suites. 5.2.1 Enumeration Size Reduction 5.2.3 Benefits of Skeletal Program Enumeration The GCC-4.8.5 test-suite contains about 21K C files. Table 1 decries the size reduction results of applying our combinatorial SPE algorithm. For the original test-suite, our combinatorial SPE approach reduces the entire size by 94 orders of magnitude. However, it is clear from the table that SPE solution set is still too large to be applied for compiler testing in practice. As a result, we set a 10K threshold such that we ignore the test programs which have more than 10K variants using our combinatorial SPE algorithm. The 10K threshold is chosen w.r.t. the characteristics of the test-suite (Table 2), i.e., |Vars||Holes| = 3.467.34 ≈ 10K). We then compare the solution spaces based on the remaining programs. From the last three columns in Table 1, we can see that the number of test files is decreased to 19K. Using the 10K threshold, we can still retain 90% of the original test programs. On those files, our SPE algorithm achieves six orders of size reduc- Hunting bugs. We apply our enumeration algorithm to test GCC-4.8.5 and Clang-3.6 by enumerating the skeletons from the GCC-4.8.5 test-suite. Our SPE technique have found 1 and 10 crash bugs in GCC and Clang, respectively. It is perhaps interesting to note that we are able to find GCC bugs by enumerating its own test-suite even if the release criteria force it to pass the original test-suite. In this evaluation, we only focus on crash bugs since wrong code bugs usually require compiler developers’ confirmation (mostly due to possible undefined behaviors in test programs). For crash bugs, compiler messages clearly indicates their occurrence. Table 3 gives the signatures of some crash bugs found in this evaluation. We can see that most of the bugs are in the backend and optimization passes. Improving coverage. As described in Section 1, one of our insights is that SPE can help trigger more internal compiler passes. In order to validate the claim, we compare 3 https://gcc.gnu.org/onlinedocs/gccint/C-Tests.html. 9 2017/7/13 Naive 0.4 1 Our 0.5 0.2 0 0 0) ,1 [1 0) ,1 [1 ) 10 2) 3) 4) 5) 6) 7) 8) 9) 10 0 0 0 0 0 0 0 10 10 2 ,1 3 ,1 4 ,1 5 ,1 6 ,1 7 ,1 8 ,1 9 ,10 0, ≥ 1 0 0 0 0 0 0 0 [ 0 [1 [1 [1 [1 [1 [1 [1 [1 0 ) 2) 3) 4) 5) 6) 7) 8) 9) 10 01 10 2 ,10 3 ,10 4 ,10 5 ,10 6 ,10 7 ,10 8 ,10 0 1 0, ,1 ≥ 9 1 0 0 0 0 0 0 0 [ 0 [1 [1 [1 [1 [1 [1 [1 [1 (a) Distribution of the numbers of variants. For example, the first pair (b) Distribution of the ratios of reduced variants. For example, the secof vertical bars shows that 29% of the test programs have fewer than 10 ond bar shows that our approach has eliminated 55% of the programs variants enumerated using the naïve approach. The percentage increases with n ∈ [10, 102 ) variants compared with the naïve approach on average. to 46% using our approach. Improvements (%) Improvements (%) Figure 8. Overview of the size reduction. In both figures, the x-axis lists the size ranges of enumeration sets P. In particular, P is described using the number of variants enumerated for each test program P . The y-axis represents the percentage. 4 PM-10 PM-20 PM-30 SPE PM-10 PM-20 PM-30 SPE 5.2 6 3 2.5 4.6 2.4 4 2 2 1 0.5 0.5 0.5 0.6 0.6 0.6 0.2 0.2 0.2 0.3 0.3 0.6 0 0 Function Line Function (a) GCC-4.8.5 coverage improvements. Line (b) Clang-3.6 coverage improvements. Figure 9. Coverage improvements over the baseline tests. PM-X represent improvements achieved by program mutation (the Orion tool) which deletes X statements, and SPE represents improvements achieved using our SPE algorithm. internal compiler error: in assign_by_spills, at lra-assigns.c:1281 error in backend: Do not know how to split the result of this operator! error in backend: Invalid register name global variable. error in backend: Access past stack top! Assertion ‘MRI->getVRegDef(reg) && “Register use before def!”’ failed. Assertion ‘Num < NumOperands && “Invalid child # of SDNode!”’ failed. 5.3 Experiments on Development Versions We apply our combinatorial program enumeration for finding bugs in the trunk versions of GCC and Clang. We select a set of small C programs from the unit test-suite of many open-source projects, such as CompCert [35], Frama-C, the Rose compiler and KCC [17]. In particular, most of our test C programs are from the test-suite in the trunk version of GCC. The test programs share similar characteristics with those described in Section 5.2. We began our testing process in early January. In less than six months, our technique has discovered 217 GCC and Clang bugs. To date, more than half of them have been fixed. To demonstrate SPE’s generality, we have also applied it to test the CompCert verified C compiler, and two optimizing Scala compilers, i.e., the production Scala compiler and the Dotty research compiler. In about three weeks, we have reported 29 CompCert crashing bugs and 42 bugs in the two Scala compilers. The developers have appreciated and promptly addressed our reports — 25 CompCert bugs have already been fixed (all have been confirmed), and 27 Dotty bugs have been confirmed. We started testing the two Scala compilers recently in late October. Among the Dotty bugs, 9 have been fixed so far. Until now, there are only five high-priority bugs in total in the Dotty code repository, and our SPE technique has discovered four of them. The rest of this section focuses discussing the GCC and Clang/LLVM bugs. Table 3. Crash signatures of bugs found in GCC-4.8.5 and Clang-3.6.1 using the GCC-4.8.5 test-suite. our SPE technique against the seminal work Orion of program mutation [32]. We choose Orion since it only considers statement deletion. Therefore, the overall search spaces for both approaches are bounded. We randomly select 100 test programs from the test-suite to run both approaches. Figure 9 gives the empirical results. The selected test programs achieve 41% function coverage and 32% line coverage for GCC, respectively. For Clang, they achieve 20% function coverage and 17% line coverage, respectively. Our SPE approach brings approximately 5% coverage improvement for GCC and 2.4% coverage improvement for Clang, respectively. On the other hand, Orion provides less than 1% coverage improvement. This comparison also demonstrates the advantage of applying our SPE technique on small programs. It is also worth noting that Orion has found 1 and 3 bugs in Clang-3.6 and GCC-4.8.5, respectively, using the same test-suite. The three GCC bugs are unique as they are different from what we have found. This evaluation has also provided practical evidence that program enumeration and program mutation offer complementary benefits. 10 2017/7/13 Compiler Reported 136 81 GCC Clang Summary Duplicate 10 3 Fixed 93 26 Invalid 2 1 Reopened 1 1 Crash 127 79 Classification Wrong code Performance 6 3 2 0 Table 4. Overview of bugs reported for trunk versions of GCC and Clang in six months. 80 60 40 20 0 74 48 39 27 12 13 P1 6 10 P2 P3 60 40 20 0 51 47 17 P4-5 -O0 (a) Bug priorities. 150 100 50 0 77 80 60 40 20 0 30 25 -O1 40 39 -O2 -O3 136 116 90 79 62 58 94 36 Earlier 5.X 6.X Trunk (c) Affected GCC versions. (b) Affected optimization levels. 63 37 28 11 13 0 C C++ 2 1 sm Inline-a 7 2 10 4 6 nd tion Middle-e RTL-optimiza IPA 5 34 6 Target on timizati Tree-op (d) Affected GCC components. Figure 10. Characteristics of GCC trunk bugs. The darker bars denote the numbers of reported bugs and the lighter bars the numbers of fixed bugs. GCC since GCC developers are relatively more responsive. In particular, GCC developers not only have fixed 68% of our bugs but also provide more feedback. Figure 10 characterizes the 136 reported GCC trunk bugs. Specifically, Figure 10(a) shows the importance of the reported bugs. P3 is the default priority in GCC’s bugzilla system. About two thirds of the bugs fall into this category. About 10% of them are release-blocking (P1). Developers have to fix all P1 bugs in order to release a future version. Figure 10(b) shows that our reported bugs cover all optimization levels. Specifically, our approach has found more -O3 bugs than the -O2 and O1 bugs. This demonstrates that the SPE technique is able to cover deep compiler optimization passes. Figure 10(c) shows the affected GCC versions. We can see that 85% of the bugs affect the latest 6 release. Moreover, 66% of the bugs affect at least three stable GCC 5 releases. Perhaps the most interesting to note is that 43% of the bugs affect earlier GCC versions from at least one year ago. It demonstrates that our techniques can find long latent bugs. Figure 10(d) shows the diversity of our reported bugs. Over half of our bugs are C++ frontend bugs. The second category of most frequent bugs concern the tree-optimization component. The results suggest that our SPE technique is useful for testing various compiler components. Our technique has discovered a large number of diverse bugs in a relatively short period of time. One unique, noteworthy aspect of our work is the large number of reported bugs in the compilers’ C++ support, making it the first successful exhaustive technique to provide this capability. C++ is an active, enormously complex language and has a growing set of features — it is very challenging to develop practical C++ program generators. Note that we have many more 5.3.1 Overall Results Table 4 gives an overview of the bugs that we have found during the testing course. We have reported 217 bugs in total. Developers have confirmed almost all of our reported bugs. Moreover, more than half of them have already been fixed within the six-month period. Some of our reported bugs are quite complex. For example, two bugs have been reopened by developers for further inspection. Although we ensure that our reported bugs have different symptoms, it is sometimes inevitable that we have occasionally reported duplicates as it is quite difficult for us to track the root cause for each bug. However, less than 5% of the bugs are duplicates. Two of our reported GCC bugs have been marked as invalid. In particular, one of them is about multiple inheritance and casting in C++, and the other is a C program that contains undefined behavior concerned with strict aliasing. We further discuss the undefined behavior issue in Section 5.4. Table 4 also gives the classification of the bugs. Most of the bugs cause compiler crashes. As mentioned in Section 5.1, we leverage the SPE technique to find both frontend and optimization bugs. Among all GCC crash bugs, 56% of them trigger frontend crashes, where most of them are related to the C++ frontend. On the other hand, 44% lead to crashes in the optimization passes. Moreover, we have discovered 8 bugs related to miscompilation. As mentioned in Section 2, one of them has been around for more than ten years. Finally, three of the bugs are related to compilation performance. We describe one such bug in Appendix A. 5.3.2 Bug Characteristics We discuss the characteristics of our reported GCC bugs. It is worth mentioning that we have made more effort testing 11 2017/7/13 1 2 3 4 class A { virtual void foo() { } }; 1 2 3 4 5 6 7 5 class B : public A, A { }; 8 9 10 6 7 8 B b1, &b2 = b1; A a = b2; (a) G++ crash 70202 (fixed) 9 10 char a; short b; void fn1() { if (b) ; else { int c[1] = {0}; l1: ; } if (a) goto l1; } 1 2 int a; double b, *c; 1 2 3 3 4 5 6 7 8 9 10 void fn1(int p1) { for (;; p1--) { a = p1; for (; p1 >= a; a--) b = c[p1]; } } (c) Clang crash 26973 (fixed) (b) GCC crash 69740 (reopened) 4 5 6 7 8 9 10 int main() { int *p = 0; trick: if (p) return *p; int x = 0; p = &x; goto trick; return 0; } (d) Clang wrong code 26994 (confirmed) Figure 11. Sample test programs that trigger bugs of GCC and Clang. bugs to triage, reduce and report, but have been reporting bugs in a steady fashion so as not to overwhelm the developers. The results highlight the novelty and benefits of our approach. 5.4 Toward Bounded Compiler Verification As mentioned in Section 1, our approach is general and establishes the first step toward practical techniques for proving the absence of compiler bugs for any programming language. For C/C++ compilers, the SPE technique itself does not guarantee that the generated programs are free of undefined behaviors. Specifically, for the incorrect return value of the program described in Figure 2, our technique cannot determine directly whether it is a compiler miscompilation or a false alarm due to possible undefined behavior. We rely on the heuristics discussed in Section 5.1 and manual inspection to confirm the bug. The test program was generated by SPE, which we believe can help prove the absence of miscompilations in C/C++ compilers. Our SPE technique has indeed found several wrong code bugs in both GCC and Clang, but much fewer than crash bugs. This section briefly discusses practical considerations in finding wrong code bugs with skeletal program enumeration. The most significant challenge is to avoid enumerating programs with undefined behaviors. In both program generation and mutation, one can design different heuristics to avoid producing “bad” programs. For instance, when performing statement insertions in Athena [33], one can carefully choose the candidate statements to avoid introducing undefined behavior such as uninitialized variables or outof-bound array accesses. Moreover, a key contribution of Csmith [57] is to ensure that its generated programs are, most likely, free of undefined behavior. However, in our SPE work, what heuristics to use is less obvious since we consider all variable usage patterns. On the other hand, SPE is deterministic and exhaustive rather than opportunistic. As a result, applying static analysis on each enumerated program would not be too expensive. We leave as interesting future work to explore static analysis techniques or efficient enumeration schemes to avoid undefined behaviors in the enumerated programs. Besides avoiding undefined behaviors, it is also challenging to detect undefined behaviors given a set of enumerated programs. This is perhaps more general since the issue itself has been an interesting, actively researched problem. The reference interpreter in CompCert [35], for example, offer tremendous help in detecting “bad” programs. However, since CompCert only works on a subset of C, it may not handle many practically useful features such as inline assembly, attributes and compiler-specific extensions. It also defines certain undefined behaviors, such as signed integer 5.3.3 Case Studies on Sample Bugs We select and discuss four reported GCC and Clang bugs. Figure 11 describes the corresponding test programs with bug classifications and status. Eight additional bug samples may be found in Appendix A. Figure 11(a). This test program exposes a long latent bug of GCC that affects all versions since GCC-4.4, which was released four years ago. The bug is in the C++ frontend of GCC, and manifests when GCC computes the path of the base classes for the class B. The GCC developers have confirmed this bug and are investigating its root cause. Figure 11(b). This is a crash bug of the GCC trunk (6.0 revision 233242). It manifests when GCC compiles the test program at -O2 and above. The goto statement in the program introduces an irreducible loop, and GCC incorrectly handles the backend and consequently triggers the assertion verify_loop_structure to fail. This reported bug had been fixed once, and later reopened by the GCC developers. Note that this program is enumerated from the test program in GCC bug report PR68841 . Figure 11(c). This test program crashes the trunk (3.9 revision 263641) of Clang at -O1 and above. This bug is a regression, and had been latent for eleven months until we discovered it. The culprit revision incorrectly passes a wrong parameter to infer the loop invariant, and consequently corrupts the emitted LLVM bitcode and causes an assertion violation in the compiler backend. Figure 11(d). The program is miscompiled by the Clang trunk (3.9.0 revision 263789). The expected exit code is 0. However the miscompiled executable returns 1 instead. The root cause is that the Clang frontend deems that the lifetime of the variable x ends after the control flow jumps to the label trick, which is incorrect. Consequently the write to variable x (i.e., int x = 0) was eliminated, and the miscompiled executable just returns a memory cell with uninitialized data. This bug is also a regression affecting the stable release of Clang 3.7 and all later versions. 12 2017/7/13 file high-quality bug reports, test programs should also be reduced first, using tools like C-Reduce [47] and Berkeley Delta [13]. Our work is also related to bounded-exhaustive testing, which concerns the enumeration of all possible input structures up to a given size [51]. Two popular techniques are declarative enumeration and imperative enumeration. In particular, declarative approaches leverage any given invariant to search for valid inputs [7, 19, 28, 50], and the imperative approaches directly construct the inputs based on more prescriptive specifications [12, 31, 49, 56]. In program synthesis, there have been studies on inductive functional programming systems for exhaustively synthesizing small programs [8, 25–27]. The essential enumeration techniques, categorized as analytical or generate-and-test approaches, share similar conceptual ideas. As mentioned in Section 4.3, existing enumeration techniques are expensive and impractical for the combinatoral enumeration problem that this work considers. overflows. Tools such as Clang’s undefined behavior sanitizers are also useful, but incomplete. As a result, we resort to manual inspection to rule out the remaining “bad” programs, which hinders productivity. Reliable tools for detecting undefined behaviors would be extremely helpful. 6. Related Work Csmith is the most popular random program generator for testing C compilers [9, 57]. Compared with the testsuite used in our study, Csmith generates large and complex programs. Csmith is a highly influential project. Over the years, it has helped find a few hundred bugs in both GCC and Clang/LLVM. Based on Csmith, the CLsmith work of Lidbury et al. focuses on testing OpenCL compilers [37]. Orange3 is a random program generator that tests arithmetic optimizations in C compilers [41]. CCG is another random C program generator which finds crash bugs in early versions of GCC and Clang [5]. Epiphron is a randomized technique to detect defects in compiler warning diagnostics in GCC and Clang [52]. For functional languages, there has also been an extensive body of work on exhaustive or random test-case generators for compiler testing [10, 11, 16, 18, 45, 49]. Boujarwah and Saleh conduct a thorough survey on generation techniques for compiler testing [6]. A recent work of Le et al. proposes the idea of testing compilers using the equivalence modulo inputs (EMI) [32] concept. Practical testing tools based on EMI mutate programs by inserting and deleting statements in unexecuted branches. In particular, Orion randomly deletes program statements in dead regions [32]. Athena adopts the Markov Chain Monte Carlo (MCMC) method to guide both statement insertions and deletions to obtain more interesting test programs [33]. Hermes inserts code fragments to live regions [53]. Moreover, Proteus applies the EMI technique to test link-time optimizers [34]. The frameworks based on EMI are quite efficient for compiler testing. They have revealed many bugs in both GCC and Clang/LLVM. Most of them are deep wrong code bugs. Besides testing C compilers, LangFuzz mutates syntactically correct JavaScript programs using failing code fragments [24]. It has discovered many vulnerabilities in the Mozilla JavaScript interpreter. Finally, the well-known mutation testing technique mutates a program to evaluate the quality of its testsuite [15, 23]. To guarantee the correctness of compilers, the two most notable developments are, perhaps, translation validation [42, 46] and verified compilers [35]. Besides verification, compiler testing is another important practical approach. For testing C compilers, all of the program generation, program mutation and our SPE techniques realize the same idea of differential testing [40]. The three approaches complement each other. Specifically, for program enumeration, we consider small test programs. Our technique exhaustively exploits all variable combinations. On the other hand, the other two approaches tend to produce large and complex programs in a randomized fashion. The buggy programs discovered using these techniques could be processed using CompCert’s reference interpreter to identify undefined behaviors [35]. To 7. Conclusion This paper has introduced skeletal program enumeration (SPE) for compiler testing and developed a practical combinatorial solution. Our approach significantly reduces the number of enumerated programs. For an empirical demonstration of its utility, we have applied it to test two production C/C++ compilers, CompCert C comipler and two Scala compilers. Our results are extremely promising. For instance, in less than six months, our approach has helped discover more than 200 bugs in GCC and Clang. More than half of our reported bugs have already been fixed, the majority are long latent, and a significant fraction are classified as critical, release blocking. Our SPE strategy and techniques are general and may be applied in other enumeration settings. This work also demonstrates the practical potential of program enumeration, and opens up opportunities toward bounded compiler verification. Acknowledgments We would like to thank our shepherd, Mayur Naik, and the anonymous PLDI reviewers for valuable feedback on earlier drafts of this paper, which helped improve its presentation. We thank Yang Chen and Davide Italiano for helpful comments on this work. This research was supported in part by the United States National Science Foundation (NSF) Grants 1319187, 1528133, and 1618158, and by a Google Faculty Research Award. The information presented here does not necessarily reflect the position or the policy of the Government and no official endorsement should be inferred. A. Additional Sample Bugs We briefly discuss eight additional sample bugs found by SPE to show its generality and the diverse bugs that it can detect. 13 2017/7/13 1 2 3 4 void foo() { unsigned long l; void *p = 0; 1 2 3 4 5 5 __builtin_unwind_init (); 6 6 7 7 l = 0; 8 8 9 9 __builtin_eh_return (l, p); 10 11 } 10 11 12 13 2 3 enum Color { R, G, B }; 1 6 7 10 11 12 13 4 struct C { C() {} int i; }; 5 6 7 void *operator new(size_t, void *p2) { return p2; } 8 9 10 11 12 13 int main() { int a; new (&a) C; return 0; } (c) G++ crash bug 71405 (fixed) 2 (e) CompCert crash bug 125 (fixed) 3 4 template < typename T > void test(T, __underlying_type (T)) {} 8 9 3 1 union U u = { 0 }; 4 5 1 2 (b) GCC wrong code bug 70138 (fixed) (a) GCC crash/performance bug 67619 (fixed) 1 double u[1782225]; int a, b, d, e; static void foo(int *p1) { double c = 0.0; for (; a < 1335; a++) { b = 0; for (; b < 1335; b++) c = c + u[a + 1335 * a]; u[1336 * a] *= 2; } *p1 = c; } int main() {...} 1 2 3 int main() { Color c = R; test (c, c); return 0; } (d) Clang++ crash bug 28045 (fixed) 4 5 6 7 8 object Main extends App { case class Foo(field: Option[String]) val x: PartialFunction[Foo, Int] = { c => c.field match { case Some(s) => 42 } } } (f) Dotty crash bug 1637 (fixed) void foo (struct A a) { a++; } (g) CompCert crash bug 121 (fixed) 1 2 3 4 class Bar { def f (x : { def g }) {} f (new Foo { def g }) } (h) Scala crash bug 10015 (open) Figure 12. Additional sample bugs. Figure 12(e). This test program triggers a crashing bug in CompCert’s frontend. Before the initialization, the parser does not check whether the type is incomplete, which triggers an assertion failure in CompCert. Figure 12(a). This bug is long latent and intriguing as it causes different symptoms for multiple GCC versions. It affects optimization levels -O1 and above. When compiling it, GCC 4.6 and 4.7 hang, whereas 4.8 to trunk crash. GCC incorrectly computes the address for exception handling, which later causes an assertion violation in the middle end. Figure 12(f). This test program crashes the Dotty compiler — a next generation compiler for Scala. It triggers an assertion in the Dotty typer. The bug has been fixed and marked as high priority in Dotty’s GitHub repository. As of March 2017, there are five high-priority bugs in the Dotty code repository, and SPE discovered four. Figure 12(b). This test program is miscompiled by the GCC trunk (6.0 revision 234026) at -O3. It is derived by enumerating a test case in GCC’s testsuite. The expression c=c+u[a+1335*a] on line 8 is obtained by replacing b in the original expression c=c+u[a+1335*b] with a. Then this replacement triggers a regression in the loop vectorizer pass. Figure 12(g). This test program crashes CompCert. Function foo’s parameter has a structure type A, whose definition is unavailable in this translation unit. CompCert did not reject the program early, thus leading to an “Unbound struct A” assertion failure in the subsequent compilation of the program. Figure 12(c). This test program crashes the trunk (7.0 revision 237059) of GCC at -Os and above. The code overrides the placement new operator of C++ on line 6. A replacement new operator creates an object in a given memory region. In the main function, this overridden new operator is called to create an object of type C at the address of the local variable a (i.e., ‘new (&a) C’). However, because C and a have different types, GCC translates the code into an ill-formed intermediate representation (i.e., GIMPLE code), which does not pass the GIMPLE verification pass. Figure 12(h). This test program crashes the 2.12 stable release of the Scala compiler. Specifically, it triggers an assertion failure in Scala’s type checker. The test program is enumerated from the regression test-suite in the Scala release. References Figure 12(d). This program triggers a bug in the name mangling module of Clang for the Itanium C++ ABI. On line 6, the template function test takes as input two parameters of the types: a generic type T and the underlying type of T. When Clang was trying to mangle the function name of the call on line 11, the bug (i.e., the type trait __underlying_type was improperly handled) led the compilation to unreachable code, thus failing an assertion. [1] Dotty Compiler. http://dotty.epfl.ch/ . [2] Perennial, Inc. Perennial C Compiler Validation Suite. http://www.peren.com/pages/cvsa_set.htm . [3] Plum Hall, Inc. The Plum Hall Validation Suite for C. http://www.plumhall.com/stec.html . [4] Scala Compiler. http://www.scala-lang.org/ . [5] A. Balestrat. CCG. https://github.com/Mrktn/ccg . 14 2017/7/13 [6] A. S. Boujarwah and K. Saleh. Compiler test case generation methods: a survey and assessment. Information & Software Technology, 39(9):617–625, 1997. [7] C. Boyapati, S. Khurshid, and D. Marinov. Korat: automated testing based on Java predicates. In ISSTA, pages 123–133, 2002. [8] F. Briggs and M. O’Neill. Functional genetic programming and exhaustive program search with combinator expressions. KES Journal, 12(1):47–68, 2008. [9] Y. Chen, A. Groce, C. Zhang, W. Wong, X. Fern, E. Eide, and J. Regehr. Taming compiler fuzzers. In PLDI, pages 197–208, 2013. [27] [28] [29] [30] [10] K. Claessen and J. Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. In ICFP, pages 268– 279, 2000. [11] K. Claessen, J. Duregård, and M. H. Palka. Generating constrained random data with uniform distribution. J. Funct. Program., 25, 2015. [12] B. Daniel, D. Dig, K. Garcia, and D. Marinov. Automated testing of refactoring engines. In FSE, pages 185–194, 2007. [13] S. M. Daniel S. Wilkerson and S. Goldsmith. Berkeley Delta. http://delta.stage.tigris.org/ . [14] N. G. De Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. In Indagationes Mathematicae, volume 75, pages 381–392, 1972. [15] R. A. DeMillo, R. J. Lipton, and F. G. Sayward. Hints on test data selection: Help for the practicing programmer. IEEE Computer, 11(4):34–41, 1978. [16] J. Duregård, P. Jansson, and M. Wang. Feat: functional enumeration of algebraic types. In Haskell, pages 61–72, 2012. [17] C. Ellison and G. Rosu. An executable formal semantics of C with applications. In POPL, pages 533–544, 2012. [18] B. Fetscher, K. Claessen, M. H. Palka, J. Hughes, and R. B. Findler. Making random judgments: Automatically generating well-typed terms from the definition of a type-system. In ESOP, pages 383–405, 2015. [19] J. P. Galeotti, N. Rosner, C. G. L. Pombo, and M. F. Frias. TACO: efficient SAT-based bounded verification using symmetry breaking and tight bounds. IEEE Trans. Software Eng., 39(9):1283–1307, 2013. [20] M. Gligoric, T. Gvero, V. Jagannath, S. Khurshid, V. Kuncak, and D. Marinov. Test generation through programming in UDITA. In ICSE, pages 225–234, 2010. [21] K. Grygiel and P. Lescanne. Counting and generating lambda terms. J. Funct. Program., 23(5):594–628, 2013. [22] K. Grygiel and P. Lescanne. Counting and generating terms in the binary lambda calculus. J. Funct. Program., 25, 2015. [23] R. G. Hamlet. Testing programs with the aid of a compiler. IEEE Trans. Software Eng., 3(4):279–290, 1977. [24] C. Holler, K. Herzig, and A. Zeller. Fuzzing with code fragments. In USENIX Security, pages 445–458, 2012. [25] S. Katayama. Systematic search for lambda expressions. In TFP, pages 111–126, 2005. [26] S. Katayama. Efficient exhaustive generation of functional programs using Monte-Carlo search with iterative deepening. [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] 15 In Proceedings of the 10th Pacific Rim International Conference on Artificial Intelligence, pages 199–210, 2008. S. Katayama. An analytical inductive functional programming system that avoids unintended programs. In PEPM, pages 43– 52, 2012. S. Khurshid and D. Marinov. TestEra: Specification-based testing of Java programs using SAT. Autom. Softw. Eng., 11 (4):403–434, 2004. D. E. Knuth. The art of computer programming. Vol. 4A., Combinatorial algorithms. Part 1. Addison-Wesley, 2011. D. L. Kreher and D. R. Stinson. Combinatorial algorithms: generation, enumeration, and search. CRC Press, London, New York, 1999. I. Kuraj, V. Kuncak, and D. Jackson. Programming with enumerable sets of structures. In OOPSLA, pages 37–56, 2015. V. Le, M. Afshari, and Z. Su. Compiler validation via equivalence modulo inputs. In PLDI, page 25, 2014. V. Le, C. Sun, and Z. Su. Finding deep compiler bugs via guided stochastic program mutation. In OOPSLA, pages 386– 399, 2015. V. Le, C. Sun, and Z. Su. Randomized stress-testing of linktime optimizers. In ISSTA, pages 327–337, 2015. X. Leroy. Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In POPL, pages 42–54, 2006. P. Lescanne. On counting untyped lambda terms. Theor. Comput. Sci., 474:80–97, 2013. C. Lidbury, A. Lascu, N. Chong, and A. F. Donaldson. Manycore compiler fuzzing. In PLDI, pages 65–76, 2015. T. Mansour and G. Nassar. Gray codes, loopless algorithm and partitions. Journal of Mathematical Modelling and Algorithms, 7(3):291–310, 2008. T. Mansour, G. Nassar, and V. Vajnovszki. Loop-free Gray code algorithm for the e-restricted growth functions. Information Processing Letters, 111(11):541–544, 2011. W. M. McKeeman. Differential testing for software. Digital Technical Journal, 10(1):100–107, 1998. E. Nagai, A. Hashimoto, and N. Ishiura. Reinforcing random testing of arithmetic optimization of C compilers by scaling up size and number of expressions. IPSJ Trans. System LSI Design Methodology, 7:91–100, 2014. G. C. Necula. Translation validation for an optimizing compiler. In PLDI, pages 83–94, 2000. F. Nielson, H. R. Nielson, and C. Hankin. Principles of program analysis. Springer, 1999. F. W. J. Olver, D. W. Lozier, R. F. Boisvert, and C. W. Clark, editors. NIST Handbook of Mathematical Functions. Cambridge University Press, New York, NY, 2010. M. H. Palka, K. Claessen, A. Russo, and J. Hughes. Testing an optimising compiler by generating random lambda terms. In AST, pages 91–97, 2011. A. Pnueli, M. Siegel, and E. Singerman. Translation validation. In TACAS, pages 151–166, 1998. J. Regehr, Y. Chen, P. Cuoq, E. Eide, C. Ellison, and X. Yang. Test-case reduction for C compiler bugs. In PLDI, pages 335– 346, 2012. 2017/7/13 [53] C. Sun, V. Le, and Z. Su. Finding compiler bugs via live code mutation. In OOPSLA, pages 849–863, 2016. [54] C. Sun, V. Le, Q. Zhang, and Z. Su. Toward understanding compiler bugs in GCC and LLVM. In ISSTA, pages 294–305, 2016. [55] P. Tarau. On type-directed generation of lambda terms. In ICLP (Technical Communications), 2015. [56] W. Visser, C. S. Pasareanu, and S. Khurshid. Test input generation with Java PathFinder. In ISSTA, pages 97–107, 2004. [57] X. Yang, Y. Chen, E. Eide, and J. Regehr. Finding and understanding bugs in C compilers. In PLDI, pages 283–294, 2011. [48] N. Rosner, V. S. Bengolea, P. Ponzio, S. A. Khalek, N. Aguirre, M. F. Frias, and S. Khurshid. Bounded exhaustive test input generation from hybrid invariants. In OOPSLA, pages 655–674, 2014. [49] C. Runciman, M. Naylor, and F. Lindblad. Smallcheck and lazy smallcheck: automatic exhaustive testing for small values. In Haskell, pages 37–48, 2008. [50] V. Senni and F. Fioravanti. Generation of test data structures using constraint logic programming. In TAP, pages 115–131, 2012. [51] K. J. Sullivan, J. Yang, D. Coppit, S. Khurshid, and D. Jackson. Software assurance by bounded exhaustive testing. In ISSTA, pages 133–142, 2004. [52] C. Sun, V. Le, and Z. Su. Finding and analyzing compiler warning defects. In ICSE, pages 203–213, 2016. 16 2017/7/13
6cs.PL
Family of Controllers for Attitude Synchronization on the Sphere arXiv:1503.06326v5 [cs.SY] 6 Jul 2016 Pedro O. Pereira and Dimos V. Dimarogonas Abstract— In this paper we study a family of controllers that guarantees attitude synchronization for a network of agents in the unit sphere domain, i.e., S 2 . We propose distributed continuous controllers for elements whose dynamics are controllable, i.e., control with torque as command, and which can be implemented by each individual agent without the need of a common global orientation frame among the network, i.e., it requires only local information that can be measured by each individual agent from its own orientation frame. The controllers are constructed as functions of distance functions in S 2 , and we provide conditions on those distance functions that guarantee that i) a synchronized network of agents is locally asymptotically stable for an arbitrary connected network graph; ii) a synchronized network is asymptotically achieved for almost all initial conditions in a tree network graph. When performing synchronization along a principal axis, we propose controllers that do not require full torque, but rather torque orthogonal to that principal axis; while for synchronization along other axes, the proposed controllers require full torque. We also study the equilibria configurations that come with specific types of network graphs. The proposed strategies can be used in attitude synchronization of swarms of under actuated rigid bodies, such as satellites. I. I NTRODUCTION Decentralized control in a multi-agent environment has been a topic of active research for the last decade, with applications in large scale robotic systems. Attitude synchronization in satellite formations is one of those applications [1], where the control goal is to guarantee that a network of fully actuated rigid bodies acquires a common attitude. Coordination of underwater vehicles in ocean exploration missions can also be casted as an attitude synchronization problem [2]. In the literature of attitude synchronization, different solutions for consensus in the special orthogonal group are found [1], [3]–[10], which focus on complete attitude synchronization. In this paper, we focus on incomplete attitude synchronization, which has not received the same attention: in this scenario, each rigid body has a main direction and the global objective is to guarantee alignment of all rigid bodies’ main directions; the space orthogonal to each main direction can be left free of actuation or controlled to accomplish some other goals. Complete attitude synchronization requires more measurements when compared to incomplete attitude synchronization, and it might be the case that a rigid body is not fully actuated but rather only actuated in the space The authors are with the ACCESS Linnaeus Center, School of Electrical Engineering, KTH Royal Institute of Technology, SE-100 44, Stockholm, Sweden. {ppereira, dimos}@kth.se. This work was supported by the EU H2020 (AEROWORKS) project and the Swedish Research Council (VR). orthogonal to a specific direction, in which case incomplete attitude synchronization is still feasible. Incomplete attitude synchronization is also denoted synchronization on the sphere in [11]–[16], where the focus has been on kinematic or point mass dynamic agents, i.e., dynamical agents without moment of inertia. In [4], attitude control in a leader-follower network of rigid bodies has been studied, with the special orthogonal group being parametrized with Modified Rodrigues Parameters. The proposed solution guarantees attitude synchronization for connected graphs, but it requires all rigid bodies to be aware of a common and global orientation frame. In [5], [6], a controller for a single-leader single-follower network is proposed that guarantees global attitude synchronization at the cost of introducing a discontinuity in the control laws. In [7], attitude synchronization in a leader-follower network is accomplished by designing a non-linear distributed observer for the leader. In [17], [18], a combination of a tracking input and a synchronization input is used; the tracking input adds robustness if connectivity is lost and it is designed in the spirit of leader-following, where the leader is a virtual one and it encapsulates a desired trajectory; however, this strategy requires all agents to be aware of a common and global reference frame. In another line of work, in [3], [8], attitude synchronization is accomplished without the need of a common orientation frame among agents. Additionally, in [3], a controller for switching and directed network topologies is proposed, and local stability of consensus in connected graphs is guaranteed, provided that the control gain is sufficiently high. In [1], attitude synchronization is accomplished with controllers based on behavior based approaches and for a bidirectional ring topology. The special orthogonal group is parametrized with quaternions, and the proposed strategy also requires a common attitude frame among agents. In [19], a quaternion based controller is proposed that guarantees a synchronized network of rigid bodies is a global equilibrium configuration, provided that the network graph is acyclic. This comes at the cost of having to design discontinuous (hybrid) controllers. A discrete time protocol for complete synchronization of kinematic agents is found in [20]. The authors introduce the notion of reshaping function, and a similar concept is presented in this manuscript. The protocol provides almost global convergence to a synchronized configuration, which relies on proving that all other equilibria configurations, apart from the equilibria configuration where agents are synchronized, are unstable. In [9], controllers for complete attitude synchronization and for switching topologies are proposed, but this is accomplished at the kinematic level, i.e., by controlling the agents’ angular velocity (rather than their torque). This work is extended in [10] by providing controllers at the torque level, and similarly to [1], stability properties rely of high gain controllers. In [11], [12], incomplete synchronization of kinematic agents on the sphere is studied, with a constant edge weight function for all edges. In particular, in [12], incomplete synchronization is used for accomplishing a flocking behavior, where a group of agents moves in a common direction. In [13], dynamic agents, which move at constant speed on a sphere, are controlled by a state feedback control law that steers their velocity vector so as to force the agents to attain a collective circular motion; since the agents are mass points, the effect of the moment of inertia is not studied. In [14], dynamic point mass agents, constrained to move on a sphere, are controlled to form patterns on the sphere, by constructing attractive and repelling forces; in the absence of repelling forces, synchronization is achieved. Also, the closed-loop dynamics of these agents are invariant to rotations, or symmetry preserving, as those in [11], [12], in the sense that two trajectories, whose initial condition – composed of position and velocity – differs only on a rotation, are the same at each time instant apart from the previous rotation. In our framework this property does not hold, since our dynamic agents have a moment of inertia, unlike the agents in [11], [12], [14], which is another novelty of the paper in hand. We propose a distributed control strategy for synchronization of elements in the unit sphere domain. The controllers for accomplishing synchronization are constructed as functions of distance functions (or reshaping functions as denoted in [20]), and, in order to exploit results from graph theory, we impose a condition on those distance functions that will restrict them to be invariant to rotations of their arguments. As a consequence, the proposed controllers can be implemented by each agent without the need of a common orientation frame. We restrict the proposed controllers to be continuous, which means that a synchronized network of agents cannot be a global equilibrium configuration, since S 2 is a non-contractible set [21]. Our main contributions lie in proposing for the first time a controller that does not require full torque when performing synchronization along a principal axis, but rather torque orthogonal to that axis; in finding conditions on the distance functions that guarantee that a synchronized network is locally asymptotically stable for arbitrary connected network graphs, and that guarantee that a synchronized network is achieved for almost all initial conditions in a tree graph; in providing explicit domains of attraction for the network to converge to a synchronized network; and in characterizing the equilibria configurations for some general, yet specific, types of network graphs. A preliminary version of this work was submitted to the 2015 IEEE Conference on Decision and Control [22]. With respect to this preliminary version, this paper presents significantly more details on the derivation of the main theorems and provides additional results. In particular, the concept of cone has been modified, with a clearer intuitive interpretation; the proof for the proposition that supports the result on local stability of the synchronized network has been simplified; further details on the condition imposed on the distance functions are provided; additional examples on possible distance functions, and their properties, are presented; and supplementary simulations are provided which further illustrate the theoretical results. The remainder of this paper is structured as follows. In Section III, the problem statement is described; in Section IV, the proposed solution is presented; in Sections V and VI, convergence to a synchronized network is discussed for tree and arbitrary graphs, respectively; and, in Section VII, simulations are presented that illustrate the theoretical results. II. N OTATION 0n ∈ Rn and 1n ∈ Rn denote the zero column vector and the column vector with all components equal to 1, respectively; 1̄n ∈ Rn denotes a column vector in {(x1 , · · · , xn ) ∈ Rn : xi = ±1, ∀i = {1, · · · , n}}; when the subscript n is omitted, the dimension n is assumed to be of appropriate size. In ∈ Rn×n stands for the identity matrix, and we omit its subscript when n = 3. The matrix S (·) ∈ R3×3 is a skewsymmetric matrix and it satisfies S (a) b = a × b, for any a, b ∈ R3 . The map Π : {x ∈ R3 : xT x = 1} 7→ R3×3 , defined as Π (x) = I − xxT , yields a matrix that represents the orthogonal projection operator onto the subspace perpendicular to x. We denote the Kronecker product between A ∈ Rm×n and B ∈ Rs×t by A ⊗ B ∈ Rm s×n t . Given A1 , · · · , An ∈ Rm×m , for some n, m ∈ N, we denote A = A1 ⊕ · · · ⊕ An ∈ Rnm×nm (direct sum of matrices) as the block diagonal matrix with block diagonal entries A1 to An . Given a, b ∈ Rn , a = ±b ⇔ a = b ∨ a = −b; additionally, we say a 6= 0 and b 6= 0 have the same direction if there exists λ ∈ R such that b = λa. We say a function f : Ω1 7→ Ω2 is of class C n , or equivalently f ∈ C n (Ω1 , Ω2 ), if its first n + 1 derivatives (i.e., f (0) , f (1) , · · · , f (n) ) exist and are continuous on Ω1 . Finally, given a set H, we use the notation |H| for the cardinality of H. III. P ROBLEM S TATEMENT We consider a group of N agents, indexed by the set N = {1, · · · , N }, operating in the unit sphere domain, i.e., in S 2 = {x ∈ R3 : xT x = 1}. The agents’ network is modeled as an undirected static graph, G = {N , E}, with N as the vertices’ set indexed by the team members, and E as the edges’ set. For every pair of agents (i, j) ∈ N ×(N \{i}), that are aware of and can measure each other’s relative attitude, we say that agent j is a neighbor of agent i, and vice-versa; also, we denote Ni ⊂ N as the neighbor set of agent i. Each agent i has its own orientation frame (w.r.t. an unknown inertial orientation frame), represented by Ri ∈ SO(3). Let the unit vector ni ∈ S 2 be a direction along R2 u 3 R2 u 2 R1 u 3 R1 u 3 R1 u 3 R2 u 2 R2 u 3 n2 ≡ R2 n̄2 n1 ≡ R1 n̄1 n1 ≡ R1 n̄1 R2 u 3 R1 u 2 R1 u 2 n2 ≡ R2 n̄2 n2 ≡ R2 n̄2 n1 ≡ R1 n̄1 R2 u 2 R1 u 2 R2 u 1 R2 u 1 R1 u 1 R1 u 1 R2 u 1 (a) Two non-synchronized rigid bodies. R1 u 1 (b) Two synchronized rigid bodies (where R1 = R2 ). (c) Two synchronized rigid bodies (where R1 6= R2 ). Fig. 2: In incomplete synchronization, n rigid bodies, indexed by i = {1, · · · , n}, synchronize the unit vectors ni = Ri n̄i , where n̄i is fixed in rigid body i. In Figs. 2(a)–2(c), n̄1 = n̄2 = √13 [1 1 1]T (u1 ,u2 and u3 stand for the canonical basis vectors of R3 ). n2 ≡ R2 n̄2 R1 u 3 n1 ≡ R1 n̄1 Ṙi (t) = fR (Ri (t), ωi (t)), R1 u 2 R2 u 3 R2 u 1 R1 u 1 Ti : R≥0 7→ R3 . The rotation matrix Ri : R≥0 7→ SO(3) evolves according to R2 u 2 (a) Two non-synchronized rigid bodies. where fR : SO(3) × R 7→ R 3 3×3 (III.1) is defined as fR (R, ω) = RS (ω) , (III.2) while each unit vector ni : R≥0 7→ S evolves according to ṅi (t) = fni (t, ni (t), ωi (t)), where fni : R≥0 × S 2 × R3 7→ R3 is defined as 2 R1 u 3 R2 u 3 n2 ≡ R2 n̄2 n1 ≡ R1 n̄1 R1 u 2 R2 u 1 R1 u 1 R2 u 2 (b) Two synchronized rigid bodies. Fig. 1: In incomplete synchronization, n rigid bodies, indexed by i = {1, · · · , n}, synchronize the unit vectors ni = Ri n̄i , where n̄i is fixed in rigid body i. In Figs. 1(a)-1(b), n̄1 = −n̄2 = √13 [1 1 1]T (u1 ,u2 and u3 stand for the canonical basis vectors of R3 ). fni (t, n, ω) = S (Ri (t)ω) n. (III.3) The previous results follows from the fact that ni (·) = Ri (·)n̄i for some constant n̄i ∈ S 2 , and therefore Ṙi (t)n̄i = S (Ri (t)ωi (t)) Ri (t)n̄i ⇒ ṅi (t) = S (Ri (t)ωi (t)) ni (t). Finally, the body-framed angular velocity ωi : R≥0 7→ R3 evolves according to the dynamics d (Ri (t)Ji ωi (t)) = Ri (t)Ti (t) ⇔ (III.4) dt −1 ⇔ω̇i (t) = Ji (−S (ωi (t)) Ji ωi (t) + Ti (t)) , (III.5) agent’s i orientation, i.e., ni = Ri n̄i , where n̄i ∈ S 2 is a constant unit vector, specified in the agent’s i body orientation frame, and known by agent i and its neighbors. In this paper, the goal of attitude synchronization is not that all agents share the same complete orientation, i.e., that R1 = · · · = RN , but rather that all agents share the same orientation along a specific direction, i.e., that n1 = · · · = nN ⇔ R1 n̄1 = · · · = RN n̄N . For example, in a group of N satellites that must align their principal axis associated to the smallest moment of inertia, it follows that, for each i ∈ N , n̄i ∈ S 2 : ∃λi > 0 : Ji n̄i = λi n̄i with Ji as the satellite’s moment of inertia and with λi as the smallest eigenvalue of Ji ; and that the desired synchronized network of satellites satisfies R1 n̄1 = · · · = RN n̄N . Figures 1 and 2 illustrate the concept of incomplete synchronization for two agents. Notice that agent i is not aware of ni , since this is specified w.r.t. an unknown inertial orientation frame; instead, agent i is aware of its own direction n̄i – fixed in its own orientation frame – and the projection of its neighbors directions onto its own orientation frame. and therefore ω̇i (t) = fωi (ωi (t), Ti (t)), where fωi : R3 × R3 7→ R3 is defined as Consider then any agent i ∈ N , with rotation matrix Ri : R≥0 7→ SO(3), unit vector ni : R≥0 7→ S 2 where ni (·) = Ri (·)n̄i , body-framed angular velocity ωi : R≥0 7→ R3 , moment of inertia Ji ∈ R3×3 (Ji > 0), and body frame torque For the purposes of analysis, we consider the state x := (n, ω) := ((n1 , · · · , nN ), (ω1 , · · · , ωN )) : R≥0 7→ (S 2 )N × (R3 )N , and the control input T := (T1 , · · · , TN ) : R≥0 7→ (R3 )N ; where x(·) evolves according to ẋ(t) = fωi (ω, T) = Ji−1 (−S (ω) Ji ω + T) . (III.6) Definition 1: Two unit vectors (n1 , n2 ) ∈ (S 2 )2 are diametrically opposed if nT1 n2 = −1, and synchronized if nT1 n2 = 1. A group of unit vectors (n1 , · · · , nN ) ∈ (S 2 )N is synchronized if nTi nj = 1 for all i, j ∈ {1, · · · , N }. Problem 1: Given a group of rotation matrices (R1 , · · · , RN ) : R≥0 7→ SO(3)N , with angular velocities (ω1 , · · · , ωN ) : R≥0 7→ R3 and moments of inertia J1 , · · · , JN satisfying (III) and (III), design distributed control laws for the torques {Ti : R≥0 7→ R3 }i∈N , in the absence of a common inertial orientation frame, that guarantee that the group of unit vectors (n1 , · · · , nN ) : R≥0 7→ (S 2 )N is asymptotically synchronized. fx (t, x(t), T(t)) where fx (t, x, T) = (fn (t, n, ω), fω (ω, T)) ∈ R 3N 3N × R , (III.7) with fn (t, n, ω) = (fn1 (t, n1 , ω1 ), · · · , fnN (t, nn , ωN )) ∈ (R3 )N and fω (ω, T) = (fω1 (ω1 , T1 ), · · · , fωN (ωN , TN )) ∈ (R3 )N . Remark 1: Given our choice of state, the corresponding vector field in (III) depends explicitly on time. The explicit time dependency encapsulates the effect of the space orthogonal to ni (·) on the kinematics of ṅi (·). Therefore, in the analysis we would have to consider the effect of initializing the system at different time instants t0 ∈ R, corresponding to different initializations of the space orthogonal to ni (t0 ). In general, that initialization does have an effect on a trajectory x(·) of ẋ(t) = fx (t, x(t), T(t)), but, as shall be verified later, it does not affect the attainment of the goal defined in Problem 1. Therefore, we assume that the initial time instant is always 0, i.e., t0 = 0. IV. P ROPOSED S OLUTION A. Preliminaries We first present some definitions and results from graph theory that are used in later sections [23]. A graph G = {N , E} is said to be connected if there exists a path between any two vertices in N . G is a tree if it is connected and it contains no cycles. An orientation on the graph G is the assignment of a direction to each edge (i, j) ∈ E, where each edge vertex is either the tail or the head of the edge. For brevity, we denote N = |N |, M = |E| and M = {1, · · · , M }. Additionally, and for notational convenience in the analysis that follows, consider the sets E = {(i, j) ∈ N × N : j ∈ Ni }, i.e., the set of edges of the graph G; and Ē = {(i, j) ∈ E : j > i}. For undirected network graphs, we can construct an injective function κ̄ : Ē 7→ M from which it is possible to construct a second, now surjective, function κ : E 7→ M, which satisfies κ(i, j) = κ̄(i, j) when j > i and κ(i, j) = κ̄(j, i) when j < i. As such, by construction, for every (i, j) ∈ E, κ(i, j) = κ(j, i), since we consider undirected graphs. The function κ(·, ·) thus assigns an edge index to every unordered pair of neighbors. The incidence matrix B ∈ RN ×M of G is such that, for every k ∈ M and for (i, j) = κ̄−1 (k), Bik = 1, Bjk = −1 and Blk = 0 for all l ∈ N \{i, j}. Finally, for each edge k ∈ M and (i, j) = κ̄−1 (k), we denote k n := ni and k̄ n := nj , i.e., we identify an agent by its node index but also by its edges’ indexes (k n if ni is the tail of edge k, and k̄ n if ni is the head of edge k). Proposition 2: If G is a tree, then B T B and (B⊗I)T (B⊗I) are positive definite [24]. Proposition 3: If G is connected but not a tree, then the null space of the incidence matrix, i.e., N (B), is non-empty, and it corresponds to the cycle space of G (Lemma 3.2 in [25]). Denote by C ⊆ {1, · · · , M } the set of indices corresponding the edges that form a cycle. Consider a network with n ∈ N cycles, {Ci }i={1,··· ,n} . A cycle Ci is said to be independent if Ci ∩ Cj = ∅ for all j ∈ {1, · · · , n}\{i}. In Fig. 3(a), a graph with two independent cycles is presented. Additionally, we say two cycles C1 and C2 share only one edge when |C1 ∩ C2 | = 1 and C1 ∪ C2 contains edges from only the following three cycles (in {Ci }i={1,··· ,n} ): C1 , C2 and C3 = C1 ∪ C2 \{C1 ∩ C2 }, with |C3 | = |C1 | + |C2 | − 2. Figures 3(b) and 8(c) present graphs with two cycles that share only one edge. Proposition 4: Consider a graph G with m independent cycles, {Ci }i={1,··· ,m} . Then the null space of B is given by N (B) = {e = (e1 , · · · , eM ) ∈ RM : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , m}}; and the null space of B ⊗ In is given by N (B ⊗ In ) = {e = (e1 , · · · , eM ) ∈ (Rn )M : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , m}}. Notice that, for an incidence matrix B ∈ RN ×M , there are M edges and these belong to R. On the other hand, for the incidence matrix B ⊗ In (with B ∈ RN ×M ), there are M edges, but, since the agents operate in an n-dimensional space, those edges belong to Rn . With that in mind, under the conditions of Proposition 4, N (B) = {e = (e1 , · · · , eM ) ∈ RM : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , m}} means that N (B) is the space where all edges of an independent cycle have the same absolute value. On the other hand, N (B ⊗ In ) = {e = (e1 , · · · , eM ) ∈ (Rn )M : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , m}} means that N (B ⊗ In ) is the space where all edges of an independent cycle have the same direction and norm (or are all zero). Proposition 5: Consider a graph G with n1 independent cycles, {Ci }i={1,··· ,n1 } , and n2 pairs of cycles that share only one edge, {(Ci1 , Ci2 )}i={1,··· ,n2 } . Then the null space of B is given by N (B) = {e = (e1 , · · · , eM ) ∈ RM : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , n1 }} ∪ {e = (e1 , · · · , eM ) ∈ RM : ek = ±el , ∀k, l ∈ Ci1 \{Ci1 ∩ Ci2 }, ep = ±eq , ∀p, q ∈ Ci2 \{Ci1 ∩Ci2 }, i = {1, · · · , n2 }}; and the null space of B⊗In is given by N (B⊗In ) = {e = (e1 , · · · , eM ) ∈ (Rn )M : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , n1 }} ∪ {e = (e1 , · · · , eM ) ∈ (Rn )M : ek = ±el , ∀k, l ∈ Ci1 \{Ci1 ∩Ci2 }, ep = ±eq , ∀p, q ∈ Ci2 \{Ci1 ∩ Ci2 }, i = {1, · · · , n2 }}. The results of Proposition 5 can be interpreted as follows: N (B) is the space where, for each cycle, all its edges (∈ R), except the one that is shared, have the same absolute value; while N (B ⊗ In ) is the space where, for each cycle, all its edges (∈ Rn ), except the one that is shared, have the same direction and norm (or are all zero). Some examples that illustrate Propositions 4 and 5, and details on equivalent incidence matrices are found in XI. Also, proofs of Propositions 4 and 5 are found in Appendix XII. These Propositions are useful in a later section, where we prove that for network graphs that satisfy the conditions of either Proposition, the agents converge to a configuration where all unit vectors belong to a common plane. n2 κ̄(2, 3) = 2 n4 B. Distance in S 2 κ̄(1, 2) = 1 κ̄(1, 4) = 4 κ̄(4, 5) = 6 n3 n5 n1 κ̄(1, 3) = 3 κ̄(1, 5) = 5 (a) Graphs two independent cycles. n2 κ̄(2, 3) = 2 n4 κ̄(1, 2) = 1 κ̄(1, 4) = 4 κ̄(4, 5) = 6 n3 n5 n1 κ̄(1, 3) = 3 κ̄(3, 6) = 8 κ̄(1, 5) = 5 κ̄(1, 6) = 7 n6 (b) Graph with one independent cycle and two cycles that share only one edge. Consider an arbitrary distance function between unit vectors d : S 2 ×S 2 → R+ 0 , satisfying d(n1 , n2 ) = 0 ⇔ n1 = n2 . We say that d ∈ D, if, for all (n1 , n2 ) ∈ S 2 × S 2 , it satisfies the partial differential equation ∂d(n1 , n2 ) ∂d(n1 , n2 ) + S (n2 ) = 0. (IV.1) S (n1 ) ∂n1 ∂n2 Let us motivate the introduction of (IV-B). Given d ∈ D, it follows that, along along a trajectory x(·) of (III), (for brevity, we omit the time dependencies below) ˙ 1 , n2 ) = ∂d(n1 ,n2 ) T fn (t, n1 , ω1 ) + ∂d(n1 ,n2 ) T fn (t, n2 , ω2 ) d(n ∂n1 Fig. 3: Two graphs, one with two independent cycles and another with one independent cycle and two cycles that share only one edge. 1 0.5 I z n3 0 n1 n⋆ n2 -0.5 -1 -1 -1 0 -0.5 0 0.5 1 1 I I x y Fig. 4: Three unit vectors n1 , n2 and n3 in a 30◦ -cone associated to the unit vector n? . We now present a definition and some results that will prove useful in a later section. Definition 2: We say that a group of unit vectors n = (n1 , · · · , nN ) ∈ (S 2 )N belongs to an open (closed) α ∈ [0, π] ¯ cone, denoted by n ∈ C(α) (n ∈ C(α)), if there exists a unit ? 2 ?T vector n ∈ S such that n ni > cos(α) (n?T ni ≥ cos(α)) for all i ∈ N . The concept of open α-cone is exemplified In Fig. 4, with three unit vectors n1 , n2 and n3 contained in a 30◦ -cone formed by a unit vector n? . In fact, any group of unit vectors contained in the sphere surface region marked in bold is contained in a 30◦ -cone associated to the unit vector n? . The following propositions follow from Definition 2 and Proposition 27 in Appendix IX. Proposition 6: If n = (n1 , · · · , nN ) ∈ C(α), for some α ∈ [0, π2 ], then max(i,j)∈N 2 (1 − nTi nj ) < 1 − cos(2α). This proposition follows immediately after Proposition 27. Proposition 7: If, given n = (n1 , · · · , nN ) ∈ (S 2 )N , max(i,j)∈N 2 (1 − nTi nj ) ≤ 1 − cos( 23 α) holds for some ¯ α ∈ [0, π], then n ∈ C(α). A proof of Proposition 7 is found in Appendix IX. (III) ∂d(n1 ,n2 ) ∂n1 ∂n1 1 2 ∂d(n1 ,n2 ) ∂n2 + ω R S (n2 ) = ω R S (n1 )  T  T     ω R 0 1 (IV-B) 1 1 ,n2 ) 1 = . ⊗ I S (n1 ) ∂d(n T ∂n1 ω2 0 R2 −1 T 1 T 1 T 2 T 2 (IV.2) where we identify an incidence matrix [1 −1]T corresponding to an edge between unit vectors n1 and n2 . Motivated by (IV-B), let us define two functions. Firstly, consider M distance functions dk ∈ D, one for each edge k ∈ M. Define then ek : S 2 × S 2 7→ R3 as ∂dk (n1 , n2 ) ek (n1 , n2 ) = S (n1 ) , (IV.3) ∂n1 to be the error of edge k, and for each k ∈ M,. Define also e : (S 2 )N 7→ R3N as T  e(n) = eT1 (1 n, 1̄ n) · · · eTM (M n, M̄ n) . (IV.4) Define, also, D : (S 2 )N 7→ R≥0 as Xk=M D(n) = dk (k n, k̄ n), (IV.5) k=1 named, hereafter, total distance function in the network of unit vectors. Note that D(n) = 0 ⇔ ∃n? ∈ S 2 : n = (1N ⊗ n? ), which means Problem 1 is solved, if along a trajectory x(·) of (III), limt→∞ D(n(t)) = 0. It follows from (IV-B) that, if dk ∈ D for all k ∈ M, then, along a trajectory x(·) of (III), Ḋ(n(t)) = ω(t)RT (t)(B ⊗ I)e(n(t)). (IV.6) Notice that (IV-B) follows from (IV-B), which is the reason for imposing such condition. Now, the point in question is what types of distance functions satisfy (IV-B). In Proposition 28, in Appendix, we prove that a distance function d(·, ·) satisfies (IV-B), i.e. d ∈ D, if and only if there exits f ∈ C 1 ((0, 2), R>0 ), with lims→0 f (s) = 0, such that d(n1 , n2 ) = f (1 − nT1 n2 ). Physically, only distance functions that are functions of the angle between two unit vectors satisfy (IV-B) (where the angle between n1 and n2 can be defined as θ(n1 , n2 ) = arccos(nT1 n2 ), with θ : S 2 × S 2 7→ [0, π]). Moreover, distance functions that satisfy (IV-B) are invariant to rotations of their arguments, i.e., d(Rn1 , Rn2 ) = d(n1 , n2 ) for any R ∈ SO(3). This property guarantees that the proposed controllers can be implemented without the need of a common inertial orientation frame, a property that is verified later. To summarize, there are M distance functions dk ∈ D, one for each edge k ∈ M, and, therefore, there are M f 2 P 1̄ lim f (s) 2 R≥0 s!2− lim sup f 0 (s) 2 R≥0 s!2− lim sup f 0 (s) = 1 s!2− p lim f 0 (s) 2 s = 0 s!2− p lim f 0 (s) 2 s 6= 0 s!2− lim f (s) = 1 f 2 P1 f 2 P0 fk ∈ C 1 ((0, 2), R>0 ), one for each edge k ∈ M, such that dk (n1 , n2 ) = fk (1 − nT1 n2 ). For reasons that will become apparent later, we restrict the previous functions fk (·) to satisfy some more properties. Definition 3: Consider a function f ∈ C 2 ((0, 2), R>0 ), satisfying i) f 0 (s) > 0∀s ∈ (0, 2), ii) lims→0+ f (s) = 0, and iii) lim sups→0+ f 0 (s), f 00 (s) < ∞. Denote f2 := lims→2− f (s) and f00 := lims→0+ f 0 (s). We say • • • • 2 N ΩD : k nT k̄ n 6= −1 ∀fk ∈ P ∞ }, (IV.9) n ={n ∈ (S ) s!2− Fig. 5: Relation between properties of f (·) and the classes it belongs to. • where f 2 P 0̄ f f f f f ∈ P0 if f00 = 0 and f ∈ P0̄ if f00 6= 0, ¯ ∈ P ∞ if f2 = ∞, and f ∈ P ∞ if√f2 < ∞, ¯ ∈ P 0 if f ∈ P ∞ ∧ lims→2− f 0 (s)√2 − s = 0, ¯ ∈ P 0̄ if f ∈ P ∞ ∧ lims→2− f 0 (s) 2 − s 6= 0, ∈ P̄ if f (·) is of any of the previous classes. Ωen ={n ∈ (S 2 )N : k nT k̄ n 6= −1 ∀fk ∈ P 0̄ }, ∞ and where we emphasize that Ωen ⊆ ΩD ⇒ n , since fk ∈ P 0̄ fk ∈ P (see Fig. 5). These domains play a role later on, since D(·) is used in constructing a Lyapunov function, while e(·) is used in constructing the control law. As such, the Lyapunov function can be well defined, while the control law is not, while if the control law is well defined, so is the Lyapunov function. Consequently, it is important to guarantee that along trajectories of the closed-loop system, the control law is well defined. Additionally, notice that (IV-B) provides some insight on why we denote ek (·, ·) as edge error of edge k. Indeed, if fk ∈ P̄, ∀k ∈ M, it follows that ek (k n, k̄ n) = 0 implies that k n = ±k̄ n, i.e., it implies that the neighbors that form edge k are either synchronized or diametrically opposed. Moreover, if fk ∈ P̄ ∀k ∈ M, the distance between unit vectors is supremum when two unit vectors are diametrically opposed, i.e., for each k ∈ M, (denote Ω = {(n1 , n2 ) ∈ S 2 × S 2 : nT1 n2 = −1}) sup (n1 ,n2 )∈Ω Figure 6 illustrates the different classes introduced in Definition 3 while Fig. 5 illustrates how the properties that f (·) satisfies affects the classes it belongs to (see Remark 33 in Appendix). In [20], the notion of reshaping function is introduced, whose definition is within the same spirit as that of Definition 3. For the rest of this manuscript, we assume that, for each edge k ∈ M, there exists a function dk (n1 , n2 ) = fk (1 − nT1 n2 ) where fk ∈ P̄; in particular, fk0 (·) plays the role of an edge weight. In e.g. [11], [12], fk (s) = ak s and fk0 (s) = ak , for all k ∈ M (ak is the weight of edge k and it is denoted by aij in [11], where (i, j) = κ̄−1 (k)). As such, (IV-B) and (IV-B) can be rewritten as D : ΩD n 7→ R≥0 (see (IV-B)) Xk=M D(n) = fk (1 − k nT k̄ n) (IV.7) k=1 and ek : {(n1 , n2 ) ∈ S 2 × S 2 : nT1 n2 6= −1 if fk ∈ P 0̄ } 7→ R≥0 as ∂fk (1−nT 1 n2 ) ∂n1 = fk0 (1 − nT1 n2 )S (n1 ) n2 , (IV.8) p ⇒ kek (n1 , n2 )k = fk0 (s) s(2 − s)|s=1−nT1 n2 , ek (n1 , n2 ) = S (n1 ) respectively. Note that ek (n1 , n2 ) is well defined for all (n1 , n2 ) ∈ S 2 × S 2 if fk ∈ P 0 ,p and if fk ∈ P 0̄ , note that S(n1 )n2 0 lim ek (n1 , n2 ) = lim fk (s) s(2 − s) lim kS(n 1 )n2 k n2 →n1 s→2− n2 →n1 does not exist. Note that the total distance function (IV-B) depends on fk (·), for all k ∈ M, while (IV-B) depends on fk0 (·), for all k ∈ M. As such, a distance function may or may not be defined when two unit vectors are diametrically ¯ opposed, depending on whether f ∈ P ∞ or f ∈ P ∞ ; similarly, an edge error may or may not be defined when two unit vectors are diametrically opposed, depending on whether f ∈ P 0 or f ∈ P 0̄ . Thus, the domains of (IV-B) and of (IV-B) depend on the classes fk (·) belongs to, for all e 3N k ∈ M. In particular, D : ΩD , n 7→ R≥0 and e : Ωn 7→ R dk (n1 , n2 ) = fk (1 − nT1 n2 ) = lim fk (s) =: dmax . k sup s→2 (n1 ,n2 )∈Ω For convenience, denote dmin := min dmax , k (IV.10) k∈M which plays an important role in this and the following sections. Proposition 8: Consider the total edge error in (IV-B) and the total distance function in (IV-B). Consider Ω0n : R≥0 ⇒ 0 D 0 ΩD n as Ωn (D̄) = {n ∈ Ωn : D(n) ≤ D̄}, where Ωn (D̄) is compact for all positive D̄ (where ⇒ refers to a set-valued function). Then, it follows that ∀D̄ < dmin , max ke(n)k < ∞, 0 n∈Ωn (D̄) and that there are no diametrically opposed neighbors, i.e., |{q ∈ M : ∀n ∈ Ω0n (D̄), q nT q̄ n = −1}| = 0. If fk ∈ P 0 for all k ∈ M, it follows that maxn∈Ωen ke(n)k = maxn∈(S 2 )N ke(n)k < ∞; moreover, given D̄ < pdmin for some p ∈ M, it follows that there are at most p − 1 diametrically opposed neighbors, i.e., |{q ∈ M : ∀n ∈ Ω0n (D̄), q nT q̄ n = −1}| ≤ p − 1. Proof: Recall Definition 3, (IV-B) and (IV-B). It follows that e(·) and D(·) grow unbounded only if two neighbors are diametrically opposed (however, this is not sufficient). Recall also that Ωen ⊆ ΩD n , meaning that e(·) can grow unbounded while D(·) remains bounded. Finally, notice that, if n ∈ (S 2 )N is such that there are q diametrically opposed neighbors, it follows that D(n) ≥ qdmin . Consider then a D̄ < dmin ≤ ∞. Then, for all n ∈ Ω0n (D̄), it follows that D(n) ≤ D̄ ⇒ ∀k ∈ M, k nT k̄ n ≥ 1 − fk−1 (D̄) > −1, which means that two neighbors are not arbitrarily close to a configuration where they are diametrically opposed and, therefore, maxn∈Ω0n (D̄) ke(n)k is bounded. For the second part of the Proposition, consider that fk ∈ P 0 for all k ∈ M. 2 N 0 Then Ωen = ΩD n = (S ) , which means maxn∈Ωn (D̄) ke(n)k f ∈ P 0 and f ∈ P0 Fig. 6: Four functions belonging to different classes as introduced in Definition 3: (from top to bottom in legend) f (s) = s, f (s) = π −2 arccos2 (1 − s), f (s) =ptan2 (0.5 arccos(1 − s)) and f (s) = 0.25( s(2 − s)(s − 1) + arccos(1 − s)). and maxn∈Ω0n (D̄) D(n) are bounded (since the domain is compact, and the functions are continuous). Consider then a = 0a D̄ < pdmin ≤ ∞. Since D(n) ≥ qdmin , then, if p ∈min M and 0 1 2 there are q diametrically opposed neighbors in n ∈ (S 2 )N , it follows that |{q ∈ M : ∀n ∈ Ω0n (D̄), q nT q̄ n = −1}| ≤ p−1. all j ∈ Ni . P P kek (·, ·)k ≤ kek (·, ·)k ≤ k∈M0 ⊆M k∈M √Notice that M ke(·)k, and, therefore, for any Ri ∈ SO(3), and for all x ∈ Ωen × R3N , T T 0 kTcl i ((Ri ni1 , · · · , Ri ni|N | ), ωi )k ≤ σ kωi k + √ i M ke(n)k(IV.13) , a relation to be used later. We can now present the complete control law Tcl : R≥0 × Ωen × R3N 7→ R3N ,   T1 ((RT1 (t)n11 , · · · , RT1 n1|N | ), ω1 ) 1   .. Tcl (t, x) =   . TN ((RTN (t)nN1 , · · · , RTN nN|N | ), ωN ) N C. Solution to Problem 1 = −[σ T (ω1 ) · · · σ T (ωN )]T − RT (t)(B ⊗ I)e(n), (IV.14) In this section, we present the controllers for the torques of each agent i. For each agent i, we design a controller that is a function of |Ni | + 1 measurements: |Ni | measurements corresponding to the distance measurements between agent i and its |Ni | neighbors, and 1 measurement corresponding to the body frame angular velocity. More specifically, we assume each agent i measures RTi (t)nj (t) = RTi (t)Rj (t)n̄j , at each time instant t ≥ 0, and for each j ∈ Ni ; physically, this means that agent i knows n̄j (the constant unit vector that it is required to synchronize with), and that it can measure the projection of this unit vector on its orientation frame; each agent i must also measure ωi (t), which does not require an inertial reference frame. For convenience denote Ni = {i1 , · · · , i|Ni | }, and, given n̄i ∈ S 2 , denote Ωni = {(ni1 , · · · , ni|N | ) ∈ S 2|Ni | : n̄Ti nil 6= −1, ∀l ∈ i {1, · · · , |Ni |} ∧ fκ(i,il ) ∈ P 0̄ } which provides the domain where the control law for agent i is well defined (recall that if fk ∈ P 0̄ , for some k ∈ M, then (IV-B) is not defined when two unit vectors are diametrically opposed). We then propose, for each agent i ∈ N , the following decentralized T T control law Tcl i : (νi , ωi ) = ((Ri ni1 , · · · , Ri ni|N | ), ωi ) ∈ i 3 3 Ωni × R 7→ R Xl=|Ni |  Tcl eκ(i,il ) n̄i , RTi nil (IV.11) , i (νi , ωi ) = −σ(ωi ) − l=1 with σ ∈ Σ (see Definition 5 in Appendix). The timed control laws for each agent i ∈ N are then Ti : R≥0 7→ R3 as where R(·) = R1 (·) ⊕ · · · ⊕ RN (·) (see Notation). For the remainder of this paper, we dedicate efforts in studying the equilibria configurations induced by this control law (for different types of graphs), their stability, and what is the effect of the chosen distance functions. Notice that (IV-C) is defined on R≥0 ×Ωen ×R3N . As such, when fk ∈ P 0 ∀k ∈ M, Ωen = (S 2 )N , and the analysis is simplified; when, however, ∃k ∈ M : fk ∈ P 0̄ , Ωen ⊂ (S 2 )N (where Ωen is open), and it is necessary to guarantee that a trajectory x(·) never approaches the boundary of Ωen . D. Lyapunov Function In addition to the total distance function of the network (IV-B), let us also define the total rotational kinetic energy of the network, as H : R3N 7→ R≥0 , where 1 Xi=N T ωi Ji ωi (IV.15) H(ω) = i=1 2 T T T Ti (t) = Tcl i ((Ri (t)nj1 (t), · · · , Ri (t)nj|N | (t)), ωi (t)).(IV.12) V (x) = D(n) + H(ω), i The proposed torque control law exhibits the following properties. The controller function in (IV-C) is decentralized in the sense that it does not depend on the measurement of the global state x(·). Also, (IV-C) can be implemented without the knowledge of an inertial reference, since measuring yli (t) := RTi (t)Ril (t)n̄il at every time instant t ≥ 0 and for all l ∈ {1, · · · , |Ni |} only requires the measurement of the projection of n̄il in agent’s i body orientation frame; i while y|N (t) := ωi (t) is also measured in agent’s i body i |+1 orientation frame. Finally, notice that kTi (·)k ≤ σ max + 0 |Ni | maxj∈Ni sup0<s<2 fκ(i,j) (s). As such, the proposed control law, for each agent i, can be implemented with bounded actuation provided that σ max < ∞ and that fκ(i,j) ∈ P 0 for T fx (·, x, T) = ∂H(ω) fω (ω, T) = and which satisfies ∂H(ω) ∂x ∂ω Pi=N T T J f ω (ω , T ) = ω T, for all (ω, T) ∈ R6N . i ωi i i i i=1 Combining (IV-B) and (IV-D), consider then the Lyapunov 3N function V : ΩD 7→ R≥0 , n × R and the function W : R 3N (IV.16) 7→ R≥0 defined as T ∂V (x) fx (·, x, Tcl (·, x)) ∂x (IV-B) = − ω T RT (·)(B ⊗ I)e(n) − ω T Tcl (·, x) Xi=N (IV-C) = ωiT σ(ωi ), (IV.17) W (ω) = − i=1 and it follows that, along a trajectory x(·) of ẋ(t) = fx (t, x(t), Tcl (t, x)), V̇ (x(t)) = −W (ω(t)) ≤ 0, ∀t ≥ 0. Note that, for every i ∈ N ,   (III) 2 1 kfωi (ωi , Tcl Tcl i (·))k ≤ λmin (Ji ) i (·) + λmax (Ji ) kωi k   √ (IV-C) 2 ≤ λmin1(Ji ) σ 0 kωi k + M ke(n)k + λmax (Ji ) kωi k =: fω∞i (x).(IV.18) Moreover, along a trajectory x(·), (for brevity, below, we omit the time dependency of the state) T ∂W (x) Ẇ (ω) = fx (t, x, Tcl (t, x)) ∂x T Xi=N  ∂σ(ωi ) T = σ(ωi ) + ωi fωi (ωi , Tcl i (·)), 1=1 ∂ωi for which it follows that ∀t ≥ 0 Xi=N T |Ẇ (ω(t))| ≤ (σs + σ 0 ) kωi (t)kfω∞i (x(t)).(IV.19) 1=1 Along the same trajectory, it also follows that, for every i ∈ N (we again omit the time dependency) ω̈i = −Ji−1 (S (ω̇i ) Ji ωi + S (ωi ) Ji ω̇i + Dσ(ωi )ω̇i ) + P 0 Ji−1 RTi S (ni ) (f (·)I − f 00 (·)nj nTi ) S (nj ) (Ri ωi − Rj ωj ).(IV.20) j∈Ni It follows from (IV-D), (IV-D) and (IV-D) that if supt≥0 ke(n(t))k < ∞ and supt≥0 kωi (t)k < ∞, then supt≥0 |Ẇ (ω(t))| < ∞ and supt≥0 kω̈i (t)k < ∞; this in turn implies that W (ω(·)) and ω̇i (·) are uniformly continuous, which plays a role in proving that limt→∞ W (ω(t)) = 0 and that limt→∞ ω̇i (t) = 0. Proposition 9: Consider the vector field (III), the control law (IV-C), and a trajectory x(·) of ẋ(t) = 3N : fx (t, x(t), Tcl (t, x(t))). If x(0) ∈ Ω0x = {x ∈ ΩD n × R min V (x) < d }, then, along the trajectory x(·), limt→∞ (B ⊗ I)e(n(t)) = 0 and limt→∞ ω(t) = 0. We refer to the proof of Proposition 10, which provides a result for a more general control law than that in (IV-C), and which is described in the next section. E. Constrained Torque A natural constraint in a physical system is to require the torque provided by agent i to be orthogonal to n̄i . In satellites, thrusters that provide torque along n̄i might be unavailable; also, controlling the space orthogonal to n̄i can be left as an additional degree of freedom, in order to accomplish some other control objectives. However, the control laws proposed in (IV-C) require full torque actuation, in particular, (IV-C) requires each agent to provide torque on the plane orthogonal to n̄i . Indeed, since nT1 ek (n1 , ·) = 0, ∀n1 ∈ S 2 , ∀k ∈ M (see (IV-B)), it follows that, for all i ∈ N, T n̄Ti Tcl i (·, ωi ) = n̄i σ(ωi ), which is not necessarily 0. In short, previously, we provided control laws Tcl : Ωni × R3 7→ R3 which require full i torque by each agent i ∈ N , and in this section we provide constrained control laws T̄cl : Ωni × R3 7→ {z ∈ R3 : i T z n̄i = 0}, i.e., control laws which do not require torque along n̄i . Let us anticipate a future result by announcing that the constrained control law can only be used by agent i ∈ N when the unit vector to be synchronized by agent i ∈ N , namely n̄i , is a principal axis of that agent (i.e., when n̄i is an eigenvector of Ji ). Consider then T̄cl i : (νi , ωi ) = ((RTi ni1 , · · · , RTi ni|N | ), ωi ) ∈ Ωni × R3 7→ {z ∈ R3 : i zT n̄i = 0} defined as cl T̄cl i (νi , ωi ) = Π (n̄i ) Ti (νi , ωi ) X  l=|Ni | (IV-C) = −σ(Π (n̄i ) ωi ) − eκ(i,il ) n̄i , RTi nil (IV.21) . l=1 Additionally, consider a partition of N , i.e., L̄∪L = N with L̄∩L = ∅; where L̄ is a subset (possibly empty) of the agents whose unit vector to synchronize is an eigenvector of their moment of inertia, i.e., L̄ ⊆ {i ∈ N : ∃λi s.t. Ji n̄i = λi n̄i }. Then we propose the complete control law T̄cl : (t, x) ∈ R≥0 × (Ωen × R3N 7→ R3N defined as ( (e ⊗ 1 ) T̄ (t, x) = T̄ ((R (t)n , · · · , R n ), ω ) ∀i ∈ L̄, (IV.22) (e ⊗ 1 ) T̄ (t, x) = T ((R (t)n , · · · , R n ), ω ) ∀i ∈ L, T i 3 i 3 T cl cl cl i T i i1 T i cl i T i i1 T i i|N | i i i|N | i i i.e., for agents whose unit vector to synchronize is a principal axis, either control law (IV-C) or (IV-E) is chosen, and, for all other agents, control law (IV-C) is chosen. As such, agents whose unit vector to synchronize is a principal axis have an option between using full torque control or constrained torque control. The disadvantage with the control law in (IV-E) is that, along a trajectory of the closed-loop system, and for all i ∈ L̄, limt→∞ n̄Ti ωi (t) is not guaranteed to exist and be 0; i.e., an agent that opts for (IV-E) can asymptotically spin, with non-zero angular velocity, around n̄i (nonetheless, we can guarantee that supt≥0 kωi (t)k < ∞ ⇒ supt≥0 |n̄Ti ωi (t)| < ∞, i.e., if an agent applies (IV-E) it never spins infinitely fast around its principal axis n̄i ). Since kΠ (n̄i ) ωi k ≤ kωi k, ∀n̄i ∈ S 2 , ωi ∈ R3 , it follows ∞ ∞ that kfωi (ωi , T̄cl i (·))k ≤ fωi (x), with fωi (·) as defined in (IV-D). Similarly to (IV-D), denote W̄ : R3N 7→ R≥0 as T ∂V (x) W̄ (ω) = − fx (·, x, T̄cl (t, x)) ∂x X X = ωiT σ(ωi ) + ωjT Π (n̄j ) σ(ωj ), j∈L̄ i∈L and it follows that, along a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x)), V̇ (x(t)) = −W̄ (ω(t)) ≤ 0 ∀t ≥ 0. Moreover, along a trajectory x(·), (for brevity, below, we omit the time dependency of the state) T ˙ (ω) = ∂ W̄ (x) f (t, x, T̄cl (t, x)) ⇒ W̄ x ∂x i=N X T ˙ (ω(t))| ≤ ⇒ |W̄ (σs + σ 0 ) kωi (t)kfω∞i (x(t)). (IV.23) 1=1 Proposition 10: Consider the vector field (III), the control law (IV-E), and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If x(0) ∈ Ω0x = {x ∈ ΩD n × R3N : V (x) < dmin }, then limt→∞ (B ⊗ I)e(n(t)) = 0, limt→∞ ωi (t) = 0 for i ∈ L and limt→∞ Π (n̄j ) ωj (t) = 0 for j ∈ L̄. Moreover, supt≥0 |n̄Tj ωj (t)| < ∞ for j ∈ L̄. Proof: For brevity, we say f : R≥0 7→ Rn is bounded, if supt≥0 kf (t)k < ∞; we say f : R≥0 7→ Rn converges to a constant, if ∃f ∞ ∈ Rn : limt→∞ f (t) = f ∞ . Let us provide a brief summary for the proof. First, we prove that, along a trajectory x(·), kω(·)k and ke(n(·))k are bounded. This, in turn, guarantees uniform continuity of V̇ (x(·)) and of ω̇(·). And finally, since both V (x(·)) and ω(·) converge to a constant, we invoke Barbalat’s lemma (see [26], Lemma 4.2) to conclude that e(n(·)) converges to the null space of B ⊗ I. Recall then the functions in (IV-D) and (IV-D). Since V̇ (x(·)) ≤ −W̄ (ω(·)) ≤ 0, it follows that V (x(·)) ≤ V (x(0)) < dmin . Therefore D(n(·)) < dmin and H(ω(·)) < dmin . From D(n(·)) < dmin , it follows, with the help of Proposition 8, that e(n(·)) is bounded; while from H(ω(·)) < dmin , it follows that ω(·) is also bounded. From boundedness of e(n(·)) and ω(·), it follows that T̄cl (·, x(·)) is bounded (see (IV-E) and (IV-C)); that kω̇i (·)k ≤ fω∞i (x(·)) is bounded (see (IV-D)); that |V̈ (x(·))| = |Ẇ (ω(·))| is bounded (see (IV-E)); and, finally, that ω̈i (·) is bounded (see (IV-D)). The previous conclusions imply that V̇ (x(·)) and that ω̇(·) are both uniformly continuous. Since V (·) ≥ 0 and V̇ (x(·)) ≤ −W (ω(·)) ≤ 0, it follows that V (x(·)) converges to a constant; by Barbalat’s lemma, uniform continuity of V̇ (x(·)) then implies that V̇ (x(·)) = −W (ω(·)) converges to 0. As such, it follows from (IV-D), that ωi (·) converges to 0, for all i ∈ L, while Π (n̄j ) ωj (·) converges to 0, for all j ∈ L̄; also, notice that (IV.24) lim Π (n̄j ) ωj (t) = 0 ⇒ lim (ωj (t) − n̄j (n̄Tj ωj (t))) = 0. t→∞ t→∞ Let us now study agents in L and L̄ separately. Also, for convenience, and with some abuse of notation, denote T cl cl Tcl i (t) = (ei ⊗ 13 ) T̄ (t, x(t)), for i ∈ L, and T̄j (t) = T cl (ej ⊗13 ) T̄ (t, x(t)), for j ∈ L̄. For i ∈ L (for which (IV-C) is the chosen control law), and again by Barbalat’s lemma, convergence of ωi (·) to 0 and uniform continuity of ω̇i (·) imply that ω̇i (·) = fωi (ωi (·), Tcl i (·)) converges to 0; since ωi (·) converges to 0, so does Tcl i (·, x(·)) (see III). Now, for j ∈ L̄ (for which (IV-E) is the chosen control law), and once again by Barbalat’s lemma, convergence of Π (n̄j ) ωj (·) to d 0 and uniform continuity of dt (Π (n̄j ) ω(t)) = Π (n̄j ) ω̇(t) implies that Π (n̄j ) ω̇(·) converges to 0, and therefore lim Π (n̄j ) ω̇j (t) = 0 ⇒ lim (ω̇j (t) − n̄j (n̄Tj ω̇j (t))) = 0, (IV.25) t→∞ t→∞ Now, recall (III) where Jj ω̇j (t) = −S (ωj (t)) Jj ωj (t) + T̄cl j (t), and, from (IV-E) and (IV-E), it follows that  lim Jj n̄j (n̄Tj ω̇j (t)) + S (n̄j ) Jj n̄j (n̄Ti ωj (t))2 − T̄cl j (t) = 0 t→∞ Jj n̄j =λj n̄j ⇒  lim n̄j (n̄Tj ω̇j (t)) − T̄cl j (t) = 0 (IV.26) t→∞ If we take the inner product of (IV-E) with n̄j , and T since T̄cl j (·) ⊥ n̄j , it follows that limt→∞ (n̄j ω̇i (t)) = T cl limt→∞ n̄j T̄j (·) = 0. As such, it follows from (IV-E) that T̄cl ∈ L̄. Now to j (·) converges to 0 for all j summarize, recall that, for all i ∈ L, both ωi (·) and Tcl x(·)) converge to 0, which implies, from (IV-C), i (·, P l=|Ni | eκ(i,il ) n̄i , Ri (·)T nil (·) converges to 0. On that l=1 the other hand, for all j ∈ L̄, both Π (n̄j ) ωj (·) and T̄cl x(·)) converge to zero, whichimplies, from (IV-E), j (·, P l=|Nj | that eκ(j,jl ) n̄i , Rj (·)T njl (·) converges to 0. All l=1 together, it implies that (B ⊗ I)e(n(·)) converges to 0. Finally, supt≥0 |n̄Tj ωj (t)| < ∞ since ω(·) is bounded (H(ω(·)) < dmin ). Notice that dmin , defined in (IV-B), is a design parameter, and therefore, the domain of attraction in Proposition 10 can be made larger by increasing this parameter. More specifically, dmin increases the domain of attraction in the state space related to ω, which is clearer in the next corollaries. Corollary 11: Proposition 9 holds if r := D(n(0)) < 1 − r. dmin H(ω(0)) dmin < 1 and Proof: If the Corollary conditions hold, then V (x(0)) = D(n(0)) + H(ω(0)) < dmin − H(ω(0)) + H(ω(0)) = dmin . Corollary 11 states that if the total kinetic energy is small w.r.t. dmin , and if the total distance in the network is small w.r.t. 1 − r, asymptotic synchronization is guaranteed. < 1 and Corollary 12: Proposition 9 holds if r := H(ω(0)) dmin if 1−r dk (k n(0), k̄ n(0)) < , ∀k ∈ M. (IV.27) min d M If (12) holds, then D(n(0)) = P Proof: d ( n(0), n(0)) ≤ M max d ( n(0), n(0)) < k̄ k∈M k k k̄ k∈L k k dmin (1 − r), in which case, Corollary 11 holds. Corollary 12 states that if the total kinetic energy is small, and if all neighbors are close, then asymptotic synchronization is guaranteed. Corollary 13: Proposition 9 holds if r := if   n(0) ∈ C 1 2 H(ω(0)) dmin arccos 1 − min fk−1 dmin 1−r M  < 1 and  k∈M , (IV.28) where d = mink∈M lims→2 fk (s). If fk ∈ P for all k ∈ M, then dmin = ∞ and (13) reduces to n(0) ∈ C( π2 ). ∞ min Proof: By invoking Proposition 6, it follows that (13) implies that dk (k n(0), k̄ n(0)) ≤ fk (min fl−1 (dmin 1−r M )) ≤ l∈M dmin 1−r M for all k ∈ M, and therefore (12) holds. Corollary 13 states that if the total kinetic energy is small, and if all neighbors are initially contained in a small cone, then synchronization is guaranteed. Moreover, if dmin = ∞ and if all neighbors are initially contained in an open π2 -cone, then synchronization is also guaranteed. Proposition 14: Consider the vector field (III), the control law (IV-E), and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If fk ∈ P 0 for all k ∈ M, then for all x(0) ∈ (S 2 )N × R3N , limt→∞ (B ⊗ I)e(n(t)) = 0, limt→∞ ωi (t) = 0 for i ∈ L and limt→∞ Π (n̄j ) ωj (t) = 0 for j ∈ L̄; additionally, if x(0) ∈ Ω0x = {x ∈ (S 2 )N × R3N : ∃p ∈ M, V (x) < pdmin }, then no more than p − 1 neighbors are ever diametrically opposed, i.e., supt≥0 |{q ∈ M : T q n (t)q̄ n(t) = −1}| ≤ p − 1. Proof: Notice that if fk ∈ P 0 for all k ∈ M then 2 N Ωen = ΩD n = (S ) , which is a compact set. Since e(·) is continuous in Ωen , it follows that maxn∈Ωen ke(n)k < ∞, and, therefore, ke(n(·))k is bounded regardless of the trajectory x(·). To conclude that limt→∞ (B ⊗ I)e(n(t)) = 0, limt→∞ ωi (t) = 0 for i ∈ L and limt→∞ Π (n̄j ) ωj (t) = 0 for j ∈ L̄, it suffices to follow the same steps as in the proof of Proposition 10. For the final statement in the Proposition, consider x(0) ∈ Ω0x = {x ∈ Ωx : ∃p ∈ M, V (x) < pdmin }. Since, along a trajectory x(·), D(n(·)) ≤ V (x(·)) ≤ V (x(0)) < pdmin , it suffices to invoke Proposition 8, with D̄ = V (x(0)), and the Proposition’s conclusion follows. Denote fxcl (t, x) := fx (t, x, Tcl (t, x)) as the closed-loop vector field. Note then that Ωeqx = {x ∈ (S 2 )N × R3N : ∀t ≥ 0, fxcl (t, x) = 0} provides the set of all equilibrium points, and moreover {x ∈ (S 2 )N × R3N : (B ⊗ I)e(n) = 0, ωi = 0 for i ∈ L, Π (n̄j ) ωj = 0 for j ∈ L̄} ⊆ Ωeqx . As such, Propositions 10 and 14 imply that, under the respective Propositions’ conditions, a trajectory x(·) converges to the set of equilibrium points. Note also that [(1N ⊗n? )T ·]T ∈ Ωeqx for all n? ∈ S 2 , i.e., all configurations where all agents are synchronized are equilibrium configurations (agents are synchronized and not moving, or agents are synchronized and spinning around their principal axis). Finally, notice that since e(Sn) = e(n) for all S ∈ {IN ⊗ R ∈ R3N ×3N : R ∈ SO(3)} and for all n ∈ Ωen , it follows that Ωeqx has geometric isomerism [14]; i.e. [nT ·] ∈ Ωeqx ⇒ [SnT ·] ∈ Ωeqx , which means that for every equilibrium configuration, there exits infinite other equilibria configurations which are the same up to a rotation. In Section V, for tree graphs, we show that Ωeqx is composed of configurations where agents are either synchronized or diametrically opposed; while in Section VI, for graphs discussed in Propositions 4 and 5, we show that Ωeqx is composed of configurations where agents belong to a common plane. In light of these comments, it follows that Corollaries 11-13 provide conditions for when a trajectory is guaranteed to converge to a configuration where all agents are synchronized, and not any other configuration in Ωeqx ; in particular, if the initial kinetic energy is too large with respect to dmin , the agents may escape to other equilibria configurations other than synchronized ones. Remark 15: Consider the closed-loop vector field fxcl (t, x) = fx (t, x, Tcl (t, x)). Additionally, consider the alternative state x̃(t) = diag(I3N , R(t))x(t) ⇔ x(t) = diag(I3N , RT (t))x̃(t), which evolves according to ˙ x̃(t) = diag(0, Ṙ(t))x(t)+ diag(I3N , R(t))fxcl (t, x(t))|x(t)=diag(I3N ,RT (t))x̃(t) = diag(I3N , R(t))fxcl (t, diag(I3N , RT (t))x̃(t)) =:fx̃cl (t, x̃(t)) The difference between x̃(·) and x(·) is that all quantities in x̃(·) are expressed in the inertial reference frame, while in x(·) the angular velocities are expressed in the body reference frame of each agent. If Ji = ji I for all i ∈ N , then for any S ∈ {R ⊗ I2N ∈ R6N ×6N : R ∈ SO(3)}, it can be verified that fx̃cl (·, Sx̃) = Sfx̃cl (·, x̃), which implies that the closed-loop dynamics of the agents are invariant to rotations; i.e., given two initial conditions x̃1 (0) and x̃2 (0) satisfying x̃1 (0) = Sx̃2 (0), it follows that x̃1 (t) = Sx̃2 (t) for all t ≥ 0. This is the case, because when Ji = ji I, then (III) reduces to a second order integrator. A similar result has been reported in [14], where the agents are mass points (i.e., agents without moment of inertia). However, in our framework, where in general Ji 6= ji I for some i ∈ N , invariance of the closed-loop dynamics to rotations does not hold due to the term S (ωi ) Ji ωi in (III). V. T REE G RAPHS Let us focus first on static tree graphs. For these graphs, Proposition 2 states that N (B ⊗I) = {0}. In this section, we quantify the domain of attraction for synchronization to be asymptotically reached, i.e., we construct a domain Ω0x such that if x(0) ∈ Ω0x , then all trajectories of (III) under control law (IV-E) asymptotically converge to a configuration where all unit vectors are synchronized. Later, we construct another Ω0x , for graphs other than tree graphs, which is smaller in size, and we quantify how much smaller it is. Theorem 16: Consider a static tree graph, the vector field (III), the control law (IV-E), and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If x(0) ∈ Ω0x = {x ∈ 3N ΩD : V (x) < dmin } then synchronization is asympn × R totically reached, i.e., limt→∞ (ni (t) − nj (t)) = 0, for all (i, j) ∈ N 2 . If fk ∈ P ∞ for all k ∈ M, then dmin = ∞ and synchronization is asymptotically reached for almost all initial conditions in (S 2 )N × R3N . Proof: Under the Theorem’s conditions, we can invoke Proposition 10 to conclude that limt→∞ (B ⊗ I)e(n(t)) = 0 and Proposition 8 to conclude that two neighbors are never arbitrarily close to a configuration where they are diametrically opposed. Since N (B ⊗ I) = {0}, it follows that limt→∞ (B ⊗ I)e(n(t)) ⇒ limt→∞ e(n(t)) = 0. As such, and since two neighbors are never arbitrarily close to a configuration where they are diametrically opposed, it follows that all unit vectors converge to one another. For the second part of the Theorem, notice that, if dmin = ∞, 3N 3N \{(S 2 )N × R3N } = . Since ΩD then Ω0x = ΩD n × R n × R 2 N 3N ∞ T {x ∈ (S ) × R : ∀fk ∈ P , k n k̄ n = −1} is a set of zero measure in the space of all initial conditions, i.e. (S 2 )N ×R3N , synchronization for almost all initial conditions is guaranteed when dmin = ∞. Notice that in Theorem 16, increasing dmin enlarges the region of stability, and it yields the almost global stability result for dmin = ∞. However, a similar result for other graphs, than tree graphs, is not presented in this manuscript. Example 1: Consider the distance functions  α d(n1 , n2 ) = f (1 − nT1 n2 ) where f (s) = a arccos(1−s) , with a > 0 π max ∞ ¯ and α ≥ 2. For these, d = a, f ∈ P and f ∈ P 0̄ ; also f ∈ P0 . Suppose fk (s) = f (s) for all k ∈ M, and for some a and α. Invoking Corollary 13, it follows that if r := H(ω(0)) < 1 and a  1! π 1−r α n(0) ∈ C 2 M then Theorem’s 16 conclusions follow. Notice that by increasing a convergence for arbitrary initial values of rotational kinetic energy can be guaranteed; on the other hand, by increasing α we can increase the size of the cone where  the agents need to initially be contained (up to a cone C π2 ). We emphasize that the domain of attraction in Theorem 16 is however larger, in the sense that there are more initial conditions which do not satisfy the previous conditions, but for which synchronization is still guaranteed. Example 2: Consider the distance function d(n1 , n2 ) = f (1 − nT1 n2 ) where f (s) = 2 a tan2 (0.5 arccos(1 − s)), for which dmax = ∞ and f ∈ P ∞ (and therefore f ∈ P 0̄ ). If fk (s) = f (s) for all k ∈ M, then convergence to a synchronized network in a tree graph is guaranteed for almost all initial conditions (see Theorem 16). Theorem 17: Consider a static tree graph, the vector fields (III), the control law (IV-E), and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If fk ∈ P 0 for all k ∈ M, 3N : ∃p ∈ M, V (x) < pdmin } and x(0) ∈ Ω0x = {x ∈ ΩD n ×R then the group of unit vectors converges to a configuration where no more than p − 1 neighboring unit vectors are diametrically opposed. Proof: Under the Theorem’s conditions, Proposition 14 can be invoked. Additionally, since N (B ⊗ I) = {0} in a tree graph, it follows that limt→∞ (B ⊗ I)e(n(t)) ⇒ limt→∞ e(n(t)) = 0, which implies that all neighbors are either synchronized or diametrically opposed. Since, by Proposition 14, there are at most p−1 diametrically opposed neighboring unit vectors, it follows that the group of unit vectors converges to a configuration where no more than p − 1 neighboring unit vectors are diametrically opposed. Example 3: Consider the distance α functions d(n1 , n2 ) = f (1 − nT1 n2 ) where f (s) = a 2s for positive a and α ≥ 1. For these functions, dmax = a, f ∈ P 0 , and f ∈ P0 if α > 1 and f ∈ P0̄ if α = 1. Suppose fk (s) = f (s) for all k ∈ M, and for some a and α. It follows that if r := H(ω(0)) <p a (for some p ∈ M) and   1 !! p−r α 1 n(0) ∈ C arccos 1 − 2 2 M then Theorem’s 17 conditions are fulfilled and its conclusions follow. Similarly to example 1, by increasing a convergence for arbitrary initial values of rotational kinetic energy can be guaranteed; on the other hand, by increasing α we can increase the size of the cone where the  agents need to initially be contained (up to a cone C π2 ). The main difference between this function and that in Example 1 is that, in this example, f ∈ P 0 . Under Theorem’s 17 conditions, the group of agents can converge to configurations where one or more pairs of neighbors are diametrically opposed. However, it does not provide any insight on whether these equilibrium configurations are stable or unstable. For tree graphs, a configuration where p pairs of neighbors are diametrically opposed can be shown to be unstable. For proving this statement, it suffices to find initial conditions which are arbitrarily close to an equilibrium where p pairs of neighbors are diametrically opposed, but for which convergence to a configuration where at most p − 1 pairs of neighbors are diametrically opposed is guaranteed; this reasoning implies that all configurations where neighbors are diametrically opposed are unstable, and therefore, only synchronized configurations are stable. A similar result on synchronization in SO(3) is found in [20], and of synchronization on the sphere is found in [11]. Also, Theorems 16 and 17 do not provide any insight on whether the limits limt→∞ ni (t) (for all i ∈ N ) exist; i.e, even if the unit vectors synchronize, it is not known whether those unit vectors converge to a constant unit vector or a time-varying unit vector. Some preliminaries results are found in XIV. VI. N ON -T REE G RAPHS In this section, we study the equilibria configuration induced by some more general, yet specific, network graphs. Also, we study the local stability properties of the synchronized configuration for arbitrary graphs. We first give the following definition. Definition 4: Given n vectors xi ∈ R3 , for i ∈ {1, · · · , n}, we say that {xi }i∈{1,··· ,n} belong to a common plane if there exists a unit vector ν ∈ S 2 such that Π (ν) xi = xi for all i ∈ {1, · · · , n}. We say that {xi }i∈{1,··· ,n} belong to a common unique plane if there exists a single pair of unit vectors (+ν, −ν), with ν ∈ S 2 such that Π (ν) xi = xi for all i ∈ {1, · · · , n} Let us first discuss a property that is exploited later in this section. Proposition 18: Consider n1 , n2 ∈ S 2 . If S (n1 ) n2 6= 0, then n1 and n2 belong a common unique plane. S(n1 )n2 ∈ S 2 , which is well Proof: Consider ν = kS(n 1 )n2 k defined since S (n1 ) n2 6= 0. It follows that Π (ν) n1 = n1 and that Π (ν) n2 = n2 , which implies that n1 and n2 belong a common plane. Moreover, n1 and n2 belong a common unique plane, since n1 and n2 span a two dimensional space. Proposition 19: Consider n1 , . . . , nn ∈ S 2 , with |nTi ni+1 | = 6 1 for all i = {1, · · · , n − 1}. If S (nn−1 ) nn S (n1 ) n2 = ··· = ± , ± kS (n1 ) n2 k kS (nn−1 ) nn k then all unit vectors belong to a common unique plane. Proof: Consider n = 3. Since |nT1 n2 | 6= 1 and |n n3 | = 6 1, it follows that kS (n1 ) n2 k = 6 0 and kS (n2 ) n3 k = 6 0. Additionally, by assumption, S (n1 ) n2 S (n2 ) n3 ± =± , (VI.1) kS (n1 ) n2 k kS (n2 ) n3 k T 2 S(n1 )n2 is satisfied. Consider then ν = kS(n ∈ S 2 . It follows 1 )n2 k immediately that Π (ν) n1 = n1 and that Π (ν) n2 = n2 . It also follows that Π (ν) n3 = (I − νν T ) n3 = n3 − ν(ν T n3 ) = n3 , where ν T n3 = 0 follows from taking the inner product of (VI) with n3 . Altogether, it follows that n1 , n2 and n3 belong to a common unique plane (see Proposition 18). For n > 3, it suffices to apply the previous argument n − 2 times. Proposition 20: Consider n1 , . . . , nn ∈ S 2 . If ±e1 (n1 , n2 ) = · · · = ±en−1 (nn−1 , nn ) then all unit vectors belong to a common plane, which is unique if ±e1 (n1 , n2 ) = · · · = ±en−1 (nn−1 , nn ) 6= 0. Proof: If ±e1 (n1 , n2 ) = · · · = ±en−1 (nn−1 , nn ) 6= 0, it suffices to invoke Proposition 19. If ±e1 (n1 , n2 ) = · · · = ±en−1 (nn−1 , nn ) = 0, it follows that ±n1 = · · · = ±nn , and therefore, all unit vectors belong to a common plane. Theorem 21: Consider the vector field (III), the control law (IV-E) with fk ∈ P 0 for all k ∈ M, and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If the network graph contains only independent cycles, then for each cycle, all its unit vectors converge to a common plane. Proof: By invoking Proposition 14, it follows that limt→∞ (B⊗I)e(n(t)) = 0, i.e., e(n(·)) converges to the null space of B ⊗I. Now, consider a graph with only independent cycles and recall Proposition 4. Without loss of generality, consider that there is only one independent cycle and that the first n ≥ 3 edges form that cycle. From Proposition 4, it follows that e(n) ∈ N (B ⊗ I) ⇒ ±e1 (1 n, 1̄ n) = · · · = ±en (n n, n̄ n). In turn, from Proposition 20, it follows that all unit vectors that form the cycle belong to a common plane when (B ⊗ I)e(·) = 0. Figure 7(a) exemplifies the statement in Theorem 21, where three agents form a complete graph, and thus there is one independent cycle, and where the distance function is the same for all edges. In this scenario, and because the distance function is the same for all edges, the unit vectors form an equilateral triangle. In Fig. 7(b), four agents form a complete graph, which does not fit the conditions of Theorem 21 (a complete graph with fours agents has three cycles, but they all share edges with each other, i.e., they are not independent); for this scenario, we can find equilibria configurations where the unit vectors do not belong to a common plane, and, in Fig. 7(b), an equilibrium configuration is shown where the four agents form a tetrahedron. 1 1 0.5 z-Axis 0.5 I z-Axis 0 0 I −0.5 −0.5 −1 1 0.5 1 0 −0.5 I y-Axis −1 1 0.5 0 0 −0.5 −1 −1 I x-Axis (a) Triangular configuration I −1 y-Axis −1 −0.5 I 0 0.5 1 x-Axis (b) Tetrahedron configuration Fig. 7: Equilibrium configurations in a complete graph (K3 in Fig. 7(a) and K4 in Fig. 7(b)), with the same distance function for all edges (in Example 3 with α = 1) Theorem 22: Consider the vector field (III), the control law (IV-E) with fk ∈ P 0 for all k ∈ M, and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))). If the network graph contains only independent cycles or cycles that share only one edge, then all unit vectors belonging to each independent cycle converge to a common plane, and all unit vectors belonging to each pair of cycles that share only one edge also converge to a common plane. Proof: For network graphs with only independent cycles, the proof follows the same steps as those in the proof of Theorem 21. Thus, and w.l.o.g, consider graphs with only two cycles that share only one edge, and recall Proposition 5 (adding other cycles does not affect the following conclusions, as long as those cycles are formed by other edges other than those that form the two previously mentioned cycles). W.l.o.g, assume that the first n = q +s−1 ≥ 5 edges are part of the two cycles that share only one edge, where the edges {1, · · · , q−1, q} form the first cycle (|{1, · · · , q−1, q}| = q), while the edges {q, q + 1, · · · , n} form the second cycle (|{q, q +1, · · · , n}| = s), and with the q th edge as the shared edge between cycles (for brevity, denote p = q − 1 and r = q +1). Under the Theorem’s conditions, and by invoking Proposition 14, it follows that limt→∞ (B ⊗ I)e(n(t)) = 0, i.e., e(n(·)) converges to the null space of B ⊗I. From (XII), N (B ⊗ I) is spanned by the vector  (1̄q−1 ⊗ α)T (α + β)T (1̄s−1 ⊗ β)T 0T T , for any α, β ∈ R (see Proposition 5). 3 Suppose q n 6= ±q̄ n, where q n and q̄ n are the unit vectors that form edge q; then eq (q n, q̄ n) 6= 0 and therefore α+β 6= 0 ⇒ α 6= 0 ∨ β 6= 0; moreover, q n and q̄ n form a common unique plane (see Proposition 18). If α = 0 (or β = 0), it follows that ±e1 (1 n, 1̄ n) = · · · = ±ep (p n, p̄ n) = 0, and therefore the unit vectors in the first (or second) cycle belong to a common plane (Proposition 20). Also, if α = 0 (or β = 0), it follows that β 6= 0 (or α 6= 0), and therefore ±er (r n, r̄ n) = · · · = ±en (n n, n̄ n) 6= 0, and therefore all unit vectors in the second (or first) cycle belong to a common unique plane (Proposition 20). However, since the unit vectors of the first (or second) cycle are either all synchronized or some are diametrically opposed to others, it follows that all unit vectors in both cycles belong to a common unique plane. Consider now the case where α 6= 0 and β 6= 0, which implies that ±e1 (1 n, 1̄ n) = · · · = ±ep (p n, p̄ n) 6= 0 as well as ±er (r n, r̄ n) = · · · = ±en (n n, n̄ n) 6= 0. Thus, by Proposition 20, it follows that all unit vectors in each cycle belong to a common plane. Since q n and q̄ n form a common unique plane, and since q n and q̄ n belong simultaneously to both cycles, it follows that all unit vectors in both cycles belong to a common unique plane. Suppose now that q n = ±q̄ n. Then eq (q n, q̄ n) = 0, and it follows that α + β = 0 ⇒ α = −β 6= 0 ∨ α = β = 0. If α = β = 0, then e(n) = 0 ⇔ ±n1 = · · · = ±nN and the Theorem’s conclusions follow. If α = −β 6= 0, then ±e1 (1 n, 1̄ n) = · · · = ±ep (p n, p̄ n) = ±er (r n, r̄ n) = · · · = ±en (n n, n̄ n) 6= 0, which implies that all unit vectors in both cycles belong to a common unique plane (Proposition 20). Figure 8 exemplifies the statement in Theorem 22, with a network of six agents, with the network graph in Fig. 8(c), and where the distance function is the same for all edges (distance function in Example 3 with α = 1). In this scenario, there are two cycles that share only one edge, one cycle composed of unit vectors {n1 , n2 , n3 , n4 , n5 }, a second cycle composed of unit vectors {n1 , n5 , n6 }, and where the shared edge is formed by {n1 , n5 }. There are at least two equilibria configurations (apart from configurations where ni = ±nj for some i and j), which are given in Fig. 8(a) and Fig. 8(b), where in both cases all unit vectors belong to a common plane. Propositions 21 and 22 focus on equilibria for some general, yet specific, network graphs. For arbitrary graphs, we can find equilibria configurations as exemplified in Fig. 7(b), where four agents in a complete graph are at equilibrium when forming a tetrahedron. We now present a proposition, which will be useful in guaranteeing local asymptotic stability of incomplete attitude synchronization for arbitrary graphs. ¯ Proposition 23: Consider n ∈ C(α), for some α ∈ [0, π2 ), and assume that i) the network graph is connected; ii) e(n) ∈ N (B ⊗ I), with e(·) as defined in (IV-B). This takes place if and only if ∃ν ∈ S 2 : n = (1N ⊗ ν). Proof: For the sufficiency statement, it follows that, if ∃ν ∈ S 2 : n = (1N ⊗ ν), then all unit vectors are contained in a π2 -cone, i.e., n ∈ C( π2 ); and, moreover, e(1N ⊗ ν) = 0 ⊆ N (B ⊗ I). For the necessity statement, the proof is as follows. For a tree graph, (B ⊗ I)e(n) = 0 ⇔ e(n) = 0 follows. This implies that ni = ±nj for all (i, j) ∈ N × Ni , but since n ∈ C( π2 ), it follows that ni = nj for all (i, j) ∈ N × Ni . In a connected graph, this implies that ni = nj for all (i, j) ∈ N × N , and therefore ∃ν ∈ S 2 : n = (1N ⊗ ν). expanded into X 0 fκ(i,j) (1 − nTi nj ) (µT nj − (µT ni )nTi nj ) = 0.(VI.3) j∈Ni Now, consider the set T = {i ∈ N : i = arg maxi∈N (1 − µT ni )}, and choose k ∈ T (in the end, we show that, in fact, T = N ). Notice that 0 < cos(α) ≤ µT nk ≤ µT nj for all k ∈ T and all j ∈ N . As such, it follows from (VI) with i = k that P 0 0 ≤ cos(α) fκ(i,j) (1 − nTi nj ) (1 − nTk nj ) ≤ j∈Nk ≤ P 0 fκ(i,j) (1 − nTi nj ) (µT nj − (µT nk )nTk nj ) = 0.(VI.4) j∈Nk Notice that the lower bound (on the left side of (VI)) is non-negative and zero if and only if all neighbors of agent 0 k are synchronized with itself (note that lims→2− fκ(i,j) (s) 0 ¯ may be 0, but since n ∈ C(α), fκ(i,j) (s)|s=1−nTi nj can only vanish if s → 0+ ). As such, it follows from (VI) that all neighbors of agent k are contained in T , i.e., Nk ⊂ T . As such, the same procedure as before can be followed for the neighbors of agent k, to conclude that the neighbors of the neighbors of agent k are all synchronized. In a connected graph, by applying the previous reasoning at most N − 1 times, it follows that all unit vectors are synchronized, or, equivalently, that ∃ν ∈ S 2 : n = (1N ⊗ ν). Proposition 23 has the following interpretation. Recall that {x ∈ (S 2 )N × R3N : (B ⊗ I)e(n) = 0, ωi = 0 for i ∈ L, Π (n̄j ) ωj = 0 for j ∈ L̄} ⊆ Ωeqx , where Ωeqx is the set of equilibrium points. For example, we have seen that, for specific graphs, all equilibrium configurations are such that all unit vectors belong to a common plane (see Theorems 21 and 22), as illustrated in Fig. 8. However, if we can guarantee that along a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))), ¯ ∃α ∈ [0, π2 ) : n(t) ∈ C(α), ∀t ≥ 0, i.e., if we can guarantee that all unit vectors remain in an closed α-cone smaller than an open π2 -cone, then we can invoke Proposition 23 to conclude that limt→∞ (B ⊗I)e(n(t)) = 0 ⇒ limt→∞ (ni (t)− nj (t)) = 0; i.e., that convergence of e(n(·)) to the null space of B ⊗ I implies synchronization of the agents. This motivates us to introduce a distance d? > 0, which will be useful in guaranteeing that, along a trajectory x(·), ¯ ∃α ∈ [0, π2 ) : n(t) ∈ C(α), ∀t ≥ 0. Consider then    d? = min fk 1 − cos π3 N 1−1 < dmin , (VI.5) k∈M For an arbitrary graph, the null space of (B ⊗ I) may be more than 0, i.e., (B ⊗ I)e(·) = 0 6⇒ e(·) = 0. We anticipate the final result by stating that if n ∈ C( π2 ), then (B ⊗ I)e(n) = 0 ⇒ e(n) = 0, in which case we conclude again that ∃ν ∈ S 2 : n = (1N ⊗ ν). Consider then an n ∈ (S 2 )N , such that (B ⊗ I)e(n) = 0. This means that, for every i ∈ N (Bi: stands for the ith row of B), P 0 (IV-B) 0 = (Bi: ⊗ I)e(n) = S (ni ) fκ(i,j) (1 − nTi nj )nj .(VI.2) j∈Ni ¯ Since n ∈ C(α), it follows that there exists a unit vector µ ∈ S 2 , such that µT ni ≥ cos(α) > 0 for all i ∈ N . Taking the inner of (VI) with S (ni ) µ, it follows P product 0 that µT Π (ni ) j∈Ni fκ(i,j) (1 − nTi nj )nj = 0, which can be   which satisfies fk−1 (d? ) ≤ 1 − cos π3 N 1−1 for all k ∈ M. Notice that d? < dmin , since dmin = mink∈M lims→2− fk (s), 1 − cos( π3 N 1−1 ) < 2 for all N ≥ 2, and since all fk (·) are increasing functions in (0, 2). As shown next, if D(n(0)) < d? M (and H(ω(0) = 0), then the network of unit vectors is forever contained in a closed α-cone, for some α ∈ [0, π2 ). Theorem 24: Consider an arbitrary network graph, the vector field (III), the control law (IV-E), and a trajectory x(·) of ẋ(t) = fx (t, x(t), T̄cl (t, x(t))) If x(0) ∈ Ω0x = 3N {x ∈ ΩD : V (x) < d? } then synchronization is n × R asymptotically reached, i.e., limt→∞ (ni (t) − nj (t)) = 0, for all (i, j) ∈ N 2 . Moreover, all implications of Proposition 10 n2 n1 1 1 0.8 0.8 n2 0.6 0.6 0.4 0.2 n6 0 n3 n6 I n3 y-Axis π 9 I y-Axis 0.2 0 5π 9 0.4 n1 -0.2 -0.2 n5 -0.4 n2 -0.4 -0.6 n3 n4 -0.6 n4 -0.8 -0.8 n5 n1 -1 -1 -1 -0.5 n4I 0 0.5 1 -1 -0.5 x-Axis n5I 0 0.5 1 x-Axis (a) Equilibrium configuration with network graph shown in Fig. 8(c) (b) Equilibrium configuration with network graph shown in Fig. 8(c) n6 (c) Graph with two cycles that share only one edge Fig. 8: Two equilibrium configurations for group with network graph shown in Fig. 8(c), with the same distance function for all edges (in Example 3 with α = 1) also follow. VII. S IMULATIONS Proof: Since d? < dmin , we can invoke Proposition 10, and infer that limt→∞ (B ⊗ I)e(t) = 0 (as well as all other implications stated in the Proposition). Since V̇ (x(·)) ≤ 0, it follows that fk (1 − k nT (·)k̄ n(·)) ≤ D(n(·)) ≤ V (x(·)) ≤ V (0) < d? , for all k ∈ M. In turn, this implies that θ(k n(·), k̄ n(·)) ≤ arccos(1 − fk−1 (d? )) < π3 N 1−1 , for all k ∈ M. Since the angular displacement between any two unit vectors ni and nj in a connected graph satisfies θ(ni (·), nj (·)) ≤ (N − 1) maxk∈M θ(k n(·), k̄ n(·)) (see Proposition 27), it follows that supt≥0 θ(ni (t), nj (t)) < π3 between any two unit vectors ni and nj . As such, it follows ¯ 3 supt≥0 θ(ni (t), nj (t))), from Proposition 7 that n(·) ∈ C( 2 3 where 2 supt≥0 θ(ni (t), nj (t)) < π2 . Finally, we invoke Proposition 23, which implies that limt→∞ (B ⊗ I)e(n(t)) = 0 ⇒ limt→∞ (ni (t) − nj (t)) = 0. Let us provide a corollary to Theorem 24, with an easier to visualize region of attraction. Corollary 25: Theorem 24 holds if r := if    ? n(0) ∈ C 1 2 arccos 1 − min fk−1 k∈M d M H(ω(0)) dmin < 1 and  (1 − r) ? with d as in (VI). For proving Corollary 25 it suffices to check that if its conditions are satisfied, then V (x(0)) < d? . Remark 26: Comparing Theorems 16 and 24, it follows that the region of attraction in Theorem 16 is larger than that in Theorem 24. Loosely speaking, the region of attraction in min Theorem 16 is dd? > 1 times larger than the region of attraction in Theorem 24. This difference comes from the network graph topology, and in fact, a tree network graph provides stronger results. Theorems 16 and 24 provide asymptotic results, namely limt→∞ e(n(t)) = 0. Remark 34 in Appendix provides some insight on exponential convergence to 0. We now present simulations that illustrate some of the results presented previously. For the simulations, we have a group of ten agents, whose network graph is that presented in Fig. 11. The moments of inertia were generated by adding a random symmetric matrix (between −I and I, entry-wise) to the identity matrix. For the initial conditions, we have chosen ω(0) = 0 and we have randomly generated one set of 10 rotation matrices. In Fig. 9, n̄i = [1 0 0]T for i = {1, 2, 3, 4, 5} and n̄i = [0 1 0]T for i = {6, 7, 8, 9, 10}, and since these are not necessarily principal axes, we apply the control law (IV-E), with L̄ = ∅ and L = N . In Fig. 10, n̄i is the principal axis of Ji , with largest eigenvalue, for i = {1, 2, 3, 4, 5}, and n̄i = [1 0 0]T for i = {6, 7, 8, 9, 10}. Therefore, we apply the control law (IV-E), with L̄ = {1, 2, 3, 4, 5} and L = {6, 7, 8, 9, 10}. For the edge 1, we have chosen f1 (s) = 10 tan2 (0.5 arccos(1 − s)). For the other edges, we have chosen fk (s) = 5s, for k = M\{1}. Notice that we have chosen a distance function (for edge 1) that grows unbounded when two unit vectors are diametrically opposed. As such, it follows that agents 1 and 6 will never be diametrically opposed, under the condition that they are not initially diametrically opposed. We have also chosen σ(x) = k √ σ2 x x T with k = 10 and σx = 1. σx +x x For this choice, we find that σ max = kσx = 10. As such, for all agents, except 1 and 6, an upper bound on the norm of their torque is given by σ max + 2 · 5 = 20 (the factor 2 relates to the fact that all agents, except 1 and 6, have two neighbors, and the factor 5 comes from fk (s) = 5s ⇒ fk0 (s) = 5). For agents 1 and 6, no upper bound can be found (more precisely, a bound can be found, but it depends on the initial conditions). Given these choices, it follows from Corollary 25 that if n(0) ∈ C(≈ 1◦ ) then synchronization is guaranteed. We emphasize, nonetheless, that Corollary 25 provides conservative conditions for synchronization to be achieved, and the domain of attraction is in fact larger. We also emphasize that, for tree graphs, the domain of attraction is considerably larger: for example, if we removed the edges between agents 1 and 2, and between agents 6 and 7, we would obtain a tree graph, and Corollary 13 would read 0.5 0.5 0.5 0.5 -0.5 -0.5 -1 -1 -1 -1 -1 0 1 y-Axis 1 0.5 -0.5 0 I -1 I x-Axis (a) Trajectories w/o noise -0.5 -1 0 1 y-Axis 1 0.5 -0.5 0 I -1 I x-Axis (b) Trajectories with noise 0 I I 0 -0.5 I -1 -1 0 1 y-Axis 1 I -1 -0.5 0 0.5 I x-Axis (a) Trajectories w/o noise 180 160 160 140 140 140 140 120 120 120 120 100 80 Degrees (◦ ) 180 160 Degrees (◦ ) 180 80 100 80 60 60 40 40 40 40 20 20 20 0 5 10 15 20 25 30 5 10 Time 15 20 25 30 (d) Error angle between neighbors with noise Fig. 9: Synchronization in network of 10 unit vectors with and without noise, where blue agents perform synchronization of their first axes (n̄i = [1 0 0]T ) and black agents synchronization of their second axes (n̄i = [0 1 0]T ). 5 10 15 20 25 30 0 5 10 Time VIII. C ONCLUSIONS In this paper, we proposed a distributed control strategy that guarantees attitude synchronization of unit vectors, representing a specific body direction of a rigid body. The proposed control torque laws depend on distance functions 20 25 30 (d) Error angle between neighbors with noise Fig. 10: Synchronization in network of 10 unit vectors with and without noise, where blue agents perform synchronization of principal axes and black agents synchronization of their first axes (i.e., n̄i = [1 0 0]T ). n2 n3 n4 n5 κ̄(1,6)=1 n6 n1 The trajectories of the unit vectors for described conditions are presented in Figs. 9(a)–9(b) and 10(a)–10(b). Notice that despite not satisfying conditions of Theorem 24 (the unit vectors are not always in a π2 cone), incomplete attitude synchronization is still achieved. This can be verified in Figs. 9(c)-9(d) and 10(c)-10(d), which present the angular error between neighboring agents. In Figs. 10(a) and 10(b), the control laws are different between agents 1–5 and 6–10. The former perform synchronization of principal axes, by applying the constrained control law (IV-E); while the later perform synchronization of their first axes, i.e., n̄i = [1 0 0]T , by applying the control law (IV-C). In Figs. 9(d) and 10(d), for which the control laws were corrupted by noise, perfect synchronization is not asymptotically achieved. Instead, the unit vectors converge to a configuration where they remain close to each other (error of ≈ 5◦ between neighbors). 15 Time (c) Error angle between neighbors without noise as n(0) ∈ C(≈ 18◦ ). Finally, we emphasize that we can increase the size of the cones in Corollaries 13 and 25, by choosing different distance functions, as exemplified in Example 1. For each Fig. 9 and Fig. 10, we provide two simulations: one where the control law is that in (IV-E) and another where the control law is that in (IV-E) but corrupted by noise; specifically, for each agent i ∈ N , Ti (t) = T̄cl i (t, x(t)) + 0.1λi [0 0 1]T , where λi corresponds to the largest eigenvalue of Ji . -1 x-Axis 0 0 Time (c) Error angle between neighbors without noise I 20 0 0 -0.5 0 0.5 80 60 0 1 100 60 0 1 (b) Trajectories with noise 160 100 0 y-Axis 180 Degrees (◦ ) Degrees (◦ ) 0 I I 0 z-Axis 1 z-Axis 1 z-Axis 1 z-Axis 1 n10 n9 n8 n7 Fig. 11: Graph with 10 agents, where edge 1 is formed by agents 1 and 6 in S 2 , and we provide conditions on these distance functions that guarantee that i) a synchronized network is locally asymptotically stable in an arbitrary connected undirected graph network; ii) a synchronized network can be achieved for almost all initial conditions in a tree graph network. We imposed conditions on the distance functions that guarantee that these are invariant to rotation of their arguments, which means that the proposed control laws can be implemented by each individual rigid body in the absence of a global common orientation frame, i.e., by using only local information. Additionally, if the direction to be synchronized is a principal axis of the rigid body, we proposed a control law that does not require full torque actuation, and, more specifically, it only requires torque in the plane orthogonal to the principal axis. We also studied the equilibria configurations that come with certain types of graph networks. Directions for future work include studying the stability of all equilibria configurations, apart from the synchronized configuration; to determine whether a synchronized network converges to a constant unit vector in a fixed, though unknown, orientation frame; and to extend the results to complete attitude synchronization. For complete attitude synchronization, though, it is not possible to construct a constrained control law, since it requires full torque actuation. R EFERENCES [23] C. Godsil, G. Royle, and C. Godsil, Algebraic graph theory. Springer New York, 2001, vol. 207. [1] J. Lawton and R. Beard, “Synchronized multiple spacecraft rotations,” Automatica, vol. 38, no. 8, pp. 1359–1364, 2002. [24] D. Dimarogonas and K. Johansson, “Further results on the stability of distance-based multi-robot formations,” in IEEE American Control Conference, 2009, pp. 2972–2977. [2] N. Leonard, D. Paley, F. Lekien, R. Sepulchre, D. Fratantoni, and R. Davis, “Collective motion, sensor networks, and ocean sampling,” Proceedings of the IEEE, vol. 95, no. 1, pp. 48–74, Jan 2007. [3] A. Sarlette, R. Sepulchre, and N. Leonard, “Autonomous rigid body attitude synchronization,” Automatica, vol. 45, no. 2, pp. 572–577, 2009. [25] S. Guattery and G. Miller, “Graph embeddings and laplacian eigenvalues,” SIAM Journal on Matrix Analysis and Applications, vol. 21, no. 3, pp. 703–723, 2000. [26] J. Slotine and W. Li, Applied nonlinear control. Englewood Cliffs, NJ, 1991, vol. 199, no. 1. Prentice-Hall [4] D. Dimarogonas, P. Tsiotras, and K. Kyriakopoulos, “Leader–follower cooperative attitude control of multiple rigid bodies,” Systems & Control Letters, vol. 58, no. 6, pp. 429–435, 2009. [27] D. Zwillinger, Table of integrals, series, and products. Elsevier, 2014. [5] A. Bondhus, K. Pettersen, and J. Gravdahl, “Leader/follower synchronization of satellite attitude without angular velocity measurements,” in IEEE Conference on Decision and Control and European Control Conference, 2005, pp. 7270–7277. [29] R. Buck and E. Buck, Advanced calculus. Education, 1965. Tata McGraw-Hill [30] H. Khalil and J. Grizzle, Nonlinear systems. Saddle River, 2002, vol. 3. Prentice Hall Upper [28] R. Horn and C. Johnson, Matrix analysis. Cambridge university press, 2012. [6] T. Krogstad and J. Gravdahl, “Coordinated attitude control of satellites in formation,” in Group Coordination and Cooperative Control. Springer, 2006, pp. 153–170. IX. T RIANGULAR I NEQUALITY [7] H. Cai and J. Huang, “The leader-following attitude control of multiple rigid spacecraft systems,” Automatica, vol. 50, no. 4, pp. 1109–1115, 2014. Proposition 27: Consider three unit vectors n1 , n2 and n. The following triangular inequality is satisfied, [8] S. Nair and N. Leonard, “Stable synchronization of rigid body networks,” Networks and Heterogeneous Media, vol. 2, no. 4, p. 597, 2007. [9] J. Thunberg, W. Song, E. Montijano, Y. Hong, and X. Hu, “Distributed attitude synchronization control of multi-agent systems with switching topologies,” Automatica, vol. 50, no. 3, pp. 832–840, 2014. [10] W. Song, J. Thunberg, X. Hu, and Y. Hong, “Distributed high-gain attitude synchronization using rotation vectors,” Journal of Systems Science and Complexity, vol. 28, no. 2, pp. 289–304, 2015. θ(n1 , n2 ) ≤ θ(n1 , n) + θ(n, n2 ), where θ : S 2 × S 2 7→ [0, π], defined as θ(n1 , n2 ) = arccos(nT1 n2 ). Proof: Since n1 and n2 can be written as n1 = cos(θ(n1 , n))n + sin(θ(n1 , n))ν1 , n2 = cos(θ(n2 , n))n + sin(θ(n2 , n))ν2 , [11] R. Olfati-Saber, “Swarms on sphere: A programmable swarm with synchronous behaviors like oscillator networks,” in IEEE Conference on Decision and Control, 2006, pp. 5060–5066. where ν1 , ν2 ∈ S 2 are unit vectors orthogonal to n, then [12] N. Moshtagh and A. Jadbabaie, “Distributed geodesic control laws for flocking of nonholonomic agents,” IEEE Transactions on Automatic Control, vol. 52, no. 4, pp. 681–686, 2007. = cos(θ(n1 , n)) cos(θ(n2 , n)) + sin(θ(n1 , n)) sin(θ(n2 , n))ν1T ν2 [13] D. Paley, “Stabilization of collective motion on a sphere,” Automatica, vol. 45, no. 1, pp. 212–216, 2009. [14] W. Li and M. Spong, “Unified cooperative control of multiple agents on a sphere for different spherical patterns,” IEEE Transactions on Automatic Control, vol. 59, no. 5, pp. 1283–1289, 2014. [15] F. Dörfler and F. Bullo, “Synchronization in complex networks of phase oscillators: A survey,” Automatica, vol. 50, no. 6, pp. 1539– 1564, 2014. [16] A. Sarlette, S. Tuna, V. Blondel, and R. Sepulchre, “Global synchronization on the circle,” in Proceedings of the 17th IFAC world congress, 2008, pp. 9045–9050. [17] S. Chung, U. Ahsun, and J. Slotine, “Application of synchronization to formation flying spacecraft: Lagrangian approach,” Journal of Guidance, Control, and Dynamics, vol. 32, no. 2, pp. 512–526, 2009. [18] S. Chung, S. Bandyopadhyay, I. Chang, and F. Hadaegh, “Phase synchronization control of complex networks of lagrangian systems on adaptive digraphs,” Automatica, vol. 49, no. 5, pp. 1148–1161, 2013. [19] C. Mayhew, R. Sanfelice, J. Sheng, M. Arcak, and A. Teel, “Quaternion-based hybrid feedback for robust global attitude synchronization,” IEEE Transactions on Automatic Control, vol. 57, no. 8, pp. 2122–2127, Aug 2012. [20] R. Tron, B. Afsari, and R. Vidal, “Intrinsic consensus on SO(3) with almost-global convergence.” in IEEE Conference on Decision and Control, 2012, pp. 2052–2058. [21] D. Liberzon, Switching in systems and control. Springer, 2003. [22] P. Pereira and D. Dimarogonas, “Family of controllers for attitude synchronization in S 2 ,” in IEEE Conference on Decision and Control, 2015. nT1 n2 = = cos(θ(n1 , n) + θ(n2 , n)) + sin(θ(n1 , n)) sin(θ(n2 , n)) (1 + ν1T ν2 ) | {z } ≥0 ≥ cos(θ(n1 , n) + θ(n2 , n)). As such, θ(n1 , n2 ) ≤ θ(n1 , n) + θ(n2 , n). Proof: [of Proposition 7] Let us construct an ν ∈ S 2 such that θ(nk , ν) ≤ α for all k ∈ N , with θ(·, ·) defined in Proposition 27. If max(i,j)∈N 2 θ(ni , nj ) = 0, it suffices to pick ν = ni , for any i ∈ N , and the Proposition’s conclusion follows. If 0 < max(i,j)∈N 2 θ(ni , nj ), take (k, l) = nk +nl arg max(i,j)∈N 2 θ(ni , nj ), and consider then ν = kn , k +nl k 2 which is well defined since 0 < θ(nk , nl ) < 3 π < π. By construction, it follows that θ(nk , ν) = θ(nl , ν) = θ(nk2,nl ) . From Proposition 27, it follows that, for any j ∈ N , θ(nj , ν) ≤ θ(nj , nk ) + θ(nk , ν) ≤ θ(nl , nk ) + θ(nk , ν) ≤ 3 2 2 θ(nk , nl ). Thus, if θ(nk , nl ) ≤ 3 α, for some α ∈ [0, π], then θ(nj , ν) ≤ α for all k ∈ N , and the Proposition’s conclusion follows. X. S OLUTION TO PDE (IV.1) The partial differential equation (IV-B) is a restriction imposed on the distance functions. The question that follows is what kinds of distance functions d : S 2 × S 2 → R+ 0 satisfy (IV-B). Distance functions of the type d(n1 , n2 ) = f (1 − nT1 n2 ) (with f ∈ C 1 ((0, 2), R≥0 )) satisfy (IV-B). In fact, those are the only type of distance functions that satisfy (IV-B), as we show next. Proposition 28: Consider two orthogonal unit vectors, i.e., (v1 , v2 ) ∈ Ω = {(n1 , n2 ) ∈ S 2 × S 2 : nT1 n2 = 0}. Additionally, consider a function η ∈ C 1 (R3 × R3 , R≥0 ) that satisfies ∂η(v1 , v2 ) ∂η(v1 , v2 ) + S (v2 ) = 0, (X.1) S (v1 ) ∂v1 ∂v2 for all (v1 , v2 ) ∈ Ω. Then, η(v1 , v2 ) is constant for all (v1 , v2 ) ∈ Ω. Proof: The function η(·, ·) is constant for all (v1 , v2 ) ∈ Ω, if the differential dη(·, ·) is zero along (v1 , v2 ) ∈ Ω. This condition is proved next. Taking the inner product of (28) with vi (i ∈ {1, 2} and j = {1, 2}\{i}), it follows 1 ,v2 ) 1 ,v2 ) = 0, which means ∂η(v is that viT S (vj ) ∂η(v ∂vj ∂vj orthogonal to both S (v1 ) v2 and S (v2 ) v1 . Since v1 , v2 and S (v1 ) v2 form a basis of R3 , it then follows that     ∂η(v1 ,v2 ) 1 ,v2 ) 1 ,v2 ) = v1T ∂η(v v1 + v2T ∂η(v v2 ∂v1 ∂v1 ∂v1 (X.2) , h1 (v1 , v2 )v1 + h3 (v1 , v2 )v2 ,     T ∂η(v1 ,v2 ) T ∂η(v1 ,v2 ) v1 + v2 ∂v2 v2 v1 ∂v2 ∂η(v1 ,v2 ) = ∂v2 , h4 (v1 , v2 )v1 + h2 (v1 , v2 )v2 . (X.3) By replacing (X) and (X) in (28), it follows that h3 (v1 , v2 ) = h4 (v1 , v2 ) , h(v1 , v2 ) for all (v1 , v2 ) ∈ Ω (notice that S (v1 ) v2 6= 0). Now, recall that (v1 , v2 ) ∈ Ω means that v1T v1 = 1, v2T v2 = 1 and v1T v2 = 0. In turn, this implies that dv1T v1 = 0, dv2T v2 = 0 and dv1T v2 + dv2T v1 = 0. From (X), it follows 1 ,v2 ) that dv1T ∂η(v = h1 (·, ·)dv1T v1 + h(·, ·)dv1T v2 = ∂v1 1 ,v2 ) T h(·, ·)dv1 v2 , and, from (X), it follows that dv2T ∂η(v = ∂v2 T T T h(·, ·)dv2 v1 + h2 (·, ·)dv2 v2 = h(·, ·)dv2 v1 . Since 1 ,v2 ) 1 ,v2 ) dη(v1 , v2 ) = dv1T ∂η(v + dv2T ∂η(v = ∂v1 ∂v2 = 0, the Proposition’s h(v1 , v2 ) (dv1T v2 + dv2T v1 ) conclusion follows. Proposition 29: Consider a function η ∈ C 1 (R3 × R3 , R≥0 ) that satisfies ∂η(n1 , n2 ) ∂η(n1 , n2 ) + S (n2 ) = 0, (X.4) S (n1 ) ∂n1 ∂n2 for all (n1 , n2 ) ∈ S 2 × S 2 . Then, η(n1 , n2 ) = h(1 − nT1 n2 ) for (n1 , n2 ) ∈ S 2 × S 2 and for any h ∈ C 1 ((0, 2), R≥0 ). Proof: Condition (29) is satisfied for (n1 , n2 ) ∈ S 2 × S , and, in particular, it is satisfied for (n1 , n2 ) ∈ Θ , {(v1 , v2 ) ∈ S 2 × S 2 : (v1T v2 )2 6= 1} which is a set of full measure w.r.t. S 2 × S 2 . For (n1 , n2 ) ∈ Θ, consider the variables n1 + n2 n1 − n2 v1 = , v2 = , v3 = nT1 n2 , kn1 + n2 k kn1 − n2 k and notice that, by construction, n1 and n2 canpbe obtained from v1 , v2 and v3 (indeed, n1,2 = v3 v1 ± 1 − v32 v2 ), meaning that a bijection exists between (n1 , n2 ) and (v1 , v2 , v3 ); moreover, v1 is orthogonal to v2 , i.e., v1T v2 = 0. 2 The proof hereafter explores the previous change of variables. First, notice that there exists a function h̃(·, ·, ·) such that η(n1 , n2 ) = h̃(v1 (n1 , n2 ), v2 (n1 , n2 ), v3 (n1 , n2 )) or alternatively η(n1 (v1 , v2 , v3 ), n2 (n1 , n2 , v3 )) = h̃(v1 , v2 , v3 ). Then, from (29), it follows that (for simplicity, all arguments in the equations below are omitted) ! ∂v2 ∂ h̃ ∂v3 ∂ h̃ ∂v1 ∂ h̃ + ··· + + S (n1 ) ∂n1 ∂v1 ∂n1 ∂v2 ∂n1 ∂v3 ! ∂v1 ∂ h̃ ∂v2 ∂ h̃ ∂v3 ∂ h̃ S (n2 ) + + = 0 (X.5) ∂n2 ∂v1 ∂n2 ∂v2 ∂n2 ∂v3   ∂v1 ∂v1 ∂ h̃ ⇔ S (n1 ) + S (n2 ) + ··· ∂n1 ∂n2 ∂v1   ∂v2 ∂v2 ∂ h̃ S (n1 ) + S (n2 ) + ··· ∂n1 ∂n2 ∂v2 ∂ h̃ =0 (X.6) (S (n1 ) n2 + S (n2 ) n1 ) ∂v3 ∂ h̃ ∂ h̃ ⇔S (v1 ) + S (v2 ) =0 (X.7) ∂v1 ∂v2 where the chain rule has been applied to derive (X) from  (29);  and  from (X) to (X), the relations (recall that ∂ x xT x 1 = I − ∂x kxk kxk kxk kxk ) ∂v1 1 = (I − v1 v1T ) , for i ∈ {1, 2}, ∂ni kn1 + n2 k ∂v2 1 , for j ∈ {1, 2}, = ± (I − v2 v2T ) ∂nj kn1 − n2 k together with the relations S (n1 ) v1 + S (n2 ) v1 = 0 and S (n1 ) v2 − S (n2 ) v2 = 0 have been used. It follows from Proposition 28 and from (X), that h̃(v1 , v2 , v3 ) does not depend on v1 and v2 , and, as such, η(n1 , n2 ) = h̃(·, ·, nT1 n2 ) = h(1 − nT1 n2 ). XI. AUXILIARY E XAMPLES (S ECTION IV-A) Example 4: In Fig. 12, three graphs with equivalent incidence matrices are presented (incidence matrices in (4), (4) and (4)). (Two matrices D, E ∈ Rn×m are said to be equivalent iff there exist non-singular P ∈ Rn×n and Q ∈ Rm×m such that D = P EQ [27].) The incidence matrix in Fig. 12(a) is given by   1 0 1 1 0 . B1 = −1 (XI.1) 0 −1 −1 Consider a graph, with incidence matrix B̃1 ∈ RN ×M , and a second graph, with incidence matrix B̃2 ∈ RN ×M , obtained from the previous after a swap of nodes. Then B̃1 = Γ1 B̃2 Ī, where Γ1 ∈ RN ×N is a permutation matrix corresponding to the swap of nodes (permutation of rows) and Ī ∈ RM ×M is a diagonal matrix with diagonal elements ±1 (column k ∈ M needs to be multiplied by −1 when, after permutation of rows, i becomes larger than j with (i, j) = κ̄−1 (k)). The graph in Fig. 12(b) is obtained from that in Fig. 12(a) by swapping nodes 1 and 2, and, as such, its incidence matrix Be = 0. Without loss of generality, assume that is given by  0 B2 =Γ1 B1 Ī = 1 0  −1 = 1 0 1 0 0   0 1 −1 1 0  0 −1 −1 0 0 1 0 −1 1 0  1 0 −1 0 1  0 −1 −1 0 0 1 0  0 0 1   0 1 0 = −1 1 0  1 0 0 1 , −1 −1 (XI.2) where column 1 needs to be multiplied by -1 since rows 1 and 2 have permuted and κ̄(1, 2) = 1. Consider again a graph, with incidence matrix B̃1 ∈ RN ×M , and a second graph, with incidence matrix B̃2 ∈ RN ×M , obtained from the previous after a swap of edges (edges’ numbers). Then B̃1 = B̃2 Γ2 , where Γ2 ∈ RM ×M is a permutation matrix corresponding to the swap of edges (permutation of columns). The graph in Fig. 12(c) is obtained from that in Fig. 12(b) by swapping edges 1 and 3, and, as such, its incidence matrix is given by  1 B3 = B2 Γ2 = −1 0  1 0 0 0 1 0 1 −1 −1 0 1 0 0 1 0   1 0 0 =  1 0 −1  1 1 . 0 −1(XI.3) −1 0 Example 5: Figure 3(a) displays a graph with two independent cycles, with incidence matrix and its null space in (5).  1 −1  B1 =   0  0 0  0 1 1 1 0 1 0 0 0 0  −1 −1 0 0 0 , 0 0 −1 0 1 0 0 0 −1 −1     0     1    1  0               −1  0  . N (B1 ) = span   ,   (XI.4)  0  1        0 −1     1 0 Example 6: Figure 3(b) displays a graph with one independent cycle and two cycles that share only one edge, with incidence matrix and its null space in (6) (B1 defined in (5)).     B1 B=    0 1 0 0 0 0 −1 0 0 1 0 0 −1     ,          0  0 1               1  0  0    −1  1  0            0  0  1 , ,  . N (B) = span   0  0 −1                    0  0  1     0 −1  0       0 1 0 (XI.5) XII. P ROOFS OF P ROPOSITIONS 4, 5 Proof: [of Proposition 4] Without loss of generality, consider a graph with only one cycle composed of Mc edges. Then, its associated incidence matrix B can be divided in two parts, i.e., B , [Bc̄ Bc ]: Bc corresponds to all edges that are part of the cycle; and Bc̄ corresponds to all other edges. Bc can be further partitioned in two parts, i.e., Bc , [Bc1 Bc2 ], where Bc2 is a single column matrix corresponding to a single edge of the cycle and such that [Bc̄ Bc1 ] corresponds to a tree. Since [Bc̄ Bc1 ] is a tree, it must be positive definite (see Proposition 2); thus, it follows that the null space of B has dimension 1, i.e., |N (B)| = 1, and there exists a unique (up to a scalar multiplication) non-zero vector e ∈ RM such that  Bc ,  Bc1 Bc2  = 1  −1   0   ..  .   0   0 0 ··· ··· ··· .. . 0 0 0 .. . 0 ··· 0 ··· 0 0 1 −1 0 0 1 −1 .. . 1 0 0 .. .       ,  0   −1  0 PM −1 which means, Bc2 = i=1c (Bc1 )i . Consequently, the nonzero vector e = [0TM −Mc 1TMc −1 − P 1]T belongs to the nullM −1 1 2 space of B, since [Bc̄ Bc Bc ]e = i=1c (Bc1 )i − Bc2 = 0. For B ⊗ In , its null-space is spanned by the columns of e ⊗ In = [0 In · · · In − In ]T . In general, the incidence matrix will be of the form B = Γ1 [Bc̄ Bc1 Bc2 ]Ī Γ2 , with Γ1 ∈ RN ×N and Γ2 ∈ RM ×M as permutation matrices and Ī ∈ RM ×M as a diagonal matrix with diagonal elements ±1; i.e., the incidence matrix B will be equivalent to [Bc̄ Bc1 Bc2 ] apart from a reordering of nodes’ and edges’ numbering. In that case, the null space of B will be spanned by ΓT2 Ī[0TM −Mc 1TMc −1 − 1]T , or, alternatively, N (B) = {e ∈ RM : ek = ±el , ∀k, l ∈ C}, where C is the set of the edges that form the cycle. For m independent cycles, {Ci }i={1,··· ,m} , i.e., cycles that do not share edges, N (B) = {e ∈ RM : ek = ±el , ∀k, l ∈ Ci , i = {1, · · · , m}}. Similar conclusions extend to N (B ⊗ I). Proof: [of Proposition 5] Without loss of generality, consider a graph with only one pair of cycles that share only one edge. Similarly to the proof of Proposition 4, we partition the incidence matrix as B , [Bc̄ Bc ] and through a similar argument we conclude that |N (B)| = 2. In this scenario, Bc is decomposed in three parts. Without loss of generality, assume that   Bc , Bc1 Bc2 Badj  = 1  −1   ..  .   0   0   0    0    0    0 0 −1 0 0 0 ··· ··· .. . 0 0 .. . ··· 0 0 1 −1 0 0 ··· 0 ··· 0 1 0 ··· 0 ··· 0 0 .. . ··· ··· .. . 0 0 .. . 1 0 .. . 0 0 1 ··· 0 ··· .. . 0 0 0 .. . 0 0 0 .. . 0 0 1 0 0 0 0 −1 0 0 0 1 0 .. . 0 −1 0 0 0 .. . 0 .. . 0 −1 0 0 0 .. . 1 0 . 0 ··· −1 0 −1 0 ..           ,          1 c where [B Badj ] corresponds to one cycle (of dimension Mc1 ≥ 3), [Bc2 Badj ] corresponds to the second cycle (of dimension Mc2 ≥ 3),Pand Badj corresponds PM −1to the shared M −1 edge. As such, Badj = i=1c1 (Bc1 )i = i=1c2 (Bc2 )i , which means that N (B) is given by     0 0      1Mc −1  0Mc −1  1 , 1  , span  (XII.1)   1Mc −1    0Mc2 −1  2   −1 −1 while N (B ⊗ In ) is spanned by the columns of     0 0 1Mc −1 ⊗ In  0Mc −1 ⊗ In   1   1  0Mc −1 ⊗ In  , 1Mc −1 ⊗ In  . 2 2 −In −In (XII.2) n2 κ̄(2, 3) = 2 n1 κ̄(1, 2) = 1 n3 n1 κ̄(1, 3) = 3 (a) Graph with incidence matrix B1 in (XI.1) κ̄(1, 3) = 2 n1 κ̄(1, 2) = 1 n3 n2 κ̄(1, 3) = 2 κ̄(1, 2) = 3 n3 κ̄(2, 3) = 3 n2 κ̄(2, 3) = 1 (b) Same graph as in (c) Same graph as in Fig. 12(a) apart from a swap Fig. 12(b) apart from a swap between nodes 1 and 2 between edges 1 and 3 (incidence matrix B2 (incidence matrix B3 in (XI.2)). in (XI.3)). Fig. 12: Three graphs with equivalent incidence matrices. The null space in (XII) can be equivalently written as [0T α1TMc1 −1 β1TMc2 −1 − (α + β)]T for any α, β ∈ R. In general, the incidence matrix will be of the form B = Γ1 [Bc̄ Bc1 Bc2 Badj ]Ī Γ2 , with Γ1 ∈ RN ×N and Γ2 ∈ RM ×M as permutation matrices and Ī ∈ RM ×M as a diagonal matrix with diagonal elements ±1; i.e., the incidence matrix B will be equivalent to [Bc̄ Bc1 Bc2 Badj ] apart from a reordering of nodes’ and edges’ numbering. With that in mind, the null space in (XII) can also be written as N (B) = {e ∈ RM : ek = ±el , ∀k, l ∈ C 1 \{C 1 ∩ C 2 }, ep = ±eq , ∀p, q ∈ C 2 \{C 1 ∩C 2 }, } , with C 1 = {M −Mc1 −Mc2 +1, . . . , M − Mc2 − 1} ∪ {M } and C 2 = {M − Mc2 , . . . , M − 1} ∪ {M } (i.e, C 1 corresponds to the set of edges of one cycle, and C 2 corresponds to the set of edges of the other cycle, where the M th edge is the shared edge). Including independent cycles or other pairs of cycles that share only one edge does not affect the previous conclusions regarding the null space, and, therefore, the conclusions of the Proposition follow. XIII. I NSTABILITY Under Theorem’s 17 conditions, a configuration where two (or more) neighboring unit vectors are diametrically opposed, with all the other neighboring unit vectors synchronized, is an equilibrium solution. In fact, consider a constant unit vector n? , ω = 0 and ni = ±n? for all i ∈ N . Under these circumstances, Ti i = 0 for all i ∈ N (see (IV-C)), implying that all those configurations correspond to equilibrium configurations. Multiple equilibria exist because the control laws (IV-C) are continuous and the states ni (for all i ∈ N ) evolve in a non-contractible set (see [21]). Notice, however, that the equilibrium ω = 0 and ni = n? for all i ∈ N is guaranteed to be (locally) asymptotically stable (see Theorem 24). For all other equilibria, their stability, or lack thereof, is a subject of current research. T T the control law [ω1T . . . ωN ] = ω = −RT (B ⊗ I)e, since 2 2 it implies that V̇ = − k(B ⊗ I)ek ≤ −λmin (B T B) kek . Since V̇ (t) is uniformly continuous, Barbalat’s Lemma suffices to conclude that e converges to 0, which, in turn, implies that there exists a (possibly time-varying) unit vector n? (t) such that limt→∞ (ni (t) ± n? (t)) = 0, for all i ∈ N . Let us focus on the equilibria configuration where n? is time invariant, i.e, focus on scenarios where all the unit vectors converge a constant unit vector, either +n? or −n? (the study of stability, or lack thereof, for time-varying n? (t) is a subject of current research). For the remaining part of this section, it is shown that the previous equilibrium configuration is unstable whenever two (or more) neighboring unit vectors are diametrically opposed. This conclusion follows from a linearization procedure, which is described next. For a constant n? , consider the variables xi , Π (n? ) ni , T i si , sign (n n ) , (XIII.2) for all i ∈ N . From (XIII) and (XIII), it is possible to reconstruct ni , since ni = (nTi n? )n? + Π (n? ) ni = (nTi n? )n? + x(XIII.3) i q 2 (XIII.4) = sign (nTi n? ) 1 − kxi k n? + xi q 2 = si 1 − kxi k n? + xi (XIII.5) 2 where the relation (n1 n2 )2 + kΠ (n1 ) n2 k = (n1 n2 )2 + 2 kS (n1 ) n2 k = 1 has been used from (XIII) to (XIII). Since nTi n? can only change sign when ni is orthogonal to n? , it follows that ṡi = 0, (XIII.6) p if kxi k < 1 for all time (kxi k = 1 − (nTi n? )2 ). Additionally, from (XIII), it follows that q In this section, we consider simpler dynamical agents and study the stability of equilibria where two (or more) neighboring unit vectors are diametrically opposed. Consider then agents ni , for i ∈ N , with kinematics (III), and whose angular velocities ωi are assumed to be controllable (intuitively, this corresponds to controlling single integrators rather than double integrators). Consider also the Lyapunov function P V (n) = M d ( n, k=1 Pk k k̄ n), whose time derivative yields V̇ = ω T R(B ⊗ I)e M k=1 dk (k n, k̄ n). This motivates the choice of (XIII.1) ? q nTi nk = (si 1 − kxi k2 n? + xi )T (sk 1 − kxk k2 n? + xk ) q q 2 2 = si sk 1 − kxi k 1 − kxk k + xTi xk , for all i, k ∈ N , and where the fact that, for all i ∈ N , xi is orthogonal to n? has been used. For xi = xk = 0, si sk = sign ((nTi n? )(nTk n? )) = 1 if ni and nk are synchronized and si sk = sign ((nTi n? )(nTk n? )) = −1 if ni and nk are diametrically opposed. Thus, by continuity, for small kxi k and kxk k, si sk = sign ((nTi n? )(nTk n? )) = 1 if ni and nk are almost synchronized (i.e., 1 − nTi nk is small) and si sk = sign ((nTi n? )(nTk n? )) = −1 if ni and nk are almost diametrically opposed (i.e., −1 − nTi nk is small). Since n? is constant, it follows from (XIII) that ẋi =Π (n? ) ṅi =Π (n? ) (−S (ni ) ωi )  P 0 (dθ (ni , nk ))nk =Π (n? ) −S (ni ) S (ni ) k∈Ni fκ(i,k) ! X ? T 0 fκ(i,k) (dθ (ni , nk ))nk =Π (n ) (I − ni ni ) vectors are diametrically opposed), as long as fk0 (2) > 0 for all k ∈ M. As such, the matrix in (XIII), which is symmetric, is not positive semi-definite for s? 6= 1N (which means it has at least one eigenvalue with negative real part – Theorem 4.1.8 in [28]), which means any equilibrium where two neighboring unit vectors are diametrically opposed is unstable. On the other hand, the matrix in (XIII) is positive semi-definite for s? = 1N (this corresponds to the scenario where all unit vectors are synchronized), and the linearization cannot be used to infer stability of this equilibrium (nonetheless, this equilibrium is asymptotically stable). k∈Ni = P 0 fκ(i,k) (dθ (ni , nk )) (Π (n? ) nk − (nTi nk )Π (n? ) ni ) XIV. C ONVERGENCE TO C ONSTANT U NIT V ECTOR k∈Ni = X 0 fκ(i,k) (dθ (ni , nk )) (xj − (nTi nk )xi ) k∈Ni = X 0 fκ(i,k) (dθ (ni , nk )) (xj − xi ) + k∈Ni X 0 fκ(i,k) (dθ (ni , nk )) (1 − (nTi nk )) xi , (XIII.7) k∈Ni where ni and nk can be as in (XIII). By stack expressed T T T . . . x x and si as s , ing all x , i as x N 1  T  T T s1 . . . sN , (XIII) and (XIII) can be written compactly as ẋ = − (B ⊗ I)D1 (x, s)(B ⊗ I)T x + D2 (x, s)x =:A(x, s)x, (XIII.8) ṡ =0 if kxi k < 1 for all i ∈ N Theorem 16 provides conditions for convergence to a synchronized network, but it does not provide any insight on whether lim ni (t) exists, i.e., whether the synchronized t→∞ network converges to a constant unit vector or if it converges to a time-varying unit vector. Example 7: Consider the following unit vector,  T n(t) = cos(ln(t))) sin(ln(t))) 0 whose limit as time grows to infinity does not exist. Nonetheless, its time derivative is given by      − sin(ln(t))) 0 − 1t 0 cos(ln(t))) 1 cos(ln(t))) =  1t 0 0  sin(ln(t)))  ṅ(t) = t 0 0 0 0 0 (XIII.9)  with  D1 (x, s) =  ⊕ fk0 (dθ (k n, k̄ n)) ⊗ I k∈M ! D2 (x, s) = ⊕ X i∈N 0 κ(i,j) f  T 1 0 0 1 n(t) , S (ω(t)) n(t) t where ω(·) converges to 0. This means that convergence of ω(·) to 0 does not guarantee convergence of its unit vector to a constant unit vector. =S T i (dθ (ni , nj )) (1 − (n nk )) ⊗ I, j∈Ni where both D1 (x, s) and D2 (x, s) are positive semi-definite. As expected, the states x? = 0 and s? = 1̄ ∈ {z ∈ RN : z2i = 1, ∀i = {1, · · · , N }} are equilibria of the system with dynamics (XIII) and (XIII). The linearized system for (XIII) and (XIII), and around each equilibrium, is given by      ẋ A(0, s? ) 0 x = (XIII.10) ṡ 0 0 s    (B ⊗ I)D1 (0, s? )(B ⊗ I)T − D2 (0, s? ) 0 x =− 0 0 s where the condition kxi k < 1, for all i ∈ N , is dropped since the linearization is performed around x? = 0. Notice that 1T3N ((B ⊗ I)D1 (0, s? )(B ⊗ I)T − D2 (0, s? )) 13N = = − 1T3N D2 (0, s? )13N XX 0 =−3 (1 − s?l s?k )fκ(l,k) (2) l∈N k∈Nl is zero if and only if s? = 1N and negative otherwise (this includes all scenarios where at least two neighboring unit Proposition 30: Consider two functions on [a, b], h1 (x) and h2 (x), such R b that 0 ≤ h1 (x) ≤ h2 (x) for R b all x ∈ [a, b]. Then, if a h2 (x)dx is convergent, so is a h1 (x)dx (comparison test) [29]. 31: Consider a function R Proposition R b h(x) on [a, b]. If b |h(x)|dx is convergent, then so is h(x)dx [29]. a a Proposition 32: Consider a unit vector n with angular velocity ω. If ω converges exponentially fast to zero, then n converges to a constant unit vector. Proof: Consider an arbitrary constant unit vector e ∈ S 2 (for example, the standard basis vectors in R3 ). Then eT n(t) isR a scalar function of time, t and it satisfies eT n(t) = 0 eT S (ω(τ )) n(τ )dτ . Since |eT S (ω(τ )) n(τ )| ≤ kω(τ )k ≤ C exp(−λτ ) (for some positive C and λ), it follows from Propositions 30 and 31 that lim eT n(t) exists. Finally, since e is an arbitrary unit t→∞ vector, lim n(t) also exists. t→∞ The goal in this section is to study whether a network that converges to a synchronized configuration actually converges to a constant unit vector (in an unknown fixed orientation frame). An analysis for the dynamic case (control at the torque level) is not performed, but rather an analysis for the kinematic case (control at the angular velocity level). Consider then that ω is the control variable chosen as ω = RT (B ⊗ I)e. Consider that gk is of class P ∪ P 0 for all k ∈ M. Also, assume that, for each edge k, there exists an interval I = [0 b], for some 0 < b < π, such that if dθ (k n, k̄ n) ∈ I then 2 2 αk kek k ≤ dk (k n, k̄ n) ≤ ᾱk kek k , (XIV.1) where ek = gk (dθ (k n, k̄ n))S (k n) k̄ n. Then, if the network converges to a synchronized configuration, i.e. ni 1 = · · · = ni N , it follows that lim ni (t) = n? t→∞ for some constant n? and for all i ∈ N . In order to comeP to this conclusion, consider the Lyapunov M function V (n) = k=1 dk (k n, k̄ n) whose time derivative is rendered V̇ = − k(B ⊗ I)ek ≤ 0 by the chosen control law. If the network converges to the equilibrium configuration where ni 1 = · · · = ni N , it follows that V (t) converges asymptotically to zero, and consequently, for all edges k ∈ M, dθ (k n, k̄ n) will eventually enter the set I (which has non-zero measure). Say T is the time instant when, for all edges k ∈ M, dθ (k n, k̄ n) ∈ I for all t ≥ T . From the previous discussion, a finite T exists, and for t ≥ T one can say M M X X 2 2 αk kek (k n, k̄ n)k ≤V (n) ≤ ᾱk kek (k n, k̄ n)k k=1 k=1 2 2 min(αk ) ke(n)k ≤V (n) ≤ max(ᾱk ) ke(n)k . k k 2 2 Since V̇ = − k(B ⊗ I)ek ≤ −λmin (B T B) kek , it follows that kek converges exponentially fast to 0 (tree graph), and so does ωi (since ω = RT (B ⊗ I)e) for all i ∈ N . As such, it follows from Proposition 32 that all ni converge to a constant unit vector. We can perform a very similar analysis for the dynamic case, but we need to construct a different Lyapunov function (than that provided in Section IV-D), specifically one whose time derivative depends on both k(B ⊗ I)ek and kωi k. We do not present such Lyapunov function in this paper. Convergence to a constant vector in arbitrary graphs is also a topic for future research. We present next an example of a distance function that satisfies conditions (XIV). Example 8: Consider the distance function presented in Example 3 with α = 1, i.e., d(n1 , n2 ) = a(1 − nT1 n2 ). For this distance function g = a and ke(n1 , n2 )k = a kS (n1 ) n2 k. This distance function satisfies 2 1 ke(n1 , n2 )k 1 2 ≤ d(n1 , n2 ) ≤ ke(n1 , n2 )k a 2 a for dθ (n1 , n2 ) ∈ [0, π2 ]. XV. E XTRA R EMARKS Remark 33: In Definition 3, since f (·) is monotonous in (0, 2), lims→0+ f (s) and lims→2− f (s) exist; while lims→0+ f 0 (s) and lims→2− f 0 (s) do not necessarily exist. However,√in what follows the √important limits are lims→0+ f 0 (s)√s and lims→2− f 0 (s) 2 − s which exist: 0 lims→0+ f 0 (s) s = 0 since lim sups→0 √+ f (s) < ∞ and 0 0 lim inf s→0+ f (s) ≥ 0; lims→2− f (s) 2 − s√= 0 when lim sups→2− f 0 (s) < ∞; and lims→2− f 0 (s) 2 − s may 0 or may not be 0 when lim sups→2 √− f (s) = ∞. Also, ∞ 0 if f ∈ P then lim √s→2− f (s) 2 − s 6= 0: indeed, 0 − f (s) suppose lims→2 2 − s = 0, which implies that √ sups∈(0,2) f 0 (s) 2 − s =: b < ∞; since Z s f 0 (x)dx lim f (s) = lim+ f (s) + lim− s→2− s→0 s→2 0 Z s √ 1 √ = lim− (f 0 (x) 2 − x)dx s→2 2−x Z0 s √ 1 √ ≤b lim− dx = 2 2b < ∞, s→2 2−x 0 which implies that f 6∈ P ∞ . As such, f ∈ P ∞ ⇒ f ∈ P 0̄ . Figure 5 illustrates how the properties that f (·) satisfies affects the classes it belongs to. Definition 5: Given σ : R3 7→ R3 , we say σ ∈ Σ if ∃σ ∈ C 1 (R≥0 , R≥0 ) : σ(x) = σ(kxk)x, and σ 0max = supx∈R3 kDσ(x)k = supx∈R3 k ∂σ(x) ∂x k < ∞ (i.e., σ(·) is Lipschitz, see Lemma 3.1 in [30]) Moreover, we denote σ max = supx∈R3 kσ(x)k. Remark 34: Theorems 16 and 24 provide asymptotic results, namely limt→∞ e(n(t)) = 0 (or alternatively that limt→∞ dist(n(t), Ω? ) = 0, where Ω? = {n ∈ (S 2 )N : n = 1N ⊗ n? , ∀n? ∈ S 2 }). An open question is when can it be guaranteed that those limits converge to 0 exponentially fast. Similarly to [11], consider θ̇1 = f 0 (1−cos(θ1 −θ2 )) sin(θ2 − θ1 ) and θ̇2 = f 0 (1 − cos(θ1 − θ2 )) sin(θ2 − θ1 ), where we omitted the time dependencies; it follows that, if we denote θ = θ1 − θ2 , then θ̇ = −2f 0 (1 − cos(θ)) sin(θ). In [11], only f (s) = a12 s ⇒ f 0 (s) = a12 is considered, but in this manuscript we consider a wider p set of functions. Consider then the function f (s) = 18 ( s(2 − s)(s − 1) + arccos(1 − s)), and notice that f ∈ P0 (see Fig. 6). It follows that θ̇ = −| sin(θ)| sin(θ); therefore, if θ(0) ∈ [0, π2 ], it follows that θ(t) = arccot(t + cot(θ(0))), R ∞which does not converge exponentially fast to 0 (since 0 θ(t)dt = ∞). Consider now the function f (s) = s, and notice that f ∈ P0̄ . It follows that θ̇ = −2 sin(θ) < −θ, where the inequality follows for θ ∈ [0, π2 ]; therefore, if θ(0) ∈ [0, π2 ], it follows that θ(t) ≤ exp(−t), which does converge exponentially fast to 0. This suggests that, in this manuscript’s framework, exponential convergence cannot be guaranteed for all f ∈ P̄, while asymptotic stability can still be guaranteed.
3cs.SY
The Salesman’s Improved Paths: 3/2 + 1/34 Integrality Gap and Approximation Ratio ∗ András Sebő1 and Anke van Zuylen2 1 arXiv:1604.02486v1 [cs.DM] 8 Apr 2016 2 CNRS, Univ. Grenoble Alpes, Optimisation Combinatoire (G-SCOP) Department of Mathematics, College of William & Mary, Williamsburg, VA, [email protected] January 16, 2018 Abstract We give a new, strongly polynomial algorithm and improved analysis of the metric s − t path TSP. The algorithm finds a tour of cost less than 1.53 times the optimum of the subtour elimination LP, while known examples show that 1.5 is a lower bound for the integrality gap. A key new idea is the deletion of some edges, where the arising connectivity problems can be solved for a minor extra cost. On the one hand our algorithm and analysis extend previous tools, at the same time simplifying the framework. On the other hand new tools are introduced, such as a linear program that allows us to efficiently choose the probabilities of edges used for analyzing the reconnection cost and a new way of applying the matroid partition theorem and algorithm to different matroids, in order to write the subtour elimination optimum as a particular convex combination of spanning trees. Furthermore, the 3/2 target-bound is easily reached in some relevant new cases. keywords: path traveling salesman problem (TSP), approximation algorithm, Christofides’ heuristic, the Chinese postman problem, matching theory, T -join, polyhedra 1 Introduction In the Traveling Salesman Problem (TSP), we are given a set V of n “cities”, a cost function c : V2 → Q≥0 , and the goal is to find a tour of minimum cost that starts and ends in the same city and visits each city exactly once. This “minimum length Hamiltonian circuit” problem is one of the most well-known problems of combinatorial optimization. In its full generality, the TSP is hopeless: it is not only NP-hard to solve but also to approximate, and even for quite particular lengths, since the Hamiltonian cycle problem in 3-regular graphs is NP-hard [15]. A condition on the cost function that helps in theory and is often satisfied in practice is known as the “triangle inequality” in complete graphs. A nonnegative function on the edges that satisfies this inequality is called a metric function. For a thoughtful and entertaining account of the difficulties and successes of the TSP, see Bill Cook’s book [6]. If the cost function is a metric, then P we may relax the problem into finding a Eulerian submultigraph (V, E ∗ ) of minimum cost e∈E ∗ c(e), since a traversal of this graph can be shortcut to a tour without increasing the cost. The multiplicities of edges can be restricted to be 0, 1 or 2. ∗ Research initiated during the Hausdorff Trimester Program in Combinatorial Optimization, Hausdorff Institute of Mathematics, Bonn; Partially supported by LabEx PERSYVAL-Lab (ANR 11-LABX-0025) and by a grant from the Simons Foundation (#359525, Anke Van Zuylen). 1 Christofides [5] gave a very simple 32 -approximation algorithm for the metric TSP: separate the problem into finding a minimum cost connected subgraph (minimum cost spanning tree) and completing this tree to an Eulerian subgraph, by correcting the parity of the constructed tree, S, i.e., by adding a minimum cost TS -join, where TS is the set of vertices that have odd degree in S (Chinese postman problem). Wolsey [25] observed that Christofides’ algorithm also implies a bound on the strength of the well-known subtour elimination linear program (LP), that was introduced by Dantzig, Fulkerson and Johnson [8]: X Min c(x) := c(e)x(e) V e∈( 2 ) X subject to: x(e) = f ({i}), for all i ∈ V, (1) e∈δ({i}) X e∈δ(U ) x(e) ≥ f (U ), x(e) ≥ 0, for all ∅ ( U ( V,   V for all e ∈ . 2 (2) (3) where f (U ) ≡ 2 for all sets U , and δ(U ) = {{i, j} ∈ E : i ∈ U, j 6∈ U }. The first set of constraints impose the condition that every vertex is visited once, and the second set of constraints, known as the subtour elimination constraints, ensure that every subset is visited at least once. Let x∗ denote an optimal solution to the subtour elimination LP, and OP TLP := OP TLP (c) := c(x∗ ) the optimal objective value. The integrality gap for metric TSP is the worst-case ratio, over all metric cost functions, of the cost of the optimal tour to OP TLP . Wolsey [25] observed that x∗ is in the the spanning tree polytope, and that x∗ /2 is in the T -join polyhedron for any set T of even size, which implies that the integrality gap of the subtour elimination LP is at most 32 . Despite significant effort, no improvements are known for either the approximation ratio or the integrality gap for the metric TSP. A relevant generalization of the (metric) TSP is the (metric) s − t path TSP. In this problem, the salesman starts in s, ends in t, and needs to visit every other city once. In other words, the goal is to find a Hamiltonian path from s to t of minimum cost. The subtour elimination LP for the s − t path TSP is as above, but now defining f (U ) = 1 if |U ∩ {s, t}| = 1 and f (U ) = 2 otherwise. Note that the special case s = t is the regular traveling salesman problem. In this paper, we describe a new, combinatorial, strongly polynomial algorithm and improved analysis with the new approximation and integrality ratio 3/2 + 1/34 for the metric s − t path traveling salesman problem. To achieve this, we also need to delete edges from Christofides’ trees, in the hope that they will be automatically reconnected during parity correction; however, this is not always the case, and whenever it is not, we also need to invest separately in reconnection; for analyzing it, we use an LP for defining the distribution of a random choice for the reconnecting edges, we explore a new way of using matroid partition for finding the initial set of trees, and we consider a specific convex combination of T -joins rather than a minimum cost T -join. To the best of our knowledge, the first relevant occurrence of possibly different s and t is in Hoogeveen’s article [17], providing a Christofides-type approximation algorithm for the metric case, with an approximation ratio of 5/3 rather than 3/2. √There had been no improvement until An, Kleinberg and Shmoys [1, 2] improved this ratio to 1+2 5 < 1.618034 with a simple algorithm and an ingenious new framework for the analysis. The algorithm in [1, 2] is the best-of-many version of Christofides’ algorithm. It first determines a minimum cost solution x∗ of the subtour elimination LP. Then writing x∗ as a convex combination of spanning trees and adding Christofides’ parity correction for each, the algorithm outputs the best of the arising solutions. The best-of-many 2 algorithm was used by subsequent publications and is also used in the present work with some modification; mainly, we alter Christofides’ algorithm by deleting certain edges from the spanning tree (see Section 2.1), and by then correcting both parity and connectivity. To analyze the best-of-many algorithm, An, Kleinberg and Shmoys [1] come up with a certain “master formula” to bound the average parity correction cost, that was also used in subsequent publications. Sebő [20] improved the analysis further by separating each spanning tree in the convex combination into an s − t path and its complement. Letting p∗ be the indicator vector of the average of the s − t paths, and q ∗ of the edges that are not on the s − t path, we have that x∗ = p∗ + q ∗ . This separation makes it possible to use a simple and transparent master formula (see (6) in Section 2.2), but, surprisingly, until now the original, quite involved one was used by all the papers on s − t path TSP following [1]. Moreover, p∗ is further decomposed: it is the sum of naturally arising vectors (see xQ later on). These vectors are getting an extended role in the present paper (Section 2.2). For the s − t path TSP on “graph metrics”, that is, cost functions that are defined as the shortest path distances on a given unweighted graph, Gao [13] proves the existence of a tree in the support of LP solution x∗ that has exactly one edge in so-called narrow cuts (see Section 2.1 below). For such a tree, it is possible to bound the cost of the parity correction by c(x∗ )/2, as in Wolsey’s version of Christofides’ analysis. This allows Gao to give a very elegant proof of the approximation ratio 3/2 for graph metrics, a result that was first shown by [21] with a combinatorial, but more difficult proof. Recently, Gottschalk and Vygen [16] significantly extended Gao’s approach by proving the existence of a decomposition of x∗ into certain “layers”; each layer consists of spanning trees that have exactly one edge in a subset of the narrow cuts. This will turn out to be needed in our analysis. We show that it is actually a particular matroid partition, which is also algorithmically useful for a strongly polynomial combinatorial algorithm (see Section 2.3 and Section 5). However, the constraints of the corresponding matroid partition (or basis packing) theorem of Edmonds [9] are apparently not straightforward to prove (see Appendix D for a weaker statement and the exposition of the problem); we therefore make use for the moment of [16] for checking the validity of Edmonds’ matroid partition condition. The occurring particular matroid sums will probably remain a helpful tool for the s-t-path TSP problem, and we believe that a direct way of proving Edmonds’ condition will eventually be found. In the next section, we provide more details for the approaches described above in the form we need them in this paper, along with the novel algorithm and tools of our analysis. 2 Preliminaries, Algorithm and Outline of the Analysis In this section we introduce our notation, terminology, and definitions. In the first subsection we also state our new algorithm. The second subsection gives an overview of the ideas we need to analyze our algorithm. The third subsection explains a particular phenomenon of the algorithm and its analysis: the necessity to choose a particular convex combination of trees. 2.1 The Algorithm: Best-of-Many with Deletion  Given a finite set V and costs c : V2 → Q≥0 satisfying the triangle inequality, let x∗ be the minimum cost solution to the subtour elimination LP for s − t path TSP, and E = {e : x∗ (e) > 0}. We will slightly abuse notation, and use the same notation for a (multi) subset of E and its own E incidencePvector in ZE notation ≥0 . For a vector z ∈ R and any (multi)subset H of E, the usual P z(H) := e∈H z(e) is then just the scalar product of two vectors, as well as c(z) := e∈E c(e)z(e). 3 We can write x∗ as a convex combination of spanning trees; of Pthat is, there exist∗ a collection P spanning trees S and coefficients λS > 0 for S ∈ S such that S∈S λS = 1 and x = S∈S λS S, and these can be found in strongly polynomial time with a combinatorial algorithm. (The existence follows from Tutte and Nash-Williams’ theorems [23], [18]; the combinatorial algorithm from Cunningham [7]; see also Barahona [3] for a result specifically concerning spanning trees, and Schrijver [19, page 891] for an account of the best complexities so far.) For a set of edges S, we let TS be the set of odd degree vertices of S, i.e. those that have an odd number of incident edges from S. For two sets A, B, let A△B := (A \ B) ∪ (B \ A) be the symmetric difference operation, which corresponds to the mod 2 sum of the incidence vectors. Then the vertex set with the “wrong” degree parity is TS △{s, t}. A T -join (T ⊆ V, |T | is even) is a set of edges J such that |J ∩ δ({i})| is odd for i ∈ T and |J ∩ δ({i})| is even for i ∈ V \ T . The operation “+” between sets means the disjoint union (sum of the multiplicity vectors). If S is a spanning tree and JS a TS △{s, t}-join, (V, S + JS ) is a spanning connected multigraph in which s and t have odd degree and every other vertex has even degree. We call the edge set of such a graph an {s, t}-tour. The best-of-many Christofides’ (BOMC) algorithm computes a minimum cost TS △{s, t}-join for every tree S with λS > 0, and outputs the resulting {s, t}-tour of minimum total cost. The cost of the BOMC solution is at most the cost of the {s, t}-tour we obtain by adding a TS △{s, t}-join to a randomly chosen spanning tree S with Pr(S = S) = λS . Clearly, the expected cost of S is equal to c(x∗ ); the main difficulty for the analysis of the s-t path TSP version of Christofides’ algorithm is the “parity correction” part. It follows from Edmonds and Johnson [11] that the TS △{s, t}-join polyhedron is X y(e) ≥ 1 for all U such that |U ∩ TS △{s, t}| is odd, e∈δ(U ) y(e) ≥ 0 for all e ∈ E. As noted above, Wolsey [25] observed for the TSP (i.e. for s = t) and a solution x∗ to the subtour elimination LP for the TSP that x∗ /2 is in the T -join polyhedron for any set T ⊆ V, |T | even. If s 6= t this is not true anymore for a solution x∗ to the corresponding subtour elimination LP since for cuts U separating s and t, called s − t cuts, f (U ) = 1 in the LP, and hence we are only guaranteed that x∗ (δ(U ))/2 ≥ 12 . Following [1, 2], we say that Q ⊂ E is narrow if x∗ (Q) < 2. We let Q be the set of all narrow cuts, that is, Q = {Q ⊂ E : x∗ (Q) < 2}. Figure 1 shows an example of an optimal solution x∗ to the subtour elimination LP for an s − t path TSP and the narrow cuts Q. An, Kleinberg and Shmoys [1, 2], observe that Q is a chain: Lemma 1 (An, Kleinberg, Shmoys [1, 2]) Let U1 , U2 such that s ∈ U1 ∩ U2 , and Qi = δ(Ui ) is in Q for i = 1, 2. Then either U1 ⊆ U2 , or U2 ⊆ U1 . We include a brief proof (with some useful elements for the more general Lemma 15): Proof: The lemma is a consequence of the submodular inequality that will be helpful in the following equality form: x∗ (δ(A)) + x∗ (δ(B)) = x∗ (δ(A ∩ B)) + x∗ (δ(A ∪ B)) + 2x∗ (A \ B, B \ A), (4) where (X, Y ) is the set of edges with one endpoint in X, the other in Y . The equality is easily verified. Now to show Lemma 1 apply (4) to A := U1 , B := V \ U2 . If the lemma does not hold, A ∩ B and A ∪ B are both non-empty, strict subsets of V . Furthermore, note that A ∩ B contains neither of s, t and A ∪ B contains both of s, t. Hence, by constraint (2), the first and second terms in the right hand side of (4) are at least 2, contradicting that the left hand side is strictly smaller than 4 since δ(U1 ), δ(U2 ) ∈ Q. ✷ 4 Q2 Q1 Q3 Q4 Q5 Q6 3 s 1 2 4 5 6 t Figure 1: An example from Gao [14]: for full edges x∗ (e) = 1, for dashed edges x∗ (e) = 2/3 and for dotted edges x∗ (e) = 1/3. The narrow cuts are indicated by gray lines and labeled Q1 , . . . , Q6 . An, Kleinberg and Shmoys [1, 2] observe that for a narrow cut Q = δ(U ), the TS △{s, t}-join polyhedron has a constraint for U only if the spanning tree S has an even number of edges in Q. In Section 2.2, we give all necessary details of their approach and later works [20, 14, 24, 16] on analyzing the cost of the TS △{s, t}-join for S ∈ S.  INPUT: Set V , two vertices, s, t ∈ V and c : V2 → Q≥0 . OUTPUT: An {s, t}-tour. Let x∗ be an optimal solution to the subtour elimination LP for the s − t path TSP, and write x∗ as a layered convex combination of O(|E|) spanning trees (see the definition in Section 2.3, and a proof of existence in Section 5). Let S be the collection of trees with positive coefficient. for S ∈ S do Construct forest-based {s, t}-tour: Let L(S) be the set of lonely edges of S, and F := F (S) := S \ L(S). Let yF be the vector in the TF △{s, t}-join polyhedron defined in Section 3. Write yF as a convex combination of at most O(|E|) different TF △{s, t}-joins. Let JF be the collection of TF △{s, t}-joins with positive coefficient. for JF ∈ JF do Contract the components of (V, F + JF ), and let 2DF +JF be the edge set of a doubled minimum cost spanning tree on the contracted graph. P1 (F, JF ) = F + JF + 2DF +JF . end for Let P1 (S) be a minimum cost {s, t}-tour among {P1 (F, JF )}JF ∈JF . Construct Christofides-based {s, t}-tour: P2 (S) = S + JS , where JS is a minimum cost TS △{s, t}-join. end for S Return a minimum cost {s, t}-tour from among S∈S {P1 (S), P2 (S)}. Algorithm 1: Best-of-Many With Deletion (BOMD) In this paper, we modify the best-of-many Christofides’ algorithm by deleting certain edges called lonely from the spanning trees S ∈ S. We denote by L(S) the set of lonely edges of tree S, where we require for all e ∈ L(S) that the two components of S \ {e} are the two sides of a narrow cut, that is,  L(S) ⊆ e ∈ S : there exists Q ∈ Q such that Q ∩ S = {e} . (5) Note that we do not require equality in (5), and this flexibility will enable us to choose the lonely 5 3 S1 s 1 2 4 5 t 6 3 s S2 1 2 4 3 5 6 s t 1 2 4 5 6 t S3 Figure 2: x∗ from Figure 1 expressed as a layered convex combination of three spanning trees S1 , S2 , S3 , each with multiplier λSi = 1/3. Note that S1 is a so-called Gao-tree (see Section 2.3). All edges but {3, 4} are lonely in S1 , and in S2 , S3 only the edges incident to s and t are lonely. edges to satisfy additional conditions. For each tree S ∈ S, we delete its lonely edges to obtain a forest F (S) := S \L(S). We write F instead of F (S) whenever S is clear from the context. We then add a TF △{s, t}-join to obtain a graph in which each vertex except for s and t has even degree, and finally, we add a doubled spanning tree on the components of this graph to get an {s, t}-tour. Note that adding a spanning tree on the components suffices to make the graph connected, and we double it in order to keep the degree parities. In order to bound the cost of the doubled spanning tree, we will need to use properties of the TF △{s, t}-join; more precisely, we will take a fractional solution in the TF △{s, t}-join polyhedron and write it as a convex combination of TF △{s, t}-joins, and then repeat the computation for each of the TF △{s, t}-joins in the convex combination. In addition to computing several forestbased {s, t}-tours (with different TF △{s, t}-joins) for each S ∈ S, the algorithm also computes a Christofides-based {s, t}-tour, and returns the least expensive among all constructed {s, t}-tours. (See Algorithm 1 for a complete formalized description.) 2.2 The Analysis and its Setting: Deletion, Correction, Completion, Reconnection, Balancing P P Given x∗ = S∈S λS S, where S is a set of spanning trees, λS > 0 for S ∈ S, and S∈S λS = 1, recall that this coefficient vector can be interpreted as a probability distribution. We will slightly abuse notation and let S denote both the support of the convex combination, and also a tree-valued random variable with Pr(S = S) = λS . (See Figure 2 for such a convex combination, where x∗ is from Figure 1.) We will also take distributions over convex combinations of T -joins. We let E [·] denote the expectation or average of a random vector in RE ; for example E [S] = x∗ . For a spanning tree S, let S(s, t) be the s − t path of S. Various notations for trees S will be inherited by S (and similarly for T -joins): for instance, S(s, t) is the path-valued random variable which is equal to S(s, t) on the event S = S. 2.2.1 Bounding the cost of the Christofides-based {s, t}-tours To analyze the average cost of the Christofides-based {s, t}-tours, we detail an observation of [20] used in the analysis of the best-of-many Christofides’ algorithm. Observation 2 Since S = S(s, t) + S \ S(s, t), and for any S ∈ S, S + S \ S(s, t) is an {s, t}-tour, defining p∗ := E [S(s, t)] , q ∗ := E [S \ S(s, t)] , x∗ = E [S] = p∗ + q ∗ ∈ RE , the cost of the solution 6 found by the best-of-many Christofides’ algorithm can be bounded by E [c(S) + c(S \ S(s, t))] = c(x∗ ) + c(q ∗ ) = 2c(x∗ ) − c(p∗ ). When c(q ∗ ) is sufficiently small compared to c(p∗ ), then this bound provides the best approximation guarantee; when it is large, another bound is better, and it is shown in [20] that the best of the two provides a bound of 8/5 on the approximation and integrality ratio. In Appendix A, we rederive this bound in a surprisingly simple way. In fact, since we will be taking the minimum of the Christofides-based {s, t}-tour and the forestbased {s, t}-tour, this observation allows us to “erase” S \ S(s, t) from further consideration for parity correction, i.e., for analyzing the cost of the forest-based {s, t}-tours, we will only take the complementary S(s, t) into account. 2.2.2 Basic parity correction Concretely, to analyze the parity correction for the forests, we will always use x∗ + γ S(s, t), 2 (6) as a so-called basic parity correction, where γ is a chosen parameter between 0 and 1/2. The basic ∗ parity correction plays a similar role to the vector β x2 + (1 − β)S that was used in the analysis of [1], which was also adopted by subsequent work [20, 14, 24, 16]. ∗ For γ = 1/2 the basic parity correction x2 + 21 S(s, t) for any S ∈ S gives a feasible solution to the T -join polyhedron for any set T of even size, so in particular it allows us to bound the cost of the TS △{s, t}-join. On average, the basic parity correction with γ = 1/2 will equal p∗ x∗ 2 + 2 , and combined with Observation 2, we get the integrality gap and approximation ratio min 32 c(x∗ ) + 12 c(p∗ ), 2c(x∗ ) − c(p∗ ) ≤ 53 c(x∗ ) equal to Hoogeveen’s ratio. We can similarly use 1 x∗ 2 + 2 S(s, t) as a fractional TF △{s, t}-join for the forest F = S \ L(S); however, the summand 1 2 S(s, t) is too expensive to get a good bound. To improve the ratio further, we will need γ < 1/2, but then the basic parity correction vector may not be feasible for the TF △{s, t}-join polyhedron. Hence, as in previous analyses of the bestof-many algorithm, we will need to add a parity completion1 vector to the basic parity correction vector so as to ensure the constraints of the TF △{s, t}-join polyhedron are satisfied for the narrow cuts Q with x∗ (Q) < 2 − 2γ, in which F contains an even number of edges. However, we cannot reduce γ to 0, since the completion vectors are too expensive for large narrow cuts. The treshold 2 − γ for being “large” will be chosen optimally at the end of Section 3. 2.2.3 Parity completion The parity completion vector will add (fractional) edges for each narrow cut Q if |Q ∩ F | is even. If we define the set of lonely edges in tree S by taking (5) with equality, the expectation of the incidence vectors of the lonely edges for each narrow cut Q is equal to a vector defined in Sebő [20], which was used in [20] for defining good parity completion vectors. In particular, for each narrow cut Q, we introduce a vector xQ ∈ RE , where xQ (e) := Pr(e is the lonely edge of S in Q). 1 (7) Our terminology differs from that in [1], where the term “correction vector” is used for what we call the “parity completion vector”. We use the term “parity correction vector” for a vector that is in the TF △{s, t}-join polyhedron, and it will be composed of basic parity correction and parity completions. 7 If (5) is satisfied with equality, then Pr(|Q ∩ S| = 1) = xQ (Q) and xQ (Q) ≥ 2 − x∗ (Q), (8) P because x∗ (Q) = E [|Q ∩ S|] = ∞ k=1 k Pr(|Q ∩ S| = k) ≥ Pr(|Q ∩ S| = 1) + 2(1 − Pr(|Q ∩ S| = 1)). This is also observed in equation (3) of [2] as Markov’s inequality. As mentioned after (5), L(S) is allowed to be a proper subset of the right hand side of (5), and the lonely edges will be chosen to satisfy additional properties. One property that we require now from the set of lonely edges L(S) in addition to (5), is that xQ (Q) = 2 − x∗ (Q), (9) P where we recall that xQ (Q) = e∈Q Pr(L(S) ∩ Q = {e}). This equality can clearly be satisfied by removing edges from L(S) for some S ∈ S appropriately. ∗ Q (Q) = 1, on every cut. In other words, adding xQ /2 to the basic Hence, we have that x (Q)+x 2 parity correction vector for every Q such that |Q ∩ F | is even gives a suitable vector to complete parity correction, that is, for parity completion. On the other hand, if we let F be the random forest obtained by deleting L(S) from S, then we also have that xQ (e) is the deletion probability for edge e and cut Q. So by deleting the lonely edges from S, we “save up” for parity completion. In Section 3, we show how to put these ingredients together to construct an appropriate parity correction vector yF , and we analyze its mean cost over S ∈ S. 2.2.4 Reconnection Finally, we need to bound the average cost of the doubled minimum cost spanning tree 2DF +JF between the components of (V, F + JF ), meaning the doubled edge-set of a spanning tree in the graph whose vertex-set is the set of contracted components of (V, F + JF ). Note that doubling a minimum cost spanning tree between the components of (V, F + JF ) gives the minimum possible cost of the reconnection of F + JF if using only doubled edges; for bounding the expectation of 2DF +JF we can therefore consider any set of doubled edges that reconnect the forest. For a tree S ∈ S, denote by Q(S) ⊆ Q the set of lonely cuts of S: cuts Q for which |Q ∩ S| = 1 for which the unique edge in Q ∩ S is in L(S). For Q ∈ Q(S), we denote by eQ S the (incidence vector of) the unique edge of Q ∩ S. Since F = S \ L(S), JF must contain at least one edge in every cut in Q ∈ Q(S), since |F ∩ Q| is even (and equal to 0). Now, if each edge in JF is contained in at most one lonely cut, then (V, F + JF ) is connected, and the doubled spanning tree is empty, its cost is 0. We will call the edges that are contained in more than one lonely cut of S the bad edges for S, and denote them by B(S), that is, B(S) = {e ∈ E : there exist Q1 6= Q2 ∈ Q(S), e ∈ Q1 ∩ Q2 }. Ideally, we would like a low cost TF △{s, t}-join JF (or, a fractional TF △{s, t}-join yF ) that has no edges in B(S). Figure 3 shows a forest F and a TF △{s, t}-join JF with two bad edges. As we sketched above, our fractional TF △{s, t}-join is going to consist of the basic parity ∗ correction x2 + γS(s, t) plus a parity completion vector for which we will use the xQ vectors for Q ∈ Q. There is no way to avoid that the basic parity correction vector contains bad edges, but we will choose our convex combination of x∗ into spanning trees in such a way that parity completion does not add more bad edges (see sections 2.3 and 5 for more details). Given the parity correction vector yF that we construct, we consider a random TF △{s, t}-join JF with E [JF ] = yF . In Section 4 we give an upper bound on the expected cost of the doubled spanning tree 2DF +JF , where the expectation is over JF . For any e ∈ E, we define Q(S, e) as the 8 3 s 1 2 4 5 6 t Figure 3: The forest F1 := F (S1 ) obtained by removing the lonely edges from S1 in Figure 2 contains only the edge {3, 4} indicated in (solid) black, the dashed edges are the lonely edges of S1 . The (solid) red edges give a possible TF1 △{s, t}-join JF1 , where edges {s, 3} and {3, 6} are bad edges. An upper bound on 2DF1 +JF1 can be obtained by adding two copies of two out of the three lonely edges {s, 1}, {1, 2}, {2, 4} and adding two copies of either {4, 5} or {5, 6}. set of lonely cuts of S that contain e; note that b ∈ B(S) if and only if |Q(S, b)| ≥ 2. We can upper bound the cost of 2DF +JF by, for each bad edge b ∈ JF , taking two copies of each lonely edge in S ∩ Q(S, b) except possibly one such lonely edge; so the cost can be upper bounded by doubling the cost of [ Q {eS : for all but at most one Q in Q(S, b)}. (10) b∈JF The challenge that is addressed in Section 4 is to decide for which Q ∈ Q(S, b) we do not add two copies of the edge eQ S . The goal is to choose it so that on average (over all JF ∈ JF ), we get a hgood bound on the number of times we use eQ S , and hence on the cost of 2DF +JF . Note that i Q Q E eQ S = x , and we thus express the cost of reconnection in terms of the vectors {x }Q∈Q as well. 2.2.5 Balancing To bound the average cost of the forest-based {s, t}-tours, we now simply add up the average cost of the forest plus parity correctionP(consisting of basic parity correction and parity completion) plus reconnection. By noting that Q∈Q xQ ≤ E [S(s, t)] = p∗ (since the lonely edges of spanning trees S must be contained in S(s, t)), all terms of the bound on the average cost of the forest-based {s, t}-tours will be expressable in terms of x∗ and p∗ . Finally, the analyis can take the minimum of the Christofides-based {s, t}-tours (which by Observation 2 has cost decreasing in c(p∗ )) and the cost of the forest-based {s, t}-tours is increasing in c(p∗ ). The worst case for the minimum of the two is when the two are balanced, that is equal. 2.3 Matroid Partition to Avoid Additional Reconnection Besides the improved algorithm, and the main ideas of the analysis, there is an important, technical looking detail that has to be handled: as explained in the previous subsection, not only parity, but connectivity also has to be corrected if the TF △{s, t}-join contains bad edges. We show in Section 5 that when choosing a convex combination of trees in a particular way that can be computed with Edmonds’ “matroid partition algorithm”, parity completion does not contribute to the probability of bad edges occurring in the TF △{s, t}-join. Let us introduce the reader to this nontrivial matter. In a beautiful paper [13], Gao showed that there always exists a spanning tree S in the support of x∗ (that is, in S ⊆ {e : x∗ (e) > 0}) such that |S ∩ Q| = 1 for every narrow cut Q. Whenever there exists such a minimum cost spanning tree that satisfies this property (like for “graph-metrics”) the 3/2 ratio and integrality gap follow straightforwardly. A tree in which every narrow cut is lonely, that is, contains a single edge of the tree, is called a Gao-tree. The interesting idea of choosing the convex combination of spanning trees in a particular way, so as to decrease the cost of parity completion, was introduced in Vygen [24]. The claimed progress in the ratio was only 0.001, but the idea of reassambling the trees S ∈ S which participate in the convex 9 combination is further developed by Gottschalk and Vygen [16]. They generalize the concept of Gao-trees, and the reassambling leads to a powerful result: a convex combination using generalized Gao-trees. Although the use of local changes is constructive, the algorithm it implies is not a polynomial time algorithm. However, using an approximate solution to this convex combination that can be found in polynomial time, Gottschalk and Vygen state that the best-of-many algorithm gives a 1.566-approximation and integrality ratio for the s − t path TSP. In Section 5 we prove that (generalized) Gao-trees form a matroid, and that a convex combination into these trees can be found as a corollary of Edmonds’ matroid partition algorithm [10] (see also [12, Theorem 13.3.1], [19, Corollary 42.1a]). As a consequence, a “suitable” convex combination is constructed directly (without a posteriori reassambling or exchanges), in strongly polynomial time, from the matroid partition algorithm applied to the matroids of (generalized) Gao-trees. We note that, independent of our work, Kanstantsin Pashkovich also pointed out that this convex combination can be found (in weakly polynomial time) using the ellipsoid method [Jens Vygen, private communication, 2016]. We will use the term “layered” to refer to the resulting convex combination: We say that the spanning tree S of G with lonely edges L(S) and consequently defined lonely cuts Q(S) is layered, if for each Q ∈ Q(S) and cut Q′ such that x∗ (Q′ ) ≤ x∗ (Q) we have Q′ ∈ Q(S), that is, Q′ is also lonely in S if it is smaller than another cut Q lonely in S. We say that the tree-valued random variable S, or the convex combination of spanning trees S with coefficients λS for S ∈ S is layered, if E [S] = x∗ , (5), (9) hold, and each S ∈ S is layered. In Section 5 the existence and (strongly) polynomial algorithm for finding a layered convex combination will be confirmed. We can view these results as strengthenings of (9), which states that the larger the cut, the more rarely it is lonely; in a layered convex combination this is true in the stronger sense of the containment (implication) of events. In order to achieve this, we exploit the possibility of proper containment in (5), i.e., Q(S) may be a proper subset of {Q ∈ Q : |Q ∩ S| = 1}. We finish this section by showing how layered convex combinations allow us to avoid additional reconnection costs. We also state the theorem that converts this to a simple bound on the total of reconnection costs; the proof is deferred to Section 4. Lemma 3 Let S be layered, S ∈ S, and Q ∈ Q \ Q(S). Then xQ (B(S)) = 0. Proof: We prove xQ (Q′ ) = 0 for each Q′ ∈ Q(S). Indeed, since S is layered, x∗ (Q′ ) < x∗ (Q), for otherwise Q ∈ Q(S). But then using that S is layered, Q′ is lonely in every tree S ′ ∈ S where Q is lonely, so Q and Q′ cannot have a common edge in such a tree S ′ , proving xQ (Q′ ) = 0. Therefore, the edges e with xQ (e) > 0 are not contained in any Q ∈ Q(S) at all, whereas the edges of B(S) are contained in at least two cuts of Q(S). ✷ Algorithm 1 loops through a layered S, and has an inner loop through the support JF of a convex combination of TF △{s, t}-joins, for each F ∈ F := S \ L(S). Consider the corresponding TF △{s, t}-join valued random variable JF (with E [JF ] = yF ) that accompanies F . (In Algorithm 1, the inner loop determines a minimum cost reconnecting edge-set 2DF +JF for every JF in the support of JF , thus derandomizing the random TF △{s, t}-join JF that accompanies F .) Theorem 4 Assume S is layered, S ∈ S, and F = S \ L(S) is accompanied by JF . Then X E [c(2DF +JF )] ≤ (x∗ (Q) − 1)c(eQ S ). Q∈ Q(S) 10 3 The New Ratio In this section we prove the main result, relying on Theorem 4. It may be useful for the reader to consult Appendix B at this point, where we show how the bound 3/2 can be proved more simply for special cases, without the need for Theorem 4. Theorem 5 The Best-of-Many With Deletion (BOMD) algorithm returns a solution to the s − t  1 OP TLP . path TSP of cost at most 32 + 34 Proof: We analyze the different parts of the forest-based {s, t}-tour P1 (S) averaged over S ∈ S. Forest: Let F := S \ L(S). Expected Value of Forest : E [F] = x∗ − X xQ . Q∈Q Parity Correction (PC): For each forest F , we define yF as the sum of the following vectors: Basic Parity Correction (BP): 12 x∗ + γ S(s, t). Note that (BP) is enough to ensure that yF satisfies the constraints of the TF △{s, t}-join polyhedron for all Q = δ(U ) with x∗ (Q) ≥ 2 − 2γ. 1 Expected Value of (BP): x∗ + γ p∗ . 2   1 ∗ Parity Completion for Empty Cuts (PCE): 1 − x (Q) − γ eQ S. 2 We recall that eQ S is the (indicator vector of) the lonely edge of S in Q. We add this (PCE) vector to yF for every Q ∈ Q(S) such that x∗ (Q) ≤ 2 − 2γ. Note that then (BP)+(PCE) suffices of the TF △{s, t}-join polyhedron for each narrow cut to ensure that yF satisfies the constraint h i Q Q such that Q ∩ F = ∅. Since E eS = xQ , we have:   X 1 Expected Value of (PCE): 1 − x∗ (Q) − γ xQ . 2 Q∈Q: x∗ (Q)≤2−2γ ! 1 − 12 x∗ (Q) − γ xQ . Parity Completion for Non-Empty Even Cuts (PCL): 2 − x∗ (Q) We add this vector to yF for every Q such that x∗ (Q) ≤ 2 − 2γ and |F ∩ Q| is even and at least 2. By (9), yF satisfies the constraints of the TF △{s, t}-join polyhedron also for narrow cuts such that |F ∩ Q| is even and non-zero. Contrary to (PCE), (PCL) does not depend on (the outcome of the random variable) S, but only on the cut Q ∈ Q. However, the choice of adding it or not, depends on S: we add it only if |F ∩ Q| is even and at least two, the probability of which can be bounded by Pr(|S ∩ Q| ≥ 2), which is at most 1 − (2 − x∗ (Q)) by (9), so we add (PCL) with probability at most x∗ (Q) − 1: ! X 1 − 12 x∗ (Q) − γ xQ . Expected Value of (PCL): (x∗ (Q) − 1) ∗ (Q) 2 − x ∗ Q∈Q: x (Q)≤2−2γ The combination of the parts (BP) + (PCE) + (PCL) gives a fractional solution to the TF △{s, t}join polyhedron for any fixed tree S and its uniquely determined forest F = S \ L(S) :   X 1 ∗ 1 ∗ yF = x + γ S(s, t) + 1 − x (Q) − γ eQ S 2 2 Q∈Q:x∗ (Q)<2−2γ,|Q∩F |=0 ! X 1 − 12 x∗ (Q) − γ xQ . (11) + ∗ (Q) 2 − x ∗ Q∈Q:x (Q)<2−2γ,|Q∩F |≥2,even 11 Reconnection: For each S ∈ S, define the random TF △{s, t}-join E [JF ] = yF . By P JF with ∗ Theorem 4: Expected Value of Reconnection Cost: E [c(2DF +JF )] ≤ Q∈Q (x (Q) − 1)c(xQ ). TOTAL: If we add up the costs of the bounds on the different parts of the solution, we get 3 ∗ ∗ ∗ Q 2 c(x ) + γc(p ) plus the sum over all Q ∈ Q of some multiple (that depends on x (Q)) of c(x ). ∗ Q ∗ ∗ In particular, if 2 − 2γ < x (Q) < 2, the multiplier of c(x ) is −1 + x (Q) − 1 = x (Q) − 2 ≤ 0, and if x∗ (Q) ≤ 2 − 2γ it is    x∗ (Q) − 1 2 − x∗ (Q) − 2γ 1 ∗ ∗ 1+ + x∗ (Q) − 2. + x (Q) − 1 = −1 + 1 − x (Q) − γ 2 2 − x∗ (Q) 2(2 − x∗ (Q)) We choose γ so that this multiplier is nonpositive for all Q ∈ Q, that is, we want 1 1 2 − x∗ (Q) − 2γ + 2(2 − x∗ (Q))(x∗ (Q) − 2) ≤ 0 that is, (2 − x∗ (Q) − )2 + γ − ≥ 0. 4 16 1 The minimum of γ for which this is satisfied for all 1 ≤ x∗ (Q) ≤ 2 is γ = 16 , where we note that 7 ∗ equality holds if and only if x (Q) = 4 . 1 We have thus bounded the average cost of the P1 (S) solutions by 32 c(x∗ ) + 16 c(p∗ ). By Observation 2, the average cost of the P2 (S) solutions is at most 2c(x∗ ) − c(p∗ ), and therefore the cost of the solution returned by (BOMD) is at most     3 1 1 3 c(x∗ ) + c(p∗ ), 2c(x∗ ) − c(p∗ ) = + c(x∗ ). min 2 16 2 34 ✷ 4 Bounding the Reconnection Cost In this section we provide a bound, tight in some sense, on the cost of the doubled spanning tree c(2DF +JF ) between the components of (V, F + JF ), as explained in Section 2.2.4. We fix S and F = S \ L(S), and in this section, we think of JF as representing a random TF △{s, t}-join, with E [JF ] = yF . Recall that (10) gives us a way to upper bound the expected cost of 2DF +JF : for each bad edge b ∈ JF , we add two copies of the lonely edges eQ S for all but at most one of the lonely cuts Q ∈ Q(S, b) that contain b. We will say that the edges for which two copies are added are used for reconnection. Obviously, the best bound is obtained by choosing to omit the most expensive lonely edge; however, for our analysis, we will randomly choose the cut Q ∈ Q(S, b) for which we do not add two copies of the edge eQ S for reconnection. Note that we are free to determine the probability distribution and, for simplicity, we also allow not choosing any of the cuts. We denote x(b, Q) := Pr(eQ S is not used for reconnection | b ∈ JF ), and describe a system of linear inequalities that turns out to express that {x(b, Q) : b ∈ B(S), Q ∈ Q(S)} is a suitable set of conditional probabilities ( as will be shown in Lemma 6): (D0) (D1) x(b, Q) ≥ 0, X Q∈Q(S,b) for all b ∈ B(S), Q ∈ Q(S, b), x(b, Q) ≤ 1 for all b ∈ B(S), 12 X (D2) b∈B(S)∩Q x∗ (b)x(b, Q) ≥ rQ , for all Q ∈ Q(S), where rQ := 1 − x∗ (Q \ B(S)). Note that rQ can be negative, in which case the constraint is vacuously satisfied. The conclusion of the following lemma, Lemma 6, will lead to Theorem 4; the conditions of Lemma 6 will be assured by two additional lemmas: Lemma 7 and Lemma 3. Lemma 6 Let Q ∈ Q(S), and suppose Pr(b ∈ JF ) ≤ x∗ (b)/2 for each b ∈ B(S). Let x(b, Q) := Pr(eQ S is not used for reconnection |b ∈ JF ), then Pr(eQ S is used for reconnection ) ≤ x∗ (Q) − 1 , 2 provided {x(b, Q) : Q ∈ Q(S), b ∈ B(S)} satisfy (D2). Proof: By the law of total probability: Pr(eQ S is used for reconnection ) = X b∈B(S) (1 − x(b, Q)) Pr(b ∈ JF ), where we can substitute the condition Pr(b ∈ JF ) ≤ x∗ (b)/2, and arrive at Pr(eQ S is used for reconnection ) ≤ X x∗ (b) (1 − x(b, Q)), for all Q ∈ Q(S). 2 b∈B(S) Therefore, the claimed inequality holds provided that X b∈B(S) (x∗ (b)/2)(1 − x(b, Q)) ≤ x∗ (Q) − 1 , for all Q ∈ Q(S). 2 Multiplying by 2 and rearranging, we get that this inequality is equivalent to X X − x∗ (b)x(b, Q) ≤ x∗ (Q) − 1 − x∗ (b), for all Q ∈ Q(S), b∈B(S) b∈B(S) which is exactly (D2) multiplied by −1. ✷ Despite the seemingly rough bounding, all of the applied inequalities in the series are best possible in the following sense: the resulting inequality cannot be improved with our methods, not even if there is only one narrow-cut-size in addition to 1 (which is a special case of Appendix B.2). Lemma 7 The system of linear inequalities (D0), (D1), (D2) is feasible for all S ∈ S. Proof: Let S ∈ S. Farkas’ lemma provides a necessary and sufficient condition for feasibility. The special structure of the bipartite matching constraints (D1), (D2) makes possible to simplify this condition to the following Kőnig-Hall type characterization (in fact equivalent to the Kőnig-Hall theorem for f -factors or transportation problems: Claim 1 The system of linear inequalities (D0), (D1), (D2) is feasible if and only if for all Q′ ⊆ Q(S): X rQ ≤ x∗ (∪Q∈Q′ Q ∩ B(S)) Q∈Q′ 13 The proof that this condition is indeed necessary and sufficient can be done for instance by a reduction to a transportation problem. Let K be the least common denominator of x∗ . We create a transportation problem with |Q(S)| demand nodes, one for each Q ∈ Q(S), with demand rQ , and K|B(S)| supply nodes, each with supply 1. Note that there are thus K supply nodes b1 , . . . , bK corresponding to bad edge b; for each Q ∈ Q(S) such that b ∈ Q, we create K arcs (bi , Q) for i = 1, . . . , K. One can show that if there exists a solution to this transportation problem then there exists a solution in which for each b, Q, the flow on the arcs (bi , Q) is equal for i = 1, . . . , K . Such a solution is exactly a solution to (D0), (D1), (D2). For self-containedness and since a formal reduction would take at least as much space, we provide a direct proof in terms of inequalities in Appendix C. Q′ Therefore, what we have to prove is that the condition of Claim 1 is satisfied by x∗ . Let ⊆ Q(S). Then X X X rQ = (1 − x∗ (Q \ B(S))) = |Q′ | − x∗ (Q \ B(S)). Q∈Q′ Q∈Q′ Q∈Q′ According to Claim 1, what we have to show is that this quantity is at most x∗ (∪Q∈Q′ Q ∩ B(S)), which is exactly the content of Claim 2: Claim 2 x∗ (∪Q∈Q′ Q) ≥ |Q′ |. Indeed, denote k := |Q′ |, and let C0 , . . . , Ck the vertex sets of components of S \ ∪Q∈Q′ eQ S , where s ∈ C0 , t ∈ Ck . Since {C0 , . . . , Ck } is a partition of V , every edge is counted twice in the sum of their coboundaries: x∗ (∪Q∈Q′ Q) = k k−1 j=0 j=1 X 1 1 1X ∗ x∗ (δ(Cj ))+x∗ (δ(Ck ))) ≥ (1+2(k−1)+1) = k, x (δ(Ci )) ≥ (x∗ (δ(C0 ))+ 2 2 2 exactly as claimed, finishing the proof of Claim 2 and of Lemma 7. ✷ Proof of Theorem 4 and Restated Algorithm We are now ready to prove Theorem 4 putting together Lemmas 6, 7 and 3. As a bonus, the proof reveals that the inner loop of our algorithm can be replaced by an appropiate definition of the objective function for the TF △{s, t}-join that anticipates the reconnection cost. We finish this section by developing this. Proof of Theorem 4: Let JF be a random TF △{s, t}-join with E [JF ] = yF (see Section 3) that is “derandomized” by the algorithm. We prove: X E [c(2DF +JF )] ≤ (x∗ (Q) − 1)c(eQ S) Q∈ Q(S) On the event JF = JF the least possible cost for reconnecting F + JF with pairs of doubled edges is c(2DF +JF ). Another possible way of reconnecting is to add for all b ∈ JF ∩ B(S), the lonely edges of Q(S, b) doubled, except one of them, as explained in (10) and the lines above it. Hence, we have   X X  − max 2c(eQ ) + (12) 2c(eQ c(2DF +JF ) ≤ S) . S b∈JF ∩B(S) Q∈Q(S,b) 14 Q∈Q(S,b) Now we prove that the right hand side of this equation can be upper-bounded by the right hand side of the assertion of the theorem, by randomizing the choice of the unique cut in Q(S, b) for which the lonely edge is not used for reconnection, and then applying Lemma 6: Note that the basic parity correction part of yF (b) is equal to x∗ (b)/2 for b ∈ B(S), and we thus need to show that the (PCE) and (PCL) vectors occurring for tree S are 0 for edges in B(S). This is immediately true for (PCE): eQ S for Q ∈ Q(S) is by definition contained in exactly one cut of Q(S), while the edges in B(S) are those contained in at least two such cuts. The fact that this also holds for (PCL) is exactly the conclusion of Lemma 3. Hence, the condition of Lemma 6 that P r(b ∈ JF ) ≤ x∗ (b)/2 for every b ∈ B(S) is satisfied. Lemma 7 makes sure that one can define a probability distribution so that the (conditional) probabilities give a valid choice (by (D0) and (D1)) and satisfy (D2). So Lemma 6 can indeed x∗ (Q)−1 for every Q ∈ Q(S). When eQ be applied, that is, Pr(eQ S is S is used for reconnection ) ≤ 2 Q used for reconnection, it is doubled, so its contribution to the costs is 2c(eS ), and therefore the P ✷ expectation of the described random reconnection cost is Q∈Q(S) (x∗ (Q) − 1)c(eQ S ). We now show how the counting of the above proof can be used to remove the inner loop (over all JF ∈ JF ) from our algorithm. Since the expected reconnection cost 2DF +JF can be upper bounded using (12) and it is in fact this value that is upper bounded in Theorem 4, we can replace 2DF +JF in the algorithm and in the summary of the analysis in Theorem 5 as well: rather than letting 2DF +JF be a doubled minimum cost spanning tree, we let it denote the edge set of which the cost is given by the right hand side of (12). Redefining the objective function for the computation of a minimum cost TF △{s, t}-join in the following way can then replace the inner loop (over the TF -joins of JF ): for any e ∈ E \ B(S) let c′ (e) = c(e), and for b ∈ B(S) let X c′ (b) := c(b) − max 2c(eQ ) + 2c(eQ S S ). Q∈Q(S,b) Q∈Q(S,b) Then the minimum c′ -cost TF △{s, t}-join JF∗ anticipates the cost of the reconnection with 2DF +JF as well. Since our analysis bounded the c′ -cost of a convex combination of TF △{s, t}-joins this bound also applies to c′ (JF∗ ). We summarize the revised algorithm using the specifications of this section in Algorithm 2. 5 Layered Trees through Matroid Partition In this section we prove that a layered S, E [S] = x∗ exists, and can be found in a combinatorial way and strongly polynomial time. Recall that this means for Q ∈ Q(S) (S ∈ S) and x∗ (Q) ≥ x∗ (Q′ ), that Q′ is also lonely. Note that an arbitrary convex combination is not necessarily layered (see Figure 4). Let the different cut-sizes of narrow cuts be 2 − ζ1 > 2 − ζ1 − ζ2 > . . . > 2 − ζ1 − . . . − ζk = 1, and Qi := {Q ∈ Q : x∗ (Q) ≤ 2 − ζ1 − . . . − ζi }, Bi := {S ⊆ E : S is a spanning tree of G, |S ∩ Q| = 1 for all Q ∈ Qi }, that is, Bi is the set Pof spanning trees of G = (V, E) for which every cut Q ∈ Qi contains exactly one edge. Clearly, ki=1 ζi = 1, and B1 ⊆ . . . ⊆ Bk . The following is a fractional (so weaker) version of Edmonds’ matroid partition theorem in the form that we need it (see close versions to which it can be reduced [19, Chapter 42]): 15 Let x∗ be an optimal solution to the subtour elimination LP for the s − t path TSP. Write x∗ as a layered convex combination of spanning trees. Let S be the collection of trees with positive coefficient. for S ∈ S do Construct forest-based {s, t}-tour: F := F (S) := S \ L(S). Let c′ (e) = c(e) for all e ∈ E \ B(S). P Q Let c′ (b) = c(b) + Q∈Q(S,b) 2c(eQ S ) − maxQ∈Q(S,b) 2c(eS ). for all b ∈ B(S). Let JF∗ be a minimum cost TF △{s, t}-join with respect to costs c′ . Contract the components of (V, F + JF∗ ), and let 2DF +JF∗ be the edge set of a doubled minimum cost spanning tree on the contracted graph. P1 (S) = F + JF∗ + 2DF +JF∗ . Construct Christofides-based {s, t}-tour: P2 (S) = S + JS , where JS is a minimum cost TS △{s, t}-join with respect to costs c. end for S Return a minimum cost {s, t}-tour from among S∈S {P1 (S), P2 (S)}. Algorithm 2: Restated Best-of-Many With Deletion Theorem 8 Let Mi = (E, ri ) (i = 1, . . . , k) be matroids, w ∈ RE , and λi ∈ R, 0 ≤ λi ≤ 1 (i = 1, . . . , k). Let P i be the convex hull of independent sets of Mi . There exist xi ∈ P i for i = 1, . . . , k such that: k X λi xi = w, (13) i=1 if and only if for all X ⊆ E : k X i=1 λi ri (X) ≥ w(X). (14) We say that edge e ∈ E is in layer i (i ∈ {1, . . . , k}), if there is a unique cut Q ∈ Qi such that e ∈ Q. Edges may also be in several or no layers. Since Q1 ⊇ . . . ⊇ Qk , the layers in which an edge is contained are consecutive numbers. (If it is contained exactly in layers i ∈ [a, b] ∩ N, then it is contained in at least 2 cuts of Qi for i < a, and in none of the cuts Qi for i > b.) Denote Li := {e ∈ E : e is in layer i}. So we can think of layer i to be the set Li of “Gao edges” for the cuts Qi . The edges Gao used for his solution [13] were those of L1 . Following and generalizing Gao [13] we call sets of the form W \ U 6= ∅ where s ∈ U ⊆ W , Q = δ(U ) ∈ Q, R = δ(W ) ∈ Q, level-sets. If in addition, Q, R ∈ Qi , W \ U will be called a level-set of layer i. Gao [13, Lemma 3.2] proved that level-sets induce connected subgraphs of G. The natural ordering of chains induces a natural ordering of (inclusionwise) minimal level-sets starting with {s} and ending with {t}. What Gao calls level sets are the minimal level sets of layer 1. In the Appendix we extend his connectivity result by proving that level-sets of Qi are in fact ζ1 + . . . + ζi -connected (Lemma 15), and show the connection with layered convex combinations of spanning trees. We use here only that Li ∩ Q 6= ∅ for all Q ∈ Qi (i = 1, . . . , k) and the level-sets induce connected graphs. (15) that can be checked anew, S or as a special case of [13, Lemma 3.2], or apply Lemma 15 in Appendix D. Denote Gi := E \ Q∈Qi Q. Let Mi := (E, ri ) (i = 1, . . . , k) be the matroid whose independent sets are of the form Fi ∪ Ci , where Fi is a forest in Gi and Ci ⊆ Li , |Ci ∩ Q| ≤ 1 for each Q ∈ Qi . 16 3 s 1 2 4 5 6 t 5 6 t 5 6 t S1 3 S2 s 1 2 4 3 s 1 2 4 S3 Figure 4: x∗ from Figure 1 expressed as a convex combination of three spanning trees S1 , S2 , S3 , each with multiplier λSi = 1/3, that is not layered. Note that x∗ (Qj ) = 5/3 for j = 2, . . . , 5, that there is exactly one Si for which |Qj ∩ Si | = 1, so in order for (9) to hold, Qj has to be lonely in the unique tree Si such that |Qj ∩ Si | = 1. But then, for example, Q2 is lonely in S1 , but Q3 is not. (Such sets form the independent sets of a matroid, as straightforward from the fact that the forests of any graph form the independent sets of a matroid.) The set of bases of Mi will be denoted by Bi . Clearly, B ∈ Bi if and only if B meets each component of Gi in a spanning tree, and meets each cut of Qi in exactly 1 edge. According to (15), Bi 6= ∅. Summarizing: Mi := (E, ri ) is a matroid, and its rank is ri (E) = n − 1 (i = 1, . . . , k). (16) We first establish the connection between layered convex combinations and these matroids: Lemma 9 The following statements are equivalent: (i) There exists a layered convex combination. P P ∗ (ii) There exists a convex combination S∈S λS S = x (λS > 0 for S ∈ S, S∈S λS = 1) of spanning trees, and k nonnegative integers 1 ≤ m1 ≤ . . . ≤ mk = |S|, so that P the trees in the first mi terms of the sum are in Bi , and the sum of the first mi coefficients is ij=1 ζj (for all i = 1, . . . , k). (iii) The equation (13) holds, where w = x∗ and P i is the convex hull of Bi , λi = ζi (i = 1, . . . , k). Furthermore, finding (i), (ii) or (iii) are (strongly) polynomially equivalent. Proof: If (ii) holds, the sum of the coefficients from the first term and the m1 -th term is ζ1 , and the trees P Pi are in B1 . From the mi + 1-th until the mi+1 -th term the sum of the coefficients is i+1 ζ − j=1 j j=1 ζj = ζi+1 , and the trees are in Bi+1 (i = 1, . . . , k − 1), by the constraint of (ii). This is exactly a combination of spanning trees in the form of (13), with the specifications of (iii). So (iii) is proved. Consider now a convex combination in the form of with the specifications of (iii). Substitute P(13) k P i ∗ for x a convex combination of Bi , and let x = i=1 S∈Bi λS S be the corresponding convex P combination of x∗ into spanning trees, where ζi xi = S∈Bi λS S. The set of lonely edges L(S) for S ∈ Bi is defined as S ∩ Li . 17 (17) By the definition of Li (5) is satisfied, moreover by (15) then Q(S) = Qi . In order to prove (i), it remains to check that S is layered, and according to the definition end of Section 2.3 this means ′ that Q ∈ Qi and x∗ (Q′ ) ≤ x∗ (Q) for a cut imply is obviously true. P Q ∈ Qi , which Finally, suppose that (i) holds, and let S∈S λS S = x∗ be a layered convex combination. In this sum, order the trees S in decreasing order of the largest cut-size among the cuts in Q(S). Then group the ties, that is, form k groups of sums (some of which may be empty) of trees whose lonely cuts have the same maximum cut size 2 − ζ1 , . . . , 2 − ζ1 − . . . − ζi , . . . , 2 − ζ1 , . . . , 2 − ζ1 − . . . − ζk respectively. Since S is layered, for the trees S in the i-th group Qi ⊆ Q(S), and therefore in the first i groups there are only trees in Bi . Let mi be the number of trees in the first i groups (i = 1, . . . , k). By (9) which is satisfied by L(S) (see the lines after (9) or the definition of layered at the end of Section 2.3) the probability that a cut of size 2 − ζ1 − . . . − ζi contains a lonelyP edge is exactly ζ1 + . . . + ζi , and this happens exactly for the trees of the first i groups, so mi = ij=1 ζi , which provides a convex combination of the form of (ii). ✷ By Theorem 8 and Lemma 9, a layered convex combination exists if and only if (14) holds for our matroids, and then it can be determined in polynomial time: Theorem 10 The matroids Mi (i = 1, . . . k) satisfy (14) with w = x∗ , λi = ζi , and ri the rank function of the matroid (E, Bi ); a layered convex combination exists and can be determined in strongly polynomial time, by running the matroid partition algorithm once. Proof: The existence of a convex combination satisfying Lemma 9 (ii) has already been proved using an interesting, but technically demanding local procedure, “tree-reassambling”, by Gottschalk and Vygen [16], without the matroid property. So by Lemma 9 we have (iii) as well, and therefore, by the easy part of the matroid partition theorem, Theorem 8 this implies (14). Running Edmonds’ matroid partition algorithm (see the references below) it cannot terminate with a violated condition, so it will terminate by finding a convex combination that satisfies (ii), which, again by Lemma 9 implies (i), that is, a layered convex combination, as claimed. ✷ Note that our proof uses the result of [16] to check that (14) holds; however, checking that (14) holds for a particular set of matroids is usually a straightforward task, that would provide a direct simpler proof for the existence of layered decompositions as well. Lemma 15 (Appendix D) shows a direct algorithmic proof for the existence of a basis-packing in Mi for all i ∈ {1, . . . , k} respecting the capacity function x∗ with sum of coefficients ζ1 + . . . + ζi . This is weaker than a layered convex combination: it is explained in Appendix D that having only one packing satisfying each of these k properties simultaneously would be sufficient for (and is equivalent to) a layered convex combination, that is, to (14) or (20). However, when this manuscript is submitted, we have not completed a direct approach for proving this. For actually finding a layered convex combination through tree packing, the proofs are algorithmic provided a testing membership problem in tree polyhedra is available. ([19, Chapter 51, mainly 51.4]; or it may be better to use general matroid bases packing, see also Edmonds’ “matroid base packing theorem”[9] (a straightforward consequence of Edmonds’ matroid partition theorem) [12, 13.3.13], [19, Corollary 42.1d], and execute any weighted algorithm giving priority to smaller index matroids; for the polynomial solvability of matroid basis packing we refer to [7], and at [19, page 891] the exact competitive complexities can be checked.) The rankSoracle can be computed in linear time for all our matroids Mi = (E, ri ) as well: ri (X) = |V |−c(X \ Q∈Qi Q)+|Q ∈ Qi : Q∩Li 6= ∅|, where c(Y ) (Y ⊆ E) denotes the number of connected components of (V, Y ). We conclude by summarizing the overall proof of our bounds from a bird’s eye view: Theorem 10 allows us to avoid additional reconnection costs, by ensuring that the parity completion part of the 18 parity correction vector does not contribute to the probability of requiring reconnection across a lonely cut (Lemma 3). This is an important ingredient in the proof of Theorem 4, which bounds the total expected reconnection cost. Another important component of the bound of Theorem 4 is provided by Section 4, where we define a probability distribution that determines which lonely edges to use for reconnection, thus allowing us to “allocate” the cost of reconnection to the lonely cuts. Then Theorem 4 itself is used in the improved ratio that is our main result, Theorem 5. References [1] H. Ch. An, R. D. Kleinberg, and D. B. Shmoys. Improving Christofides’ algorithm for the s-t path TSP. In: Proceedings of the 44th Annual ACM Symposium on Theory of Computing (STOC’12). Revised in [2]. [2] H. Ch. An, R. D. Kleinberg, and D. B. Shmoys. Improving Christofides’ algorithm for the s-t path TSP. J. ACM, 62(5):34, 2015. [3] F. Barahona. Packing spanning trees. Mathematics of Operations Research, 20(1):104–115, 1995. [4] J. Cheriyan, Z. Friggstad, and Z. Gao. Approximating minimum-cost connected t-joins. Algorithmica, 72(1):126–147, 2015. [5] N. Christofides. Worst case analysis of a new heuristic for the traveling salesman problem. Report 388, Graduate School of Industrial Administration, Carnegie-Mellon University, Pittsburgh, PA, 1976. [6] W. J. Cook. In Pursuit of the Traveling Salesman: Mathematics at the Limits of Computation. Princeton University Press, December 2011. [7] W. Cunningham. Testing membership in matroid polyhedra, Journal of Combinatorial Theory, Series B, 36:161–188, 1984. [8] G. Dantzig, R. Fulkerson, and S. Johnson. Solution of a large-scale traveling-salesman problem. Operations Research, 2:393–410, 1954. [9] J. Edmonds. Lehman’s switching game and a theorem of Tutte and Nash-Williams, J. of Research of the National Bureau of Standards, Section B 69 (1965), pp. 125–130. [10] J. Edmonds. Submodular functions, matroids and certain polyhedra. In: Combinatorial Structures and Their Applications, Proceedings of the Calgary International Conference on Combinatorial Structures and Their Applications 1969 (R. Guy, H. Hanani, N. Sauer, J. Schönheim, eds.), Gordon and Breach, New York 1970, pp. 69–87. [11] J. Edmonds, and E. L. Johnson. Matching, Euler tours and the Chinese postman. Mathematical Programming, 5 (1973), 88–124. [12] A. Frank. Connections in Combinatorial Optimization. Oxford University Press 2011. [13] Z. Gao. An LP-based 3/2-approximation algorithm for the s-t path graph Traveling Salesman Problem. Oper. Res. Lett., 41(6):615–617, 2013. [14] Z. Gao. On the metric s-t path traveling salesman problem. 29(3):1133–1149, 2015. SIAM J. Discrete Math., [15] M. R. Garey, D. S. Johnson, and R. E.Tarjan. The planar hamiltonian circuit problem is np-complete. SIAM Journal on Computing, 5(4):704–714, 1976. [16] C. Gottschalk and J. Vygen. Better s-t -tours by Gao trees. CoRR, abs/1511.05514, 2015. 19 [17] J. A. Hoogeveen. Analysis of Christofides’ heuristic: Some paths are more difficult than cycles. Operations Research Letters, 10(5):291 – 295, 1991. [18] C.St.J.A. Nash-Williams. Edge-disjoint spanning trees of finite graphs, The Journal of the London Mathematical Society, 36, 445–450, 1961. [19] A. Schrijver. Combinatorial Optimization - Polyhedra and Efficiency. Springer, 2003. [20] A. Sebő. Eight-fifth approximation for the path TSP. In Proceedings of the 16th International Conference on Integer Programming and Combinatorial Optimization (IPCO), pages 362–374, 2013. [21] A. Sebő, J. Vygen, Shorter tours by nicer ears: 7/5-approximation for graphic TSP, 3/2 for the path version, and 4/3 for two-edge-connected subgraphs, Combinatorica, 34 (5) October (2014), 597–629. [22] A. Sebő. Problems about uniform covers, with tours and detours. In Matematisches Forschungsinstitut Oberwolfach Report No. 51/2014, DOI: 10.4171/OWR/2014/51, November 2014, on joint work with Y. Benchetrit and M. Stehlı́k, pages 2912–2915, March 2015. [23] W.T. Tutte. On the problem of decomposing a graph into n connected factors, The Journal of the London Mathematical Society, 36, 221-230, 1961. [24] J. Vygen. Reassembling trees for the traveling salesman. CoRR, abs/1502.03715, 2015. [25] L. A. Wolsey. Heuristic analysis, linear programming and branch and bound. Mathematical Programming Study, 13:121–134, 1980. 20 APPENDIX The appendix contains further illustrations of our techniques and additional results. In Appendix A, we illustrate our setting and analysis on the best-of-many Christofides’ algorithm (without deletion) with a very short proof of the guarantee of 8/5. In Appendix B, we show that the deletion of lonely edges gives tight results in certain cases. In each of these part of the difficulties disappear, which allows to focus better on those that remain. In Appendix C, we give a self-contained proof of Claim 1, and in Appendix D we provide a new matroid construction inspired by Section 5. We also show a partial direct proof for the layered convex combination and exhibit what is missing from a full matroidal proof. A Our Setting and Analysis for BOMC Let us say that a narrow cut Q is small if 1 ≤ x∗ (Q) ≤ 32 , and large, if 32 ≤ x∗ (Q) < 2. (If x∗ (Q) = 32 it is both small and large.) We begin by considering the cases when all narrow cuts are small or all are large. Throughout Appendix A, we take L(S) to be the set of edges of S that are the unique edge in some narrow cut, i.e., (5) will hold with equality, and we can apply (8). A.1 All Narrow Cuts Are Small If all narrow cuts are small, then the probability that |Q ∩ S| is even is at most x∗ (Q) − 1 ≤ 21 by P Q ∗ (8). Also, by (8), the vector x2 + Q∈Q:|Q∩S| even x2 is in the TS △{s, t}-join polyhedron. Hence, P Q the average or expected parity correction can be bounded by 21 x∗ + Q∈Q 21 x2 ≤ 21 x∗ + 41 p∗ , where the inequality follows by noting that P if e is the lonely edge in narrow cut Q in some tree S, then e must be on the s − t path in S, so Q∈Q xQ ≤ E [S(s, t)] = p∗ . So, if all narrow cuts are small, we can again bound the cost of the best-of-many solution by 32 c(x∗ ) + 41 c(p∗ ), and combined with Observation 2, this implies a bound of 85 c(x∗ ) for this case as well. A.2 All Narrow Cuts Are Large If all narrow cuts are large, then the basic parity correction vector (6) with γ = 14 yields already as good a vector as the best one in the “All Small” case: it is in the TS △{s, t}-join polyhedron for any S, since by assumption x∗ (Q) ≥ 32 for all Q. Hence, the average cost of the spanning tree plus parity correction is at most c(x∗ ) + 21 c(x∗ ) + 1 3 ∗ ∗ ∗ ∗ 4 c(p ). Using Observation 2, we can also bound the cost by 2c(x ) − c(p ), and since min{ 2 c(x ) + 8 1 ∗ ∗ ∗ ∗ 4 c(p ), 2c(x ) − c(p )} ≤ 5 c(x ), we get the desired result. A.3 Combining the Two Cases It turns out that the two extreme cases described above can be “merged” by essentially taking the average of the two, and surprisingly without having any extra cost. We show two, slightly different proofs of the ratio 8/5 of [20]: the first, applying systematically the setting of the present paper, the second, even simpler, pointing more at the intuitive “averaging merge” also constituting a bridge to the original solution, that we include as a remark. Connectivity: Tree S. Expected Value of Connectivity: E [S] = x∗ . 21 Parity Correction: The cost of a TS △{s, t}-join can be upper bounded by the cost of a point in the TS △{s, t}-join polyhedron, which is the sum of the following two vectors: Basic Parity Correction (BP): 12 x∗ + γ S(s, t). Expected Value of (BP): 21 x∗ + γ p∗ .   2 − 2γ − x∗ (Q) xQ . Parity Completion for Even Cuts (PCL): 2 − x∗ (Q) 2 We add a parity completion term for narrow cut Q and tree S ∈ S only if |Q ∩ S| is even, and x∗ (Q) ∈ [1, 2(1 − γ)). By (8), (BP)+(PCL) is a vector in the TS △{s, t}-join polyhedron for each S ∈ S. Since we add (PCL) for Q with probability 1 − xQ (Q) ≤ x∗ (Q) − 1 by (8), the X (1 − γ − x∗ (Q)/2) (x∗ (Q) − 1) Q expectation of the (PCL) vector is at most x . 2 − x∗ (Q) ∗ Q∈Q:x (Q)<2(1−γ) For each Q ∈ Q the coefficient of xQ in this sum is at most  x x − 1 1−γ− , 2 2−x where x = x∗ (Q). For fixed γ, the unique maximum of this expression in the interval [1, 2] is √ x = 2 − 2γ. Substituting this in the formula we find that the unique minimum is γ = 81 , when q the worst cut-size is x = 2 − 2 × 18 = 23 , the unique intersection of small and large cut-sizes. Substituting these values into our bound, we get that the coefficient of xQ for all Q ∈ Q is at most 81 . Finally note that if e is the lonely edge in narrow P cut Q in some tree S, then e must be on the 1 s − t path in S, so (PCL) is finally bounded by 8 Q∈Q xQ ≤ 81 E [S(s, t)] = 18 p∗ . Expected Value of (PCL): ≤ 81 p∗ . Expected Value of Parity Correction: 1 ∗ 2x + 41 p∗ . The total expected cost of the solution can thus again be bounded by 32 c(x∗ ) + 41 c(p∗ ). Combined with Observation 2, we can bound the cost of the constructed solution by 58 c(x∗ ). Remark: We can also arrive at this solution without optimizing over γ, with less computation: For the bounds in the “all small” and “all large” case the unique worst cut-size is x = 32 . Take a convex combination (for instance with 12 coefficients, leading to their arithmetic mean), of the two parity correction vectors π1 and π2 that “even cuts” receive P in the two cases respectively: P Q 1 ∗ xQ 1 ∗ 1 2 π1 := 12 x∗ + x2 and π2 := 21 x∗ + 14 p∗ . Then π := π1 +π = x + 2 2 2 2 + 8 p is certainly a valid 3 parity completion vector for even cuts of size 2 , as it is the convex combination of two valid parity correction vectors. is automatically valid for even cuts of size at In fact, since π contains the term 81 p∗ , the vector   Q ∗ (Q) P 7/4−x 1 ∗ x least 74 . Moreover, if we replace π by 12 x∗ + 2 + 8 p (where we have to add the 2−x∗ (Q) middle term only for even cuts), then we get a valid parity correction vector. By (8), we add the middle term with probability x∗ (Q) − 1 for each Q ∈ Q, so the mean value of parity correction is at most   X 7/4−x∗ (Q) xQ ∗ 1 ∗ 1 ∗ x + (x (Q) − 1) ∗ 2 2 + 8p 2−x (Q) Q∈Q Now, for 1 ≤ x < 2,  7 x − 8 2  1 x−1 ≤ . 2−x 8 2 (Multiply both sides of the inequality by 2 − x > 0, ( 78 − x2 )(x − 1) − 18 (2 − x) = − x2 + − 81 (2x − 3)2 ≤ 0.) So we got the same bound as in the two special cases. 22 3x 2 − 9 8 = B Tight Bound on the Integrality Gap for Special Cases We show some simple cases where the ratio and integrality gap 3/2 can be proved. B.1 Disjoint and Almost-Disjoint Narrow Cuts Let G = (V, E) be a graph and denote 1 be the all-1 vector on the edges. A naturally arising open question relaxing the integrality gap of the subtour elimination LP is to determine the smallest constant α so that α1 is feasible, that is, a convex combination of T -tours2 [22]: For 3-edge-connected graphs 1 is always feasible. Indeed, setting 2/3 on all the edges is in the (dominant of the) convex hull of spanning trees and 1/3 is in the (dominant of the) convex hull of T -joins for every T . It has been pointed out that this result is not best possible. Indeed, the conjecture that the integrality gap of the subtour elimination LP is 43 for the metric TSP is wellknown to be equivalent to the feasibility of 34 x provided x is in the subtour polytope. Therefore, if this conjecture is true, α = 43 · 32 = 89 is also feasible for T = ∅, which may be a weaker and more hopeful conjecture to prove than the 34 -conjecture about the integrality gap. However, if T 6= ∅ the integrality gap is at least 3/2 (see [2] for an example for T = {s, t}), and it follows that α ≥ 1 is necessary for α1 to be feasible. Instead of 3-edge-connectivity we have to require then only that T -even cuts (that is, cuts δ(U ), U ⊆ V , |T ∩ U | is even) are of size at least 3. The conjecture that the integrality gap of the subtour elimination LP is 32 implies that α = 32 · 32 = 1 already defines a feasible vector, that is, 1 is feasible for such graphs. Our techniques allow us to prove shortly that this is indeed true, that is: If all T -even cuts of G are of size at least 3, 1 is a convex combination of T -tours. For T -tours, narrow cuts are also defined, and have similarly nice properties. They do not form a chain, but they do form a laminar system [4]. Since we will see that we do not need reconnection here, our proof can be extended to this case, but for ease of communication we restrict ourselves to T = {s, t} in the following. Then the condition means just that identifying s and t we get a 3-edge-connected graph. The generalization for arbitrary T is straightforward. Theorem 11 Let G = (V, E) be a connected graph, s, t ∈ V and let |δ(U )| ≥ 3 for any |U ∩{s, t}| = 6 1. Then, 1 can be expressed as a convex combination of {s, t}-tours. Proof: We can suppose that G is 2-edge-connected, since a cut-edge necessarily separates s and t, and we can proceed by induction, separating the problem into two. Note also that x∗ (e) = 32 on every e ∈ E is a feasible solution to the subtour elimination LP for s − t path TSP. Hence, we can use the BOMD algorithm on x∗ , where the narrow cuts are exactly the s − t cuts of G containing two edges. We will show that the forest-based {s, t}-tours F + JF give us the desired convex combination; in other words, that reconnection is never needed. Forest: We take an arbitrary decomposition of x∗ into spanning trees S ∈ S, and let F := F (S) := S \ L(S). P Expected Value of Forest: x∗ − Q∈Q xQ . Parity Correction (PC): We take yF to be the basic parity correction vector with γ = 0, and we add as parity completion xQ /2 for every narrow cut Q such that |Q ∩ F | is even. As observed in Section 2.2.3, this indeed gives a P feasible parity correction vector. Expected Value of (PC): 21 x∗ + 21 Q∈Q xQ . 2 A T -tour is a connected graph in which the set of odd degree vertices is T . 23 Reconnection: Note that the fact that the non-s − t-cuts of G have at least three edges implies that the narrow cuts are pairwise disjoint: Indeed, suppose there exist narrow cuts Q1 = δ(U1 ), Q2 = δ(U2 ) (each containing exactly two edges), s ∈ U1 , t ∈ U2 and Q1 ∩ Q2 6= ∅ Then the left hand side of (4) is 2 · 32 + 2 · 32 , and the first term of the right hand side is 3 · 23 = 2 by the condition of the theorem; the last term on the right hand side is at least 2 · 23 because a common edge, that exists by the non-emptiness asumption, has one endpoint in U1 \ U2 and the other in U2 \ U1 . Since 43 6= 53 this is a contradiction. It follows that there are no bad edges, since these are contained in at least two narrow cuts: Expected Value of Reconnection: 0. P By adding up the different parts, we see that 32 x∗ − 12 Q∈Q xQ ≤ 1 is already in the convex hull of {s, t}-tours. ✷ P We actually proved that 23 x∗ − 21 Q∈Q xQ is a convex combination of {s, t} tours, under the more general condition that the narrow cuts are disjoint. We can strengthen this result as follows. Theorem 12 Let x∗ be a feasible solution to the subtour elimination LP for s − t path TSP, and let G = (V, E) be the support graph of x∗ . If no edge in G is contained in more than two narrow cuts, then 32 x∗ is a convex combination of {s, t}-tours. Proof: By Lemma 1, we know that there exist s ⊆ U1 ⊂ U2 ⊂ U2 ⊂ . . . Uk such that the narrow cuts are exactly δ(Ui ) for i = 1, . . . , k. We will call a narrow cut Q = δ(Ui ) odd-numbered or even-numbered, depending on whether i is odd or even. We decompose x∗ into spanning trees. However, we will now only remove lonely edges from either the odd-numbered narrow cuts, or the even-numbered narrow cuts, each with probability 12 . This changes the expectation of the forest to 1P Q ∗ x − 2 Q∈Q x . P The upper bound 12 x∗ + 12 Q∈Q xQ on (PC) is still valid (see above), and we are again guaranteed that 2DF +JF = ∅, since a bad edge can be contained in only two consecutive narrow cuts, and we never delete the lonely edges of both of these. Whence the cost of reconnection is 0. Adding up ✷ the two nonzero contributions we get exactly 23 x∗ . B.2 A 3/2-Approximation if All Narrow Cuts Are Small In this section we analyze the BOMD algorithm when all narrow cuts Q have x∗ (Q) ≤ 32 . The following inequality that appears in Vygen [24] is very handy to exploit such upper bounds, and gives an easier (but weaker) tool than the tools developed in Section 4 for bounding reconnection costs: 1 For any Q1 , Q2 ∈ Q, x∗ (Q1 ∩ Q2 ) ≤ (x∗ (Q1 ) + x∗ (Q2 )) − 1. (18) 2 We derive this by stopping before the last inequality in the proof of Claim 2, with the particular choice Q′ = {Q1 , Q2 }. Indeed, then x∗ (∪Q∈Q′ Q) ≥ |Q′ | − 1 + 21 (x∗ (Q1 ) + x∗ (Q2 )) = 1 + 21 (x∗ (Q1 ) + x∗ (Q2 )). Subtracting this inequality from x∗ (Q1 ) + x∗ (Q2 ) = x∗ (Q1 ) + x∗ (Q2 ), we get (18). In our special case x∗ (Q1 ∩ Q2 ) ≤ 12 follows for all Q1 , Q2 ∈ Q. We show below that this inequality is sufficient to get a good bound on the cost of reconnection, assuming that we use a layered convex combination from Section 5. In fact, we get the following simple analysis of the forest-based solutions found by the BOMD algorithm: Forest: Forest F := F (S) := S \ L(S). P Expected Value of Forest: x∗ − Q∈Q xQ . 24 Parity Correction: The fractional solution yF in the TF △{s, t}-join polyhedron is constructed by adding the following vectors: Basic Parity Correction (BP): 21 x∗ . Note that 21 x∗ (Q) ≥ 1 for any cut Q that is not narrow, so (BP) is enough to ensure that yF satisfies the constraints of the TF △{s, t}-join polyhedron for the cuts that are not narrow. Expected Value of (BP): 21 x∗ .   ∗ Parity Completion for Empty Cuts (PCE): 1 − x 2(Q) eQ S. Note that (BP)+(PCE) are indeed sufficient to ensure that yF satisfies the constraints of the TF △{s, t}-join polyhedron for narrow cuts Q such that |Q ∩ F | = 0.   P ∗ Expected Value of (PCE): Q∈Q 1 − x (Q) xQ . 2 Parity Completion for Non-Empty Even Cuts (PCL): 21 xQ . Recall from Section 2.2.3 that indeed (BP) + (PCL) are indeed sufficient to ensure that yF satisfies the constraints of the TF △{s, t}-join polyhedron for narrow cuts Q such that |Q ∩ F | is even and ≥ 2. We also have that Pr(|Q ∩ F| ≥ 2) ≤ Pr(|Q ∩ S| ≥ 2) ≤ x∗ (Q) − 1, and thus: P Expected Value of (PCL): 12 Q∈Q (x∗ (Q) − 1) xQ . P Expected Value of Parity Correction: 21 x∗ + 21 Q∈Q xQ . Reconnection: When all cuts are small, we can use a simple rule to implement reconnection (10): for each bad edge b in JF , we choose the “leftmost” of the lonely cuts Q in Q(S, b) as the cut for which we do not add a doubled edge. (Cut Q′ = δ(U ′ ) ∈ Q is to the left of Q = δ(U ) ∈ Q, if s ∈ U ′ ⊂ U ; by Lemma 1 this is a total order on the narrow cuts.) Now let Q ∈ Q(S), and compute the probability of adding two copies of eQ S for reconnection. For ′ ′ this to happen, JF must contain an edge b ∈ Q ∩ Q where Q is the first lonely cut in S to the left of Q. The probability that JF contains such an edge is the sum of basic parity correction on ∗ ′ Q′ ∩ Q, plus parity completion on Q′ ∩ Q: the former of these two is at most x (Q2 ∩Q) ≤ 14 by (18) under our assumption that all cuts are small; the latter is 0 by Lemma 3, since S is layered and the parity completion vectors are scalar multiples of xQ . P Hence, for a given S, we get a bound on the reconnection cost of 12 Q∈Q(S) c(eQ S ), that is: P Expected Value of Reconnection Cost: E [c(2DF +JF )] ≤ Q∈Q 21 c(xQ ). We thus have that the total mean cost of P1 (S) can    X X 1  x∗ − xQ  +  x∗ + 2 Q∈Q Q∈Q be bounded by  1 Q X 1 Q 3 ∗ x x = x . + 2 2 2 Q∈Q One not-small narrow cut size We can extend the above analysis to the case when there exists one value z > 23 such that for all narrow cuts Q, either x∗ (Q) ≤ 23 or x∗ (Q) = z. In this case, we let the parameter γ in the basic parity correction vector be non-zero, where the exact value is determined by the analysis. Compared to the ratio 3/2 we lose 1/34, like in the general case! Now we use the same rule to deal with the tree S in the event b ∈ B(S) ∩ JF : choose the leftmost lonely cut in Q(S, b) as the cut for which we do not use the edge eQ S for reconnection. As in the case when all cuts are small (see the above proof), let Q ∈ Q(S) and consider the probability ′ of using eQ S for reconnection. Again, for this to happen, JF must contain an edge b ∈ Q ∩ Q where 25 Q′ is the first lonely cut in S to the left of Q. The probability that JF contains such an edge is the sum of basic parity correction on Q′ ∩ Q, plus parity completion on Q′ ∩ Q: the former of these ∗ ′ two is now at most x (Q2 ∩Q) ≤ 12 (x∗ (Q) − 1) by (18); the latter is 0 by Lemma 3, since S is layered and the parity completion vectors are scalar multiples of xQ . This is exactly the bound on the probability of adding two copies of eQ S shown for the general case in Section 4, but the proof is much simpler and combinatorial, it is ignoring Section P 4! For a given tree S, and its forest F = S\L(S), we can thus bound E [c(2DF +JF )] ≤ Q∈Q(S) (x∗ (Q)− P ∗ Q 1)c(eQ Q∈Q (x (Q) − 1)x . S ), and taking the average of all S ∈ S, we get a bound of The remainder of the computation is exactly the same as in Section 3. We are not able to improve the obtained bound, even not if z = 74 and the only other cut-size is 1 and occurs only for δ(s) and δ(t). Being able to reach in general the best bound we know for this easy case we reach the maximum within the possibilities of our methods. C A Self-Contained Proof of the Extended Kőnig-Hall Theorem In this section we give a self-contained proof of Claim 1 (see proof of Lemma 7). We use the duality theorem of linear programming (instead of Farkas’ Lemma), so we add the objective function 0 to minimize. The dual of the LP defined by this objective function constrained by the inequalities (D0), (D1), (D2), is simple to state, since every variable of the primal linear program is contained with nonzero coefficients, in at most one inequality of (D1) and one inequality of (D2): Denoting by yQ (Q ∈ Q(S)), yb , (b ∈ B(S)) the dual variables associated to the inequalities in (D1), (D2) respectively, after multiplying (D1) by −1, the dual is: Maximize X Q∈Q(S) rQ yQ − X yb , subject to: b∈B(S) x∗ (b)yQ − yb ≤ 0, and yQ ≥ 0, yb ≥ 0 for all b ∈ B(S), Q ∈ Q(S, b). Clearly, the dual LP is feasible, and by the duality theorem of linear programming, (D0), (D1), (D2) is feasible if and only if the optimum of the dual LP is zero; furthermore, note that for an arbitrary choice yQ ≥ 0(Q ∈ Q(S)), the optimal choice yb (b ∈ B(S)) is uniquely determined as yb := x∗ (b) max yQ Q∈Q(S,b) In other words (D0), (D1), (D2) is feasible, if and only if X X (Farkas) rQ y Q ≤ x∗ (b) max yQ , for all yQ ≥ 0(Q ∈ Q′ ). Q∈Q(S) b∈B(S) Q∈Q(S,b) Note that the condition of Claim 1 is exactly the yQ := 1 (Q ∈ Q′ ) special case of (Farkas)! So to prove Claim 1, we only have to check that whenever (Farkas) is violated the condition Claim 1 is also violated. To prove this, suppose by contradiction that there exists yQ (Q ∈ Q(S)) be such that (Farkas) is violated, that is, X X (violatedFarkas) rQ yQ > x∗ (b) max yQ , Q∈Q(S) b∈B(S) 26 Q∈Q(S,b) We suppose the number of different values of yQ is minimum here, and let η =: max{yQ : Q ∈ Q}. Note that if all yQ > 0 are equal (to η) then dividing all yQ (Q ∈ Q(S)) by η, we see that Claim 1 is violated also. If they are not all equal, let the second largest value of yQ be η − ε with η > ε > 0 and let ′′ Q := {Q ∈ Q(S) : yQ = η} ( Q′ ,. Now if the condition in Claim 1 is not violated then X rQ ≤ x∗ (∪Q∈Q′′ Q ∩ B(S)). Q∈Q′′ Subtracting ε times the left hand side of this inequality from (violated Farkas), it is straightforward to see that (as usual, with yb := x∗ (b) maxQ∈Q(S,b) ε the right hand side of (violated Farkas) is also decreased by at least ε times the right hand side. We get that (Farkas) is violated with one fewer yQ value, a contradiction, finishing the proof of the claim. D Matroids We discuss here a slightly different way of handling layered convex combinations by using basis packing rather than the matroid partition approach of Section 5. These two are well-known to be equivalent, but both may have their advantage at use. An advantage of basis packing for us is that it helps presenting a partial direct proof of Theorem 10, and measure what is missing for a full proof in a clean way; see Section D.1). In the second subsection, we show a new matroid construction generalizing the matroids of Section 5, which may provide some additional insight. D.1 How to Check for Basis Packing, and What Is Missing? We state here a version of the “Basis Packing Theorem” of Edmonds for graphs. This provides some insight to the graphs induced by the level sets of the layers, implying a somewhat weaker statement than the layered convex combination of spanning trees, and making clear what is missing from a full direct proof (as promised in Section 5). For a given vector w to be a convex combination of spanning trees is the ζ = 1 special case of the following well known result of Tutte [23] and Nash-Williams [18] about packing spanning trees in graphs, itself a special case of matroid partition. This is a fractional (so weaker) version [19, Theorem 51.1a]: For family P of disjoint subsets of V , let δ(P) denote the set of edges in E whose two endpoints are in two different sets of P. Theorem 13 Let G = (V, E) be a graph, B the set of its spanning trees, w ∈ RE , and ζ ∈ R+ . There exist λB ∈ R+ (B ∈ B, |{B ∈ B : λB > 0}| ≤ |E|) such that: X X λB B ≤ w, λB = ζ, (19) B∈B B∈B if and only if for any partition P of V : w(δ(P)) ≥ ζ(|P| − 1), (20) and λB (B ∈ B) or a violated condition can be found in strongly polynomial time. We prove that for all i = 1, . . . , k (19) holds for B := Bi and ζ = ζ1 +. . .+ζi , and we can actually go to the furthest possible statement in this direction. For each basis in the chain B1 ⊆ . . . ⊆ Bk this graph version of the basis packing theorem is exactly what we need. Still, we also state basis packing theorem for matroids whose condition would be equivalent to check to that of Theorem 8: 27 Theorem 14 Let Mi = (E, ri ) (i = 1, . . . , k) be matroids, w ∈ RE , R := r1 (E) = . . . = rk (E) = x∗ (E), and λi ∈ R, 0 ≤ λi ≤ 1 (i = 1, . . . , k). Let P i the convex hull of Bi the set of bases of Mi . There exist xi ∈ P i for i = 1, . . . , k such that: k X λi xi = w, (21) i=1 if and only if for all X ⊆ E : w(X) ≥ Pk i=1 λi (R − ri (X)). (22) and the coefficients of a convex combination or a violated condition can be found in strongly polynomial time. This is the fractional version of [9] [19, Corollary 42.1d], a generalization of Theorem 13 for arbitrary matroids. A natural condition to check would be the condition of this theorem for our matroids. However, this appears to be a somewhat confusing task that we could not fully solve so far. Lemma 15 For each i = 1, . . . k, Bi satisfies (19) with w := x∗ , and ζ := ζ1 + . . . + ζi . Proof: It is necessary and sufficient to check two inequalities: (20) for the graphs induced by level-sets of Qi and x∗ (Q) ≥ ζ1 + . . . + ζi for cuts Q ∈ Qi . Then we get by Theorem 13 a “packing” of ζ spanning trees in the level sets, and the same quantity of edges in the cuts of Qi ; these can be straightforwardly pasted together to get the claimed packing. Both inequalities are consequences of the following claim: Claim: Let P be a partition of W \U 6= ∅ where s ∈ U ⊆ W , Q = δ(U ), R = δ(W ), x∗ (Q), x∗ (R) ≤ 2 − ζ. Then x∗W \U (δ(P)) ≥ ζ(|P| − 1), where x∗W \U is a restricton of x∗ to the set of edges induced by W \ U . Indeed, applying the submodular inequality (4) to W and V \ U : 2(2 − ζ) ≥ x∗ (Q) + x∗ (δ(R) ≥ x∗ (δ(W \ U )), where x∗ (δ(W \ U )) = into (23) we obtain: P P ∈P (23) x∗ (δ(P )) − 2x∗W \U (δ(P)) ≥ 2|P| − 2x∗W \U (δ(P)). Substituting this x∗W \U (δ(P)) ≥ |P| − 2 + ζ. (24) Now if |P| = 2 this is exactly the claimed inequality, and in case |P| > 2 it is stronger. The claim is proved. Now the Lemma also follows by noting that in case of Q, R ∈ Qi , the condition of the Claim is satisfied with ζ := ζ1 + . . . + ζi . Moreover, if U and W are in addition such that there exists exactly one Y such that U ( Y ( W , δ(Y ) ∈ Qi , then apply the claim to the partition of size 2 {Y \ U }, to get x∗ (Li ∩ δ(Y )) ≥ ζ, with the same ζ. Pasting together the ζ spanning trees of inclusionwise minimal level sets of Qi and of the ζ edges in Li ∩ Q for each Q ∈ Qi provides the packing of ζ bases. ✷ Note that |P| − 2 + ζ = ζ(|P| − 1) + (1 − ζ)(|P| − 2). With this remark (24) and Theorem 14 straightforwardly imply the following stronger result: Theorem 16 For every i = 1, . . . k there exists a convex combination of forests majorated by x∗ consisting of a packing of ζ = ζ1 + . . . + ζi spanning trees that are bases of Mi and ζi+1 + . . . + ζk forests, each with at most two components induced in each level set of Mi . 28 Such a convex combination is the best possible in terms of spanning trees and graphs with at most two components in each level set. However, we do not know how to use this sharpening to have all the packings simultaneously. Recall B1 ⊆ . . . ⊆ Bk . A convex combination of spanning trees containing simultaneously all the packings of Theorem 16 is exactly the assertion of Lemma 9 (ii), and as such, by Lemma 9 is equivalent to the existence of a layered convex combination. Unfortunately, Theorem 16 is weaker than (iii). D.2 A (New?) Matroid Construction We present the matroid construction of Section 5 starting from an arbitrary matroid. Is this matroid construction known? The graph special case was very useful for us, and the matroidal proofs may provide some more insight. A cut in a matroid is a minimal set that does not intersect any circuit in exactly 1 element; a set of elements is a cut if and only if it is a circuit of the dual matroid. A matroid will be given in the form M = (E, B) or in the form (M, r) where B is the set of its bases, and r is its rank function. Lemma 17 Let M = (E, B) be a matroid, and C a set of cuts of M such that BC := {B ∈ B : |B ∩ C| ≤ 1 for all C ∈ C} = 6 ∅. Then BC is the set of bases of a matroid. It follows immediately that then in fact |B ∩ C| = 1 (for all B ∈ BC , C ∈ C); it follows from BC 6= ∅ that each C ∈ C has elements that are not contained in any other member of C. (Hint: If b ∈ B ∈ B, then there exists a unique cut in M disjoint of B \ {b}.) Proof: Let B1 , B2 ∈ BC , b2 ∈ B2 \ B1 arbitrary. We show there exists b1 ∈ B1 such that (B1 \ {b1 }) ∪ {b2 } ∈ BC . If b2 ∈ ∪C∈C C, then let C be the (unique) cut disjoint of B2 \ b2 ; then C ∈ C. But then the unique circuit of B1 ∪ {b2 } must have an element in C besides b2 , denote it b1 . (Since B1 \ {b1 } has also a unique disjoint cut, C is the only cut of C containing b1 .) So (B1 \ {b1 }) ∪ {b2 } ∈ BC . If b2 ∈ / ∪C∈C C, then the unique circuit of B1 ∪ {b2 } is disjoint of ∪C, since a circuit and a cut cannot meet in exactly 1 element. Let b1 6= b2 be an element of this circuit. ✷ 29
8cs.DS
arXiv:1607.07135v3 [math.GR] 30 Sep 2016 Metric spaces with complexity of the smallest infinite ordinal number Jingming Zhu, Yan Wu ∗ Abstract. In this paper, we are concerned with the study on metric spaces with complexity of the smallest infinite ordinal number. We give equivalent formulations of the definition of metric spaces with complexity of the smallest infinite ordinal number and prove that the exact complexity of the finite product Z ≀ Z × Z ≀ Z × · · · × Z ≀ Z of wreath product is ω, where ω is the smallest infinite ordinal number. Consequently, we obtain that the complexity of (Z ≀ Z) ≀ Z is ω + 1. Keywords Metric spaces, the exact complexity, the smallest infinite ordinal number, wreath product; 1 1 Introduction Inspired by the property of finite asymptotic dimension of M.Gromov ([1]), a geometric concept of finite decomposition complexity was introduced by E.Guentner, R.Tessera and G.Yu. Roughly speaking, a metric space has finite decomposition complexity when there is an algorithm to decompose the space into nice pieces in certain asymptotic way. It turned out that many groups have finite decomposition complexity and these groups satisfy strong rigidity properties including the stable Borel conjecture ([2],[3]). In [3], E.Guentner, R.Tessera and G.Yu show that the class of groups with finite decomposition complexity includes all linear groups, subgroups of almost connected Lie groups, hyperbolic groups and elementary amenable groups and is closed under taking subgroups, extensions, free amalgamated products, HNN-extensions and inductive limits. Finite decomposition complexity is a large scale property of a metric space. To make the property quantitative, a countable ordinal the complexity can be defined for a metric space with finite decomposition complexity. There is a sequence of subgroups of Thompson’s group F which is defined by induction as follows: G1 = Z ≀ Z, Gn+1 = Gn ≀ Z. We are concerned with the study of the exact complexity of Gn which is partially inspired by the question of the finite decomposition complexity of Thompson’s group F([4],[5],[6]). In fact, if the exact complexity of the sequence {Gn } of subgroups of F is strictly increasing, then we can prove that Thompson’s group F does not have finite decomposition complexity. In [6], we proved that the complexity of Gn is ωn and the exact complexity of Z ≀ Z is ω, where ω is the smallest infinite ordinal number, but it is still unknown about the exact complexity of Gn when n > 1. Here we prove that the exact complexity of the finite product Z ≀ Z × Z ≀ Z × · · · × Z ≀ Z of wreath product is ω. Consequently, we obtain that the complexity of (Z ≀ Z) ≀ Z is ω + 1. There is no group of examples known which make a difference between the exact complexity of ω and the exact complexity of α, where α is a countable ordinal greater than ω. So the question arises naturally: Is there any metric space with the exact complexity greater than ω? Here we give equivalent descriptions of the definition of metric spaces with complexity of ω. ∗ College of Mathematics Physics and Information Engineering, Jiaxing University, Jiaxing , 314001, P.R.China. E-mail: [email protected]; [email protected] 1 This research was supported by the National Natural Science Foundation of China under Grant (No.11301224,11401256,11501249) 1 2 Equivalent descriptions of metric spaces with complexity of ω We begin by recalling some elementary concepts from coarse geometry. Let (X, d) be a metric space. For U, V ⊆ X, let diam U = sup{d(x, y) : x, y ∈ U } and d(U, V ) = inf{d(x, y) : x ∈ U, y ∈ V }. △ A family U of subsets of X is said to be uniformly bounded if diam U = sup{diam U : U ∈ U} is finite. A family U of subsets of X is said to be r-disjoint if d(U, V ) ≥ r for every U 6= V ∈ U. Definition 2.1. ([7]) A metric space X has finite asymptotic dimension if there is a n ∈ N, such that for every rS> 0, there exists a sequence of uniformly bounded families {Ui }ni=1 of subsets of X such that the union ni=1 Ui covers X and each Ui is r-disjoint. Let X and Y be metric families. A map of families from X to Y is a collection of functions F = {f }, each mapping some X ∈ X to some Y ∈ Y and such that every X ∈ X is the domain of at least one f ∈ F . We use the notation F : X → Y and, when confusion could occur, write f : Xf → Yf to refer to an individual function in F . Definition 2.2. A map of families F : X → Y is uniformly expansive if there exists a non-decreasing function θ : [0, ∞) → [0, ∞) such that for every f ∈ F and every x, y ∈ Xf , d(f (x), f (y)) ≤ θ(d(x, y)). F : X → Y is effectively proper if there exists a proper non-decreasing function δ : [0, ∞) → [0, ∞) such that for every f ∈ F and every x, y ∈ Xf , d(f (x), f (y)) ≥ δ(d(x, y)). And F : X → Y is a coarse embedding if it is both uniformly expansive and effectively proper. Two maps f, g : X −→ Y are close if {d(f (x), g(x)) : x ∈ X} is a bounded set. If f : X −→ Y is a coarse embedding and there exists a coarse embedding g : Y −→ X such that f ◦ g and g ◦ f are close to the identities on X and Y respectively, then f is called a coarse equivalence. Definition 2.3. ([2],[3]) A metric family X is r-decomposable over a metric family Y if every X ∈ X admits a decomposition G X = X0 ∪ X1 , Xi = Xij , r−disjoint r where each Xij ∈ Y. It is denoted by X → Y. Remark 2.1. To express the idea that X is the union of Xi and the collection of these subspaces {Xi } is r-disjoint, we write G X= Xi . r−disjoint Definition 2.4. ([2],[3]) (1) Let D0 be the collection of uniformly bounded families: D0 = {X : X is uniformly bounded }. (2) Let [ α be an ordinal greater than 0, let Dα be the collection of metric families decomposable over Dβ : β<α r Dα = {X : ∀ r > 0, ∃ β < α, ∃ Y ∈ Dβ , such that X → Y}. 2 Definition 2.5. ([2],[3]) • A metric family X has finite decomposition complexity if there exists a countable ordinal α such that X ∈ Dα . • We say that the complexity of the metric family X is α if X ∈ Dα . ¯ Dβ . • We say that the exact complexity of X is α if X ∈ Dα and ∀ β < α, X ∈ Remark 2.2. • Note that for any β < α, Dβ ⊆ Dα . • We view a single metric space X as a metric family with a single element. It is known that a metric space X has finite asymptotic dimension if and only if X ∈ Dn for some n ∈ N ([3],[6]). Definition 2.6. some n ∈ N. We say that a metric family X has uniformly finite asymptotic dimension if X ∈ Dn for Lemma 2.1. ([2],[3])(Coarse invariance) Let X and Y be two metric families and there is a coarse embedding φ : X → Y. If Y ∈ Dα for some countable ordinal α, then X ∈ Dα . Consequently, if φ is a coarse equivalence, then X ∈ Dα if and only if Y ∈ Dα . In particular, if X is a subspace of a metric space Y and Y ∈ Dα , then X ∈ Dα . It is easy to obtain the following two Lemmas by simple induction. Lemma 2.2. ([6]) Let X be a metric space with a left-invariant metric and {Xi }i be a sequence of subspaces of X with the induced metric. If {Xi }i ∈ Dα , then {gXi }g,i ∈ Dα , where gXi = {gh|h ∈ Xi }. △ Lemma 2.3. ([6]) Let X = {Xi } and Y = {Yj } be metric families, X × Y = {Xi × Yj }. Then for any m, n ∈ N, if X ∈ Dm and Y ∈ Dn , then X × Y ∈ Dm+n . L Example 2.1. Let G = ∞ i=1 Z (countable infinite direct sum) with d1 (g, h) = ∞ X | n | | gn − fn | , ∀g = (g1 , · · · , gn , · · · ), h = (h1 , · · · , hn , · · · ) ∈ G. n=1 It was proved that (G, d1 ) ∈ Dω , where ω is the smallest infinite ordinal number ([3]). Inspired by the equivalent descriptions of finite asymptotic dimension ([7]), here we give the equivalent descriptions of metric spaces with complexity ω. Before stating the theorem, we recall some necessary definitions. Let X be a metric space and let U be a cover of X, the Lebesgue number L(U) of U is the largest number λ such that if A ⊆ X and diam A ≤ λ, then there exists some U ∈ U such that A ⊆ U. The multiplicity m(U) of U is the maximal number of elements of U with a nonempty intersection. The d-multiplicity of U is defined to be the largest n such that there is a x ∈ X, satisfying Bd (x) meets n sets in U. A map ϕ : X → Y between metric spaces is ε Lipschitz if d(ϕ(x1 ), ϕ(x2 )) ≤ εd(x1 , x2 ) for every x1 6= x2 ∈ X. We use the notation l2 for the Hilbert space of square summable sequences, i.e. l2 = {(x1 , x2 , · · · ) | ∞ X | xn |2 < ∞}. n=1 Let ∆ denote the standard infinite dimensional simplex in l2 , i.e. ∆ = {(x1 , x2 , · · · ) ∈ l2 | ∞ X xn = 1, xn ≥ 0}. n=1 A uniform complex is a simplicial complex considered to be a subset of ∆ with each vertex at some basis element with the restricted metric. 3 Theorem 2.1. Let X be a metric space. The following conditions are equivalent. (1) X ∈ Dω . i.e. for every r > 0, there exist r-disjoint families V0 and V1 such that V0 ∪ V1 covers X and the family V0 ∪ V1 has uniformly finite asymptotic dimension. (2) For every d > 0, there exists a uniformly finite asymptotic dimension cover V of X with d-multiplicity ≤ 2. i.e. ∀ x ∈ X, ♯{V ∈ V|V ∩ Bd (x) 6= ∅} ≤ 2. (3) For every λ > 0, there exists a uniformly finite asymptotic dimension cover W of X with the Lebesgue number L(W) > λ and the multiplicity m(W) ≤ 2. (4) For every ε > 0, there exists an ε-Lipschitz map ϕ : X → K ⊆ ∆ to a uniform simplicial complex of dimension 1 such that {ϕ−1 (st v)|v ∈ K (0) } has uniformly finite asymptotic dimension, where st v is the star of the vertex v in the complex K. (5) For every uniformly bounded cover V of X, there is a cover U of X with uniformly finite asymptotic dimension such that V refines U (i.e. every V ∈ V is contained in some element U ∈ U) and the multiplicity m(U) ≤ 2. • (1)⇒(2): For every d > 0 and r > 2d, there exist r-disjoint families V0 and V1 such that V0 ∪ V1 covers X and the family V0 ∪ V1 has uniformly finite asymptotic dimension. Let V = V0 ∪ V1 . For x ∈ X, if V1 ∩ Bd (x) 6= ∅ and V2 ∩ Bd (x) 6= ∅, then d(V1 , V2 ) ≤ 2d < r. So V1 and V2 belong to distinct families V0 and V1 . Therefore, ♯{V ∈ V|V ∩ Bd (x) 6= ∅} ≤ 2. • (2)⇒(3): Let λ > 0 be given and take a uniformly finite asymptotic dimension cover V of X with 2λ-multiplicity ≤ 2. Define Ve = N2λ (V ) = {x ∈ X | d(x, V ) < 2λ} and let W = {Ve | V ∈ V}. It is easy to see W has uniformly finite asymptotic dimension by Lemma 2.1. Note that m(W) ≤ 2. i.e. ∀ x ∈ X, ♯{Ve ∈ W| x ∈ Ve } ≤ 2. Indeed, if x ∈ Ve = N2λ (V ), then d(x, V ) < 2λ. It follows that V ∩ B2λ (x) 6= ∅. Since ♯{V ∈ V|V ∩ B2λ (x) 6= ∅} ≤ 2, we have ♯{Ve ∈ W| x ∈ Ve } ≤ ♯{V ∈ V|V ∩ B2λ (x) 6= ∅} ≤ 2. It is easy to see that L(W) > λ. Indeed, for every A ⊆ X with diam A ≤ λ, choose a ∈ A ⊆ X. Since V is a cover of X, there exists V ∈ V such that a ∈ V and hence A ⊆ Bλ (a) ⊆ N2λ (V ) = Ve ∈ W. • (3)⇒(4): Let ε > 0 be given and suppose that W is a uniformly finite asymptotic dimension cover of X with L(W) > λ = 20 ε and m(W) ≤ 2. For each W ∈ W, define ϕW : X −→ [0, 1] by ϕW (x) = P d(x, X − W ) . V ∈W d(x, X − V ) Note that ϕW (x) = 0 if and only if x ∈ W . The maps {ϕW } define a map ϕ : X −→ K by ϕ(x) = {ϕW (x)}W ∈W . 4 It is easy to see that x ∈ ϕ−1 (st W ), i.e. ϕW (x) > 0 if and only if x ∈ W . Then ϕ−1 (st W ) = W . Hence {ϕ−1 (st W )}W ∈W = W has uniformly asymptotic dimension. Finally, we check that ϕ : X −→ K is ε Lipschitz. Note that | d(x, X − U ) − d(y, X − U ) | ≤ d(x, y), ∀ x, y ∈ X, ∀U ∈ W and X d(x, X − W ) ≥ W ∈W λ , ∀ x ∈ X. 2 Indeed, since diam B λ (x) ≤ λ and L(W) > λ, there exists W0 ∈ W such that B λ (x) ⊆ W0 . So 2 2 X d(x, X − W ) ≥ d(x, X − W0 ) ≥ W ∈W λ . 2 Since m(W) ≤ 2 ♯{W ∈ W| ϕW (x) > 0} ≤ 2, then we have |ϕU (x) − ϕU (y)| = P d(y, X − U ) d(x, X − U ) −P V ∈W d(x, X − V ) V ∈W d(y, X − V ) d(y, X − U ) d(y, X − U ) −P d(x, X − V ) V ∈W V ∈W d(y, X − V ) X d(y, X − U ) 2 P ≤ d(x, y) + P | d(y, X − V ) − d(x, X − V ) | λ d(x, X − V ) V ∈W d(y, X − V ) V ∈W ≤ d(x, X − U ) − d(y, X − U ) P V ∈W d(x, X − V ) + P V ∈W 2 2 ≤ d(x, y) + ∗ 4d(x, y) λ λ 10 = d(x, y). λ Therefore, kϕ(x) − ϕ(y)k2 = ( X 2 1 | ϕU (x) − ϕU (y) | ) 2 U∈W ≤ (4 ∗ = 1 100 2 d (x, y)) 2 λ2 20 d(x, y) = εd(x, y). λ • (4)⇒(1): Let r > 0 be given and let K be any uniform complex of dimension 1. For each i = 0, 1, let Ui = {st(bσ , β 2 K) | σ ⊂ K, dim σ = i}, where bσ is the barycenter of σ and β 2 K denotes the second barycentric subdivision. It is easy to see that Ui is c-disjoint for some constant c > 0. Let ε = rc , take an ε-Lipschitz map ϕ : X → K ⊆ ∆ to a uniform simplicial complex of dimension 1. Define Vi = {ϕ−1 (U ) | U ∈ Ui }, i = 0, 1. Then Vi is r-disjoint and V0 ∪ V1 covers X. For every st(bσ , β 2 K) ∈ Ui , there exists u ∈ K (0) such that st(bσ , β 2 K) ⊆ st(u, K). and it follows that ϕ−1 (st(bσ , β 2 K)) ⊆ ϕ−1 (st(u, K)). 5 Since {ϕ−1 (st u)|u ∈ K (0) } has uniformly finite asymptotic dimension, Vi = {ϕ−1 (st(bσ , β 2 K)) | σ ⊂ K, dim σ = i} has uniformly finite asymptotic dimension. • (1)⇒(5): Let V be given with diam V ≤ B, for some positive constant B. Take r-disjoint families W0 and W1 of uniformly finite asymptotic dimension with r > 2B and W0 ∪ W1 covers X. For each i = 0, 1, let Ui = {NB (W ) | W ∈ Wi }. Since Wi is r-disjoint and r > 2B, Ui is disjoint. Let U = U0 ∪ U1 , then m(U) ≤ 2. For every V ∈ V, since W0 ∪ W1 covers X, there is a W ∈ W0 ∪ W1 such that W ∩ V 6= ∅. Assume that x0 ∈ W ∩ V , then for every x ∈ V , we have d(x, W ) ≤ d(x, x0 ) ≤ diam V ≤ diam V ≤ B. i.e. x ∈ NB (W ). Therefore, V ⊆ NB (W ) ∈ U and hence V refines U. • (5)⇒(3): Let λ > 0 be given and let V = {Bλ (x) | x ∈ X}. Clearly, V is a uniformly bounded cover of X. So there is a cover W of X with uniformly finite asymptotic dimension such that V refines W and m(W) ≤ 2. Finally, we will show that L(W) ≤ λ. Indeed, for every A ⊆ X and diam A ≤ λ, choose any a ∈ A, then A ⊆ Bλ (a) ∈ V. Since V refines W, there is a W ∈ W such that Bλ (a) ⊆ W . Therefore, A ⊆ Bλ (a) ⊆ W . 3 The exact complexity of the product of wreath products Definition 3.7. Let G be a countable discrete group. A length function l : G −→ R+ on G is a function satisfying: for all g, f ∈ G, • l(g) = 0 if and only if g is the identity element of G, • l(g −1 ) = l(g), • l(gf ) ≤ l(g) + l(f ). We say that the metric d, defined as follows: d(s, t) = l(s−1 t) ∀ s, t ∈ G, is the metric induced by the length function l. A length function l is called proper if for all C > 0, l−1 ([0, C]) ⊂ G is finite. Let S be a finite generating set for a group G, for any g ∈ G, define |g|S to be the length of the shortest word representing g in elements of S ∪ S −1 . We say that | · |S is word-length function for G with respect to S. The left-invariant word-metric dS on G is induced by word-length function. i.e., for every g, h ∈ G, dS (g, h) = |g −1 h|S . Note that the word-length function of a finitely generated group is a proper length function. The Cayley graph is the graph whose vertex set is G, one vertex for each element in G and any two vertices g, h ∈ G are incident with an edge if and only if g −1 h ∈ S ∪ S −1 . Lemma 3.1. ([9]) A countable discrete group admits a proper length function l and that any two metrics of a countable discrete group induced by proper length functions are coarsely equivalent. 6 By Lemma 2.1, finite decomposition complexity is a coarsely invariant property of metric spaces. As a consequence, we say that a discrete group has finite decomposition complexity if its underlying metric space has finite decomposition complexity for some (equivalently every) metric induced by proper length function. Let G and N be finitely generated groups and let 1G ∈ G and 1N ∈ N be their units. The support of a function f : N → G is the set supp(f ) = {x ∈ N |f (x) 6= 1G }. M The direct sum G of groups G (or restricted direct product) is the group of functions N C0 (N, G) = {f : N → G with finite support}. There is a natural action of N on C0 (N, G): for all a ∈ N, x ∈ N, f ∈ C0 (N, G), a(f )(x) = f (xa−1 ). The semidirect product C0 (N, G) ⋊ N is called restricted wreath product and is denoted as G ≀ N . We recall that the product in G ≀ N is defined by the formula (f, a)(g, b) = (f a(g), ab) ∀f, g ∈ C0 (N, G), a, b ∈ N. Let S and T be finite generating sets for G and N , respectively. Let e ∈ C0 (N, G) denotes the constant function taking value 1G , and let δvb : N → G, v ∈ N, b ∈ G be the δ-function, i.e. δvb (v) = b and δvb (x) = 1G for x 6= v. b and hence (δvb , 1N ) = (e, v)(δ1bN , 1N )(e, v −1 ). Since every function f ∈ C0 (N, G) can Note that a(δvb ) = δva bk b1 be presented δv1 · · · δvk , (f, 1N ) = (δvb11 , 1N ) · · · (δvbkk , 1N ) and (f, u) = (f, 1N )(e, u). The set Se = {(δ1sN , 1N ), (e, t)|s ∈ S, t ∈ T } is a generating set for G ≀ N . Note that G and N are subgroups of G ≀ N . An explicit formula for the word length of wreath products was found by Parry. Lemma 3.2. ([8]) Let x = (f, v) ∈ G ≀ N , where f ∈ C0 (N, G) and v ∈ N . Assume that f = δvb11 · · · δvbnn , let p(x) be the shortest path in the Cayley graph of N which starts at 1N , visits all vertices vi and ends at v. Then n X |x|G≀N = |p(x)| + |bk |G . k=1 The following statement immediately follows from the above Lemma. L Corollary 3.1. For every f = δvb11 · · · δvbnn ∈ Z Z = C0 (Z, Z) ⊂ Z ≀ Z, where bi ∈ Z and vi ∈ Z. Let w(f ) be the shortest loop in the Cayley graph of Z which based at 0 and visits all vertices vi , then |f |Z≀Z = |w(f )| + n X |bk |. k=1 Lemma 3.3. ([3]) Let G be a finitely generated subgroup of GL(n, R) for some natural number n, then G ∈ Dω . Theorem 3.1. For every m ∈ N, let G = (Z ≀ Z)m = Z ≀ Z × Z ≀ Z × · · · × Z ≀ Z. Then G ∈ Dω and for any | {z } m ¯ Dα . i.e. the exact complexity of G is ω. α < ω, G ∈ 7 Proof. Since Z ≀ Z is a finitely generated group, (Z ≀ Z)m is finitely generated. By Lemma 3.3, it suffices to show that (Z ≀ Z)m is a subgroup of GL(n, L R) for some natural number n. Define a map ψ : Z ≀ Z → GL(2, R) as follows: ∀x = (f, n) ∈ Z ≀ Z, where f ∈ Z Z, n ∈ Z, ψ(x) = Now we will show that  P 1 k∈suppf f (k)π k 0 πn  ∀x = (f, n), y = (g, m) ∈ Z ≀ Z, ψ(xy) = ψ(x)ψ(y). Indeed,  ψ(x)ψ(y) = P  = P 1 k∈suppf 0 πn f (k)π k  P 1 k∈suppg g(k)π k 1P k+n k f (k)π + k∈suppg g(k)π k∈suppf  0 πm  0 π n+m Since xy = (f, n)(g, m) = (f n(g), n + m) and f n(g)(k) = f (k) + g(k − n),   1 0 ψ(xy) = P k π n+m k∈suppf ∪suppn(g) [f (k) + g(k − n)]π Note that X X f (k)π k + g(k)π k+n = k∈suppf k∈suppg X k∈suppf X f (k)π k + n(g)(k)π k = X [f (k)+g(k−n)]π k . k∈suppf ∪suppn(g) k∈suppn(g) It follows that ∀x = (f, n), y = (g, m) ∈ Z ≀ Z, ψ(xy) = ψ(x)ψ(y). m e Define a map ψ : (Z ≀ Z) −→ GL(2m, R) as follows: ∀x = (x1 , x2 , · · · , xm ) ∈ (Z ≀ Z)m , e ψ(x) = diag(ψ(x1 ), ψ(x2 ), ψ(x3 ), . . . , ψ(xm )) ∈ GL(2m, R). It is easy to check that ψe is a group homomorphism. So (Z ≀ Z)m can be considered as a subgroup of GL(2m, R). Finally, since Z ≀ Z is a subgroup of (Z ≀ Z)m and Z ≀ Z does not have asymptotic dimension, we have ¯ Dα . ∀ α < ω, G ∈ Therefore, the exact complexity of G is ω. Lemma 3.4. ([6]) Let H be a countable group and H m = H × H × · · · × H . For every r ∈ N, there exist m ∈ {z } | m N and a metric family Y such that r (1) H ≀ Z → Y, (2) there is a coarse embedding from Y to {gH m }g∈L H . Theorem 3.2. (Z ≀ Z) ≀ Z ∈ Dω+1 . i.e. the complexity of (Z ≀ Z) ≀ Z is ω + 1. Proof. Let H = Z ≀ Z, by Lemma 3.4, for every r ∈ N, there exist m ∈ N and a metric family Y such that r (1) H ≀ Z → Y, (2) there is a coarse embedding from Y to {gH m }g∈L H . By Theorem 3.1, H m ∈ Dω . Then it is easy to obtain that {gH m }g∈L H ∈ Dω . Since there is a coarse embedding from Y to {gH m }g∈L H , Y ∈ Dω by Lemma 2.1. Therefore, (Z ≀ Z) ≀ Z = H ≀ Z ∈ Dω+1 . Acknowledgments. We thank Jiawen Zhang for many useful discussions. 8 References [1] M. Gromov, Asymptotic invariants of infinite groups. in: Geometric Group Theory, Vol.2, Sussex, 1991, in: Lond. Math. Soc. Lect. Note Ser., vol.182, Cambridge Univ. Press, Cambridge, 1993, pp.1–295. [2] E. Guentner, R. Tessera, G. Yu, A notion of geometric complexity and its application to topological rigidity. Invent. Math. 189(2012), 315–357. [3] E. Guentner, R. Tessera, G. Yu, Discrete groups with finite decomposition complexity. Groups Geom. Dyn. 7 (2013), 377–402. [4] J. W. Cannon, W. J. Floyd and W. R. Parry, Introductory notes on Richard Thompsons groups. Enseign. Math. (2) 42 (1996), no. 3-4, 215–256. [5] Yan Wu, Xiaoman Chen, Distortion of Wreath Products in Thompson’s Group F. Chinese Annals of Mathematics,Series B, 35B(5) (2014), 801–816. [6] Yan Wu, Xiaoman Chen, On Finite Decomposition Complexity of Thompson Group. Journal of Functional Analysis, Vol.261, Issue 4, (2011), 981–998. [7] G. Bell, A. Dranishnikov, Asymptotic dimension in Bedlewo. Topology Proc. 38 (2011), 209–236. [8] W. Parry, Growth series of some wreath products. Trans. Am. Math. Soc. 331(1992), no. 2, 751–759. [9] R. Willett, Some notes on property A, Limits of graphs in group theory and computer science, 191–281, 2009. 9
4math.GR
A ROS Multi-Ontology References Service: OWL Reasoners and Application Prototyping Issues arXiv:1706.10151v1 [cs.RO] 30 Jun 2017 Luca Buoncompagni1, Alessio Capitanelli and Fulvio Mastrogiovanni Abstract— In this extended abstract, we introduce the ARMOR service, a general-purpose and scalable interface between robot architectures and OWL2 reasoners. ARMOR addresses synchronisation and communication issues among heterogeneous and distributed software components. As a guiding scenario, we consider a prototyping approach for the use of symbolic reasoning in human-robot interaction applications. I. I NTRODUCTION The challenge of sharing and communicating information is crucial in complex human-robot interaction (HRI) scenarios. Ontologies and symbolic reasoning are the state of the art approach for a natural representation of knowledge, especially within the Semantic Web domain. In such a context, scripted paradigms have been adopted to achieve high expressiveness [1]. Nevertheless, since symbolic reasoning is a high complexity problem, optimising its performance requires a careful design of the knowledge resolution. Specifically, a robot architecture requires the integration of several components implementing different behaviors and generating a series of beliefs. Most of the components are expected to access, manipulate, and reason upon a run-time generated semantic representation of knowledge grounding robot behaviors and perceptions through formal axioms, with soft real-time requirements. The Robot Operating System (ROS) is a de facto standard for robot software development, which allows for modular and scalable robot architecture designs1 . Currently, a number of approaches exist to integrate a semantic representation in ROS, such as the KnowRob2 support for Allen’s Algebra [2] through a complete framework of useful ontologies, or the native ROS support of MongoDB3, which can be also used to provide a suitable representation for semantic querying. Unfortunately, none of these support the study of advanced reasoning paradigms, and they heavily rely on ad hoc reasoning solutions, significantly limiting their scope. We argue that this fact affects the study of different approaches to semantics in Robotics. For instance, it limits our capability to explore novel semantic representations of perceptions, which offers similar but not equivalent beliefs. We lack a standardized general framework to work with ontologies, natively supporting symbolic logic and advanced reasoning paradigms. 1 All the authors are with the Department of Informatics, Bioengineering, Robotics and Systems and Engineering, University of Genoa. Corresponding author’s email: [email protected]. 1 http://www.ros.org/ 2 http://www.knowrob.org/doc 3 https://www.mongodb.com/ The Ontology Web Language (OWL) is a standard representation supporting several reasoning interfaces, e.g., Pellet [3], and logics approaches [4]. Thus, it can be a solid foundation to a framework for symbolic reasoning in Robotics. OWL is based on the separation between terminological and assertional knowledge, referred to as different boxes. Typically, in Robotics scenarios, we design a static semantics for the beliefs to be represented in the TBox. Then, we populate the ABox through individuals defined using types and properties and, at run-time, we classify knowledge using instance checking. We argue that, due to the high complexity of HRI scenarios, the possibility of a dynamic semantics in the TBox is desirable as well. For instance, it could be used to learn new types for classification. This lead us to a study requiring reasoning heuristics to be compared, components to be shared and different semantics to be adapted. For this purpose, we propose the ROS Multi Ontology References4 (ARMOR in short). ARMOR is an open source service which manipulates and queries OWL2 ontologies. It provides a simple access to a set of dynamic ontologies, handling also the synchronizations among different components in the architecture. Last but not the least, it is a convenient tool to directly assess semantics supported by advanced reasoners. II. S YSTEM ’ S A RCHITECTURE A. Basic ARMOR Concepts Figure 1 shows a schematic representation of ARMOR. It interfaces the OWL API5 through the Java-based Multi Ontology References library (AMOR). Then, ARMOR exposes AMOR functionalities as a service to ROS-based architectures, relying on the support for Java in ROS (ROSJava6 ). ARMOR messages have been designed to accommodate all OWL2 functionalities. Nevertheless, we have implemented only an exhaustive subset of those features so far (i.e., only common run-time operations). Indeed, ontology managers are not distributed across satellite components of a ROS architecture. Instead, dedicated components are in charge of management, while others only provide knowledge axioms, possibly at run-time. With ARMOR, it is possible to inject in the service other symbolic procedures, extending the semantics already provided by AMOR. Static descriptions can be defined with dedicated software, e.g., Protégé7. 4 https://github.com/EmaroLab/ARMOR 5 http://owlapi.sourceforge.net/ 6 https://github.com/rosjava 7 http://protege.stanford.edu/ Fig. 1. The ARMOR components (white boxes), interfaces (external arrows) and their dependencies (bidirectional arrows) drawn within their respective domains (coloured boxes). ROS Parameters AMOR References ROS Java Service ROS Injected Semantic AMOR Enquirer AMOR Manipulator Knowledge Base OWL API ARMOR ROS B. AMOR The core library, referred to as AMOR, contains a map of instantiated ontologies, where the key is a unique name identifier used to access the corresponding ontology in a threadsafe manner. AMOR provides several common operations, such as those to create individuals, assign their properties, make them disjointed and classify them, just to name a few. Furthermore, AMOR ensures complete accessibility to the OWL API features for compatibility and extendability purposes. For example, AMOR allows for invoking reasoning tasks by specifying its OWLReasoner factory, i.e., the unique package of its Java implementation, which assures compatibility with all OWL reasoners. In the current implementation, we interface several properties that are useful to tune the AMOR behavior, e.g., the buffering of the manipulations or a continuous reasoner update, using the standard ROS Parameter Server, as well as parameters for debugging purposes such as toggling a Graphical User Interface (GUI) for visualising ontology states. C. ARMOR The ARMOR service is based on a ROS message structure (i.e., a triple) for the use of the AMOR functionalities from any node in the architecture, even when the development language is different from Java (e.g., Python8 and C++ are the most common languages in Robotics development). Such a message is composed of: 1) the client name, which is used by the service to identify different callers, 2) the reference name, indicating the operation’s target reference, and 3) the command to execute, i.e., add, remove, replace, query, load, mount, etc.9 Each of those commands may be further refined by: a) the primary and secondary specifiers, which augment command labels, e.g., add(individual, class) or remove(individual, property), and b) the arguments, a list of entities in the reference parameterizing the command, e.g., hadd(class) "Sphere"i, or even hadd(property,individual) "hasNorth" "LivingRoom" "Corridor"i. An ARMOR call is based on one or more messages with the same structure. When such a request is sent, the service manipulates or queries the ontology with the given directives. Then, it returns whether the ontology is consistent, eventual error codes with their description, and the names of the queried entities, if requested. One advanced feature of ARMOR is the possibility of flexibly synchronizing all operations. This follows a mounting/unmounting paradigm, where one or more nodes identified by the same client name can prevent other nodes from manipulating a given ontology, in order to ensure manipulation consistency. On the contrary, queries are always allowed. Calls to busy ontologies will report the issue. The user can choose how to handle this situation. III. A PPLICATIONS We are currently using ARMOR in different applications. Here we mention only two of them. The first is aimed at implementing a dynamic PDDL problem generator. This approach uses descriptions of the predicates and objects within a tabletop scenario to infer unsatisfied norms and consequently generate goals [5]. The system has been integrated with ROSPlan10 by substituing the internal semantic data structure with ARMOR and a suitable OWL ontology. Currently, we are investigating the performance of semantic feedback for re-planning. The second is a system to learn by experience the arrangement of objects in the robot’s workspace by mapping their properties into the TBox. In this case, we inject a centralised service that scans semantic spatial relations and shapes ontologies, populated by different components in the architecture. Through them, such a service generates a new semantic scene class that the reasoner interprets as soon as it performs hierarchical classification. In this study, we are currently comparing different multi-modal perception modules to generate beliefs indicating relevant properties of a scene as perceived by a robot. IV. C ONCLUSIONS We introduced the ARMOR service to manipulate OWL ontologies and fully query their reasoners within a ROS architecture. ARMOR is based on a flexible set of messages allowing for the direct access of several OWL features from any component of the architecture. It ensures synchronization between client calls, and flexibility through procedure injection. It also provides an easy interface to OWL2 representations. R EFERENCES [1] M. Krötzsch, F. Simancik, and I. Horrocks, “A description logic primer,” arXiv preprint arXiv:1201.4089, 2012. [2] J. F. Allen, “Maintaining knowledge about temporal intervals,” Communications of the ACM, vol. 26, no. 11, pp. 832–843, 1983. [3] E. Sirin, B. Parsia, B. C. Grau, A. Kalyanpur, and Y. Katz, “Pellet: A practical owl-dl reasoner,” Web Semantics: science, services and agents on the World Wide Web, vol. 5, no. 2, pp. 51–53, 2007. [4] (2004) Owl web ontology language guide. [Online]. Available: https://www.w3.org/TR/owl-guide/ [5] A. Capitanelli and F. Mastrogiovanni, “An ontology-based hybrid architecture for planning and robust execution in tabletop scenarios,” pp. 31–35, 2016. [Online]. Available: http://ceur-ws.org/Vol-1834/ 8A simple set of OWL functions can be find at https://github.com/EmaroLab/ARMOR_py_api. 9 A complete list is available at https://github.com/EmaroLab/ARMOR/blob/master/commands.md. 10 https://github.com/KCL-Planning/ROSPlan
2cs.AI
Robust Semi-Cooperative Multi-Agent Coordination in the Presence of Stochastic Disturbances arXiv:1709.01586v3 [cs.SY] 5 Jan 2018 Kunal Garg Dongkun Han Abstract— This paper presents a robust distributed coordination protocol that achieves generation of collision-free trajectories for multiple unicycle agents in the presence of stochastic uncertainties. We build upon our earlier work on semi-cooperative coordination and we redesign the coordination controllers so that the agents counteract a class of state (wind) disturbances and measurement noise. Safety and convergence is proved analytically, while simulation results demonstrate the efficacy of the proposed solution. I. I NTRODUCTION Coordination in multi-agent systems has attracted much attention over the last decade with a plethora of theoretical and practical problems that this paper can not cite in their entirety; for recent overviews the reader is referred to [1]–[4]. A fundamental problem of interest in the area of distributed coordination and control is the decentralized multiagent motion planning, which mainly focuses on generating collision-free trajectories for multiple agents (e.g., unmanned vehicles, robots) so that they reach preassigned goal locations under limited sensing, communication, and interaction capabilities. Numerous elegant methodologies on planning the motion for a single agent (robot) have appeared in recent years, with the most popular being (i) samplingbased methods, including probabilistic roadmaps [5], and rapidly-exploring random trees [6], [7], (ii) Lyapunov-based methods, including either the definition of closed-form feedback motion plans via potential functions or vector fields, or computation of Lyapunov-based feedback motion plans via sum-of-squares programming [8], [9], and (iii) graph search and decision-theoretic methods, see also [10], [11] for a detailed presentation. Although each method has its own merits and caveats, arguably Lyapunov-based methods (often termed reactive) are particularly popular for multiagent motion planning problems, as they offer scalability with the number of agents, and the merits of Lyapunov-based control design and analysis. In addition, robustness against modeling and/or measurement uncertainties is of primary importance for real-world systems and applications. Hence the problems of modeling, quantifying, and treating uncertainty are of particular interest when it comes to multi-agent coordination. A straightforward way to model uncertainty in multi-agent systems is by The authors are with the Department of Aerospace Engineering, University of Michigan, Ann Arbor, MI, USA; {kgarg, dongkunh, dpanagou}@umich.edu. The authors would like to acknowledge the support of the Automotive Research Center (ARC) in accordance with Cooperative Agreement W56HZV14-2-0001 U.S. Army TARDEC in Warren, MI and the support of the NASA Grant NNX16AH81A. Dimitra Panagou considering them as bounded disturbances. In [12], a stable uncertainty is assumed to be bounded in H∞ -norm by some prior given desired tolerance, and a state space observer along with a robust controller are designed by using the algebraic Riccati equations. In [13], an additive l2 -norm bounded disturbance is considered, and a robust controller is proposed for the distributed cooperative tracking problem in a leader-follower network by using Lyapunov stability theorems. In [14], both bounded disturbances and unmodeled dynamics are assumed in the dynamics of agents; an identifier for each agent is designed to estimate the unknown disturbances and unmodeled dynamics. Related work considering bounded deterministic disturbances can be found in the design of finite-time consensus algorithms with mismatched disturbances [15], and the rotating consensus control with mixed model uncertainties and external disturbances [16]. Another way of modeling uncertainty is by Gaussian random processes. In [17], communication noises are described by a standard Brownian motion, and the mean square consensus in the multi-agent system is achieved by proposing a stochastic approximation-type gain vector, which attenuates the effect of noises. This work is extended to networks with Markovian switching topologies [18], and leader-follower networks [19] with a similar noise-attenuation controller. In [20], it is assumed that the measurements for each agent are disturbed by white noises. Robust consensus can be achieved by applying stochastic Lyapunov analysis. Based on this idea, in [21], the average-consensus problem of firstorder multi-agent systems is considered, and a necessary and sufficient condition is proposed for robust consensus by using probability limit theory. The aforementioned methods are efficient in solving the coordination problems with stochastic uncertainties in measurement or system dynamics; however, safety (i.e., the generation of collision-free trajectories) is not considered. In contrast to the aforementioned results, in this paper we consider the problem of generating collision-free trajectories for multiple agents in the presence of uncertainty. We propose a robust, Lyapunov-based coordination protocol that achieves collision-free motion for multiple agents in a distributed fashion, in the presence of state and measurement uncertainties. The method builds upon our earlier work in [22], in which the nominal (uncertainty-free) case was considered. More specifically, we redesign the semi-cooperative coordination protocol in [22] so that it accommodates the case of state and measurement uncertainties. Our approach yields a method on the safe and robust motion planning of multiple agents that is based on analytic vector fields, hence offers scalability with the number of agents along with provable guarantees. In summary, the contributions of this paper are: (i) a robust, semi-cooperative coordination protocol that accommodates for a class of stochastic disturbances in the agents’ dynamics and measurements, and (ii) the derivation of analytical bounds on the navigation (estimation) and final state errors of the agents in terms of the considered uncertainties. The paper is organized as follows: Section II includes an overview of the modeling of the system under the effect of disturbances. Section III presents the robust coordination protocol along with the safety and convergence analysis. Section IV evaluates the performance of the proposed method via two simulation scenarios. Our conclusions and thoughts on future work are summarized in Section V. II. M ODELING AND P ROBLEM S TATEMENT Let us consider N identical agents i ∈ {1, . . . , N }, which are assigned to move  T to goal locations of position coordinates rgi = xgi ygi relative to some global frame G, while avoiding collisions. The motion of each agent i is modeled under unicycle kinematics with additive disturbances that stand for state and output uncertainty, for instance due to wind effects and sensor imperfections, respectively, as:       ẋi ui cθi wx q̇i = f (qi , ui ) + Γw ⇒  ẏi  = ui sθi  + wy  , (1a) ωi 0 θ̇i yi = hi (qi ) + vi , (1b)  T T where qi = ri θi is the state vector of agent i, compris T ing the position vector ri = xi yi and the orientation θi of the  agentTwith respect to (w.r.t.) the global frame G, ui = ui ωi is the control input vector comprising the linear velocity ui and the angular velocity ωi of agent i, f (·, ·) : R3 × R2 → R3 is the vector valued function of the agent dynamics, and c(·) , cos(·), s(·) , sin(·) and   1 0 Γ = 0 1 . 0 0  T The random process w = wx wy is assumed to be  T Gaussian, white, of known mean w̄ = w̄x w̄y and known covariance Pw ∈ R2×2 . To maintain the Lipschitz continuity of the proposed control law, we assume that the mean value of state disturbance is continuous in time and is bounded. Furthermore, yi ∈ Rm is the output vector comprising the available measurements, hi (·) : R3 → Rm is the output function, and vi ∈ Rm is the measurement noise modeled as a Gaussian, white process of zero mean v̄i = 0 and known covariance Pvi ∈ Rm×m . For simplicity in the sequel we assume that the output function is the identity map so that the measurement model reduces to yi = qi + vi , and that the measurements are uncorrelated, so that the covariance matrix of vi reads Pvi = diag(σvi,1 , σvi,2 , σvi,3 ). Each agent i is modeled as a closed circular disk of radius %i , and has a circular communication/sensing region Ci of  T radius Rc centered at ri = xi yi , denoted as Ci : {r ∈ R2 | kri − rk ≤ Rc }. We denote Ni the set of neighboring agents k ∈ Ci of agent i. We assume that each agent i can measure the position rk , orientation θk and receive the linear velocity uk of any agent k lying in Ci . In our earlier work [22] we considered the nominal case of (1), i.e., the case for w = 0, v = 0, and designed the following semi-cooperative distributed coordination protocol: Coordination of linear velocities: The linear velocity ui of each agent i is governed by the control law:       max 0, min ui|k , dm ≤ dik ≤ d , k∈Ni |Jk <0 ui = ui , d < dik < dc ,    uic , dc ≤ dik ; (2) where: – dij is the Euclidean distance between agents i and j, dm ≥ 2(2% + % ) is the minimum allowable pairwise distance, dc is a positive constant such that dc ≤ Rc , and dr is a positive constant such that dm < dr < dc , – uic = kui tanh(kri − rgi k), kui > 0, – ui is the value of the linear velocity ui of the agent i when dij = dc , that is, ui = uic |dij =dc , – the distance d is set equal to d = dr − , – ui|k is the safe velocity of agent i w.r.t. a neighbor agent k ∈ Ni , given as: ui|k = ui d − dik dik − dm + εi uis|k , d − dm d − dm (3) with the terms in (10) defined as:   rki T ηk cos θi uis|k = uk , η = , Jk = rki T ηi , i sin θi rki T ηi rki = ri − rk , and 0 < εi < 1. Coordination of angular velocities: The angular velocity ωi of each agent i is governed by the control law: ωi = −kωi (θi − ϕi ) + ϕ̇i , (4)   Fiy where kωi > 0, and ϕi , arctan Fix is the orientation of a reference vector field Fi for agent i, defined as: Y X Fi = (1 − σij )Fgi + σij Fioj , (5) j∈Ni j∈Ni where details about the attractive and repulsive vector fields can be found in [22]. Under this protocol we were able to establish collisionfree and almost globally convergent motion of the agents towards to their goal locations: Theorem 1: Consider N agents i ∈ {1, . . . , N } assigned to move to goal locations rgi . Then, under the coordination protocol (2), (4), each agent safely converges to its goal configuration almost globally, except for a set of initial conditions of measure zero. Proof: The design and analysis of the coordination controller is given in [22]. In this paper we seek to design a robust coordination protocol so that each agent i can safely accommodate the effects of state and measurement uncertainties w(t), vi (t), t ∈ [0, ∞), respectively. Since we are only concerned about radial convergence of the agents to their respective goal locations, we re-define the radially attractive vector field Frgi for ri 6= rgi as: where w̄ is the known mean of the state disturbance and T upi = upi ωip is the control input. We propose the following coordination protocol yielding the feedback control law upi (q, w̄, dm ) for the perturbed dynamics (8) of agent i: Frgix = (6a) Coordination of linear velocities: The linear velocity of each agent i is governed by the control law:    P  − 1 log e−µui|k , dm ≤ dik ≤ d , µ p ui = , k∈Ni |Jk <0  uic , d ≤ dik ; (9) Frgiy (6b) where: • the linear velocity of agent i when free of conflicts is: −(xi − xgi ) , (xi − xgi )2 + (yi − ygi )2 −(yi − ygi ) = . (xi − xgi )2 + (yi − ygi )2 Fi − w̄ , kFi k ui = kui tanh (kri − rgi k) , uic = ui With this globally attractive field, the new reference field is given by Y X Fi = (1 − σij )Frgi + σij Fioj . (7) j∈Ni The problem of safe trajectory generation in the presence of disturbances is tackled in two steps. The first step is to modify the nominal controller in order to accommodate for known state disturbances, that in our case can be thought of as wind effects. This task is achieved by feed-forwarding the mean wind speed to each agent’s control law as per (9) and (13). Once we have a controller that handles this class of known disturbances, the next step is to make it robust w.r.t. unknown, zero-mean state disturbances and sensor noises. To accomplish this, an Extended Kalman Filter (EKF) based observer is used to estimate the state vector for the feedback coordination law of each agent. In order to incorporate the estimation error, the crucial safety parameters involved in the nominal control law (i.e., the minimum allowed separation dm and the set Jk of critical neighbors k to agent i) in (2) are modified. Then, with a controller in hand for nominal (or disturbance-free case), feed-forwarded with the known mean wind speed, and by using estimated states as feedback with properly modified safety parameters, we get a robust coordination protocol that steers the agents within a neighborhood of their goal locations, while maintaining safety at all times. Recall that the system is safe if the interagent distance dij between any pair of agents i, j is always greater than a minimum allowed separation dm . (11) • where kui > 0 and Fi is given by the nominal vector field (7),  T a1 , . . . , an , the function g(a) = for a =  P N − µ1 log e−µai is a smooth approximation of the • minimum function min{a1 , . . . , an } as µ → ∞, ui|k is the safe velocity of agent i w.r.t. a neighbor agent k ∈ Ni , given as: j∈Ni III. ROBUST C OORDINATION : D ESIGN AND A NALYSIS (10) i=1 dik − dm d − dik + εi uis|k , (12) d − dm d − dm with the terms in (10) defined as:   rki T ηk cos θi uis|k = upk , η = , Jk = rki T ηi , i sin θi rki T ηi ui|k = uic rki = ri − rk , and 0 < εi < 1. A. Control design under bounded disturbances We first consider the case where each agent i is subject to known state disturbances, without any measurement uncertainty, i.e., we consider the agent dynamics:    p    ẋi ui cos θi w̄x p p q̇i = f (qi , ui ) + Γw̄, ⇒  ẏi  =  ui sin θi  + w̄y  , ωip 0 θ̇i (8a) yi = hi (qi ) = qi , (8b) Fig. 1. If Jj , rji T ηi < 0, i.e., if agent i moves towards agent j, then agent i adjusts its linear velocity according to the velocity profile shown here, given analytically by (12). Coordination of angular velocities: The angular velocity of each agent i is governed by the control law: ωip = −kωi (θi − ϕpi ) + ϕ̇pi , (13) where kωi > 0, ϕpi , arctan  Fp  Fpni niy Fp nix is the orientation of Fp i kFp ik for the perturbed = the normalized vector field system (8) at a point (x, y), with the vector field Fpi for the perturbed system (8) given out of: Fpi = ui Fi − w̄, kFi k (14) where Fi is the nominal vector field given out of (7), and ui is given out of (11). The time derivative of ϕpi reads  p  ∂ Fniy ∂ Fp p p niy ϕ̇pi = Fpnix cθ + sθ i i ∂x ∂y    p p − ∂ F∂xnix cθip + ∂ F∂ynix sθip Fpniy ui . It can be readily seen that steady-state solution of θ̇i = ωip = −kω (θi − ϕpi ) + ϕ̇pi is θi = ϕpi . The derivative of inter-agent distance is given in (17). Hence, we have: upi rji T ηi − upj rji T ηj d dij = . dt dij (18) The worst case neighbor for agent i is defined as the agent j ∈ {Ni | Jj , rji T ηi < 0} towards whom the rate of change of inter-agent distance dij given by (18), due to the motion of agent i, is maximum. More specifically, the decision making process works as follows: The term Jj < 0 describes the set of neighbor agents j of agent i towards whom agent i is moving [23]. Thus agent i computes safe velocities ui|j w.r.t. each neighbor j ∈ {Ni | Jj < 0}, and picks the minimum ui|j of the safe velocities so that the first term in (18) is as less negative as possible. Now, the value of the safe velocity ui|j (12) when dij = dm is by construction r T η j . Plugging this value into (18) equal to εi uis|k = εi uj rji T ji ηi reads: d (εi − 1)uj rji T ηj dij = ≥ 0. dt dij Fig. 2. Construction of new vector Field Fpi in the presence of wind w̄ to follow the desired vector field Fi . Here, blue line is the desired trajectory, green arrow shows the direction of the mean wind speed, dotted black arrow shows direction of nominal vector field Fi while solid orange arrow represents direction of constructed vector field Fpi . The following theorem proves that safety for the multiagent can be guaranteed under the control law given by (9) and (13): Theorem 2: If each agent i ∈ {1, . . . , N } subject to the system dynamics (8) follows the control law given by (9) and (13), then ∀i, j ∈ {1, . . . , N }, i 6= j, it holds that: kri (t) − rj (t)k ≥ dm , ∀t ≥ 0, (15) and each agent converges to its goal location almost globally, i.e., kri∞ − rgi k , lim kri (t) − rgi k = 0, t→∞ (16) except for a set of initial conditions of measure zero. Proof: To prove (15), we have that under the control law (9), agent i adjusts its linear velocity ui according to the velocity profile shown in Fig. 1, given analytically out of (12), so that the distance dij w.r.t. the worst case neighbor j remains greater than dm . Mathematically, it is required that d dij dij =dm ≥ 0, dt so that the inter-agent distance does not decrease further once the agents i, j are at the minimum allowed separation dm . (19) To see why this condition is true, recall that εi − 1 < 0, uj ≥ 0, and rji T ηj ≤ 0: this is because agent j is either following a vector field Fj that points away from agent i, or happens to move away from agent i in the first place. This implies that the inter-agent distance dij can not become less than dm [22]. To verify this argument, it is sufficient to show that in the presence of known disturbances w̄, the motion of any agent i, j ∈ {1, 2, . . . , N } under the control law (9) and (13) is along their nominal vector fields given by (7), as follows: Let θid be the nominal direction that agent i is supposed to follow the nominal vector field Fi , i.e., θid ,  under  Fix arctan Fiy . From the steady-state solution of θ˙i = ωi under the control law (13), we have θi = ϕpi , where θi is the orientation of the agent i. Let ∠(·) be signed angle, defined to be positive in the clockwise direction and negative in the counter-clockwise direction. Now, from (8) we have: ∠(ṙi − w̄)  = θi . Also, by construction of the new vector field (14), ∠ ui kFFii k − w̄ = (13) ϕpi = θi out of the steady-state solution of(13), see also  Figure 2. Thus we have that ∠(ṙi − w̄) = ∠ ui kFFii k − w̄ , which makes ∠r˙i = ∠Fi = θid . Hence, the motion of agent i is along the desired nominal vector field Fi . Analysis of convergence of the agents to their goal locations is given in [22]. Note that the analysis given in [22] is carried out for dipole type attractive vector field, which will still hold for the radially attractive vector field. Since, except for a set of initial conditions of measure zero, the nominal vector field drives the agents to their goal location (Theorem 1), it follows that the modified coordination protocol also drives the agents to their goal locations almost globally. It is to be noted that while the direction of motion of agent i is along the nominal vector field Fi , its orientation (heading angle) θi remains along the modified vector field Fpi . p p (xi − xj )(ẋi − ẋj ) + (yi − yj )(ẏi − ẏj ) (8) (xi − xj )(ui cθi + w̄x − uj cθj − w̄x ) ˙ p dij = = dij (xi − xj )2 + (yi − yj )2   p p p p p p (x − x )(u cθ − u cθ ) + (y − y )(u sθ − u sθ ) i j i j i j i j (yi − yj )(ui sθi + w̄y − uj sθj − w̄y ) i j i j + = . dij dij B. Extension of the controller for stochastic disturbances In order to estimate the states of the system in the presence of stochastic disturbances, we design a system observer based on the Extended Kalman Filter: q̂˙ i = f (q̂i , ui ) + Γw̄ + Ki (yi − ŷi ), Ṗi = Ai Pi + Pi ATi (20a) T − Ki Hi Pi + ΓPw Γ , (20b) ŷi = h(q̂i ) = q̂i , (20c) Ki = −Pi HiT Pv−1 , i (20d) ui = ui (q̂, w̄, d0m , J ), where Ai = ∂f ∂qi q̂i (20e) is the state matrix of the linearized dynamics evaluated at q̂i , Hi = ∂h ∂qi q̂i is the linearized output matrix evaluated at q̂i , Pi is the covariance matrix of the estimation error q˜i = qi − q̂i , and Ki is the Kalman gain. Note that the control law (20e) has the same form as (9) but it uses the estimated states q̂ for feedback, the mean wind speed w̄ for feed-forward command, and involves d0m as the new safety parameter. The last parameter J is introduced to re-define the worst-case neighbor, as per (21). Stability of EKF-based estimator: In [24], authors have shown that the EKF is stable if there exist positive constants c̄, p, q, δ, k such that: • kH(t)k ≤ c̄ • System is uniformly observable • p ≤ Pv ≤ δI • q ≤ Pw ≤ δI 2 • kH.O.T k ≤ kkq̃i k where q̃i = qi − q̂i and H.O.T stands for higher-order terms of the linearization . Furthermore, if these conditions hold, then the estimation error is exponentially mean-square bounded. Using this result, we now show that EKF based estimator will remain bounded for system (1) whose control law is given by (20e). In our system, H is just an identity mapping, which allows us to choose c̄ = 1. Since H is identity, we have that the system is always observable. By the assumption on the type of disturbance we consider in (1), the covariance matrices Pvi and Pw are non-zero constant matrices and hence are bounded. We assume that the initial estimation error is bounded. Now, we show that our closedloop system also satisfies the condition on boundedness of H.O.T . The function f of the system dynamics given by (1) is continuously differentiable in qi and ui . From (9) and (13) we have that the control law (20e) is a bounded, continuously differentiable function of q, since the vector field Fpi , its partial derivatives w.r.t. xi and yi , and the linear control input upi , are continuously differentiable and bounded. Hence for (17) all agents the closed loop function f (qi ) is a continuously differentiable, bounded function of the states of the agent i. k Hence all its derivatives ddqfk are bounded in Rn . Using the i expression for Lagrange Remainder for Taylor series expansion [25], since we are using first order expansion, we have that the norm of the remainder of Taylor series expansion 2 or the higher order terms kH.O.T k ≤ 12 k ddqf2 kkq̃i k2 and i 2 k ddqf2 k ≤ L. Hence kH.O.T k ≤ kkq̃i k2 with k = L/2. i Thus, the EKF-based estimator (20) is stable, which implies that the estimation error q̃ will remain bounded for sufficiently small disturbances, i.e., for small covariance matrices Pw and Pvi . We can therefore bound the norms of the estimation errors in individual states and position of agent i by small, positive numbers. Define the maximum of the errors in √ the estimation of the √ states for any agent i as√x , 3 max Pi11 , y , 3 max Pi22 and θ , 3 max Pi33 i i i where Pill , l ∈ {1, . . . , n}, are the diagonal terms of error covariance matrix Pi . Also, we defineqthe maximum error in the estimation of the position as d , 2x + 2y . Using the 3σ bound for the Gaussian noise, we have that kxi − x̂i k ≤ x , kyi − ŷi k ≤ y , kθi − θˆi k ≤ θ and kri − r̂i k ≤ d . Referring to Definition 4.1 of [24], we can choose a function Λ(q) = −1, so that kΛk = 1. Then, using Theorem 7 in [26], we have that kPi (t)k ≤ kPi (0)k + 1. We choose Pi (0) = Pvi , so that max kP (t)k = max kPvi k + 1. With this bound on i the covariance matrix, we can r express x = y = θ = q max kPvi k + 1 and d = 2 max kPvi k + 1 . i i C. Safety Analysis The linear velocity coordination law (9) depends upon the safety parameter dm . As only estimates of the interagent distances are available to each agent, one can set the minimum allowed estimated distance dˆijmin equal to d0m (given by (23)), in order to ensure that actual interagent distance dij remains greater than the minimum allowed distance dm . We re-define the worst case neighbor (defined earlier) in terms of the estimated states as: T j ∈ {Ni | r̂ji η̂i ≤ −J }. (21) To proceed with the analysis, we first prove the following Lemma: T Lemma 1: If r̂ji η̂i ≤ −J , where J = 2d +s(θ )(dm +2d ) , then with probability 0.997 c(θ ) T rji ηi ≤ 0. Proof: Since we are concerned about safety of the system, let’s assume that inter-agent distance dij = dm . We use the fact that kxi −x̂i k ≤ x , kyi −ŷi k ≤ y , kθi −θˆi k ≤ θ and kri − r̂i k ≤ d . Therefore we have that dm − 2d ≤ kr̂i − r̂j k ≤ dm + 2d . Now, T rji ηi = rji T   cos θi = (xi − xj )cθi + (yi − yj )sθi , sin θi θ )(dm +2d ) . which further reads as in (22). Let J = 2d +s(c( θ) Since θ and d are small positive numbers, we have cos(θ ) > 0 and J > 0. Hence, if ((x̂i − x̂j )cθ̂i + (ŷi − T ŷj )sθ̂i ) ≤ −J , then we have that rji ηi ≤ 0. Since the bounds on the estimation error are probabilistic, we only guarantee that this result holds with probability 0.9971 . Now we use this result to show the safety of the system. In order to maintain the safety of the agents in the presence of disturbances, the safety parameter d0m in the control law (20e) is given by: d0m = dm + 2d . (23) Theorem 3: If each agent i under the system dynamics (1) follows the control law given by (20e), and if d0m is given by (23), then with probability 0.997, ∀t ≥ 0, ∀ i, j ∈ {1, . . . , N }, j 6= i: kri (t) − rj (t)k ≥ dm . (24) Proof: Using triangle inequality, kr̂i − r̂j k ≤ kr̂i − ri k + kr̂j − rj k + kri − rj k ⇒ kr̂i − r̂j k ≤ 2d + kri − rj k ⇒ d0m ≤ 2d + kri − rj k. Choosing d0m as per (23), we get kri − rj k ≥ dm . To complete the proof, it is sufficient to show that when dˆij = d0m , the time derivative of inter-agent distance is positive, i.e. d˙ij > 0. In the presence of uncertainties, to guarantee that the system is safe, we modify the definition of the worst T case neighbor as j ∈ {Ni | Jˆj , r̂ji η̂j < −J } so that, from T Lemma 1 we have that rji ηj ≤ 0, which implies d˙ij ≥ 0 at dˆij , kr̂i − r̂j k = d0m . Therefore, we have that: (i) d dˆij = d0m =⇒ dij ≥ dm , and (ii) dt dij dˆij =d0 ≥ 0, m i.e. the inter-agent distance does not decrease beyond this point. Hence the multi-agent system always remains safe. Theorem 4: If agent i under the system dynamics (1) follows the control law given by (20e), then with probability 0.997: lim kri (t) − rgi k = kri∞ − rgi k ≤ f , kri∞ − rgi k ≤ kri∞ − r̂i∞ k + kr̂i∞ − rgi k. System (20a) can be seen as a perturbed form of (8) with yi − ŷi being the constantly acting, bounded perturbation. From Theorem 2, we have that rgi is an (almost globally) asymptotically stable equilibrium of (8). Furthermore, (assuming no interactions among agents in the vicinity of the goal locations) one has that rgi is a stable equilibrium of (20a). To verify this argument, use the candidate Lyapunov function V = kr̂i − rgi k2 . Define re , r̂i − rgi . Now, taking the time derivative of candidate Lyapunov function along the system (20a), we get   p p u cϕ + w̄x + reT ΓT Ki (yi − ŷi ). V̇ = reT r̂˙ i = reT pi ip ui sϕi + w̄y   p p ui cϕi + w̄x is the ṙip of agent i in the absence of Note that p p ui sϕi + w̄y unknown disturbance with magnitude |ṙip | = ui and is along the attractive vector field Frgi which inthe direction  p points ui cϕpi + w̄x −(r̂i −rgi ). Hence, we have that p p = −ui krree k . ui sϕi + w̄y Finally, since the EKF based estimator is stable, the perturbation term Ki (yi − ŷi ) can be bounded by kKi kd ≤ δ. Hence, the time derivative V̇ reads re V̇ = −reT ui + reT ΓT Ki (yi − ŷi ) kre k ≤ −kui kre k tanh(kre k) + δkre k. Hence, we have V̇ ≤ 0 for kre k = kr̂i − rgi k ≥ tanh−1 kδui where kui is chosen to be greater than δ. Using the stability of perturbed systems under the effect of constantly acting (non-vanishing) perturbations [27], we have that rgi is a stable equilibrium of (20a), which ensures that kr̂i∞ −rgi k ≤  for some small positive number  > 0. Therefore, kri∞ − rgi k ≤ kri∞ − r̂i∞ k +  ⇒ kri∞ − rgi k ≤ d + . Choosing f = d +  completes the proof. It is important to note that in the presence of stochastic state-disturbance it cannot guaranteed that an agent can achieve any given goal orientation. In fact, the steady-state orientation of any agent would be opposite to the wind direction with small deviations because of uncertain state disturbance. This is true because at goal location, Fi = 0 and hence, Fpi is along the opposite direction of wind. IV. S IMULATIONS D. Analysis of convergence to goal location t→∞ Proof: Using triangle inequality, (25) where f = d + , where  is an arbitrary small positive constant. 1 Note that this can be increased to a value arbitrarily close to 1 by using k-σ rule to bound the estimation error, where k is arbitrarily large. We consider two scenarios involving N = 20 agents which are assigned to move towards goal locations while avoiding collisions. The goal locations are selected sufficiently far apart so that the agents’ communication regions do not overlap when agents lie on their goal locations. The covariance matrix of the state disturbance is taken as Pw = diag(0.01, 0.01) and measurement noise as Pvi = diag(0.01, 0.01, 0.01). In the first case, we assume the mean wind speed to be constant with time, with w̄ =  T −0.2 0.7 (m/sec). With these uncertainties, we have   rji T ηj = (xi − x̂i ) − (xj − x̂j ) + (x̂i − x̂j ) cθi + (yi − ŷi ) − (yj − ŷj ) + (ŷi − ŷj ) sθi ≤ (x̂i − x̂j )cθi + (ŷi − ŷj )sθi + 2x cθi + 2y sθi ≤ (x̂i − x̂j )c(θˆi + θi ) + (ŷi − ŷj )s(θˆi + θi ) + 2d   ≤ (x̂i − x̂j ) cθˆi c(θ ) − sθˆi s(θ ) + (ŷi − ŷj ) sθˆi c(θ ) + cθˆi s(θ ) + 2d     = (x̂i − x̂j )cθˆi + (ŷi − ŷj )sθˆi c(θ ) − s(θ ) (x̂i − x̂j )sθˆi − (ŷi − ŷj )cθ̂i + 2d   ≤ (x̂i − x̂j )cθ̂i + (ŷi − ŷj )sθ̂i c(θ ) + s(θ )(dm + 2d ) + 2d Minimum Inter-Agent Distance min kri − rj k 15 -1.1 Opposite of Wind Direction Final Orientations of Agents -1.2 θi∞ (rad) d = 1.42 m and f = 1.52 m. The radii of the agents are % = 0.4 m, the minimum separation is set equal to dm = 2% = 0.8 m, and the communication radius is set equal to Rc = 2d0m = 7.28 m. (22) Actual minimum distance Minimum Allowed distance dm -1.3 -1.4 -1.5 10 -1.6 0 5 10 15 20 Agents Fig. 5. 5 0 0 50 100 150 Final orientations θi∞ and opposite direction of the wind. goal and the final positions reached by agents after 15,000 iterations with time-step 0.01 sec. Time (s) 40 2 Initial Locations Goal Locations Final Agent Locations Fig. 3. The smallest pairwise distance at each time instant for constant w̄. 6 9 20 19 5 12 11 11 6 1 20 Final Distance From Goal Locations 2 ǫf Estimated distance Actual Distance kri∞ − rgi k 1.5 0 3 13 16 12 17 13 8 18 14 9 10 7 19 -20 2 14 7 3 4 18 16 20 1 1 15 17 15 10 5 8 -40 -50 0.5 4 -40 -30 -20 -10 0 10 20 30 Fig. 6. Initial, goal locations and the positions reached by the agents after 150 seconds (15,000 iterations). 0 2 4 6 8 10 12 14 16 18 20 Agents Fig. 4. Final distance from the goal location for constant w̄. Figures 3 and 4 respectively show the minimum distance between any pair of agents and the final distances of agents from their respective goal locations. It can be seen that the agents reach the f ball around their respective goals, while maintaining the dm distance between each other. Figure 5 shows that agents align themselves opposite to the wind direction in the equilibrium. Figure 6 shows the initial, In the second case, we assume the mean wind speed to be time varying with w̄x (t), w̄y (t) ∈ [−1, 1] (m/sec). Similar to the first case, plots are given to show the performance of the coordination protocol in presence of time-varying wind disturbance. Figure 7 and 8 depict the minimum pairwise distances between the agents and their final distance from their goal locations, respectively. V. C ONCLUSIONS AND F UTURE W ORK We presented a safe semi-cooperative multi-agent coordination protocol under state and measurement uncertainty. Minimum Inter-Agent Distance 15 Actual minimum distance Minimum Allowed distance dm [6] min kri − rj k [7] 10 [8] 5 [9] 0 0 50 100 150 Time (s) [10] [11] Fig. 7. The smallest pairwise distance at each time instant for time varying w̄. [12] Final Distance From Goal Locations 2 Estimated distance Actual Distance 1.5 kri∞ − rgi k [13] ǫf [14] [15] 1 [16] 0.5 [17] 0 2 4 6 8 10 12 14 16 18 20 Agents [18] Fig. 8. Final distance from the goal location for time varying w̄. [19] The nominal case of our earlier work is redesigned by feedforward control, vector-field-based feedback control, and nonlinear estimation techniques, so that safety and convergence of the agents up to some bound around the desired destination is guaranteed. In the future, we would like to study the case when the mean state disturbance has a spatial distribution. Ongoing work focuses on treating the case of input- and state- constrained agents under uncertainties, with application to fixed-wing aircraft operating in obstacle environments. R EFERENCES [1] W. Ren and Y. Cao, “Overview of recent research in distributed multi-agent coordination,” in Distributed Coordination of Multi-agent Networks, ser. Communications and Control Engineering. SpringerVerlag, 2011, ch. 2, pp. 23–41. [2] S. Knorn, Z. Chen, and R. H. Middleton, “Overview: Collective control of multiagent systems,” IEEE Transactions on Control of Network Systems, vol. 3, no. 4, pp. 334–347, Dec. 2016. [3] X. Wang, Z. Zeng, and Y. Cong, “Multi-agent distributed coordination control: Developments and directions via graph viewpoint,” Neurocomputing, vol. 199, pp. 204–218, Mar. 2016. [4] M. Mesbahi and M. Egerstedt, “Graph theoretic methods in multiagent networks,” 2010. [5] L. Kavraki, P. Svestka, J.C.-Latombe, and M. Overmars, “Probabilistic roadmaps for path planning in high-dimensional configuration spaces,” [20] [21] [22] [23] [24] [25] [26] [27] IEEE Transactions on Robotics and Automation, vol. 12, no. 4, pp. 566–579, Aug. 1996. S. M. LaValle and J. J. Kuffner Jr, “Rapidly-exploring random trees: Progress and prospects,” 2000. S. Karaman and E. Frazzoli, “Sampling-based algorithms for optimal motion planning,” International Journal on Robotics Research, vol. 30, no. 7, pp. 846–894, Jun. 2011. R. Tedrake, I. R. Manchester, M. M. Tobenkin, and J. W. Roberts, “Feedback motion planning via sums-of-squares verification,” International Journal on Robotics Research, vol. 29, no. 8, pp. 1038–1052, Apr. 2010. A. Majumdar, R. Vasudevan, M. M. Tobenkin, and R. Tedrake, “Convex optimization of nonlinear feedback controllers via occupation measures,” International Journal on Robotics Research, vol. 33, no. 9, pp. 1209–1230, Jun. 2014. S. M. LaValle, Planning Algorithms. Cambridge University Press, 2006. H. Choset, K. Lynch, S. Hutchinson, G. Kantor, W. Burgard, L. Kavraki, and S. Thrun, Principles of Robot Motion. Theory, Algorithms and Implementation. MIT Press, 2005. H. L. Trentelman, K. Takaba, and N. Monshizadeh, “Robust synchronization of uncertain linear multi-agent systems,” IEEE Transactions on Automatic Control, vol. 58, no. 6, pp. 1511–1523, Jan. 2013. Z. Meng, Z. Lin, and W. Ren, “Robust cooperative tracking for multiple non-identical second-order nonlinear systems,” Automatica, vol. 49, no. 8, pp. 2363–2372, Aug. 2013. G. Hu, “Robust consensus tracking of a class of second-order multiagent dynamic systems,” Systems & Control Letters, vol. 61, no. 1, pp. 134–142, Jan. 2012. X. Wang and S. Li, “Distributed finite-time consensus algorithms for leader-follower second-order multi-agent systems with mismatched disturbances,” in American Control Conference, 2016, pp. 2814–2819. P. Li, K. Qin, and M. Shi, “Distributed robust H infinity rotating consensus control for directed networks of second-order agents with mixed uncertainties and time-delay,” Neurocomputing, vol. 148, pp. 332–339, Jan. 2015. L. Cheng, Z. Hou, and M. Tan, “A mean square consensus protocol for linear multi-agent systems with communication noises and fixed topologies,” IEEE Transacations on Automatic Control, vol. 59, no. 1, pp. 261–267, Jan. 2014. Y. Wang, L. Cheng, W. Ren, Z. Hou, and M. Tan, “Seeking consensus in networks of linear agents: communication noises and Markovian switching topologies,” IEEE Transactions on Automatic Control, vol. 60, no. 5, pp. 1374–1379, May 2015. L. Cheng, Y. Wang, W. Ren, Z. Hou, and M. Tan, “On convergence rate of leader-following consensus of linear multi-agent systems with communication noises,” IEEE Transactions on Automatic Control, vol. 61, no. 11, pp. 3586–3592, Nov. 2016. M. Huang and J. H. Manton, “Coordination and consensus of networked agents with noisy measurements: Stochastic algorithms and asymptotic behavior,” SIAM Journal on Control and Optimization, vol. 48, no. 1, pp. 134–161, Feb. 2009. T. Li and J. Zhang, “Consensus conditions of multi-agent systems with time-varying topologies and stochastic communication noises,” IEEE Transactions on Automatic Control, vol. 55, no. 9, pp. 2043–2057, Feb. 2010. D. Panagou, “A distributed feedback motion planning protocol for multiple unicycle agents of different classes,” IEEE Transactions on Automatic Control, vol. 62, no. 3, pp. 1178–1193, Mar. 2017. D. Panagou, D. M. Stipanović, and P. G. Voulgaris, “Distributed coordination and control of multi-robot networks using Lyapunov-like barrier functions,” IEEE Transactions on Automatic Control, vol. 61, no. 3, pp. 617–632, Mar. 2016. K. Reif, S. Gunther, E. Yaz, and R. Unbehauen, “Stochastic stability of the continuous-time extended Kalman filter,” IEE Proceedings-Control Theory and Applications, vol. 147, no. 1, pp. 45–52, Jan. 2000. M. Abramowitz and I. A. Stegun, Handbook of mathematical functions: with formulas, graphs, and mathematical tables. Courier Corporation, 1964, vol. 55. J. Baras, A. Bensoussan, and M. James, “Dynamic observers as asymptotic limits of recursive filters: Special cases,” SIAM Journal on Applied Mathematics, vol. 48, no. 5, pp. 1147–1158, Oct. 1988. H. K. Khalil, Noninear Systems. Prentice-Hall, New Jersey, 1996.
3cs.SY
COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS arXiv:1306.6234v1 [math.AC] 26 Jun 2013 JAN TRLIFAJ AND SERAP ŞAHINKAYA Abstract. For a commutative noetherian ring R, we investigate relations between tilting and cotilting modules in Mod–R and Mod–Rm where m runs over the maximal spectrum of R. For each n < ω, we construct a 1-1 correspondence between (equivalence classes of) n-cotilting R-modules C and (equivalence classes of) compatible families F of n-cotilting Rm -modules (m ∈ mSpec(R)). It is induced by the assignment C 7→ (C m | m ∈ mSpec(R)) whereQ C m = HomR (Rm , C) is the colocalization of C at m, and its inverse F 7→ F ∈F F . We construct a similar correspondence for n-tilting modules using compatible families of localizations; however, there is no explicit formula for the inverse. Introduction Tilting and cotilting modules and classes over Dedekind domains are well understood for almost a decade, see [4]. A generalization of their classification to Prüfer domains is due to Bazzoni [2], while tilting and cotilting classes over commutative noetherian rings have been characterized in [1]. Moreover, a construction of cotilting modules over commutative noetherian rings using injective precovers has recently been discovered in [12]. Though tilting modules over commutative rings behave well with respect to localization [9, §13.3], this is not the case for cotilting modules. In fact, the localization of an injective cogenerator need not be injective or a cogenerator (see [6] and [12]). The appropriate tool for studying cotilting modules over commutative rings is the colocalization: in [2], it was first used to transfer the classification problem for cotilting modules from Prüfer to valuation domains. In the present paper, we extend this idea to commutative noetherian rings. Of course, there are essential differences between the Prüfer and the noetherian cases: in the Prüfer case, all cotiliting modules have injective dimension ≤ 1, but they need not be of cofinite type (that is, equivalent to duals of tilting modules). In the noetherian case, there is no a priori bound on the injective dimension of cotilting modules, but all cotilting modules are of cofinite type [1]. This is the key point here; in fact, parts of our results on colocalization extend to cotilting modules of cofinite type over arbitrary commutative rings. In the noetherian setting, we construct a 1-1 correspondence between equivalence classes of cotilting modules C and equivalence classes of compatible families of their colocalizations in all maximal ideals of R (see Corollary 2.6). We prove a similar results for tilting modules using families of localizations, but the reverse correspondence is much less direct in this case. Date: January 23, 2018. 2010 Mathematics Subject Classification. Primary: 13C05. Secondary: 13D07, 13E05. Key words and phrases. commutative noetherian ring, cotilting module, characteristic sequence, colocalization. Research supported by GAČR 201/09/0816. 1 2 JAN TRLIFAJ AND SERAP ŞAHINKAYA Preliminaries In what follows, R is a commutative and associative ring with unit. The category of all (R-) modules is denoted by Mod–R, while mod–R denotes the category of all strongly finitely presented modules, that is the modules possessing a projective resolution consisting of finitely generated modules. For example, if R is noetherian, then mod–R is just the category of all finitely generated modules. The set of all prime (maximal) ideals of R is denoted by Spec(R) (mSpec(R)). For a module M , Add M denotes the class of all direct summands of (possibly infinite) direct sums of copies of M . Similarly, Prod M denotes the class of all direct summands of direct products of copies of M . Recall that given a multiplicative set S ⊆ R and a module M ∈ Mod–R, S −1 R denotes the localization of R at S, and S −1 M ∼ = M ⊗ S −1 R the localization of M at S. In case S = R \ p for a prime ideal p of R, we will prefer the more standard notation of Rp and Mp for S −1 R and S −1 M , respectively. For a class of modules C, we define the Ext-orthogonal classes C ⊥ = {M ∈ Mod–R | ExtiR (C, M ) = 0 for all C ∈ C and i ≥ 1} and ⊥ C = {M ∈ Mod–R | ExtiR (M, C) = 0 for all C ∈ C and i ≥ 1}. Let n < ω. A module T is n-tilting provided that (T1) T has projective dimension ≤ n, (T2) ExtiR (T, T (κ)) = 0 for each i > 0 and all cardinals κ. (T3) There exists a long exact sequence 0 → R → T0 → T1 → · · · → Tn → 0 where Ti ∈ Add T for each 0 ≤ i ≤ n. The class {T }⊥ is called the n-tilting class induced by T . If T and T ′ are tilting modules, then T is said to be equivalent to T ′ provided that {T }⊥ = {T ′ }⊥ . Let A, B ∈ Mod–R. The pair (A, B) is called a (hereditary) cotorsion pair, if A = ⊥ B and B = A⊥ . Notice that for C ⊆ Mod–R, (⊥ (C ⊥ ), C ⊥ ) and (⊥ C, (⊥ C)⊥ ) are cotorsion pairs, called the cotorsion pairs generated and cogenerated, respectively, by C. For a class of modules X , we let X ⊺ = {M ∈ Mod–R | ToriR (X, M ) = 0 for all i ≥ 1 and X ∈ X }. A subclass F of mod–R is called resolving provided that F is closed under extensions and direct summands, it contains R as well as all kernels of epimorphisms in F . For example, if (A, B) is a cotosion pair, then the class A∩mod–R is resolving. Given a class F ⊆ Mod–R and a module M , a well-ordered chain of submodules 0 = M0 ⊆ M1 ⊆ · · · ⊆ Mα ⊆ Mα+1 ⊆ · · · ⊆ Mσ = M S is called an F -filtration of M if Mβ = α<β Mα for every limit ordinal β ≤ σ, and for each α < σ, Mα+1 /Mα is isomorphic to an element of F . M is F -filtered in case M possesses at least one F -filtration. The following is known as the finite type theorem for tilting modules (see e.g. [9, Theorem 13.46]): Theorem 0.1. Let R be a ring, T a tilting module and (A, B) the cotorsion pair generated by T . Let F = A ∩ mod–R. Then F ⊥ = B, and T is equivalent to a tilting module T ′ such that T ′ is F -filtered. The terminology of finite type here comes from the fact that in the theorem above, while T is typically infinitely generated, the tilting class B equals F ⊥ where F is a resolving subcategory of mod–R consisting of modules of bounded projective dimension (the bound being the projective dimension of T ). If T is an n-tilting module, then the localization S −1 T is an n-tilting S −1 Rmodule (see e.g. [9, §13.3]). Moreover, filtrations go well with localization, that is, COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS 3 if T is C-filtered, then S −1 T is CS -filtered where CS = {S −1 M | M ∈ C}, and the induced tilting class in Mod–S −1 R equals TS = {N ∈ Mod–S −1 R | N ∼ = S −1 M for some M ∈ T } = CS⊥ (see [9, 13.47 and 13.50]). We now recall the dual setting of cotilting modules. Let n < ω. A module C is n-cotilting provided that (C1) C has injective dimension ≤ n, (C2) ExtiR (C κ , C) = 0 for each i > 0 and all cardinals κ. (C3) There exists a long exact sequence 0 → Cn → · · · → C1 → C0 → W → 0 where Ci ∈ Prod C for each 0 ≤ i ≤ n and W is an injective cogenerator for Mod–R. By Bazzoni [3], a module C is n-cotilting, iff ⊥ C = Cog n (C) where Cog n (C) denotes the class of all modules M for which there exists an exact sequence of the form 0 → M → C α0 → C α2 → · · · → C αn−1 for some cardinals αi (i < n). The class ⊥ C is the n-cotilting class induced by C. If C and C ′ are cotilting modules, then C is said to be equivalent to C ′ provided that ⊥ C = ⊥ C ′ . A cotilting class C is of cofinite type provided that there exist n < ω and a class F consisting of strongly finitely presented modules of projective dimension ≤ n, such that C = F ⊺ . Let C be a cotilting module. Then C is of cofinite type provided the class ⊥ C is of cofinite type. While all tilting modules are of finite type by Theorem 0.1, the dual result fails in general: cotilting modules that are not of cofinite type do exist over each non-strongly discrete valuation domain, [2]. However, if R is any commutative noetherian ring, then all cotilting modules are of cofinite type by [1] (see also Lemma 2.2 below). Let µ be an ordinal and A = (Aα : α ≤ µ) be a sequence of modules. Let (gαβ : α ≤ β ≤ µ) be a sequence of epimorphisms with gαβ ∈ HomR (Aβ , Aα), such that E = {Aα , gαβ | α ≤ β ≤ µ} is an inverse system of modules. E is called continuous, provided that A0 = 0 and Aα = limβ≤α Aβ for all limit ordinals α ≤ µ. ←− Let C be a class of modules. Assume E is a continuous inverse system as above. Then A = Aµ is called C-cofiltered (by A), provided that Ker(gαα+1 ) is isomorphic to an element of C for all α ≤ µ. The sequence A is a C-cofiltration of A. Denote by (−)∗ the duality HomR (−, W ) where W is an injective cogenerator for Mod–R. If T is an n-tilting module and F = ⊥ (T ⊥ ) ∩ mod–R then F is a resolving subcategory of mod–R consisting of modules of projective dimension ≤ n. W.l.o.g., T is F -filtered (see Theorem 0.1). The dual module C = T ∗ is an n-cotilting module, and it is F ∗ -cofiltered, the induced cotilting class in Mod–R being F ⊺ (see [9, Theorem 15.2]). In fact, an n-cotilting module D is of cofinite type, if and only if D is equivalent to T ∗ for an n-tilting module T . Finally, we note that unlike filtrations, the cofiltrations do not go well with localizations of modules because localizations do not commute with the inverse limits that are used in limit steps of constructions of the cofiltrations. Colocalizations (to be introduced in the next section) give a way of overcoming this problem. 1. Colocalization of cotilting modules The notion of colocalization is due to Melkerson and Schenzel (cf. [13, p.118]), but similar constructions were used already in [5] (see Lemma 1.3 below). 4 JAN TRLIFAJ AND SERAP ŞAHINKAYA Definition 1.1. For every module M and every maximal ideal m of R, we denote by M m the Rm -module HomR (Rm , M ); we call it the colocalization of M at m. Similarly, for a class of modules C, we define C m = {C m | C ∈ C}, so C m is a class of Rm -modules. Example 1.2. 1. If M is an Rm -module, then M m = HomR (Rm , M ) = HomRm (Rm , M ) ∼ =M as Rm -modules. 2. If M = N ∗ is a dual module, then M m = HomR (Rm , N ∗ ) ∼ = (N ⊗R Rm )∗ , so the colocalization of a dual module is isomorphic to the dual of a localization. In particular, M m is pure-injective as an R-module for each pure-injective module M . We will need the following classic facts: Lemma 1.3. Let S be a multiplicative subset of R and i ≥ 1. (a) For every module A and S −1 R-module B, we have ExtiS −1 R (S −1 A, B) ∼ = ExtiR (A, B). (b) For every pure-injective module B and every S −1 R-module A, we have ExtiS −1 R (A, HomR (S −1 R, B)) ∼ = ExtiR (A, B). In particular, if m ∈ mSpec(R), M and C are modules, and C is pure-injective, then ExtiR (M, C m ) ∼ = ExtiR (Mm , C). −1 Proof. (a) Since S −1 R is a flat module, TorR R, A) = 0 for every n ≥ 1, and n (S the claim follows by [5, Proposition VI.4.1.3]. (b) Since S −1 R is flat and B is pure-injective, ExtnR (S −1 R, B) = 0 for every n ≥ 1, and the claim follows by [5, Proposition VI.4.1.4]. Finally, applying the isomorphisms from (a) and (b) to the particular setting,  we obtain ExtiR (M, C m ) ∼ = ExtiR (Mm , C). = ExtiRm (Mm , C m ) ∼ In particular, Lemma 1.3(b) applies to cotilting modules, because each cotilting module is pure-injective by [11]. The next Lemma shows that colocalization works fine in the setting of cotilting modules of cofinite type: Lemma 1.4. Let T be an n-tilting module, m ∈ mSpec(R), and W be an injective cogenerator for Mod–R. Let (−)∗ = HomR (−, W ) and F = ⊥ (T ⊥ ) ∩ mod–R. Then dual module C = T ∗ is an n-cotilting R-module (of cofinite type), and its colocalization C m is an n-cotilting Rm -module isomorphic to the dual of the n-tilting ⊺ Rm -module Tm . Moreover, ⊥ C m = Fm in Mod–Rm , so C m is of cofinite type. Proof. The first claim has already been noticed above (see [9, 15.2]). By [9, 13.50], Tm is an n-tilting Rm -module. Moreover, C m = HomR (Rm , T ∗ ) ∼ = (Tm )∗ = HomRm (Tm , Wm ), because HomR (Tm , E(R/p)) = 0 for all p * m by the Nakayama lemma. Since Wm is an injective cogenerator for Mod–Rm , applying [9, 15.2] again, we see that C m is an n-cotilting Rm -module. Finally, let M ∈ Mod–Rm and i ≥ 1. Then ExtiRm (M, C m ) ∼ = ExtiR (M, C) by Lemma 1.3(a), so M ∈ ⊥ C m iff M ∈ ⊥ C iff M ∈ F ⊺ = ⊥ F ∗ by the Ext-Tor ⊺ duality. The latter is equivalent to M ∈ ⊥ (F ∗ )m = ⊥ (Fm )∗ = Fm (see Lemma 1.3(b)). Since Fm ⊆ mod–Rm consists of Rm -modules of projective dimension ≤ n, the assertion follows.  Unlike localization, the colocalization is not exact in general, because Rm is flat, but it need not be projective. However, colocalization preserves exactness of all short exact sequences of the form 0 → A → B → C → 0 with A pure-injective. This is essential for our next lemma: COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS 5 Lemma 1.5. Let m ∈ mSpec(R) and n < ω. Let T be an F -filtered n-tilting module, where F = ⊥ (T ⊥ ) ∩ mod–R. Let C = T ∗ . Then the n-cotilting Rm -module C m is (F ∗ )m -cofiltered. Proof. By the assumption, C is F ∗ -cofiltered, with a cofiltration (Cα | α ≤ µ). Let µ be an ordinal and I = {Cα , gαβ | α ≤ β ≤ µ} be the corresponding inverse system of modules such that C0 = 0, Cα = limβ≤α Cβ for all limit ordinals α ≤ µ, ←− and Ker(gα,α+1 ) is isomorphic to an element of F ∗ for all α ≤ µ. Define m gαβ = HomR (Rm , gαβ ) : (Cβ )m → (Cα )m m for all α ≤ β ≤ µ. Then gαβ is an epimorphism for all α ≤ β ≤ µ, because Rm is flat and Ker(gα,α+1 ) is pure injective. Since the covariant HomR (Rm , −) functor commutes with inverse limits, we obtain C0m = 0 and (Cα )m = limβ≤α (Cβ )m for all ←− limit ordinals α ≤ µ. Also Ker(gα,α+1 )m is isomorphic to an element of (F ∗ )m for each α ≤ µ. It follows that m I m = {(Cα )m , gαβ : α ≤ β ≤ µ} is a continuous inverse system of Rm -modules witnessing that the colocalized module C m is (F ∗ )m -cofiltered.  In [2, Theorem 2.5], Bazzoni proved that when R is a commutative domain and C is a 1-cotilting module, then the C m is a 1-cotilting Rm -module Q colocalized module m for each m ∈ mSpec(R), and m∈mSpec(R) C is a 1-cotilting module equivalent to C. The proof easily extends to an arbitrary commutative ring R. However, the extension of the result to n-cotilting modules over noetherian rings for n > 1 needs more work. Lemma 1.6. Let n < ω and C be an n-cotilting module which is of cofinite type, so ⊥ C = F ⊺ for some F ⊆ mod–R consisting of modules of projective dimension ≤ n. Let m ∈ mSpec(R). Then as an R-module, C m is pure-injective, and satisfies conditions (C1) and (C2). Moreover, ExtiR (C m , C) = 0 for each i > 0 and each m ∈ mSpec(R). Proof. The pure-injectivity of C m as an R-module has already been observed in Example 1.2.2. By Lemma 1.3(a) each injective Rm -module is injective also as R-module, so C m has injective dimension ≤ n by condition (C1) for the cotilting Rm -module C m . Moreover, for each i > 0 and all cardinals κ, we have ExtiR ((C m )κ , C m ) = ExtiRm ((C m )κ , C m ) = 0, so (C2) holds for C m viewed as an R-module. The equality ExtiR (C m , C) = 0 now follows by Lemma 1.3(b).  Lemma 1.7. Let n <Q ω and C be an n-cotilting module which is of cofinite type. Then the module D = m∈mSpec(R) C m is n-cotilting, and equivalent to C. Proof. We will prove that Cog n (D) = ⊥ D = ⊥ C = Cog n (C). The last equality holds since C is an n-cotilting module. First, we show that Cog n (D) ⊆ Cog n (C) = ⊥ C. Let M ∈ Cog n (D). There is a long exact sequence f0 f1 fn−2 fn−1 0 → M ֒→ Dβ1 → · · · → Dβn−1 → Dβn . We will show that ExtiR (M, C) = 0 for each i ≥ 1. Consider the short exact sequences (where i < n − 1 and Ki = Im fi ) 0 → Ki → Dβi+1 → Ki+1 → 0. 6 JAN TRLIFAJ AND SERAP ŞAHINKAYA Applying the functor HomR (−, C) we obtain the long exact sequences . . . → Ext1R (Ki+1 , C) → Ext1R (Dβi+1 , C) → Ext1R (Ki , C) → . . . . . . → ExtiR (Ki+1 , C) → ExtiR (Dβi+1 , C) → ExtiR (Ki , C) → i+1 βi+1 , C) → Exti+1 → Exti+1 R (Ki , C) → . . . R (Ki+1 , C) → ExtR (D m We know that D ∈ Cog n (C) since C ∈ Cog n (C) by Lemma 1.6. So ∼ Ext2 (K1 , C) ∼ Ext1 (M, C) = = ... ∼ = Extn+1 (Kn , C) = 0 R R R because C has injective dimension ≤ n. Similarly, ExtiR (M, C) = 0 for each i > 1. Next, we show that ⊥ C ⊆ ⊥ D. In fact, M ∈ ⊥ D if and only if ExtiR (M, C m ) = 0 for each i ≥ 1 and m ∈ mSpec(R). By Lemma 1.3(c), ExtiR (M, C m ) ∼ = ExtiR (Mm , C). ⊥ ⊥ Let M ∈ C. We claim that Mm ∈ C. Since each flat module is a direct limit of finitely generated free modules, Mm = M ⊗R Rm = M ⊗R limα Rnα = −→ limα M ⊗R Rnα = limα M nα . Since the cotilting class ⊥ C is closed under direct −→ −→ products and direct limits, the claim follows. Finally, we show that D is an n-cotilting module. This will give the remaining equality ⊥ D = Cog n (D). We proceed by verifying conditions (C1)-(C3) for D. (C1) Since C is n-cotilting, i.d.(C) ≤ n. By Lemma 1.6,i.d.(C m ) ≤ n for each m ∈ mSpec(R), whence i.d.(D) ≤ n. (C2) We claim that ExtiR (Dκ , D) = 0 for all i ≥ 1. Since ⊥ C ⊆ ⊥ D, it suffices to prove that ExtiR (Dκ , C) = 0 for all i > 0. It is enough to show that ExtiR (D, C) = 0 for all i ≥ 1. By the definition of D, Q this is equivalent to ExtiR ( m∈mSpec(R) C m , C) = 0. Again, it suffices to prove that ExtiR (C m , C) = 0 for every maximal ideal m, but this holds by Lemma 1.6. (C3) Since C is of cofinite type, C is equivalent to T ∗ for an n-tilting module T . There exists a long exact sequence of the form 0 → R → T0 → . . . → Tn → 0 where Ti ∈ Add (T ) for all i ≤ n. Localizing at a maximal ideal m, we obtain the exact sequence 0 → Rm → (T0 )m → . . . → (Tn )m → 0. Clearly, (Ti )m ∈ Add (Tm ) for each maximal ideal m, since localization commutes with direct sums. L Applying the exact functor (−)∗ = HomR (−, m∈mSpec(R) ERm (Rm /mm )) to the localized exact sequence, we obtain ∗ 0 → (Tn )∗m → . . . → (T0 )∗m → Rm →0 where ((Ti )m )∗ ∈ Prod (Tm∗ ). Since (C ′ )m ∈ Prod C m where C ′ = T ∗ , also ((Ti )m )∗ ∈ Prod (C ′ )m for all i ≤ n. From the previous exact sequence we obtain Y Y Y 0→ ((Tn )m )∗ → . . . → ((T0 )m )∗ → (Rm )∗ → 0. m∈mSpec(R) m∈mSpec(R) m∈mSpec(R) Q Q ∗ So for each i ≤ n, m∈mSpec(R) ((Ti )m ) ≤⊕ m∈mSpec(R) (C m )αi = Dαi for a cardinal αi . Q It remains to show that E = m∈mSpec(R) (Rm )∗ is an injective cogenerator for Mod–R. However, Rm L is flat, hence (Rm )∗ is injective, and so is E. More∗ over, (Rm ) = HomR (Rm , m∈mSpec(R) ERm (Rm /mm )) has a direct summand HomR (Rm , ERm (Rm /mm )) = HomRm (Rm , ERm (Rm /mm )) = ERm (Rm /mm ), and the latter module contains the simple module R/m. It follows that E is a cogenerator for Mod–R.  COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS 7 Lemmas 1.6 and 1.7 yield Theorem 1.8. Let n < ω and C be an n-cotilting module of cofinite type. Then for each C m is an n-cotilting Rm -module of cofinite type, and Q m ∈ mSpec(R), m D = m∈mSpec(R) C is an n-cotilting module equivalent to C. 2. The noetherian case In this section, we will assume that R is a commutative noetherian ring. Then all cotilting modules are of cofinite type by [1, Theorem 4.2]. We are going to investigate the relation among the Rm -modules C m (m ∈ mSpec(R)) from Theorem 1.8, the goal being to obtain a complete characterization of cotilting modules in terms of compatible families of their colocalizations. First, we recall that in the noetherian setting, cotilting classes correspond 1-1 to characteristic sequences of sets of prime ideals: Definition 2.1. Let n < ω and P = (P0 , . . . , Pn−1 ) be sequence of subsets of Spec(R) such that (i) Pi is a lower subset of Spec(R) for each i < n (i.e., q ⊆ p ∈ Pi implies q ∈ Pi for all q ∈ Spec(R)); (ii) Pi ⊆ Pi+1 for all i < n − 1; (iii) Ass Ω−i (R) ⊆ Pi for each i < n. Then P is called a characteristic sequence (of length n) in Spec(R). Note that if P is a lower subset of Spec(R) and Q (Mα | α < κ) is a family of modulesQ such that Ass Mα ⊆ P for all α, then Ass α<κ Mα ⊆ P . Indeed, for each q ∈ Ass α<κ Mα , there is a non-zero homomorphism from E(R/q) to E(R/p) for −i some p ∈ P , whence q ⊆ p and Q q ∈ P . Similarly, for each i < ω, if Ass Ω Mα ⊆ P −i for all α < κ, then Ass Ω ( α<κ Mα ) ⊆ P . Also notice that if R is Gorenstein, then condition (iii) just says that for each i ≤ i.d.(R), the set Pi contains all prime ideals of height i. The following result was proved in [1] (see also [9, §16] and [7]). Here, for i < n < ω and an n-cotilting class C, we define C(i) = {M ∈ Mod–R | Ωj (M ) ∈ C for all j > i} (so in particular, C(0) = C). Notice that if C is an n-cotilting module such that C = ⊥ C, then C(i) = {M ∈ Mod–R | ExtjR (M, C) = 0 for all j > i}; this is an (n − i)-cotilting class (see [9, 15.13]). Lemma 2.2. [1] Let n < ω. There is a 1-1 correspondence between n-cotilting classes C and characteristic sequences P = (P0 , . . . , Pn−1 ) of length n in Spec(R) given by the mutually inverse assignments C 7→ PC = (Ass C(0) , . . . , Ass C(n−1) ) and P 7→ CP = {M ∈ Mod–R | Ass Ω−i M ⊆ Pi for all i < n}. Each n-cotilting class C is of cofinite type. The n-tilting class T corresponding to the characteristic sequence P = (P0 , . . . , Pn−1 ) is T = {N ∈ Mod–R | ToriR (M, R/p) = 0 for all p ∈ Spec(R) \ Pi and i < n}. Moreover, for each i < n and p ∈ Spec(R), we have p ∈ Ass C(i) , iff E(R/p) ∈ C(i) . If C is a cotilting module, then C m is a cotilting Rm -module by Lemma 1.6. We will now consider relations between the corresponding characteristic sequences of subsets in Spec(R) and Spec(Rm ). First, we need more notation: 8 JAN TRLIFAJ AND SERAP ŞAHINKAYA Definition 2.3. (i) Let p ∈ Spec(Rm ). Then b p denotes the prime ideal of R such that b p ⊆ m and (b p)m = p. Similarly, for a subset P ⊆ Spec(Rm ), Pb = {b p | p ∈ P }. (ii) Let n < ω. Then P is a compatible family of characteristic sequences of length n provided that P = (Pm | m ∈ mSpec(R)) where for each m ∈ mSpec(R), Pm = (P0,m , . . . , Pn−1,m ) is a characteristic sequence of [ length n in Spec(Rm ), and Pd i,m and Pi,m′ contain the same prime ideals from the set {p ∈ Spec(R) | p ⊆ m ∩ m′ }, for all m, m′ ∈ mSpec(R) and i < n. (iii) Let n < ω. Let C = (C(m) | m ∈ mSpec(R)) be a family such that C(m) is an n-cotilting Rm -module for each m ∈ mSpec(R). Let Pm = (P0,m , . . . , Pn−1,m ) be the characteristic sequence corresponding to the ncotilting class Cm = ⊥ C(m) in Mod–Rm . Then C is a compatible family of n-cotilting modules provided that (Pm | m ∈ mSpec(R)) is a compatible family of characteristic sequences of length n. Two compatible families of n-cotilting modules, C = (C(m) | m ∈ mSpec(R)) and C′ = (C ′ (m) | m ∈ mSpec(R)), are called equivalent provided that the n-cotilting Rm -modules C(m) and C ′ (m) are equivalent for each m ∈ mSpec(R). Notice that two compatible families C and C′ of n-cotilting modules are equivalent, if and only if the corresponding compatible families of characteristice sequences P and P′ are equal. Lemma 2.4. Let n < ω, m ∈ mSpec(R), and C be an n-cotilting module. Let P = (P0 , . . . , Pn−1 ) be the corresponding characteristic sequence in Spec(R). For each i < n, let Pi,m = {pm | p ∈ Pi & p ⊆ m}. Then Pm = (P0,m , . . . , Pn−1,m ) is a characteristic sequence in Spec(Rm ) which corresponds to the n-cotilting Rm module C m . Moreover, the families P = (Pm | m ∈ mSpec(R)) and C = (C m | m ∈ mSpec(R)) are compatible. Proof. It is easy to see that Pm satisfies conditions (i) and (ii) from Definition 2.1 for Rm . Consider i < n and let p ∈ Ass Ω−i (Rm ). Since the minimal injective coresolution of R localizes to the minimal injective coresolution of Rm (see e.g. [10, §18]), b p ∈ Ass Ω−i (R) ⊆ Pi whence p = (b p)m ∈ Pi,m . Thus condition (iii) holds for Pm . Let i < n and p ∈ Spec(R) be such that p ⊆ m. Denote by Cm the ncotilting class in Mod–Rm induced by C m . By Lemma 2.2, pm ∈ Ass (Cm )(i) iff ERm (Rm /pm ) ∈ (Cm )(i) iff Ωj (ERm (Rm /pm )) ∈ Cm for all j > i. The latter is equivalent to ExtjRm (ERm (Rm /pm ), C m ) = 0 for all j > i, and to ExtjR (E(R/p), C) = 0 for all j > i by Lemma 1.3(b). Similarly, p ∈ Pi = Ass C(i) iff ExtjR (E(R/p), C) = 0, for all p ∈ Spec(R) and j > i. Thus Pd i,m = Ass (Cm )(i) for each i < n. It follows that Pm is a characteristic sequence corresponding to Cm , and that the family P is compatible. Then C is compatible by Definition 2.3(iii).  Now, we can extend Theorem 1.8 to a 1-1 correspondence between cotilting R-modules and compatible families of cotilting Rm -modules (m ∈ mSpec(R)). Theorem 2.5. Let n < ω and C ∈ Mod–R. (i) If C is an n-cotilting module, then CC = (C m | m ∈ mSpec(R)) is a compatible family of n-cotilting Rm -modules. (ii) Let C = (C(m) | m ∈ mSpec(R)) be Q a compatible family of n-cotilting Rm -modules. Then the module DC = m∈mSpec(R) C(m) is n-cotilting. COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS 9 The characteristic sequence corresponding to DC is P = (P0 , . . . , Pn−1 ) S where Pi = m∈mSpecR Pd i,m for each i < n, and (P0,m , . . . , Pn−1,m ) is the characteristic sequence corresponding to C(m). (iii) If C is n-cotilting, then DCC is an n-cotilting module equivalent to C. (iv) If C = (C(m) | m ∈ mSpec(R)) is a compatible family of n-cotilting Rm modules and CDC = ((DC )m | m ∈ mSpec(R)), then the families C and CDC are equivalent (that is, (DC )m is an n-cotilting Rm -module equivalent to C(m) for each m ∈ mSpec(R)). Proof. (i) This follows by Lemma 2.4. (ii) The compatibility of C implies that P is a characteristic sequence in Spec(R): conditions (i) and (ii) of Definition 2.1 are clearly satisfied, and condition (iii) follows from the fact that the minimal injective coresolution of R localizes to the minimal injective coresolution of Rm for each m ∈ mSpec(R). We will prove that DC is an n-cotilting module corresponding to P. Since each injective Rm -module is injective also as R-module, DC is a product of modules of injective dimension ≤ n, whence condition (C1) holds for DC . Further, for each m ∈ mSpec(R), there is a long exact sequence Em : 0 → Cn,m → · · · → C0,m → ERm (Rm /mm ) → 0 where Ci,m ∈ ProdQC(m) as an Rm -module. Since C(m) ∈ Prod DC as an Rmodule, and W = m∈mSpec(R) E(R/m) is an injective cogenerator for Mod–R, Q the sequence E = m∈mSpec(R) Em witnesses condition (C3) for DC . Let CP denote the n-cotilting class corresponding to P by Lemma 2.2. Assume that M ∈ CP . We claim that ExtiR (M, DC ) = 0 for each i ≥ 1, that is, ExtiR (M, C(m)) = 0 for all i ≥ 1 and m ∈ mSpec(R). By assumption Ass Ω−i M ⊆ Pi , hence Ass Ω−i Mm ⊆ Pi,m for each m ∈ mSpec(R), by the compatibility of C. So Mm belongs to the n-cotilting class induced by C(m). By Lemma 1.3(a), we infer that ExtiR (M, C(m)) ∼ = ExtiRm (Mm , C(m)) = 0 for all i ≥ 1 and m ∈ mSpec(R), and the claim is proved. In other words, CP ⊆ ⊥ DC . In order to prove condition (C2) for DC , it only suffices to show that (DC )κ ∈ CP for all cardinals κ. Since all the sets Pi are lower subsets of Spec(R), it suffices to prove that Ass Ω−i C(m) ⊆ Pi for all i < n and all m ∈ mSpec(R). Consider a minimal injective coresolution I of C(m) in Mod–Rm . By assumption, Ass Rm Ω−i C(m) ⊆ Pi,m . Since I is also an injective coresolution in Mod–R, we have Ass Ω−i C(m) ⊆ Pd i,m ⊆ Pi . This proves condition (C2). Finally, assume that M is a module such that ExtiR (M, DC ) = 0 for all i ≥ 1. Let m ∈ mSpec(R). Then ExtiR (M, C(m)) = 0 for all i ≥ 1. Lemma 1.3(a) gives ExtiRm (Mm , C(m)) = 0, and hence Ass Rm Ω−i Mm ⊆ Pi,m , for all i ≥ 1. Consider a minimal injective coresolution I of M in Mod–R. Localizing at m, we obtain a minimal injective coresolution of Mm in Mod–Rm . Since Ass Rm Ω−i Mm ⊆ S ⊥ Pi,m , we infer that Ass Ω−i M ⊆ m∈mSpecR Pd i,m = Pi . Thus DC ⊆ CP , and P is the characteristic sequence of DC . (iii) This follows by Lemma 1.7. (iv) By part (ii), the characteristic sequence of DC is P = (P0 , . . . , Pn−1 ), where S Pi = m∈mSpecR Pd i,m for each i < n, and (P0,m , . . . , Pn−1,m ) denotes the characteristic sequence corresponding to C(m). By Lemma 2.4, (DC )m is an n-cotilting module with the characteristic sequence Qi,m = {qm | q ∈ Pi & q ⊆ m}. By compatibility, Qi,m = Pi,m for all i < n, so C(m) is equivalent to (DC )m for each m ∈ mSpec(R).  10 JAN TRLIFAJ AND SERAP ŞAHINKAYA Corollary 2.6. Let n < ω. There is a 1-1 correspondence between equivalence classes of n-cotilting R-modules and equivalence classes of compatible families of n-cotilting Rm -modules. The equivalence class of an n-cotilting module C corresponds to the equivalence class of the family of its colocalizations (C m | m ∈ mSpec(R)). Conversely, the equivalence class of a compatible family (C(m) Q | m ∈ mSpec(R)) corresponds to the equivalence class of the n-cotilting module m∈mSpec(R) C(m). We finish by translating Corollary 2.6 to the tilting setting. First, we have to introduce the corresponding notion of a compatible family: Definition 2.7. Let n < ω. Let T = (T (m) | m ∈ mSpec(R)) be a family such that T (m) is an n-cotilting Rm -module for each m ∈ mSpec(R). Let Pm = (P0,m , . . . , Pn−1,m ) be the characteristic sequence corresponding to the ncotilting class Tm = T (m)⊥ in Mod–Rm by Lemma 2.2. Then T is a compatible family of n-tilting modules provided that P = (Pm | m ∈ mSpec(R)) is a compatible family of characteristic sequences of length n. Two compatible families of n-tilting modules, T = (T (m) | m ∈ mSpec(R)) and T′ = (T ′ (m) | m ∈ mSpec(R)), are called equivalent provided that the n-tilting Rm -modules T (m) and T ′ (m) are equivalent for each m ∈ mSpec(R) (that is, the corresponding compatible families of characteristic sequences P and P′ coincide). Corollary 2.8. Let n < ω. There is a 1-1 correspondence between equivalence classes of n-tilting R-modules and equivalence classes of compatible families of ntilting Rm -modules. The equivalence class of an n-tilting module T corresponds to the equivalence class of the family of its localizations (Tm | m ∈ mSpec(R)). Proof. By Lemma 2.2, (equivalence classes of) n-tilting modules correspond 1-1, via the duality (−)∗ , to (equivalence classes of) cotilting modules. Moreover, by [9, 15.18], two n-tilting modules T and T ′ are equivalent, iff the dual modules C = T ∗ and C ′ = (T ′ )∗ are equivalent as n-cotilting modules. By Corollary 2.6, there is a further 1-1 correspondence to (equivalence classes of) compatible families of colocalizations (C m | m ∈ mSpec(R)). Since C m is isomorphic to (Tm )∗ by Lemma 1.4 for each m ∈ mSpec(R), applying Lemma 2.2 and [9, 15.18] again, we finally proceed to (equivalence classes of) compatible families of localizations of T .  Remark 2.9. The 1-1 correspondence in Corollary 2.6 is easy to compute in both directions. In particular, the cotilting Q module C is recovered up to equivalence as the product of its colocalizations: m∈mSpec(R) C m . There does not appear to be any simple way of computing the tilting module T from Lthe family of its localizations (Tm | m ∈ mSpec(R)): the naive idea of taking T ′ = m∈mSpec(R) Tm fails already for n = 0 (where T is a projective generator, but T ′ is flat and non-projective, hence not tilting; in fact, though (T ′ )∗ is a cotilting module equivalent to T ∗ , T ′ ∈ / Add T ). References [1] L. Angeleri–Hügel, D. Pospı́šil, J. Šťovı́ček, J. Trlifaj, Tilting, cotilting, and spectra of commutative noetherian rings, to appear in Trans. Amer. Math. Soc., arXiv:1203.0907. [2] S. Bazzoni, Cotilting and tilting modules over Prüfer domains, Forum Math., 19(2007), 1005–1027. [3] S. Bazzoni, A characterization of n-cotilting and n-tilting modules, J. Algebra, 273(2004), 359–372. [4] S. Bazzoni, P. C. Eklof, J. Trlifaj, Tilting cotorsion pairs, Bull. London Math. Soc., 37(2005), 683–696. [5] H. Cartan, S. Eilenberg, Homological Algebra, Princeton Univ. Press, Princeton 1956. [6] F. Couchot, Localization of injective modules over valuation rings, Proc. Amer. Math. Soc. 134(2005), 1013–1017. COLOCALIZATION AND COTILTING FOR COMMUTATIVE NOETHERIAN RINGS 11 [7] H. Dao, R. Takahashi, Classification of resolving subcategories and grade consistent functions, to appear in Int. Math. Res. Notices. [8] E.E. Enochs, O.M.G. Jenda, Relative Homological Algebra, 2nd revised and extended ed., Vol.1, GEM 30, W. de Gruyter, Berlin 2011. [9] R. Göbel, J. Trlifaj, Approximations and Endomorphism Algebras of Modules, 2nd revised and extended ed., GEM 41, W. de Gruyter, Berlin 2012. [10] H. Matsumura, Commutative Ring Theory, CSAM 8, Cambridge Univ. Press, Cambridge 1994. [11] J. Šťovı́ček, All n-cotilting modules are pure-injective, Proc. Amer. Math. Soc., 134(2006), 1891–1897. [12] J. Šťovı́ček, J. Trlifaj, D. Herbera, Cotilting modules over commutative noetherian rings, preprint. [13] J. Xu, Flat Covers of Modules, LNM 1634, Springer, New York 1996. Charles University in Prague, Faculty of Mathematics and Physics, Department of Algebra, Sokolovská 83, 186 75 Prague 8, Czech Republic E-mail address: [email protected] Gebze Institute of Technology, Department of Mathematics, 41400 Gebze, Turkey E-mail address: [email protected]
0math.AC
JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 1 Significance of Softmax-based Features in Comparison to Distance Metric Learning-based Features • Shota Horiguchi, Daiki Ikami, Kiyoharu Aizawa arXiv:1712.10151v1 [cs.CV] 29 Dec 2017 Abstract—End-to-end distance metric learning (DML) has been applied to obtain features useful in many CV tasks. However, these DML studies have not provided equitable comparisons between features extracted from DML-based networks and softmax-based networks. In this paper, we present objective comparisons between these two approaches under the same network architecture. Index Terms—deep learning, distance metric learning, classification, retrieval F 1 I NTRODUCTION Recent developments in deep convolutional neural networks have made it possible to classify many classes of images with high accuracy. It has also been shown that such classification networks work well as feature extractors. Features extracted from classification networks show excellent performance in image classification [1], detection, and retrieval [2] [3], even when they have been trained to classify 1000 classes of the ImageNet dataset [4]. It has also been shown that fine-tuning for target domains further improves the features’ performance [5] [6]. On the other hand, distance metric learning (DML) approaches have recently attracted considerable attention. These obtain a feature space in which distance corresponds to class similarity; it is not a byproduct of the classification network. End-to-end distance metric learning is a typical approach to constructing a feature extractor using convolutional neural networks and has been the focus of numerous studies [7], [8], [9], [10], [11]. However, there have been no experiments comparing softmax-based features with DML-based features under the same network architecture or with adequate fine-tuning. An analysis providing a true comparison of DML features and softmax-based features is long overdue. Fig. 1 depicts the feature vectors extracted from a softmaxbased classification network and a metric learning-based network. We used LeNet architecture for both networks, and trained on the MNIST dataset [12]. For DML, we used the contrastive loss function [13] to map images in two-dimensional space. For softmax-based classification, we added a two- or three-dimensional fully connected layer before the output layer for visualization. DML succeeds in learning feature embedding (Fig. 1a). Softmax-based classification networks can also achieve a result very similar to that obtained by DML— Images are located near one another if they belong to the same class and far apart otherwise (Fig. 1b, Fig. 1c). Our contributions in this paper are as follows: • • We show methods to exploit the ability of deep features extracted from softmax-based networks, such as normalization and proper dimensionality reduction. They are S.Horiguchi was and D.Ikami, K.Aizawa are with the Department of Information and Communication Engineering, The University of Tokyo, Bunkyo, Tokyo, Japan 133-8656. E-mail: see http://www.hal.t.u-tokyo.ac.jp/ • technically not novel, but they must be used for fair comparison between the image representations. We demonstrate that deep features extracted from softmax-based classification networks show competitive, or better results on clustering and retrieval tasks comparing to those from state-of-the-art DML-based networks [9], [10], [11] in the Caltech UCSD Birds 2002011 dataset and the Stanford Cars 196 dataset. We show how the clustering and retrieval performances of softmax-based features and DML features change according to the size of the dataset. DML features show competitive or better performance in the stanford Online Product dataset which consists of very small number of samples per class. In order to align the condition of the network architecture, we restrict the network architecture to GoogLeNet [14] which has been used in state-of-the-art of DML studies [9], [10], [11]. 2 2.1 BACKGROUND Previous Work 2.1.1 Softmax-Based Classification and Repurposing of the Classifier as a Feature Extractor Convolutional neural networks have demonstrated great potential for highly accurate image recognition [15] [16] [14] [17]. It has been shown that features extracted from classification networks can be repurposed as a good feature representation for novel tasks [1] [2] [18] even if the network was trained on ImageNet [4]. For obtaining better feature representations, finetuning is also effective [6]. 2.1.2 Deep Distance Metric Learning Distance metric learning (DML), which learns a distance metric, has been widely studied [19] [20] [21] [18]. Recent studies have focused on end-to-end deep distance metric learning [7] [8] [9] [10] [11]. However, in most studies comparisons of end-to-end DML with features extracted from classification networks have not been performed using architectures and conditions suited to enable a true comparison of performance. Bell and Bala [7] compared classification networks and siamese networks, but they used coarse class labels for classification networks and fine labels for siamese networks; thus, it was left unclear whether siamese networks are better for feature-embedding learning than classification networks. Schroff et al. [8] used triplet loss for deep metric learning in their FaceNet, which showed performance that was state-ofthe-art at the time, but their network was deeper than that of the previous method (Taigman et al. [22]); thus, triplet loss might not have been the only reason for the performance improvement, and the contribution from adopting triplet loss remains uncertain. Song et al. [9] used lifted structured feature embedding; however, they only compared their method with a softmax-based classification network pretrained on ImageNet (Russakovsky et al., [4]) and did not compare it with a finetuned network. Sohn [10], and Song et al. [11] also compared their methods to lifted structured feature embedding, thus the comparisons with softmax-based features have not been shown. 2.2 Differences Between Softmax-based Classification and Metric Learning For classification, the softmax function (Eq. 1) is typically used: exp(uc ) pc = PC , i=1 exp(ui ) (1) JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 (a) Siamese (dim = 2) (b) Softmax (dim = 2) 2 (c) Softmax (dim = 3) + L2 normalization Fig. 1. Depiction of MNIST dataset. (a) Two-dimensional features obtained by siamese network. (b) Two-dimensional features extracted from softmax-based classifier; these features are well separated by angle but not by Euclidean norm. (c) Three-dimensional features extracted from softmax-based classifier; we normalized these to have unit L2 norm and depict them in an azimuth–elevation coordinate system. The threedimensional features are well separated by their classes. (a) GoogLeNet (dimensionality is reduced to n by PCA) Fig. 2. Illustration of learning processes for softmax-based classification network and siamese-based DML network. For softmax, the gradient is defined by the distance between a sample and a fixed one-hot vector; for siamese by the distance between samples. where pc denotes the probability that the vector u belongs to the class c. The loss of the softmax function is defined by the cross-entropy C X E=− qc log pc , (2) c=1 where q is a one-hot encoding of the correct class of u. To minimize the cross-entropy loss, networks are trained to make the output vector u close to its corresponding one-hot vector. It is important to note that the target vectors (the correct outputs of the network) are fixed during the entire training (Fig. 2). On the other hand, DML methods use distance between samples. They do not use the values of the labels; rather, they ascertain whether the labels are the same between target samples. For example, contrastive loss [13] considers the distance between a pair of samples. Recent studies [8] [9] [11] [10] use pairwise distances between three or more images at the same time for fast convergence and efficient calculation. However, these methods have some drawbacks. For DML, in contrast to optimization of the softmax cross-entropy loss, the optimization targets are not always consistent during training even if all possible distances within the mini-batch are considered. Thus, the DML optimization converges slowly and is not stable. 3 3.1 M ETHODS Dimensionality Reduction Layer One of DML’s strength in using fine-tuning is the flexibility of its output dimensionality by a final fully connected layer. When using features of a mid-layer of a softmax classification network, on the other hand, the dimensionality of the (b) GoogLeNet with dimensionality reduction by a fully connected layer just before the output layer (FCR1) (c) GoogLeNet with dimensionality reduction by a fully connected layer followed by a dropout layer (FCR2) Fig. 3. GoogLeNet [14] architecture we use in this paper. We extracted the features of the red-colored layers. For (a), we applied PCA to reduce the number of feature dimensions. For (b) and (c), the dimensionality is reduced by the fc reduction layer. TABLE 1 Properties of datasets used in our experiments. Each cell shows the number of images (upper figure) and the number of classes (lower figure). Dataset Train Test Total CUB [23] 5,864 100 5,924 100 11,788 200 CAR [24] 8,054 98 8,131 98 16,185 196 OP [9] 59,551 11,318 60,502 11,316 120,053 22,634 features is fixed. Some existing methods [6] use PCA or discriminative dimensionality reduction to reduce the number of feature dimensions. In our experiment, we evaluated three methods for changing the feature dimensionality. Following conventional PCA approaches, we extracted features from a 1024-dimensional pool5 layer of GoogLeNet [14] (Fig. 3a) and applied PCA to reduce the dimensionality. In a contrasting approach, we made use of a fully connected layer—we added JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 3 TABLE 2 CUB: NMI (clustering) and Recall@K (retrieval) scores for the test set of the Caltech UCSD Birds 200-2011 (CUB) dataset. (clustering) Recall@K (retrieval) dim NMI K=1 K=2 K=4 K=8 64 64 64 64 64 64 64 56.5 (56.0) 57.2 59.2 60.8 59.1 57.4 43.6 (42.7) 45.4 48.2 51.1 49.0 48.0 56.6 (55.0) 58.4 61.4 64.0 61.1 60.3 68.6 (67.2) 69.5 71.8 75.3 72.7 72.2 79.6 (78.1) 79.5 81.9 84.0 82.3 81.6 Lifted struct [9] N-pair loss [10] Clustering loss [11] PCA + L2 FCR1 + L2 FCR2 + L2 TABLE 3 CAR: NMI (clustering) and Recall@K (retrieval) scores for the test set of the Stanford Cars 196 (CAR) dataset. (clustering) Recall@K (retrieval) dim NMI K=1 K=2 K=4 K=8 64 64 64 64 64 64 64 56.9 (57.1) 57.8 59.0 58.3 58.7 60.4 53.0 (50.5) 53.9 58.1 69.4 66.7 67.9 65.7 (63.6) 66.8 70.6 80.0 77.7 78.4 76.0 (74.9) 77.8 80.3 87.2 85.2 86.1 84.0 (83.6) 86.4 87.8 92.4 90.8 91.3 Lifted struct [9] N-pair loss [10] Clustering loss [11] PCA + L2 FCR1 + L2 FCR2 + L2 TABLE 4 OP: NMI (clustering) and Recall@K (retrieval) scores for the test set of the Online Product (OP) dataset. (clustering) Lifted struct [9] N-pair loss [10] Clustering loss [11] PCA + L2 FCR1 + L2 FCR2 + L2 Recall@K (retrieval) dim NMI K=1 K=10 K=100 64 64 64 64 64 64 64 88.7 (87.7) 89.4 89.5 87.5 87.7 87.9 62.5 (61.0) 66.4 67.0 62.4 61.3 62.5 80.8 (79.9) 83.2 83.7 78.9 78.6 79.8 91.9 (91.5) 93.0 93.2 89.7 90.1 90.8 a fully connected layer having the required number of neurons just before the output layer (FCR1, Fig. 3b). We also investigated a third approach in which a fully connected layer is added followed by a dropout layer (FCR2, Fig. 3c). 3.2 Normalization In this study, all the features extracted from the classification networks are from the last layer before the last output layer. The outputs are normalized by the softmax function and then evaluated by the cross-entropy loss function in P the networks. Assume that the output vector is p = (pi ) where i pi = 1. For arbitrary positive constant α, y = (log αpi ) returns the same vector p after the softmax function is applied. The features x we extract from the networks are given as x = W −1 y, where W denotes the linear projection matrix from the layer before the output layer to the output layer. The vector y has an ambiguity in its scale, thus its linear transformed vector x also has an ambiguity in the scale—therefore x should be normalized. As Fig. 1b clearly indicates, the distance between features extracted from a softmax-based classifier should be evaluated by cosine similarity, not by the Euclidean distance. Some studies used L2 normalization for deep features extracted from softmax-based classification networks [22] [6], whereas many recent studies have used the features without any normalization [15] [9], [25]. In this study, we also validate the efficacy of normalizing deep features. 4 E XPERIMENTS In this section, we compared the deep features extracted from classification networks to those from state-of-the-art DMLbased networks [9] [10] [11]. The GoogLeNet architecture [14] was used for all the methods—thus, the numbers of parameters are the same between DML-based networks and softmax-based features. All the networks were fine-tuned from the weights pretrained on ImageNet [4]. We used the Caffe [26] framework for the implementation. 4.1 Comparisons between softmax-based features and DML-based features Here, we give our evaluation of clustering and retrieval scores for the state-of-the-art DML methods [9] [10] [11] and for the softmax classification networks. We used the Caltech UCSD Birds 200-2011 (CUB) dataset [23], the Stanford Cars 196 (CAR) dataset [24], and the Stanford Online Products (OP) dataset [9]. For CUB and CAR, we used the first half of the dataset classes for training and the rest for testing. For OP, we used the training–testing class split provided. The dataset properties are shown in Table 1. We emphasize that the class sets used for training and testing were completely different. For clustering evaluation, we applied k-means clustering 100 times and calculated NMI (Normalized Mutual Information) [27]; the value for k was set to the number of classes in the test set. For retrieval evaluation, we calculated Recall@K [28]. JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 4 Fig. 4. CUB: Comparisons between softmax-based features and lifted structured feature embedding [9] on NMI (clustering), and Recall@K (retrieval) scores for the test set of the Caltech UCSD Birds 200-2011 (CUB) dataset. The dimension of the feature used in the retrieval experiments is 64. Fig. 5. CAR: Comparisons between softmax-based features and lifted structured feature embedding [9] on NMI (clustering), and Recall@K (retrieval) scores for the test set of the Stanford Cars 196 (CAR) dataset. The dimension of the feature used in the retrieval experiments is 64. Fig. 6. OP: Comparisons between softmax-based features and lifted structured feature embedding [9] on NMI (clustering), and Recall@K (retrieval) scores for the test set of the Online Products (OP) dataset.The dimension of the feature used in the retrieval experiments is 64. In Table 2 and Table 3, we show comparisons of the performance of clustering and retrieval using NMI and Recall@K scores, respectively, for CUB and CAR datasets. We compared the three softmax-based features, lifted structure [9], N-pair loss [10] and the clustering loss [11]. The results of the DML methods were quoted from the paper [11]. Regarding the lifted structure [9], the results in the parenthesis correspond to the scores we obtained from running the publicly available code ourselves, which we confirmed were almost the same as those in [11]. As we can see from Table 2 and Table 3, softmax- based features outperformed DML features. The softmax-based features all performed well in the two datasets. In OP dataset shown in Table 4, contrasting to CUB and CAR datasets, DML features outperform softmax-based features. We will make detailed analysis in the subsequent section. 4.2 Detailed comparisons between softmax-based features and lifted structure embedding features We made detailed comparisons between softmax-based features and lifted structure embedding [9] when changing dimen- JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 5 Fig. 7. CUB: NMI (clustering), and Recall@K (retrieval) scores for test set of the Caltech UCSD Birds 200-2011 dataset under different dataset sizes. The feature dimensionality is fixed at 1024. Fig. 8. CAR: NMI (clustering), and Recall@K (retrieval) scores for test set of the Stanford Cars 196 dataset under different dataset sizes. The feature dimensionality is fixed at 256. sionalities and size of data. We conducted these experiments using the code available for lifted structure embedding [9]. Firstly, we show how the performance varies when changing the feature dimensionalities. We changed the dimensionalities of softmax-based features via PCA, FCR1 and FCR2, and investigated how the performance of clustering and retrieval varied. We compared them against those of lifted structure embedding of the same dimensionality. For training, we multiplied the learning rates of the changed layers (output layers for all models and the fully connected layer added for FCR1 and FCR2) by 10. The batch size was set to 128, and the maximum number of iterations for our training was set to 20,000, which was large enough for the three datasets to converge as mentioned in [11]. These training strategies were exactly the same as those used in [9]. We show the results for CUB and CAR datasets in Fig. 4 and in Fig. 5, respectively, under varying dimensionalities. The deep features extracted from the softmax-based classification networks outperformed the lifted structured feature embedding in clustering (NMI) and retrieval (Recall@K). For clustering performance measured by NMI, all of the softmax models (PCA, FCR1, and FCR2) showed better scores than the lifted structured feature embedding. Regarding normalization, softmax-based features with L2 normalization showed better performance than those without normalization. The NMI scores of PCA, FCR1 and FCR2 monotonically increased as the feature dimensionality increased for the CUB dataset (Fig. 4). On the other hand, in CAR dataset (Fig. 5), the NMI scores of FCR2 and the lifted structure embeddings decreased from 256 dimensions and those of PCA and FCR1 were saturated above 256 dimensions. This experimental result shows that 1024 dimensions is too large to represent the image classes of CAR dataset. It also implies that the feature dimensionality should be carefully considered in order to achieve best performance depending on the target data. For retrieval performance measured by Recall@K metric, the softmax-based features also outperformed features of lifted structured feature embedding. Regarding L2 normalization, features with normalization showed better score than without L2-normalization. Fig. 6 shows the clustering and retrieval performance measured by NMI, and Recall@K, respectively, for the Online Products dataset. Contrasting to CUB and CAR datasets, the softmax-based features with L2 normalization and the lifted structure embedding showed almost the same performance in the clustering and retrieval. As shown in Table 1, the OP dataset is very different from the CUB and CAR datasets in terms of the number of classes and the number of samples per class—the number of classes is 22k and the number of samples is 120k. The number of samples per class in the OP dataset is 5.3 on average, which is far smaller than the CUB and CAR dataset. 4.3 The effect of the dataset scales From the results for these three datasets, we conjecture that the dataset size—that is the number of samples per class—has a considerable influence on softmax-based features. Hence, we changed the size of datasets by sampling the images of CUB and CAR datasets for each class and ran the experiments again. We constructed seven datasets of different sizes, containing 5, JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, OCTOBER 2017 10, 20, 40, 60, 80, and 100% of the whole dataset, respectively. Among them, 5% corresponds to approximately 3 and 4 images per class in the CUB and the CAR dataset, respectively. As shown in Fig. 7 and Fig. 8, the differences between the scores for softmax and DML were small if the size of the training dataset was small. The gap between softmax and DML became larger as the dataset size increased. The softmax-based classifier was largely influenced by the size of the dataset. 5 C ONCLUSION Because there was no equitable comparison in previous studies, we conducted comparisons of the softmax-based features and the state-of-the-art DML features using a design that would enable these methods to objectively demonstrate their true performance capabilities. Our results showed that the features extracted from softmax-based classifiers performed better than those from state-of-the-art DML methods [9] [10] [11] on finegrained classification, clustering, and retrieval tasks when the size of the training dataset (samples per class) is large. The results also showed that the size of the dataset largely influenced the performace of softmax-based features. When the size of the dataset was small, DML showed better or competitive performance. DML methods have advantages when the number of classes is very large and the softmax-based classifier is no longer applicable. In DML studies, softmax-based feature have rarely been compared fairly with DML-based feature under the same network architecture or with adequate fine-tuning. This paper revealed that the softmax-based features are still strong baselines. The results suggest that fine-tuned softmaxbased features should be taken into account when evaluating the performance of deep features. R EFERENCES [1] J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, T. Darrell, DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition, ICML, pp.647–655, 2014 [2] A. S. Razavian, H. Azizpour, J. Sullivan, S. Carlsson, CNN Features Off-the-Shelf: An Astounding Baseline for Recognition, CVPR Workshops, pp.512–519, 2014 [3] Y. Liu, Y. Guo, S. Wu, Song, M. S. Lew, DeepIndex for Accurate and Efficient Image Retrieval, ICMR, pp. 43–50, 2015 [4] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, Fei-Fei Li, ImageNet Large Scale Visual Recognition Challenge, IJCV, Vol. 115, No. 3, pp.211-252, 2015 [5] J. Wan, D. Wang, S. H. Hoi, P. Wu, J. Zhu, Y. Zhang, J. Li, Deep Learning for Content-Based Image Retrieval: A Comprehensive Study, ACM Multimedia, pp.157–166, 2014 [6] A. Babenko, Artem A. Slesarev, A. Chigorin, V. Lempitsky, Neural Codes for Image Retrieval, ECCV, pp.584–599, 2014 [7] S. Bell, K. Bala, Learning Visual Similarity for Product Design with Convolutional Neural Networks, SIGGRAPH, 2015 [8] F. Schroff, Florian, D. Kalenichenko, J. Philbin, FaceNet: A Unified Embedding for Face Recognition and Clustering, CVPR, pp.815– 823, 2015 [9] H. O. Song, Y. Xiang, S. Jegelka, S. Savarese, Deep Metric Learning via Lifted Structured Feature Embedding, CVPR, pp.4004–4012, 2016 [10] K. Sohn, Improved Deep Metric Learning with Multi-class N-pair Loss Objective, NIPS, pp.1857–1865, 2016 [11] Hyun Oh Song, S. Jegelka, V. Rathod, K. Murphy, Deep Metric Learning via Facility Location CVPR, pp.2206–2214, 2017 [12] Y. LeCun, L. Bottou and Y. Bengio, P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE, Vol. 86, No.11 pp.2278-2324, 1998 [13] R. Hadsell, S. Chopra, Y. LeCun, Dimensionality reduction by learning an invariant mapping, CVPR, pp.1735–1742, 2006 [14] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, A. Rabinovich, Going Deeper with Convolutions, CVPR, pp.1–9, 2015 6 [15] A. Krizhevsky, I. Sutskever, G. E. Hinton ImageNet Classification with Deep Convolutional Neural Networks, NIPS, 1097–1105, 2012 [16] K. Simonyan, A. Zisserman, Very Deep Convolutional Networks for Large-Scale Image Recognition, ICLR, 2015 [17] K. He, X. Zhang, S. Ren, J. Sun, Deep Residual Learning for Image Recognition, CVPR, pp. 770–778, 2016 [18] Q. Qian, R. Jing, S. Zhu, Y. Lin, Fine-grained visual categorization via multi-stage metric learning, CVPR, pp.3716–3724, 2015 [19] J. Bromley, I. Guyon, Y. LeCun, S. Eduard, R. Shah, Signature Verification using a ”Siamese” Time Delay Neural Network, NIPS, pp. 737–744, 1994 [20] S. Chopra, R. Hadsell, Y. LeCun, Learning a similarity metric discriminatively, with application to face verification, CVPR, pp. 539–546, 2005 [21] Large scale online learning of image similarity through ranking, G. Chechik, V. Sharma, U. Shalit, S. Bengio, JMLR, pp.1109–1135, 2010 [22] Y. Taigman, M. Yang, M. Ranzato, L. Wolf, DeepFace: Closing the Gap to Human-Level Performance in Face Verification, CVPR, pp. 1701-1708, 2014 [23] C. Wah, S. Branson, P. Welinder, P. Perona, S. Belongie, The Caltech-UCSD Birds-200-2011 Dataset, California Institute of Technology, CNS-TR-2011-001, 2011 [24] J. Krause, M. Stark, J. Deng, Fei-Fei Li, 3D Object Representations for Fine-Grained Categorization, 4th International IEEE Workshop on 3D Representation and Recognition, pp.554-561, 2013 [25] L. Wei, Q. Huang, D. Ceylan, E. Vouga, H. Li, Dense Human Body Correspondences Using Convolutional Networks, CVPR, pp.1544– 1553, 2016 [26] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, T. Darrell, Caffe: Convolutional Architecture for Fast Feature Embedding arXiv preprint arXiv:1408.5093, 2014 [27] C. D. Manning, P. Raghavan, H. Schütze, Introduction to Information Retrieval, Cambridge University Press, 2008 [28] H. Jegou, M. Douze, C. Schmid, Product Quantization for Nearest Neighbor Search, IEEE Trans. PAMI, Vol. 33, No.1 pp.117-128, 2011
1cs.CV
1 A Scalable Low-Cost-UAV Traffic Network (uNet) Santosh Devasia∗) Alexander Lee∗∗) arXiv:1601.01952v2 [cs.SY] 11 Jan 2016 U. of Washington, Seattle, WA 98195-2600, USA This article proposes a new Unmanned Aerial Vehicle (UAV) operation paradigm to enable a large number of relatively low-cost UAVs to fly beyond-line-of-sight without costly sensing and communication systems or substantial human intervention in individual UAV control. Under current free-flight-like paradigm, wherein a UAV can travel along any route as long as it avoids restricted airspace and altitudes. However, this requires expensive on-board sensing and communication as well as substantial human effort in order to ensure avoidance of obstacles and collisions. The increased cost serves as an impediment to the emergence and development of broader UAV applications. The main contribution of this work is to propose the use of pre-established route network for UAV traffic management, which allows: (i) premapping of obstacles along the route network to reduce the onboard sensing requirements and the associated costs for avoiding such obstacles; and (ii) use of well-developed routing algorithms to select UAV schedules that avoid conflicts. Available GPS-based navigation can be used to fly the UAV along the selected route and time schedule with relatively low added cost, which therefore, reduces the barrier to entry into new UAV-applications market. Finally, this article proposes a new decoupling scheme for conflict-free transitions between edges of the route network at each node of the route network to reduce potential conflicts between UAVs and ensuing delays. A simulation example is used to illustrate the proposed uNet approach. ∗) ∗∗) Professor, Mechanical Engineering Dept., Box 352600, AIAA Senior Member. Volunteer Student, Mechanical Engineering Dept., Box 352600. typeset using P T P TEX.cls hVer.0.9i 2 uNet: A Scalable Low-Cost-UAV Traffic Network §1. Introduction This article proposes a new Unmanned Aerial Vehicle (UAV) operation paradigm to enable a large number of relatively low-cost UAVs to fly beyond-line-of-sight, without costly sensing and communication systems or substantial human intervention in the individual UAV control. A broadly accessible UAV traffic network (uNet) for low-cost UAVs can reduce the barrier to entry into the UAV market and enable new commercial enterprises and applications. For example, just as mobile phones revolutionized communication in developing countries by circumventing costly landlines, minimalist UAVs could make product delivery a reality in geographic areas where transportation infrastructure is difficult and prohibitively expensive to build. The uNet itself can be an agglomeration of new franchise operators, along with internet-based application (APP) providers who enable users to automatically negotiate between different operators, and get a UAV to its destination. Additionally, existing commercial delivery companies can use the uNet to transport products and smaller UAV brokerage firms can use it to transport UAVs between locations. Current approaches to UAV traffic management are based on the free-flight paradigm, where a UAV can travel along any route as long as it can avoid restricted airspace, and satisfy constraints such as altitude limits. Such freedom to fly anywhere, nevertheless, creates challenges when trying to avoid obstacles and collisions with potentially other UAVs. For example, without a-priori detailed information of the entire airspace, the free-flight approach leads to lack of knowledge about the immediate surroundings of the UAV, which then requires sensors and/or humans to detect obstacles. The ultimate consequence of this is an increased cost of UAV operation, scaling upwards in complexity as more and more UAVs are introduced. Conflict resolution protocols in the free-flight system would need to continually evolve as density increases, and sensors and UAV-to-UAV communications would need to become progressively more sophisticated, e.g., for potential collaborative conflict resolution, as investigated previously for manned aircraft.1), 2) An approach that can avoid the increased complexity and cost of UAV-to-UAV communication is to develop pre-specified conflict avoidance rules for UAVs that are similar to visual flight rules (VFR) for manned aircraft. However, it can be challenging to develop such VFR rules that are provably safe with a large number of UAVs with multiple independent UAV operators. Another approach is to use human-guided conflict resolution similar to current air traffic management (ATM) for commercial manned flights over controlled airspace.3), 4), 5), 6) The human effort required for such conflict resolution can be lessened by using emerging concepts such as sense and avoid.7) Nevertheless, the human workload for conflict detection and avoidance tends to increase with number of aircraft, which limits the ability to scale such human-centered methods for a large number of UAVs. The new idea proposed here is to place the UAVs along an established route network, similar to automated guided vehicles on a factory floor,8), 9) or the jet routes followed by commercial aircraft in controlled airspace.10) These routes can be uNet: A Scalable Low-Cost-UAV Traffic Network 3 dense and time-varying to optimize for and accommodate conditions such as wind speed, precipitation, and other potential local variables. Routes could be ad-hoc networks set up to meet application requirements, e.g., for agricultural applications or coordinated disaster relief. Even with a high density of UAVs in flight, such route networks can provide sufficient flexibility while also addressing privacy concerns. A UAV using this route network could get to a typical home by flying over conventional roads, without flying over private property or other restricted areas. Compared to the free-flight-style of UAV traffic management, the proposed approach over established route networks (such as roadways) offers two major advantages. First, obstacles along the routes can be mapped a-priori and updated as needed, reducing onboard sensing requirements. Note that detailed mapping of obstacles is only needed along the routes in this approach and not the entire airspace as in the free-flight approach. Waypoints along these established routes can be used to fly the UAV along a three dimensional trajectory, e.g.,.11), 12) Moreover, the initial arrival into and the final departure from the uNet could be managed by humans, or using GPS-based landing schemes, e.g.,.13), 14) Then, for UAV traffic management, the amount of sensing and data required on each UAV reduces to GPS-enabled navigation from a given waypoint to the next specified waypoint. Since this does not require active imaging and sensing of the surroundings, such an approach could alleviate some of the privacy concerns associated with UAVs with substantial sensing capabilities. A second advantage is that conflict resolution over a route network can be transformed into a resource allocation problem, i.e., two UAVs cannot occupy the same section of a route at the same time. Additionally, transitions between different sections of the network can be designed to be conflict-free for reducing potential delays, e.g.,.15) Then, conflict-free route selection can be solved using well-developed existing resource allocation procedures for multi-agent systems, e.g.,.16), 17), 8), 18), 19), 9), 20) For example, scheduling can be done using context-aware route planning (CARP), where a new agent (i.e., the UAV) selects a route from a route network (e.g., selects a shortest path-length route21) ) and schedules the arrival time such that the new agent is conflict-free with respect to previous agents that have been scheduled already.16) This a-priori de-conflicting using scheduling reduces the amount of on-board sensing and communication needed on each UAV. Thereby, the proposed uNet enables access to low-cost UAV, and consequently can lead to broad usage of the uNet. Another contribution of this work is to propose a new decoupling scheme for conflict-free transitions between edges of the route network at each node of the route network to reduce potential conflicts between UAVs. At low UAV densities, establishing a waiting protocol at nodes of the route network could be one possible method of conflict avoidance. Unfortunately, this method incurs additional fuel costs to slow down from cruise and hover, and then accelerate again. If the conflicts at the nodes can be avoided by design, such delays can be reduced or even eliminated entirely. This is similar to the design of multi-level interchanges at freeway junctions that allow multiple traffic streams to pass through without crossing each other as 4 uNet: A Scalable Low-Cost-UAV Traffic Network opposed to the use of traffic lights or stop signs on typical surface streets. In addition to offering solutions for prior waypoint mapping and conflict resolution, the uNet approach is also capable of distributed development and implementation through sector-level uNets (sNets) that each manage UAVs inside their local region of the airspace. With minimal effort from the user, who only needs to specify initial and final locations along with an estimated time of arrival (ETA), a service, possibly a commercial web-application (APP), can select a route that spans multiple sNets and choose a scheduled time of arrival (STA) into the uNet based on route-availability. The APP serves to negotiate between different sNets and manage different service fees and availability along en-route sNets to propose a scheduled time of arrival (STA) into the uNet. If the UAV meets requirements such as fuel for the flight, GPS and communication needs between the UAV and sNets, and humanguided (or automated) initial and final transitions into and out of the uNet, then the flight is accepted into the first sNet. Communication between the sNet and a UAV, e.g., about waypoint specifications and current location updates (using GPS on the UAV), can be done using cellular data. This allows each sNet to manage and monitor UAV flights and conflict avoidance in its airspace In case of emergencies which is another important issue in beyond line of sight operation, e.g.,,22) the sNet can potentially redirect the UAV by providing new waypoints that could be precomputed for every section of the route network. Moreover, each sNet will keep track of route occupancy (resource allocation) in its airspace and dynamically update the available route network if needed. The proposed distributed approach allows public-private partnerships to manage different aspects of the uNet such as management and regulation of the sNets. A progressive rollout and expansion of the uNet infrastructure, one sNet piece at a time, can enable organic growth of the overall uNet. Commercial groups (such as local supermarkets or malls) can develop and manage the local sNets, and sNets can be either refined over time into smaller sectors with a finer mesh or integrated together to form larger sectors. Similar to the development of the National Science Foundation (NSF) NSFNET, which provided the backbone communication service for the Internet, the public sector could help the uNet effort by developing backbonetype services, e.g., over highways to connect local sNets. The article begins with a description of the proposed uNet structure in Section 2. The resource-allocation approach to UAV scheduling is illustrated with a simulation example in Section 3, which is followed by conclusions. §2. Proposed uNet structure 2.1. UAV routing through sNets The uNet consists of multiple sector-level uNets (sNets), each of which controls a specified region of the airspace. After entering a desired initial location Li in the initial sNet, a UAV U can potentially transition through multiple such sNets before uNet: A Scalable Low-Cost-UAV Traffic Network 5 reaching the final location Lf in the final sNet as illustrated in Fig. 1. GPS U(k) L i (k) L f (k) S k(1) P S k(i) S k(2) S k(n s,k ) uNet R(k) U(k) STA(k) Web-based Scheduler App L i (k), L f (k) ETA(k) User Fig. 1. Schematic routing of the kth UAV U (k) through the uNet from the initial location Li (k) in the initial sector-level uNet Sk (1) to the final location Lf (k) in the final sector-level uNet Sk (ns,k ). For a given expected time of arrival ETA(k) into the uNet, the router negotiates between multiple sNets to determine the scheduled time of arrival STA(k) and a conflict-free ns,k . The UAV U (k) receives GPS information flight route R(k) that spans multiple sNets {Sk (i)}i=1 and communicates its position P [U (k)](t) to the current sNet Sk (i) at time t. In particular, given the expected time of arrival ETA(k) of the k th UAV U (k) into the initial location Li (k) and the final location Lf (k), a router (potentially a web-based application) negotiates between multiple sNets to determine a scheduled time of arrival STA(k) and a flight route R(k) that is conflict-free with respect to all the prior UAVs [U (i)]k−1 i=1 in the uNet. 2.2. Definition: conflict-free In the following, two UAVs U (i) and U (j) are considered to be in conflict at some time t if they are inside the uNet region and their minimal separation is less than an acceptable value dsep , i.e., kL[U (i)](t) − L[U (j)](t)k2 < dsep (2.1) where k · k2 is the standard Euclidean norm and L[U (·)](t) is the position of the UAV U (·) at time t. The minimal separation dsep is needed to ensure that there are no collisions with other UAVs, even with potential errors in UAV positioning. Thus, the minimal separation dsep between UAVs, needed to be be conflict-free, will depend on the precision of the GPS-based navigation system. The routes are selected by the local sNets to be obstacle free. Enroute sNets ns,k [Sk (i)]i=1 ensure that all routes including the selected route R(k) for the UAV U (k) are clear of obstacles in each sNet Sk (i) ∈ S that the k th UAV U (k) passes through where S is the set of sNets and ns,k is the number of sNets traversed as in Fig. 1. The flight route R(k) can be used to determine the fuel required for the flight. If the UAV meets requirements such as fuel for the flight, GPS and communication 6 uNet: A Scalable Low-Cost-UAV Traffic Network needs between the UAV and sNets as well as human-guided (or automated) initial transition into and final transition from the uNet, then the flight is accepted by the first sNet Sk (1) on the selected flight route R(k). 2.3. Specified route structure Under a specified route structure scenario, the potential route R of a UAV U can be selected from edges of a directed graph G = (N , E) with nodes N enumerated e n , ne ≥ 1. , nn > 1 and edges E ⊆ N × N enumerated as [E(j)]nj=1 as [N (i)]ni=1 There is a path on the graph from every desired initial location to every desired final location. It is assumed that each node in the uNet has a distinct spatial location, and the edges connect distinct points in space. Therefore, the initial node N ([j]i ) and the final node N ([j]f ) of each edge Ej = {N ([j]i ), N ([j]f )} ∈ E are different, i.e., N ([j]i ) 6= N ([j]f ). Remark 1 (General 3-dimensional edges) The edges E between nodes in the graph G could be general curved paths and can be three dimensional. Alternatively, general curved paths could be approximated with straight-line segments and the start and end of these segments could be included in the set of graph nodes N . Given an initial node Li (k) and final node Lf (k) for the k th UAV U (k), a route R(k) is a path on the graph G, i.e., sequence of distinct edges, where Ek (j) = {Nk ([j]i ), Nk ([j]f )} ∈ E, (2.2) is the number of edges in route Rk , which a sequence of distinct nodes Rk = [Ek (1), Ek (1), . . . , Ek (nr,k )] , nr,k N (Rk ) = [Li (k), Nk ([1]f ), Nk ([2]f ), . . . , Nk ([nr,k ]f )] . (2.3) Therefore, the edges are connected, i.e., initial nodes Nk ([·]i ) ∈ N and final nodes Nk ([·]f ) ∈ N satisfy Nk ([j]f ) = Nk ([j + 1]i ), ∀j = 1, 2, . . . , (nr,k − 1), (2.4) ∀j = 1, 2, . . . , (nr,k − 1), (2.5) without retracing an edge, i.e., Nk ([j]i ) 6= Nk ([j + 1]f ), and the edges begin and end at the desired initial and final locations, i.e., Nk ([1]i ) = Li (k), Nk ([nr,k ]f ) = Lf (k) (2.6) 2.4. sNets s The uNet is partitioned into ns number of sNets S = [S(j)]nj=1 such that each edge inside the set of edges E of the uNet graph G belongs to a unique sNet. Each sNet S(i) can be considered as a subgraph Gi = (Ni , Ei ) of the overall graph G with Ni ⊆ N and Ei ⊆ E. An example sNet S(1) is shown in Fig. 2, where the set of nodes N1 ⊆ N associated with the sNet N1 = [N1 (1), N1 (2), . . . , N1 (12)] (2.7) uNet: A Scalable Low-Cost-UAV Traffic Network 7 is represented by numbered dots [i]12 i=1 on a square gird and the set of edges E1 ⊆ (2.8) (N1 × N1 ) ∩ E associated with the sNet is enumerated as [E1 (i)]26 i=1 and given by   {1, 4}, {2, 5}, {3, 4}, {4, 1}, {4, 3}, {4, 5}, {4, 7}, {4, 8}, {5, 2}, {5, 4}, E1 =  {5, 6}, {5, 9}, {6, 5}, {7, 4}, {8, 4}, {8, 9}, {8, 11}, {9, 5}, {9, 8}, {9, 10},  . {10, 9}, {10, 11}, {11, 8}, {11, 10}, {11, 12}, {12, 11} (2.9) 12 S(1) 11 7 8 3 9 10 4 5 6 1 2 y (0,0) x Fig. 2. Example sNet S(1) where nodes N1 are represented by numbered dots on a square gird with the same vertical height. It includes typical roadway intersection geometries such as T intersection at node 9, Y -intersection at node 8, cross-intersection at node 5, and a general non-circular intersection with more than four legs at node 4. 2.5. De-conflicting UAV routes that do not share an edge Potential conflicts between two UAVs on two routes are classified into two scenarios: (i) when the two routes do not share an edge; and (ii) when the two routes share an edge. De-conflicting UAV routes that do not share an edge is discussed first. In particular, it is assumed in the following that the uNet design is such that edges are sufficiently spaced from each other to avoid conflicts between two UAVs on two distinct routes that do not share any edges, especially far away from common nodes, as stated formally below. Assumption 1 (Sufficiently-spaced edges) The overall uNet graph G is constructed (with edges sufficiently spaced from each other) such that two UAVs one on each of two distinct edges, say E(i) and E(j), cannot not have conflicts if the two edges do not have a node N in common. Assumption 2 (Conflict-free away from nodes) If two distinct edges E(i) and E(j) have a common node N , then there is no conflict between two UAVs (one UAV on each of these two edges), when at least one of the UAVs is not inside a vertical 8 uNet: A Scalable Low-Cost-UAV Traffic Network conflict-free boundary cylinder of radius d∗ [N ] d∗ [N ] ≥ dsep (2.10) centered around the common node N and height h∗ [N ]. Assumption 3 (Edges planar near nodes) In the following, it is assumed that for each node N in the uNet graph G, each of the nN edges, say EN (i), in the set N of edges EN = [EN (j)]nj=1 connected to the node N intersects with the conflict-free boundary cylinder (in Assumption 2) at a single point aN (i). Moreover, the set of N intersection points AN = [aN (i)]ni=1 for each node N lie on a single horizontal plane, on a conflict-free boundary circle Bc [N ] ⊆ Bs [N ]. Assumptions 2 and 3 imply that all the edge-intersection points in the set AN on the circumference of the conflict-free boundary circle Bc [N ] of a node N are sufficiently separated, i.e., d(AN ) = min { d(Ni , Nj ) | Ni ∈ AN , Nj ∈ AN } i6=j ≥ dsep . (2.11) Nevertheless, two UAVs U (i) and U (j) on routes Ri and Rj respectively that share no edges could encounter conflict as they approach a shared node N , i.e., N ∈ {P (Ri ) ∩ P (Rj )} where the set of nodes of a route P (·) is defined in Eq. 2.3. To illustrate, in the example sNet S(1) in Fig. 2, a UAV, say U (1) on route R(1) from node 8 to node 10 that includes a transition from edge {8, 9} to edge {9, 10} in Fig. 3(a) could have a conflict near the common node 9 with a UAV, say U (2) on route R(2) from node 10 to node 5 that includes a transition from edge {10, 9} to edge {9, 5}. When both UAVs are inside the space circumscribed by the boundary circle Bc [9] shown in Fig. 3(b) that is centered around node 9, the potential for conflict needs to be anticipated and resolved. Potential conflicts, between UAVs on routes that do not share an edge but share a common node as described above, can be avoided by sufficiently separating the transitions between edges at all nodes. To achieve this separation, the transitions nN into a node N to an edge from each edge in the set of edges E N = [E N (j)]j=1  nN in the set of edges E N = E N (j) j=1 out of the same node N are accomplished at nN . Each level, e.g., HN (i) is a horizontal plane different-height levels HN = [HN (j)]j=1 separated from all other levels by at least height hN . Let the UAV be transitioning from edge, say E N (i) ∈ E N , into node N to edge, say E N (j) ∈ E N , out of node N . Moreover, let the intersections of these edges E N (i) and E N (j) with the the conflictfree boundary circle Bc [N ] (in Assumption 3) be aN (i) and aN (j), respectively. Once the UAV on edge EN (i) reaches aN (i) at the edge of the conflict-free boundary circle Bc [N ], the UAV moves vertically to the ith level HN (i), then horizontally on this level LN (i) to be located directly above node N before moving horizontally towards the location on level i that is directly above aN (j). Then, the UAV descends vertically down from level HN (i) to aN (j) at the edge of the conflict-free boundary circle Bc [N ] and moves out of node N along the edge E N (j). uNet: A Scalable Low-Cost-UAV Traffic Network C9(3) 8 {8,9} 9 {9,10} {8,9} {9,8} (b) b a e f {5,9} d {9,5} 9b ab fb eb d*[9] {9,10} c 9 ff C9(2) bb {5,9} {9,5} 5 (a) cf H9(3) 9f af {10,9} 10 {9,8} {10,9} {8,9} b {9,8} 9 a 9 f cb H9(2) c {9,10} {10,9} d e H9(1) {5,9} {9,5} (c) Fig. 3. Illustrative example for decoupling edge-to-edge transition at a node. (a) Example node N = 9 of sNet S(1) in Fig. 2. (b) Zoomed region around node 9 illustrating conflict-free region, which is outside of the conflict-free boundary circle Bc [9] of radius d∗ [9] centered around node 9. (c) Separating edge transitions into three levels H9 = [H9 (j)]3j=1 at different heights, one for each edge into the node 9: green level H9 (1) for edge {10, 9}; blue level H9 (2) for edge {8, 9}; red level H9 (3) for edge {5, 9}. Remark 2 (Transition levels above and below node) The levels associated with the edge-transitions of a node N need not be all above the node, they can be below or at the same height as the node N provided such spaces are free of nodes, edges, obstacles, or other constraints preventing use by the UAV. To illustrate the de-conflicted edge transitions, consider the node N = 9 in the example sNet S(1), which has six edges, E9 = = [E9 (1), E9 (2), E9 (3), E9 (4), E9 (5), E9 (6)] [{10, 9}, {8, 9}, {5, 9}, {9, 10}, {9, 8}, {9, 5}] (2.12) connected to the node, where three of these edges, E 9 = [E 9 (1), E 9 (2), E 9 (3)] = [{10, 9}, {8, 9}, {5, 9}] (2.13) are into node N = 9, as shown in Fig. 3(a). Therefore, three levels H9 = [H9 (j)]3j=1 (at different heights) are used for transitions from each of the edges in E 9 into the node N = 9 to the output edges   E 9 = E 9 (1), E 9 (2), E 9 (3) = [{9, 10}, {9, 8}, {9, 5}] (2.14) out of node N = 9, as illustrated in Fig. 3(c). Let a UAV aim to transition from edge E 9 (2) = {8, 9} into node N = 9 to edge E 9 (3) = {9, 5} out of node N = 9. Moreover, let the intersections of these edges E 9 (2) and E 9 (2) with the the 10 uNet: A Scalable Low-Cost-UAV Traffic Network conflict-free boundary circle Bc [N ] (in Assumption 3) be a9 (2) = b and a9 (2) = e, respectively, as in Fig. 3(c). Once the UAV on edge E 9 (2) = {8, 9} reaches a9 (2) = b on the circumference of the conflict-free boundary circle Bc [9], the UAV moves vertically to the 2nd level H9 (2), then horizontally on this level, H9 (2) to be located at 9b directly above node N = 9 before moving horizontally towards the location eb on level H9 (2) that is directly above the location a9 (2) = e. Then, the UAV descends vertically down from level H9 (2) to location a9 (2) = e on the circumference of the conflict-free boundary circle Bc [9] and moves out of node N = 9 along the edge E N (j) = {9, 5}. Remark 3 (Avoid back tracking) Since the nodes in a route (P (·) defined in Eq. 2.3) are distinct, transitions to edges that return back to the start node of an edge into a node are not needed, e.g., transition from edge {8, 9} ∈ E 9 to edge {9, 8} ∈ E 9 is not needed at node N = 9, and is therefore, not shown in Fig. 3(c). Even with the multiple-level edge-to-edge transitions at a common node N , the minimal distance between two UAVs on two different routes R(i) and R(j) without a common edge can be made larger than the acceptable value dsep to avoid conflicts. Note that, from Assumptions 1-3, conflicts cannot occur on the edges if both UAVs are outside the conflict-free boundary circle Bc [N ] of a common node, say N . The UAVs have to arrive into the node N through different edges since their associated routes do not share a common edge, and therefore, are designed to achieve edgetransitions using different levels in the proposed scheme. Moreover, since the input and output edges from the node N are different, the two UAVs also do not share the vertical ascending and descending paths. There are three possible scenarios under which a conflict can occur between two UAVs: (i) both UAVs are on the ascending or descending paths to different edgeto-edge transition levels HN (·); (ii) both UAVS are in two edge-to-edge transition levels HN (·); and (iii) one UAV is on one of the ascending or descending paths and the other is on an edge-to-edge transition level HN (·). The spacing between the vertical ascending and descending paths is at least as large as the minimal spacing d(AN ) between the intersection points AN of a node N , which in turn is larger than the acceptable conflict-free separation dsep from Eq. 2.11. Furthermore, there can be no conflicts under the second scenario when both UAVs are on different levels if the edge-to-edge transition levels are separated by at least the acceptable conflictfree separation dsep . Under the third scenario, the distance between two UAVs can become smaller than the minimal spacing d(AN ) between the intersection points AN of a node N . For example, consider the distance between two UAVs when both are on the same edge-to-edge transition level, e.g., H9 (2) from Fig. 3c, when one UAV U (1) is is presently located at ab on a vertical path and is transitioning to another level, e.g., H9 (3) while the other UAV U (2) is located at zb on a transition path from location bb on level H9 (2) to the location 9b on the same level, above the node 9, as shown in Fig. 4. Conflict can occur when UAV U (1) is at location ab , which is the closest that UAV U (1) gets to location zb of UAV U (2), i.e., where its vertical ascent path uNet: A Scalable Low-Cost-UAV Traffic Network 11 zb bb 9b ab H9(2) Fig. 4. Distance between two UAVs when both are on the same edge-to-edge transition level H9 (2) from Fig. 3c, e.g., when one UAV is on a vertical path transitioning to another level H9 (3) and is presently located at ab and the other is located at zb on a transition path from location bb on level H9 (2) to the location 9b on the same level, above the node 9. intersects the edge-to-edge transition level H9 (2). The distance d(ab , zb ) between the two UAVs U (1) and U (2) can be found from triangle ∆(zb 9b ab ) using the law of cosines as, d(ab , zb )2 = d(zb , 9b )2 + d(ab , 9b )2 − 2d(zb , 9b )d(ab , 9b ) cos(∠zb 9b ab ) (2.15) where the distance d(ab , 9b ) is the radius d∗ [9] of the conflict-free boundary circle Bc [9], i.e., d(ab , 9b ) = d∗ [9]. (2.16) If the angle ∠zb 9b ab is obtuse, then the UAVs cannot have a conflict since, from Eqs. 2.15, and 2.16, d(ab , zb )2 = ≥ ≥ d(9b , zb )2 + (d∗ [9])2 − 2d(zb , 9b )(d∗ [9]) cos(∠zb 9b ab ) (d∗ [9])2 since cos(∠zb 9b ab ) ≤ 0 (dsep )2 from Eq. 2.10. (2.17) When the angle ∠zb 9b ab is not obtuse, i.e., ∠zb 9b ab = ∠bb 9b ab ≤ π/2, (2.18) the distance d(ab , zb ) between the UAVs cannot be smaller than the perpendicular distance d⊥ (ab , bb 9b ) between location ab and line segment bb 9b , i.e., d(ab , zb ) ≥ d⊥ (ab , bb 9b ) = = d(ab ,p 9b ) sin (∠bb 9b ab ) ∗ d [9] 1 − cos2 (∠bb 9b ab ). (2.19) Moreover, from the law of cosines for triangle ∆(bb 9b ab ), cos (∠ab 9b bb ) = = d(bb ,9b )2 +d(ab ,9b )2 −d(ab ,bb )2 d(bb ,9b )d(ab ,9b ) 2 2(d∗ [9])2 −d(ab ,bb )2 b ,bb ) = 1 − d(a 2(d∗ [9])2 2(d∗ [9])2 (2.20) 12 uNet: A Scalable Low-Cost-UAV Traffic Network since distances d(ab , 9b ) and d(bb , 9b ) are equal to the radius d∗ [9] of the conflict-free boundary circle Bc [9], i.e., d(ab , 9b ) = d(bb , 9b ) = d∗ [9] (2.21) and the law of cosines for triangle ∆(bb 9b ab ), Eq. 2.18 and Eq. 2.21 yield, d(ab , bb )2 = = ≤ d(bb , 9b )2 + d(ab , 9b )2 − d(bb , 9b )d(ab , 9b ) cos(∠bb 9b ab ) 2(d∗ [9])2 − (d∗ [9])2 cos(∠zb 9b ab ) 2(d∗ [9])2 . (2.22) Then, from Eqs. 2.19, 2.20 and 2.22, the distance between the UAVs d(ab , zb ) satisfies r rh h i2 i 2 2 d(ab ,bb )2 b ,bb ) ∗ d(ab , zb ) ≥ d [9] 1 − 1 − 2(d∗ [9])2 = d(ab , bb ) 1 − d(a ∗ 2 4(d [9]) rh (2.23) i √ 2 ( 2d∗ [9])2 ≥ d(ab , bb ) 1 − 4(d∗ [9])2 = √12 d(ab , bb ) ≥ √12 d(A9 ) The minimal distance d(A9 ) in Eq. 2.11 between intersection points A9 of node 9 can be designed to be large by choosing a sufficiently large radius d∗ [9] of the conflictfree boundary circle Bc [9]. A large enough radius d∗ [9] enables sufficient separation between the intersection points A9 that need to be distributed on the circumference of the conflict-free boundary circle Bc [9], i.e., √ d(AN ) ≥ 2 dsep (2.24) to ensure that the distance d(ab , zb ) between the UAVs satisfies the separation requirement, 1 (2.25) d(ab , zb ) ≥ √ d(AN ) ≥ dsep . 2 Assumption 4 (Sufficiently-spaced intersection points) Each node N that has more than one edge-to-edge transition, i.e., a potential for conflict during edge-toedge transition, the minimal distance d(AN ) in Eq. 2.11 between intersection points AN of node N is sufficiently large, i.e., satisfies Eq. 2.24. Moreover, the height h∗ [N ] of the conflict-free boundary cylinder in Assumption 2 is sufficiently large so that the edge-to-edge transition levels HN (·) are sufficiently separated (hN ≥ dsep ) to avoid conflicts between UAVs at different levels, and all levels can be contained inside the conflict-free boundary cylinder. Under Assumptions 1-4 there are no conflicts between UAVs in the uNet whose routes do not share an edge. Remark 4 (Non-vertical ascent and descent) If vertical ascent and descent is not feasible, the edge-to-edge transition scheme can be modified with gradual ascent and descent. In particular, by making the size of the circles CN (·) around which transition points into and out of each level are made larger for levels that are closer to the node N . For example, the circle C9 (3) at level H9 (3) for the example in Fig. 3, around which transition points at locations af , cf and ff are arranged, can be the smallest, followed by a larger level H9 (2) and level H9 (1) can be the largest, as illustrated in Fig. 5(a). uNet: A Scalable Low-Cost-UAV Traffic Network 13 Remark 5 (Narrow streets) In narrow streets, for sufficient separation between edges, only one edge might be permitted, unless the UAVs fly above the buildings. Alternatively, two edges could be stacked vertically one above the other to enable flight in two directions, In this case the arrivals can be separated into different levels, and the proposed approach can be used to ascend or descend to a different edge, as illustrated in Fig. 5(b). Remark 6 (On-demand de-confliction) The vertical ascent and descent adds time to the UAV flight. It is possible to only use the different levels when needed, e.g., as in on-demand de-conflicting schemes.23) For example, if there are no conflicts at a node N for the k th UAV U (k) with previously scheduled UAVs, then the UAV U (k) can directly proceed from the intersection point aN (·) into the node at the circumference of the conflict-free boundary circle Bc [N ] to node N followed by movement to the intersection point aN (·) out of the node N . If there is potential for conflict, say for UAV (U (k + 1) with UAV U (k) then the later UAV U (k + 1) selects the next-closest available level HN (·) to achieve the edge-to-edge transition, as illustrated in Fig. 5(c). C9(3) ff af C9(2) bb fb C9(1) {8,9} d {9,10} {10,9} 9 b {9,8} c eb C9(2) a (a) f e H9(1) {5,9} {9,5} {8,9} bb ff ab a (b) c eb {5,9} 9 b C9(2) H9(2) fb f e H9(2) cb {9,10} cb 9b C9(1) {9,8} cf H9(3) 9f af cb H9(2) 9b ab C9(3) cf H9(3) 9f d {10,9} H9(1) 9b fb C9(1) {8,9} {9,5} 9 b {9,8} U(k) a (c) c d {9,10} {10,9} U(k+1) f e H9(1) {5,9} {9,5} Fig. 5. Schematic of alternate approaches to decoupling edge-to-edge transitions at node 9. (a) Varying the radii of the conflict-free boundary circles (largest c9 (1) to smallest c9 (3)) enables non-perpendicular changes to the different levels for edge-to-edge transitions as in Remark 4. (b) Accommodating arrivals and departures at two different heights (levels) in narrow streets, as in Remark 5. (c) On-demand conflict resolution by changing to a different level when needed. UAV U (k) does not change level but UAV U (k + 1), with potential conflict with UAV U (k) changes to the closest available level H9 (2) for edge to edge transitions, as in Remark 6. 2.6. De-conflicted turns for UAV routes with shared edge The second scenario for potential conflict occurs between UAVs on routes that share an edge. There are two conflict cases under this scenario: (i) during turns when UAVs are following each other; and (ii) during merges into an edge. The first case of conflicts during turns is studied in this subsection. Note that even if two UAVs on a single edge are sufficiently separated initially, the spacing between them can decrease when making turns, e.g., for making edge-to-edge transitions at a node or on turns within a single edge. Therefore, the spacing between UAVs following each other on a turn edge needs to be sufficiently large to ensure conflict-free turns as shown in previous works for conflict resolution, e.g.,.15), 23) In particular, if two 14 uNet: A Scalable Low-Cost-UAV Traffic Network UAVs have the same speed V (m/s) on an edge, then two UAVs arriving on the edge, one following the other, are conflict-free during turns on the edge if they are separated in arrival time at the start of the edge by minimal time Tmin that satisfies, e.g., see Lemma 2 in,15)   dsep 1 1 Tmin = dmin = (2.26) V V cos(φ∗ /2) where φ∗ < π is the maximum turn angle between straight sections of the route and dmin is the minimal separation between UAVs along straight sections of the route, as shown in Fig. 6. This is formally stated in the following assumption. dmin φ U(1) U(2) U(3) dmin Fig. 6. UAVs, e.g., U (1), U (2) and U (3), need to be spaced by at least the minimal distance dmin in Eq. 2.26 when following each other on a turn of angle φ ≤ φ∗ to avoid conflicts. Assumption 5 (Constant-speed flight) The edges and transitions between the edges are considered to be straight segments and turn between these segments of angle φ less that the maximum turn angle of φ∗ . The speed of UAVs along all straight sections in the route network is a constant V m/s and scheduled time of arrivals (STAs) into each input location Li (·) in the route network will be spaced at least by the minimal time Tmin for conflict-free turns in Eq. 2.26. Moreover, the height h∗ [N ] of the conflict-free boundary cylinder in Assumption 2 is sufficiently large so that the edge-to-edge transition levels HN (·) are sufficiently separated hN ≥ dmin (2.27) to decouple potential conflicts due to multiple heading changes at different levels,15) and all levels can be contained inside the conflict-free boundary cylinder. Remark 7 (UAVs with different speeds) The spacing condition in Eq. 2.26 for conflict-free turns can be generalized to include UAVs with different speeds and turn dynamics, e.g., see spacing conditions developed in.24), 25) Other solutions, e.g., with variable speed UAVs, could include waiting for sufficient time just before arriving at each node to avoid conflicts with UAVs passing through the node that were scheduled earlier. However, the resulting wait-related delay could be avoided by the proposed de-conflicting approach using out-of-plane edge-to-edge transitions. 2.7. De-conflicted scheduling for merging into a shared edge A scheduling-based de-conflicting approach for the second case in the sharededge scenario, i.e., for conflicts between UAVs merging into a shared edge, is studied uNet: A Scalable Low-Cost-UAV Traffic Network 15 next. Consider two UAVs, say U (1) and U (2) transition from two different edges, say E N (1) and E N (2), in the set of edges E N into node N to the same edge, say E N (3) ∈ E N , out of node N . Then, there is potential for conflict at the intersection point aN (3) of the edge E N (3) with the the conflict-free boundary circle Bc [N ]. For example, consider two UAVs U (1) and U (2) transitioning from two different edges E 9 (1) = {10, 9} and E 9 (2) = {8, 9} into node N = 9 to the same edge E 9 (3) = {9, 5} out of node N = 9. Then, there is potential for conflict at the intersection a9 (3) = e of the output edge E 9 (3) with the the conflict-free boundary circle Bc [9], as in Fig. 7. In particular, conflict occurs if both UAVs U (1) and U (2) attempt to reach the location e at the same time. Conflict can be avoided if the arrival times te (1) and te (2) for the two UAVs U (1) and U (2), respectively, at location e of the edge {9, 5} out of the node 9 are sufficiently separated, i.e., |te (1) − te (2)| > dmin /V eb U(2) c 9 b {9,8} (2.28) 9b bb {8,9} = Tmin . a f e d {9,10} {10,9} U(1) {5,9} {9,5} Fig. 7. Example merge into a shared edge, based on Fig. 3(c). Potential for conflict when UAVs, say U (1) and U (2), transition from two different edges {10, 9} and {8, 9} to the same edge {9, 5} out of node N = 9. Remark 8 (Sufficency of de-conflicting at arrival points) Since the UAVs have the same travel speed V from Assumption 5, the spacing of arrivals of UAVs by the minimum time Tmin at any intersection point of an edge out of a node N with its conflict-free boundary circle Bc [N ] ensures that the UAVs remain separated, both before and after, as long as they continue to travel together along the same set of edges and nodes. Assumption 6 (Isolation from UAVs outside uNet) The uNet is sufficiently isolated and there are are no conflicts with UAVs in the uNet and other UAVs outside of the uNet, e.g., with UAVs prior to its arrival into the uNet at an intersection point in the set ALi (k) associated with node Li (k) and after its final departure from the UAV from an intersection point in the set ALf (k) associated with node Lf (k). At each intersection point aN (i) ∈ AN of edges associated with node N and its conflict-free boundary circle Bc [N ], let the associated UAV arrival times be taN (i) (k) such that taN (i) (k) < taN (i) (k + 1) for k < k + 1. Then, under Assumptions 1-6 and with the proposed de-conflicting scheme, there are no conflicts provided the arrival times of UAVs taN (i) (k) (at each intersection point aN (i) of each node N ) are 16 uNet: A Scalable Low-Cost-UAV Traffic Network sufficiently separated, i.e., (2.29) taN (i) (k + 1) − taN (i) (k) > Tmin . §3. Example conflict-free UAV scheduling The separation of arrival times at the intersection points A = S AN of edges N and conflict-free boundary circle Bc [N ] of each node N of the route network can be achieved using existing solutions to resource allocation problems. Scheduling for the proposed uNet is illustrated with the context-aware route planning (CARP), where a new agent selects a route and schedules the arrival time such that the new agent is conflict-free with respect to previous agents.16) Thus, CARP uses a first come first served (FCFS) approach, which is not necessarily optimal over all agents, but is typically considered fair, e.g., in conventional Air Traffic Management.5) 3.1. Example uNet Consider an example uNet, shown in Fig. 8 composed of four repetitions of the sNet S(1) in Fig. 2. Potential initial and final node locations Li and Lf , respectively, are to be selected from the set L L = {1, 2, 3, 7, 13, 14, 17, 20, 23, 24, 28, 33, 34, 37, 40, 42} (3.1) depicted by white circles in Fig. 8. The grid spacing of the route network in Fig. 8 is assumed to be 100m, which is a medium-sized city block, e.g., in Seattle.26) Since GPS with Wide Area Augmentation System (WAAS) can have positioning error of say 3 − 7m, ideally the minimal separation dsep between UAVs should be 6 − 14m. Given the five edge intersection at, say node 4, de-conflicting the edge-toedge transitions would require a separation of the UAV path into four paths at each level, e.g., as in Fig. 3. Assuming that all the paths are uniformly distributed, i.e., at angle 2π/5 from each other, this requires a maximum heading change of φ∗ = π − 2π/5 = 3π/5. Then the minimal separation between the UAVs is dmin = dsep /cos(φ∗ /2) = 10 − 23m from Eq. 2.26. The spacing between UAVs on the same route is assumed to be dmin = 20m. With a speed of say V = 4m/s (about a tenth of the maximum expected UAV speed27) ), the time spacing Tmin between UAV arrivals then needs to be Tmin = dmin /V = 5s. 3.2. Selection of UAV arrivals into uNet Simulations were performed to assess delays with the proposed FCFS scheduling approach. Note that the time needed to move across the eight grids of the example uNet in Fig. 8, with gridspacing of 100m and speed V = 4m/s is T8 = 25s. Updates of the uNet, i.e., when new UAVs are aliowed to enter were performed at a time interval of T∆ = 1s and time t was discretized as t[n] = n ∗ T∆ . (3.2) uNet: A Scalable Low-Cost-UAV Traffic Network 33 S(3) 42 S(4) 41 32 28 29 24 25 23 30 31 26 27 38 39 40 36 37 19 20 15 16 17 13 14 35 34 12 S(1) 22 S(2) 11 7 8 3 17 21 9 10 4 5 6 1 2 18 y (0,0) x Fig. 8. Example uNet, with four sNets S(1), S(2), S(3) and S(4). Boundaries of the sNets are denoted by red dashed lines. Potential initial and final locations of UAVs on the uNet (e.g., node 1) are depicted by white circles. Let a set of scheduled routes R(i), i = 1, 2, · · · , k − 1 be given at discretized time instant t[n]. Then a random number r[n] ∈ [0, 1] was selected and a new UAV U (k) was selected with an expected time of arrival ET A(k) = t[n] if the random number was less than a probability of arrival pa , i.e., r[n] ≤ pa . (3.3) The input location Li (k) and the final location Lf (k) for the UAV U (k) were chosen randomly from the set L Then, the scheduled time of arrival ST A(k) was found in a two step procedure: (i) select a minimal distance route R(k) from the input location Li (k) to the final location Lf (k) through the network; and (ii) select a conflict-free scheduled time of arrival ST A(k) ST A(k) ≥ ET A(k), (3.4) that is closest to the expected time of arrival ET A(k). The process of generating a random number at update time t[n] was repeated, e.g., for UAV U (k + 1) until the random number was larger than the probability of a UAV arrival, i.e., r[n] > pa resulting in no new UAVs. The update time was then incremented to t[n + 1]. Note 18 uNet: A Scalable Low-Cost-UAV Traffic Network that more than one UAV can have an expected time of arrival ETA of t[n]. The process was stopped when the number of UAVs in the system reached k = 1000. 3.3. Simulation results The delay D(k) = ST A(k) − ET A(k) for each UAV was found and is plotted as a function of the probability pa in Fig. 9 for a 1000 UAVs. In these simulations, the time of flight from the departure intersection point in AN (i) of a node N (i) to the arrival intersection point in AN (j) of another node N (j) was approximated by the distance between the two nodes. As expected, the delays tend to increase with probability of arrival pa . Delays can be reduced by using a smaller arrival time separation, e.g. for Tmin = 2s instead of for Tmin = 5s, as seen in Fig. 9. The average maximum delay, e.g., for arrival probability pa = 0.5 decreases by 87.3%, from 97.6s to 12.4s when the separation time is decreased from Tmin = 5s to Tmin = 2s. 200 200 (a) (a)Tmin Tmin==5s 5s 160 140 140 120 100 80 120 100 80 60 60 40 40 20 20 0 0 .1 .2 (b) Tmin = 2s 180 160 max delay (s) max delay (s) 180 .3 pa .4 .5 .6 0 0 .1 .2 .3 .4 .5 .6 pa Fig. 9. Maximum delays with seven simulation trials. Each trial simulation had 1000 UAVs and varying probability pa . Two different arrival time separations Tmin were used: left plot, Tmin = 5s; and right plot, Tmin = 2s; Substantial delays might not be acceptable to users. The simulation results indicate the effect of potential UAV conflict (e.g., the separation requirement) on delays. As the UAV density increases, or as the separation requirements get large, there can be a substantial impact on the delays in the system. Clearly, one approach to reduce delays is to increase precision of the UAV navigation system, i.e., decrease the arrival time spacing Tmin between UAVs, however, this can increase costs. Alternate approaches are to choose a set of possible routes R(k) consisting of more than one viable route for each UAV. Then, an optimal route R(k) ∈ R(k) can be selected to optimize other criteria such as minimal delay between expected time of arrival at the destination ET Ad (k) and scheduled time of arrival at the destination ST Ad (k). Note that a longer route (not energy optimal) might lead to a smaller delay at the destination. Other combinations of the energy cost (path length that can be approximated by ST Ad (k)−ST A(k)) and the delay at the destination ST Ad (k)−ET Ad (k) can be used to select a route R(k) from the set of acceptable routes R(k). Another uNet: A Scalable Low-Cost-UAV Traffic Network 19 approach to reduce delays is to modify the route network. If certain routes have high demand, additional routes could be added in parallel to these dense route or allow UAVs to bypass the congested areas. Similarly, direct higher-speed edges could be added between very high demand nodes to reduce the overall delay in the system. 3.4. Future work The implementation of the proposed uNet approach will require additional development and evaluation of protocols for emergencies. For example, If the UAV is not able to reach intermediate nodes in a specified time, e.g., due to uncertainties such as wind, routing is needed to land the UAV in a designated location, or the routing needs to be dynamically updated. Such emergency re-routing could be a pre-planned set of waypoints specific to each edge section in the route network. Moreover, sensors on-board the UAV could also check for battery life with planned stops for battery swaps for long-distance travel. Moreover, to ensure that the UAVs can meet the uNet requirements, certification protocols need to be established and testing facilities are needed to prove UAV viability before acceptance into the uNet. Finally, the evaluation of the proposed uNet approach for human factors issues is needed to ensure that human supervisors can monitor and maintain overall situational awareness of overall system. §4. Conclusions This article proposed a new Unmanned Aerial Vehicle (UAV) operation paradigm to enable a large number of relatively low-cost UAVs to fly beyond-line-of-sight. The use of an established route network for UAV traffic management was proposed to reduce the onboard sensing requirements for avoiding such obstacles and enable the use of of well-developed routing algorithms to select UAV schedules that avoid conflicts. Another contribution of this work was to propose a decoupling scheme for conflict-free transitions between edges of the route network at each node to reduce potential conflicts between UAVs and ensuing delays. A simulation example and an example first-come-first-served scheduling scheme was used to illustrate the uNet approach. References References 1) E. Frazzoli, Z.-H. Mao, J.-H. Oh, and E. Feron. Resolution of conflicts involving many aircraft via semidefinite programming. Journal of Guidance, Control, and Dynamics, 24(1):79–86, 2001. 2) L. Pallottino, E. M. Feron, and A. Bicchi. Conflict resolution problems for air traffic management systems solved with mixed integer programming. IEEE Trans. Intel. Trans. Sys., 3(1):3–11, Mar. 2002. 3) D.K. Schmidt. On modelling ATC workload and sector capacity. J. of Aircraft, 13(7), Jul 1976. 4) Milan Janić. A model of air traffic control sector capacity based on air traffic controller 20 uNet: A Scalable Low-Cost-UAV Traffic Network workload. Transportation Planning and Technology, 20(4):311–335, 1997. 5) H. Erzberger. Design principles and algorithms for automated air traffic management. AGARD Lecture Series No. 200, Knowledge-Based Functions in Aerospace Systems, San Francisco, November, 1995. 6) Caitlin Ailis Kenny. Unmanned Aircraft System (UAS) Delegation of Separation in NextGen Airspace. Master’s thesis, San Jose State University, San Jose, CA, 2013. 7) Andrew Lacher, Andrew Zeitlin, David Maroney, Kelly Markin, Duane Ludwig, and Joe Boyd. Airspace integration alternatives for unmanned aircraft. Proc. of the AUVSI Unmanned Systems Asia-Pacific 2010, Pan Pacific Hotel, Singapore, pages 1–19, 1 Feb 2010 2010. 8) Ling Qiu, Wen-Jing Hsu, Shell-Ying Huang, and Han Wang. Scheduling and routing algorithms for agvs: a survey. International Journal of Production Research, 40(3):745– 760, 2002. 9) N. Smolic-Rocak, S. Bogdan, Z. Kovacic, and T. Petrovic. Time windows based dynamic routing in multi-agv systems. Automation Science and Engineering, IEEE Transactions on, 7(1):151–155, Jan 2010. 10) S. Devasia and G. Meyer. Automated conflict resolution procedures for air traffic management. Proceedings of the 36th Conference on Decision and Control, Phoenix, AZ, pages 2456–2462, December 1999. 11) E. Besada-Portas, L. de la Torre, J. M. de la Cruz, and B. Andres-Toro. Evolutionary trajectory planner for multiple uavs in realistic scenarios. IEEE Transactions on Robotics, 26(4):619–634, Aug., 2010. 12) Peng Yang, Ke Tang, Jose A. Lozano, and Xianbin Cao. Path planning for single unmanned aerial vehicle by separately evolving waypoints. IEEE Transactions on Robotics, 31(5):1130–1146, October 2011. 13) Am Cho, Jihoon Kim, Sanghyo Lee, Sujin Choi, Boram Lee, Bosung Kim, Noha Park, Dongkeon Kim, and Changdon Kee. Fully automatic taxiing, takeoff and landing of a uav using a single-antenna gps receiver only. In International Conference on Control, Automation and Systems, 2007. ICCAS ’07, pages 821–825, Oct 2007. 14) Thomas W. Carnes. A low cost implementation of autonomous takeoff and landing for a fixed wing UAV. Master’s thesis, Virginia Commonwealth University, Richmond, Virginia, 2014. 15) S. Devasia, D. Iamratanakul, G. Chatterji, and G. Meyer. Decoupled conflict-resolution procedures for decentralized air traffic control. IEEE Trans. on Intelligent Transportation Systems, 12(2):422–437, June 2011. 16) Adriaan W. ter Mors, Cees Witteveen, Jonne Zutt, and Fernando A. Kuipers. Contextaware route planning. In Jrgen Dix and Cees Witteveen, editors, Multiagent System Technologies, volume 6251 of Lecture Notes in Computer Science, pages 138–149. Springer Berlin Heidelberg, 2010. 17) D. Bertsimas and S. S. Patterson. The traffic flow management rerouting problem in air traffic control: A dynamic network flow approach. Transportation Science, 34(3):239–255, Aug., 2000. 18) Steven L. Waslander, Robin L. Raffard, and Claire J. Tomlin. Toward efficient and equitable distributed air traffic flow control. Proc. of the American Control Conference, Minneapolis, Minnesota, USA, June 14-16, 2006, pages 5189–5194, 2006. 19) Avijit Mukherjee and Mark Hansen. A dynamic rerouting model for air traffic flow management. Transportation Research Part B, 43(1):159–171, 2009. 20) Cyril Allignol, Nicolas Barnier, Pierre Flener, and Justin Pearson. Constraint programming for air traffic management : a survey. The Knowledge Engineering Review, Elsevier, 27(3):361–392, 2012. 21) Jin Y. Yen. Finding the k shortest loopless paths in a network. Management Science, 17(11):712–716, July 1971. 22) Jonathan D. Stevenson, Siu O’Young, and Luc Rolland. Beyond line of sight control of small unmanned aerial vehicles using a synthetic environment to augment first person video. Procedia Manufacturing, 3:960–967, 2015. 23) J. Yoo and S. Devasia. On-demand conflict resolution procedures for air traffic intersections. IEEE Trans. on Intelligent Transportation Systems, 15(4):538–1549, August 2014. 24) J. D. Yoo and S. Devasia. Decoupled conflict resolution procedures for non-perpendicular uNet: A Scalable Low-Cost-UAV Traffic Network 21 air traffic intersections with different speeds. 52nd IEEE Annual Conference on Decision and Control (CDC), Florence, Italy, pages 275–280, December, 10-13 2013. 25) J. Yoo and S. Devasia. Provably safe conflict resolution with bounded turn rate for air traffic control. IEEE Trans. on Control Systems Technology, 21(6):2280–2289, November 2013. 26) Arnis Siksna. The effects of block size and form in North American and Australian city centers. Urban Morphology, 1, ISSN 1027-4278:19–33, 1997. 27) Federal Aviation Administration. Operation and certification of small unmanned aircraft systems. Docket No.: FAA-2015-0150; Notice No. 15-01, RIN 2120-AJ60, February 15, 2015.
3cs.SY
Practical Challenges in Explicit Ethical Machine Reasoning∗ Louise A. Dennis and Michael Fisher arXiv:1801.01422v1 [cs.AI] 4 Jan 2018 Department of Computer Science University of Liverpool, UK [email protected] and [email protected] Abstract We examine implemented systems for ethical machine reasoning with a view to identifying the practical challenges (as opposed to philosophical challenges) posed by the area. We identify a need for complex ethical machine reasoning not only to be multi-objective, proactive, and scrutable but that it must draw on heterogeneous evidential reasoning. We also argue that, in many cases, it needs to operate in real time and be verifiable. We propose a general architecture involving a declarative ethical arbiter which draws upon multiple evidential reasoners each responsible for a particular ethical feature of the system’s environment. We claim that this architecture enables some separation of concerns among the practical challenges that ethical machine reasoning poses. Introduction There has been an explosion of interest in Ethics and Artificial Intelligence as evidenced by several high profile initiatives considering the issue such as the IEEE Global Initiative on Ethics in Artificial Intelligence and Autonomous Systems and the BSI Standard 8611: Guide to the Ethical Design and Application of Robots and Robotic Systems. While these initiatives generally take a wide-ranging view of the subject considering everything from the deployment of autonomous weapons, the societal impact from the potential loss of jobs, to the privacy issues that result from big data and social media they also consider, as a topic, the implementation of ethical reasoning in machines, often referred to as machine ethics but which we will here refer to as ethical machine reasoning in order to highlight our consideration of computational reasoning about ethical issues. One of the key challenges facing the implementation of ethical machine reasoning is that no consensus exists on the nature of morality, the key moral values, how morals relate to ethical rules and how competing ethical rules can be decided between in specific contexts. We will refer to these issues as philosophical challenges facing the implementation of ethical machine reasoning. ∗ The work in this paper was supported by the EPSRC “Verifiable Autonomy” project (EP/L024845) In this paper we contend that there are a range of other challenges faced by ethical machine reasoning which would make it a challenging area of artificial intelligence even if the philosophical challenges were resolved. These practical challenges relate to questions of how ethical reasoning is to be implemented. They let us identify the implementation of ethical machine reasoning as a distinct sub-field of automated reasoning in general and demonstrate that it is not possible to satisfactorily implement ethical machine reasoning simply by taking pre-existing automated reasoning techniques and applying them to the ethical theory of your choice. In this paper we seek to understand the practical challenges that characterise machine ethics. We frame this understanding around the discussion of existing systems that claim to implement ethical reasoning and propose a general software architecture for ethical machine reasoning which would support a variety of solutions to these challenges. Survey of Ethical Machine Reasoning Implementations All machine reasoning systems can be viewed a ethical reasoning systems from some level of abstraction, so we here restrict ourselves to systems that are explicitly ethical in the sense of Moor (Moor 2006) (i.e., they reason explicitly about ethical concepts). There are few examples of such systems and we view the main ones here – our purpose in doing so is to highlight the practical issues faced by the implementation of ethical machine reasoning. Ethical Governors The first implementation of ethical machine reasoning is generally credited to Arkin et. al, of the Georgia Tech Mobile Robot Lab (Arkin, Ulam, and Duncan 2009; Arkin, Ulam, and Wagner 2012) who outline the architecture for an ethical governor for automated targeting systems for autonomous weapons. This governor was charged with ensuring that any use of lethal force was governed by the “Law of War”, the “Rules of Engagement” and was proportional. The governor was implemented as a separate module that intercepted signals from the underlying deliberative system and, where these signals involved lethality, would go through a process of evidential reasoning which amassed information about the situation in a logical form and would then reason about the evidence using constraints represented as prohibitions and obligations. If any prohibitions were violated or obligations unfulfilled then the proposed action would be vetoed. If no prohibition were violated then the governor would proceed to a “collateral damage” estimation phase and attempt to find a combination of weapon system, targeting pattern and release position that would maximise the likelihood of neutralising the target while minimising collateral damage. The authors note that “it is a major assumption of this research that accurate target discrimination with associated uncertainty measures can be achieved despite the fog of war” and the case studies they perform using their implementation are based on this assumption and provide appropriate information up front as part of the scenario. This initial work on ethical governors was then reimplemented in a new setting of healthcare (Shim and Arkin 2017). In this setting the ethical governor monitors not an underlying autonomous system but the interactions between a patient with Parkinson’s Disease and a caregiver. The reasoning behind such a monitoring system is that sufferers from Parkinson’s Disease frequently lose control of their facial musculature, this means that many non-verbal cues and interactions between patient and care-giver are lost which can result in stigmatisation between a caregiver and patient and a decrease in the quality of patient care. This ethical governor combines an evidential reasoner with a rule-based system (as opposed to a constraint reasoning system) but the basic architecture is the same. The evidential reasoner produces an assessment of the environment based on cues such as raised voices which are represented in a logical form. The rule-based system then reasons about this logical information in order to select appropriate intervening actions such as verbal interventions or indicative gestures. GenEth The GenEth system (Anderson and Anderson 2014) is designed as an ethical dilemma analyzer. Its purpose is twofold. Firstly, it demonstrates how input from professional ethicists can be used via a process of machine learning to create a principle of ethical action preference 1 which can be applied to situations in order to determine appropriate action. GenEth analyses a given situation in order to determine its ethical features (e.g., that harm may befall a patient in some healthcare scenario), these features then give rise to duties (to minimize or maximize that feature). The principle of ethical action preference is used to compare two op1 We note that the terminology of ethical principles is used widely but inconsistently throughout the literature. tions: each option is assigned a score for each relevant ethical feature, the difference between these two scores is then used by the principle which partitions the ndimensional space defined by the feature comparisons (one dimension for each feature) into regions using inequalities. Each partition of the space specifies which of the compared actions is to be preferred in that region so, for instance if the first action is significantly worse in terms of privacy than the second (e.g., the difference in their score on the privacy feature is greater than 2) but the second action is a little worse in terms of patient safety (e.g., the difference in their score is less than -1) then the partition might specify that the first action is to be preferred. Initially GenEth was implemented as a standalone system which was used to capture information from medical ethicists on decisions that should be made in particular, manually generated, scenarios. It has subsequently been connected as a decision-making component on top of a simulator for Nao robots (Anderson, Anderson, and Berenz 2016) and evaluated in scenarios where the robot must choose between six possible actions (such as charging itself, reminding a patient to take medication, and notifying an overseer of problems). These actions are evaluated on an ongoing basis using a principle which considers eight ethical features (honour commitments, maintain readiness, minimise harm, maximise good, minimise non-interaction, respect autonomy and maximise the prevention of immobility). GenEth is able to give explanations for its decisions in terms of its partition of the space – so it can state how two options compared on the various ethical features in its judgement and refer to the statement of the principle to then justify the subsequent choice. Ethical Consequence Engines Winfield et. al, of the Bristol Robotics Lab (Winfield, Blum, and Liu 2014; Vanderelst and Winfield 2016) have investigated systems based on the concept of an Ethical Consequence Engine. This consequence engine uses simulation to evaluate the impact of actions on the environment. In particular it simulates not just the actions of the robot itself but also simulates the activity of other agents in the environment, based on some simplifying assumptions about movement and intended destinations of humans and other robots. This allows the robot to determine not only if its actions have directly negative consequences (e.g., colliding with a person) but if they have indirectly negative consequences (e.g., failing to intercept a person who might otherwise come into danger). There are two versions of the ethical consequence engine system the first of which (Winfield, Blum, and Liu 2014) was implemented on e-Puck robots and evaluated all possible actions in the environment based on a discritization of the space of operation, while the second (Vanderelst and Winfield 2016) was implemented on Nao robots and used a sampling procedure to evaluate a specific sub-set of options. Each option is scored using various metrics such as the closeness of any humans to “danger”, the closeness of the robot to “danger” and the closeness of the robot to its goal. These metrics are then combined in a weighted sum and the highest scoring option chosen. The first of these systems was also verified (Dennis, Fisher, and Winfield 2015) in a process that involved converting the metric based evaluation of the robot actions into logic based reasoning over outcomes that compared the severity of the outcome and who suffered the concequences (human or robot). Ethan The Ethan system (Dennis et al. 2016a) was developed to investigate ethical decision making in exceptional circumstances with a particular emphasis on verifiability. In the Ethan system a rational agent, based on the Beliefs-Desires-Intentions model of agency (Rao and Georgeff 1995) was used to reason about the ethical risks of plans proposed by an underlying planning system. In this system the operation of reasoning in normal circumstances was assumed to be ethical by default (i.e., there was an assumption that appropriate ethical properties were guaranteed by a process of testing or verification of the decision-making process) but that in exceptional circumstances the system might need to make use of Artificial Intelligence techniques such as planning or learning which are inherently challenging to verification. (Dennis et al. 2016a) considers the case of a planning system that returns candidate plans to the agent which are annotated with any ethical principles2 impacted by the plan. The case study looked at scenarios involving unmanned aircraft and plans were annotated with the nature of any collisions that might take place or violations of the Rules of the Air. Ethan then reasoned using a context specific ethical policy which imposed an ordering on plans based upon the ethical principles they violated. Model Checking (Clarke, Grumberg, and Peled 1999) was then applied to the Ethan agent in order to verify a number of properties, including that the agent was programmed to correctly obey the specified ethical policy – i.e., that if it selected a plan that violated some ethical principle then this was only because all the other available options were worse. Observed Features We can observe a number of features both individually and jointly across these systems that begin to define the space of practical challenges that face systems seeking to implement explicit ethical reasoning. Multi-Objective While terminology across these systems is inconsistent we note that all of them operate on the assumption that the situation in which the system finds itself may have a 2 These can be considered broadly equivalent to GenEth’s ethical features. number of potential ethical impacts – whether these are referred to as ethical features, ethical principles, ethical constraints or by some other language. We will refer to these as ethical features for convenience. While we anticipate that in most everyday reasoning situations at most one ethical feature is at stake – i.e., in many cases none of the available options have particular ethical features (answering the front door, for instance) – in nearly all cases the point of the ethical reasoning is to limit goal-directed behaviour according to ethical considerations (though some of the systems treat goal-directed behaviour as an ethical feature expressed, for instance, as obedience to the human). However, consideration of ethical features rapidly leads to the conclusion that there will be situations where the system must somehow choose between them, as well as limiting goal-directed behaviour. So GenEth has its partitioning of the space that compares individual options according to their ethical features, Ethan has its context-dependent ethical policy while the Ethical Consequence Engine prioritises humans over robots, and within that the extent of the harm that may befall the agent. We note that this makes ethical reasoning inherently multi-objective which is a practical challenge to many techniques for controlling decision-making in machines. In particular this kind of reasoning is challenging for techniques that seek to maximize or minimize some value for while at a very abstract level we can say the point of ethical reasoning is to maximise human well-being (as suggested by (Dignum et al. 2017)) this is not a concept easily captured in a function. Instead abstract concepts such as well-being are concretized as ethical features – ethical machine reasoning then becomes about deciding what balance among these features is most likely to improve or preserve human wellbeing (or some equivalent abstract general value)3 . It is tempting to drop down to a lower level and utilise multi-objective optimisation (Miettinen 1998), but this works against many other features we require such as scrutability and verifiability. Heterogenous Evidential Reasoning The Ethical Governor systems are the only approaches that explicitly describe their architecture as consisting of first an evidential reasoner which translates sensory information into a logical form and then a second reasoner that makes a decision based upon the logical translation. However both GenEth and Ethan also take something approaching this form, assuming that information has been expressed in some logical or equational form for use by the system. Interestingly the case studies presented for all these systems either adopt very simple evidential reasoning mechanisms, or use some or3 We probably need to accept that in the absence of an agreed philosophical framework for morality, the best any feature-based reasoning can hope to achieve is choosing the right outcome most of the time. acle to provide information in an appropriate form and focus on the subsequent reasoning. While the ethical consequence engines do not use a logical expression of data, they too crucially involve an evidential reasoning phase by using a simulator to make predictions about the outcomes of actions. It is also clear, particularly in (Winfield, Blum, and Liu 2014) that although the simulation results are converted to metrics and then employed in a utility function it is envisaged that this captures logical-style reasoning about the severity of outcomes and the relative importance of humans and robots. The ethical consequence engines use simulation to make predications about safety outcomes, but it is easy to see that simulation is not effective in, for instance, establishing risks to human free will and autonomy and while simulations of information flows might be sufficient to determine privacy risks in social media settings, it is unlikely to be sufficient when considering information flow around smaller groups of people such as families and health workers. An ethical machine reasoning system operating on a complex set of ethical features will need to use a variety of heterogeneous mechanisms to perform evidential reasoning about the situation it finds itself in. The nature of this heterogeneous evidential reasoning appears to be a particularly under-explored aspect of ethical machine reasoning, even given the relative youth of the field and the small number of implemented systems. It is also of note that the ethical features considered by the ethical systems we survey vary wildly, sometimes within a given system – for instance the GenEth case study (Anderson, Anderson, and Berenz 2016) considers both “readiness” (which relates primarily to how much charge the robot has) and the far more abstract concept of “good” as ethical features. Ethan treats “Do not collide with people” and “Do not collide with aircraft” as distinct ethical features despite the fact that both are clearly related to safety. Understanding of what makes a suitable ethical feature, as an atomic concept for ethical machine reasoning and whether there is some heirarchy among these (e.g., safety is associated with features specifying whose safety), and the extent to which they need to be annotated with, for instance the degree of severity of the impact and the uncertainty about the outcome, is lacking and is a challenge that clearly has both practical and philosophical aspects. However, as a general observation, ethical machine reasoning must often perform complex reasoning in real time. Real Time In general it is desirable for a number of reasons that we should be able to understand how a machine reasons: for instance in order to predict its behaviour, and diagnose errors. However this is particular important where ethical reasoning is concerned. Indeed Moor’s classification of ethical machine agents specifies that explicit agents, such as we consider here, should be able to justify their choices (Moor 2006). While moral philosophy has reached no consensus about whether morality is absolute or relative and soci- Most of these systems have had to make some compromise with the real time aspects of ethical reasoning in machines. We note that this is not always the case. The ethical governor system that mediates between patient and care-giver has more time available for reasoning than does the ethical consequence engine must react quickly to prevent an accident and in general we can envisage advisory systems for committees of people that would have minutes rather than fractions of a second for deliberation. Proactivity Most of the implementations we have surveyed are reactive – i.e., their purpose is to veto or order plans/actions suggested by the underlying system. However several of them acknowledge a need for proactivity – the ability not only to veto plans but to suggest separate courses of action. This is most obvious in the Ethical Consequence Engine in which the whole point of the experiment is to divert the robot away from its goal-directed task for ethical reasons, but also in the intervening ethical governor which does nothing unless ethical considerations prompt an intervention. In the initial implementation of the ethical consequence engine (Winfield, Blum, and Liu 2014) the underlying engine suggested all possible alternatives to the governor via a discretization process. However the later version (Vanderelst and Winfield 2016) presented only a limited number of options for practical reasons – these options were generated by the underlying control system which was therefore clearly implicitly using ethical considerations in order to generate options for the ethical layer. Researchers at Bristol Robotics Lab are now seeking to have the ethical layer request options itself if those generated by the underlying controller are deemed insufficiently ethical4 and this would be the first concrete implementation of ethical proactivity in such systems. More generally, particularly in cases where the ethical principle of human free will is concerned, it may be necessary for an ethical reasoner to go through an information discovery process in order to determine the wishes of the persons it is interacting with and the strength of those wishes before deciding whether or not it is ethical to intervene. For instance, it is a well established principle that people should be allowed to smoke in their own homes but considerable societal resource is put into making sure they are aware of the risks associated with smoking. We might want a home-support robot to confirm that a home-owner was aware of the dangers of smoking but, if they were, to thereafter allow them to smoke without intervention. Scrutability 4 Paul Bremner, personal communication. etally determined, we view ethical machine reasoning as reasoning about circumstances where a systems actions may impact on the values of a community or individual. Moor refers to these as ethical impact agents. If some concept has attained the status of a moral value, then it has assumed a place of critical importance. Therefore, while people may accept (even if they are irritated) that their SatNav sometimes chooses strange routes without explanation, they are less likely to accept that some system has chosen to violate their privacy and can offer no explanation for why it did so. The ability to understand how a system has reached some decision is variously referred to as explainability or scrutability. There are a number of forms scrutability (Caminada et al. 2014) can take, from being able to inspect design/requirements documents that set out the rules of ethical behaviour the robot is following to the ability to extract an explanation from the robot after a decision that has been made to justify that decision or reconstruct the decision-making process after some problem arises (e.g., an ethical black box (Winfield and Jirotka 2017)). We see this need for scrutability in a number of the systems we survey. Both the ethical governors and GenEth can explicitly justify their reasoning and the use of BDI style agents in Ethan also points to this concern, since their reasoning is based upon logic programming, which in turn is based upon logical deduction using explicit rules. While such derivations can be complex to follow they are designed to mimic an account of human reasoning. implemented with such verifiability in mind. Architecture: Multiple Ethical Governors We propose a generic architecture for ethical reasoning shown in Figure 1. In this architecture an ethical arbiter reasons using evidence provided by a number of evidential reasoners each of which is customised to reason appropriately about some particular ethical feature of the domain. The underlying autonomous system communicates its options to the ethical arbiter, these options are assessed by the evidential reasoners which convert information about the options into a logical or equational form which the ethical arbiter then reasons over. The ethical arbiter then communicates the result of this reasoning back to the autonomous system. The arbiter itself should be declarative in na- Privacy Reasoner Safety Reasoner Dignity Reasoner Autonomous System Ethical Arbiter Politeness Reasoner Verifiability Figure 1: An Architecture for Ethical Machine Reasoning A key value in (arguably) all human societies is human well-being, which manifests ethically as considerations around human safety (among other things). Where a system is deemed to be safety critical we are used to requiring high standards of verification. We would argue that these considerations extend to ethically critical systems. If a value is of sufficient importance to a community to be considered a moral value then we should expect high standards of verification for any system with the potential to have a serious negative impact on that value. Since, as we have noted, it is beyond our capability to simply insist autonomous systems maximise human well-being we are instead forced to encode ethical reasoning as a set of rules and these sets of rules are likely to be complex – for instance even the fairly simple case study examined in (Anderson, Anderson, and Berenz 2016) partitions the space of options into 13 regions, each representing a different combination of the ethical features of a situation. There is therefore scope for error both in implementing a stated set of rules into a machine and expressing the rules so that they do indeed reflect our values. Both (Dennis, Fisher, and Winfield 2015) and (Dennis et al. 2016a) consider formal properties for machine ethics systems that can be checked by model-checking so long as the system itself has been ture (i.e. the programming should focus on expressing the logic of the computation as opposed to its control flow). Declarative programming supports scrutability at design time (since the program itself should focus on the outcomes of execution as opposed to how those outcomes are generated) and declarative programming paradigms in general also have better support for verification. Logic programs, BDI agents and constraint reasoners are all examples of declarative programs. One advantage we claim for this architecture is it allows us to allocate some of the challenges faced by ethical machine reasoning to different parts of the system. Scrutability and multi-objective reasoning are the preserve of the ethical arbiter, while real time concerns can be partitioned into those requiring real time evaluation of the situation (which is the concern of the evidential reasoners) and efficient declarative reasoning (the concern of the arbiter). The modularity also gives us the potential to verify the ethical reasoning itself separately (e.g., following the methodology in (Dennis et al. 2016b)) from any verification of the accuracy of the evidential reasoners. In Figure 1, we have included a “politeness reasoner”. This is because many of the considerations that apply to ethical machine reasoning we believe also apply to machine reasoning about social norms – in particular that such reasoning is multi-objective and needs to be proactive. It is therefore possible to imagine such an architecture being extended to cover more general normative reasoning as well as specifically ethical reasoning. Many design choices exist within this architecture such as whether the evidential reasoners and/or the arbiter can suggest or request new actions/plans; the nature of the evidence produced (which could potentially contain information pertaining to certainty, severity, who is impacted, how many people are impacted and so on); what constitutes an atomic ethical feature that grounds out reasoning; and so on. The architecture also allows rich or sparse logics to be used by the arbiter. Conclusion We here address the challenges posed by explicit ethical machine reasoning that are not related specifically to the philosophical uncertainty surrounding the subject matter. We have argued that explicit ethical machine reasoning faces challenges relating to its multi-objective nature, its frequent requirement for real time process, the heterogenous nature of the evidence it needs to reason about and challenges relating to its scrutability and verifiability. Taken together we believe these challenges make ethical machine reasoning a sub-field of interest not just to philosophers and those interested in formal reasoning about ethics but also to those interested in the implementation of machine reasoning in general. We have proposed a generic architecture (see also (Dennis and Fisher 2017)) which we consider suitable for explicit ethical machine reasoning which, among other things, modularises the ethical reasoning component and so allows some separation of the various challenges into distinct sub-systems, providing routes for tackling these problems. None of the challenges highlighted in this paper are solved by the architecture but it is our intention in future work to implement the architecture and use it as a vehicle for tackling the various practical challenges posed by explicit ethical machine reasoning. References [Anderson and Anderson 2014] Anderson, M., and Anderson, S. L. 2014. Geneth: A general ethical dilemma analyzer. In Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, AAAI’14, 253– 261. AAAI Press. [Anderson, Anderson, and Berenz 2016] Anderson, M.; Anderson, S. L.; and Berenz, V. 2016. A Value Driven Agent : Instantiation of a Case- Supported PrincipleBased Behavior Paradigm A Value Driven Agent : Instantiation of a Case-Supported Principle-Based Behavior Paradigm. In AAAI 2016 Workshop on AI, Ethics & Society. AAAI Press. [Arkin, Ulam, and Duncan 2009] Arkin, R.; Ulam, P.; and Duncan, B. 2009. An Ethical Governor for Constraining Lethal Action in an Autonomous System. Technical Report GIT-GVU-09-02, Mobile Robot Laboratory, College of Computing, Georgia Institute of Technology. [Arkin, Ulam, and Wagner 2012] Arkin, R.; Ulam, P.; and Wagner, A. 2012. Moral Decision Making in Autonomous Systems: Enforcement, Moral Emotions, Dignity, Trust, and Deception. Proceedings of the IEEE 100(3):571–589. [Caminada et al. 2014] Caminada, M. W. A.; Kutlák, R.; Oren, N.; and Vasconcelos, W. W. 2014. Scrutable Plan Enactment via Argumentation and Natural Language Generation. In Proc. International conference on Autonomous Agents and Multi-Agent Systems (AAMAS), 1625–1626. IFAAMAS/ACM. [Clarke, Grumberg, and Peled 1999] Clarke, E.; Grumberg, O.; and Peled, D. 1999. Model Checking. MIT Press. [Dennis and Fisher 2017] Dennis, L. A., and Fisher, M. 2017. Arbiters of Acceptable Behaviour. Under review. [Dennis et al. 2016a] Dennis, L.; Fisher, M.; Slavkovik, M.; and Webster, M. 2016a. Formal Verification of Ethical Choices in Autonomous Systems. Robotics and Autonomous Systems 77:1–14. [Dennis et al. 2016b] Dennis, L. A.; Fisher, M.; Lincoln, N. K.; Lisitsa, A.; and Veres, S. M. 2016b. Practical Verification of Decision-Making in Agent-Based Autonomous Systems. Automated Software Engineering 23(3):305–359. [Dennis, Fisher, and Winfield 2015] Dennis, L. A.; Fisher, M.; and Winfield, A. 2015. Towards Verifiably Ethical Robot Behaviour. In Proceedings of the AAAI Workshop on Artificial Intelligence and Ethics (1st International Workshop on AI and Ethics). IEEE Press. [Dignum et al. 2017] Dignum, V.; Baldoni, M.; Baroglio, C.; Caon, M.; Chatila, R.; Dennis, L.; Génova, G.; Kließ, M.; Lopez-Sanches, M.; Micalizio, R.; Pavón, J.; Slavkovik, M.; Smakman, M.; van Steenbergen, M.; Tedeschi, S.; van der Torre, L.; Villata, S.; de Wildt, T.; and Haim, G. 2017. Ethics by Design: necessity or curse? Under Review. [Miettinen 1998] Miettinen, K. 1998. Nonlinear Multiobjective Optimization, volume 12 of International Series in Operations Research & Management Science. Springer. [Moor 2006] Moor, J. H. 2006. The Nature, Importance, and Difficulty of Machine Ethics. IEEE Intelligent Systems 21(4):18–21. [Rao and Georgeff 1995] Rao, A. S., and Georgeff, M. P. 1995. BDI Agents: From Theory to Practice. Proceedings of the First International Conference on Multiagent Systems 95:312–319. [Shim and Arkin 2017] Shim, J., and Arkin, R. C. 2017. An Intervening Ethical Governor for a Robot Mediator in Patient-Caregiver Relationships. In Aldinhas Ferreira, M. I.; Silva Sequeira, J.; Tokhi, M. O.; E. Kadar, E.; and Virk, G. S., eds., A World with Robots: International Conference on Robot Ethics: ICRE 2015, 77–91. Springer International Publishing. [Vanderelst and Winfield 2016] Vanderelst, D., and Winfield, A. 2016. An Architecture for Ethical Robots inspired by the Simulation Theory of Cognition. Cognitive Systems Research. [Winfield and Jirotka 2017] Winfield, A., and Jirotka, M. 2017. The case for an ethical black box. In Towards Autonomous Robotic Systems. Springer. [Winfield, Blum, and Liu 2014] Winfield, A. F. T.; Blum, C.; and Liu, W. 2014. Towards and Ethical Robot: Internal Models, Consequences and Ethical Action Selection. In Mistry, M.; Leonardis, A.; Witkowski, M.; and Melhuish, C., eds., Advances in Autonomous Robotics Systems, volume 8717 of Lecture Notes in Computer Science, 85–96. Springer.
2cs.AI
Compressed Sensing by Shortest-Solution Guided Decimation Mutian Shen3 , Pan Zhang1 , and Hai-Jun Zhou1,2,4 1 arXiv:1709.08388v3 [eess.SP] 18 Dec 2017 Key Laboratory for Theoretical Physics, Institute of Theoretical Physics, Chinese Academy of Sciences, Beijing 100190, China 2 School of Physical Sciences, University of Chinese Academy of Sciences, Beijing 100049, China 3 School of the Gifted Young, University of Science and Technology of China, Hefei 230026, China 4 Synergetic Innovation Center for Quantum Effects and Applications, Hunan Normal University, Changsha, Hunan 410081, China (Dated: 25 September, 2017 (version 1); 05 October, 2017 (version 2); 18 December, 2017 (version 3)) Compressed sensing is an important problem in many fields of science and engineering. It reconstructs signals by finding sparse solutions to underdetermined linear equations. In this work we propose a deterministic and non-parametric algorithm SSD (Shortest-Solution guided Decimation) to construct support of the sparse solution under the guidance of the dense least-squares solution of the recursively decimated linear equation. The most significant feature of SSD is its insensitivity to correlations in the sampling matrix. Using extensive numerical experiments we show that SSD greatly outperforms `1 -norm based methods, Orthogonal Least Squares, Orthogonal Matching Pursuit, and Approximate Message Passing when the sampling matrix contains strong correlations. This nice property of correlation tolerance makes SSD a versatile and robust tool for different types of real-world signal acquisition tasks. I. INTRODUCTION Real-world signals such as images, voice streams and text documents are highly compressible due to their intrinsic sparsity. Recent intensive efforts from diverse fields (computer science, engineering, mathematics and physics) have established the feasibility of merging data compression with data acquisition to achieve high efficiency of sparse information retrieval [1, 2]. This integrated signal processing framework is called compressed sensing or compressed sampling [3–5]. At the core of this sampling concept is an underdetermined linear equation involving an M ×N real-valued matrix D Dh = z . (1) (Throughout this paper we use uppercase and lowercase bold letters to denote matrices and vectors, respectively.) The column vector h ≡ (h1 , h2 , . . . , hN )T is to be determined, while the column vector z ≡ (z1 , z2 , . . . , zM )T is the result of M sampling operations (measurements) on a hidden signal h0 ≡ (h01 , h02 , . . . , h0N )T ; in matrix form, this is z ≡ Dh0 . (2) The vector h0 is called a planted solution of (1). Given a matrix D and an observed vector z, the task is to reconstruct the planted solution h0 . The sampling process (2) has compression ratio α ≡ M 0 N < 1. If the number Nnz of non-zero entries in h exceeds M , some information must be lost in compression and it is then impossible to completely recover h0 from z. However, if the sparsity ρ ≡ NNnz is sufficiently below the compression ratio (ρ < α), h0 can be faithfully recovered by treating (1) as the sparse representation problem of obtaining a solution h with the least number of non-zero entries [6, 7]. As `0 -norm minimization is intractable, many different heuristic ideas have instead been explored for this sparse recovery task [1, 7]. These empirical methods form three major clusters: greedy deterministic algorithms for `0 -norm minimization, convex relaxations, and physics-inspired message-passing methods for approximate Bayesian inference. Representative and most popular algorithms of these categories are Orthogonal Least Squares (OLS) and Orthogonal Matching Pursuit (OMP) [8–17], `1 -norm based methods [3, 6, 18–21], and Approximate Message Passing (AMP) [22, 23], respectively. (In statistical physics the AMP method is known as the Thouless-Anderson-Palmer equation [24].) To achieve good reconstruction performance, these algorithms generally assume the sampling matrix D to have the restricted isometric property (RIP) [25]. This requires D to be sufficiently random, uncorrelated and incoherent, which is not necessarily easy to meet in real-world applications. In many situations the matrix D is intensionally designed to be highly structured. For instance, D in the closely related dictionary learning problem often contains several complete sets of orthogonal base vectors to increase the representation capacity, leading to considerable correlations among the columns [6, 18]. An efficient and robust algorithm applicable for correlated sampling matrices is highly desirable. In this work we introduce a simple deterministic algorithm, Shortest-Solution guided Decimation (SSD), that is rather insensitive to the statistical property of the sampling matrix D. This algorithm has the same structure as the celebrated OLS and OMP algorithms [8–13]. It selects a single column of D at each iteration step. The most significant difference is on how to choose the matrix columns: While OLS and OMP select the column that having the largest magnitude of (rescaled) inner product with the residual of vector z, SSD selects a column under the guidance of the dense least-squares (i.e., shortest 2 Euclidean-length) solution of the decimated linear equation. SSD exploits the left- and right-singular vectors of the decimated sampling matrix. On random uncorrelated matrices SSD works better than OLS, OMP and `1 -norm based methods; it is slightly worse than AMP which for uncorrelated Gaussian matrices is proven to be Bayes-optimal under correct priors [22, 26]. A major advantage of SSD is that it does not require the sampling matrix to satisfy the RIP condition. Indeed we observe that the performance of SSD on highly correlated matrices remains the same even when `1 -norm based methods, OLS and OMP, and AMP all fail completely. This remarkable feature makes SSD a versatile and robust tool for different types of practical compressed sensing and sparse approximation tasks. II. THE GENERAL DENSE SOLUTION When the number M of constraints is less than the number of degrees of freedom N (α < 1), the linear equation (1) has infinitely many solutions and most of them are dense (all the entries of h are non-zero). To gain a geometric understanding on the general (dense) solution, we first express the sampling matrix in singular value decomposition (SVD) [27] as D = U ΛV T . Here U is an M×M orthonormal matrix; Λ is an M×N diagonal matrix whose diagonal elements are the M non-negative singular values λ1 ≥ λ2 ≥ . . . ≥ λM ; and V is an N×N orthonormal matrix. The columns of U ≡ (u1 , u2 , . . . , uM ) form a complete set of unit base vectors for the M -dimensional real space, so the vectors uµ ≡ (uµ1 , uµ2 , . . . , uµM )T satisfy huµ , uν i = δµν . Here and in following discussions ha, bi denotes theP inner product of two vectors a and b (e.g., huµ , uν i ≡ i uµi uνi ); and δµν is the Kronecker symbol, δµν = 0 for µ 6= ν and δµν = 1 for µ = ν. Similarly, the orthonormal matrix V ≡ (v 1 , v 2 , . . . , v N ) is formed by a µ T complete set of unit base vectors v µ ≡ (v1µ , v2µ , . . . , vN ) µ ν ν for the N -dimensional real space, with hv , v i = δµ . Expanding the vector z as a linear combination of base vectors uµ , we obtain the following expression for the general solution of (1): h=g+ N X ν cν v . (3) ν=M +1 Each of the N−M coefficients cν is a free parameter that can take any real value; g ≡ (g1 , g2 , . . . , gN )T is a column vector uniquely determined by z: g= M X µ=1 Θ(λµ ) hz, uµ i µ v ≡ D+ z , λµ (4) where Θ(x) is the Heaviside function, Θ(x) = 1 for x > 0 and Θ(x) = 0 for x ≤ 0; D + is the (Moore-Penrose) pseudo-inverse of D [27]. We call g the guidance vector. We will rank the N entries of g in descending order of 3 2 g r 1 N FIG. 1: Geometric interpretation on the general solution h in (3). The guidance vector g ≡ (g1 , . . . , gN )T lies within an M -dimensional subspace; the remainder vector r lies within the (N −M )-dimensional null space of matrix D signified by the elliptic shaded area, which is perpendicular to g. Each dashed line represents one of the N coordinate axes. In this schematic figure g1 has the largest magnitude among all the entries of g, so the leading index l is l = 1. The sparsest solution of (1) is very likely to have large projection on the leading coordinate axis l but is unlikely to have zero projection on this axis l. Filled circular and square points are examples of likely and unlikely sparse solutions, respectively. their magnitude, and the index l ∈ {1, 2, . . . , N } of the maximum-magnitude entry gl of g will be referred to as the leading index. The guidance vector g is perpendicular to all the basePvectors v ν with ν > M . The remainder term r ≡ ν>M cν v ν of the general solution (3) therefore is perpendicular to g. A simple geometric interpretation of (3) is illustrated in Fig. 1: the solution h can move freely within the (N − M )-dimensional subspace (called the null space or kernel of D) spanned by the base vectors v ν with ν > M ; this subspace is perpendicular to the guidance vector g, which itself is a vector within the M -dimensional subspace spanned by the base vectors v µ with µ ≤ M . Notice that the guidance vector g is nothing but the shortest Euclidean-length (i.e., least squares) soluqP 2 tion [27]. That is, the `2 -norm ||g||2 ≡ j gj achieves the minimum value among all the solutions of (1). This is easily proved by setting all the coefficients cν of (3) to zero. We may therefore compute g by the LQ decomposition method which is more economic than SVD. The sampling matrix is decomposed as D = LQT , with Q ≡ (q 1 , q 2 , . . . , q M ) being an N × M orthonormal matrix (the columns q µ satisfying hq µ , q ν i = δµν for µ, ν ∈ {1, . . . , M }) and L being an M × M lowertriangular matrix. The guidance vector g is then a linear combination of the unit vectors q µ : g= M X aµ q µ , (5) µ=1 and the coefficient vector a ≡ (a1 , . . . , aM )T is eas- 3 where β ≡ (β1 , β2 , . . . , βM )T is a column vector of M Lagrange multipliers βi [28]. We can employ a simple iterative method of dual ascent: g β (t) (t+1) T (t) , +ε (t) =D β =β (t) (7a) z − Dg (t)  . (7b) At each iteration step t = 0, 1, . . . the updating rate parameter ε(t) is set to an optimal value to minimize the convergence time, see Appendix A for the explicit formula. III. THE GUIDANCE VECTOR AS A CUE The guidance vector g is dense and it is not the planted solution h0 we are aiming to reconstruct. But, does the dense g bring some reliable clues about the sparse h0 ? Because the observed vector z encodes the information of h0 through (2), we see that g= M X hh0 , v µ iv µ ≡ P h0 . (8) µ=1 Here the N × N matrix P is a projection operator: P ≡ M X µ µ T ), ) (v1µ , v2µ , . . . , vN (v1µ , v2µ , . . . , vN (9) µ=1 which projects h0 to the subspace spanned by the first M base vectors v µ (1 ≤ µ ≤ M ) of matrix V . A diagonal PM entry of P is Pii = µ=1 (viµ )2 , while the expression for PM an off-diagonal entry is Pij = µ=1 viµ vjµ . Notice that, had the summation in (9) included all the N base vectors, P would have been the identity matrix (Pij = δij ), and then g would have been identical to h0 . Because only M base vectors are included in (9) the non-diagonal entries of P no longer vanish, but their magnitudes are still markedly smaller than those of the diagonal entries. Since v µ is a unit vector we may expect that viµ ≈ ± √1N , then we estimate Pii ≈ M N = α. We may also expect that viµ and vjµ are largely independent √ of each other, then we get that Pij ≈ ± NM (with roughly equal probability to be positive or negative). Let us now focus on one entry gi of g. According to (8) X (a) (b) gi = Pii h0i + Pin h0n ≡ gi + gi . (10) n6=i 0.5 1 (a) |gl| 0.4 (c) 0.3 0.8 N = 10,000 0.2 N = 1,000 0.1 p1 0.6 1 (b) 0.8 0.6 ρ = 0.20 0.4 ρ = 0.10 0.2 ρ = 0.05 f ily fixed by solving the lower-triangular linear equation La = z. The least-squares solution g can also be obtained through convex minimization with the following cost function  1 2 g + β T z − Dg , (6) 2 0 1 0.4 0.2 10 100 rank 1000 0 0 0.04 0.08 0.12 0.16 0.20 ρ FIG. 2: The guidance vector g reveals which entries of the planted solution h0 are most likely to be non-zero. Results are obtained on Gaussian matrices D with compression ratio α = 0.2. (a): Rank curves for three guidance vectors of three h0 samples containing ρN non-zero entries with ρ = 0.05, 0.1 and 0.2, respectively (N = 103 ). The entries gi of g are ranked according to their magnitudes; the corresponding curves in (b) show the fractions f (n) of non-zero entries of h0 among the n top-ranked indexes i. (c): Probability p1 of h0l being non-zero (l being the leading index of g). p1 is evaluated over 104 random h0 samples, each of which containing ρN nonzero entries uniformly distributed in (−1, +1), withN = 103 (plus symbols) or N = 104 (cross symbols). As a comparison, the dashed line shows the probability of an entry of h0 being non-zero if it is chosen uniformly at random among all the N entries. Because h0 is a sparse vector with only ρN non-zero (b) entries, the summation in the above expression (gi ) contains only ρN terms. Neglecting the possible weak (b) correlations among the coefficients Pq ≈ in , we get gi √ √ P √ N M 1 0 2 ± N ρN a0 = ± αρa0 , where a0 ≡ ρN i=1 (hi ) is the rooted square mean value of the non-zero entries of (b) h0 . Notice that gi does not depend much on the index i and it is of the same order as the first term of (10), (a) which is gi ≈ αh0i . For the leading index l of g, since gl must have the maximum magnitude among all the entries gi , we expect (a) (b) that gl will have the same sign as gl and it will have considerably large magnitude. It then follows that h0l is very likely to be non-zero and also that |h0l | & a0 . The above theoretical analysis suggests that the vector g is very helpful for us to guess which entries of the planted solution h0 have large magnitudes. The validity of this theoretical insight has been confirmed by our numerical simulation results (Fig. 2). We find that indeed the guidance vector g contains valuable clues about the non-zero entries of h0 . If an index i is ranked on the top with respect to the magnitude of gi , the corresponding value h0i has a high probability to be non-zero (Fig. 2a and 2b). This is especially true for the leading index l of g. We also observe that, both for ρ < α and for ρ ' α, the probability of h0l being non-zero becomes more and more close to unity as the size N increases (Fig. 2c). This indicates the cue offered by g is more reliable for larger-sized compressed sensing problems. Building on the theoretical insights of (8) and (10), we 4 now propose a simple algorithm for solving equation (1). IV. SHORTEST-SOLUTION GUIDED DECIMATION (SSD) Let us denote the sampling matrix as a collection of column vectors dµ , i.e., D ≡ (d1 , d2 , . . . , dN ). With respect to the leading index l of g the linear equation (1) is rewritten as X hl dl + hµ dµ = z . (11) µ6=l Therefore, if all the other N −1 entries hµ of the vector h are known, hl is uniquely determined as hl = X hdµ , dl i hz, dl i − hµ l l . l l hd , d i hd , d i 1 M PM i=1 |zi | >  do . decimation 1. Get the least-squares Psolution g = {gµ : µ ∈ Φ} for the linear equation µ∈Φ gµ dµ = z. 2. Get leading index l of g by criterion |gl | ≥ |gµ | (∀µ ∈ Φ); then delete index l from set Φ. 3. Deposit to stack T the linear equation for hl : X hz, dl i hdµ , dl i − h . µ hdl , dl i µ∈Φ hdl , dl i 4. Update dµ (for every µ ∈ Φ) and z as: \l Bh = y . (13) B ≡ (b1 , . . . , bl−1 , bl+1 , . . . , bN ) is an M × (N−1) matrix decimated from D with its column vectors bµ being (µ 6= l) . (14) hz, dl i l d . hdl , dl i z←z− hdµ , dl i l d , hdl , dl i µ∈Φ hz, dl i l d . hdl , dl i end while Set hµ = 0 for every µ ∈ Φ. while Stack T 6= ∅ do . backtrack 1. Solve the top equation of stack T . end while (15) This residual vector y and all the decimated column vectors bµ are perpendicular to dl . Equation (13) has the identical form as the original linear problem (1). If y is a zero vector, we can simply set h\l to be a zero vector too and then a solution h with a single non-zero entry hl is obtained by (12). On the other hand if the residual y is non-zero, we can obtain the shortest Euclidean-length (least squares) solution of (13) as the new guidance vector. (If we adopt the dual ascent method (7) for this task, it is desirable to start the iteration from the old guidance vector to save convergence time.) A new leading index (say m) will then be identified, and the corresponding entry hm is expressed by the remaining N −2 entries of h as X hy, bm i hbµ , bm i − h . µ hbm , bm i hbm , bm i dµ ← dµ − 2. Pop the top equation out of stack T . The M -dimensional vector y is the residual of z: hm = while (12) Let us denote by h\l ≡ (h1 , . . . , hl−1 , hl+1 , . . . , hN )T the vector formed by deleting hl from h. This vector must satisfy the following linear equation y≡z− Input: M × N matrix D ≡ (d1 , d2 , . . . , dN ); M dimensional vector z; index set Φ = {1, 2, . . . , N }; convergence threshold  (set to be 10−8 ); stack T of linear equations (initially T = ∅). Output: solution vector h = (h1 , h2 , . . . , hN )T . hl = µ6=l hdµ , dl i bµ ≡ d µ − l l d l hd , d i Algorithm 1 Shortest-Solution guided Decimation (SSD) for the compressed sensing problem Dh = z. (16) µ6=l,m This Shortest-Solution guided Decimation (SSD) process will terminate within a number K of steps (K ≤ M ). We will then achieve a unique solution for the K selected entries hl , hm , . . . by backtracking the K derived equations such as (16) and (12), setting all the other N −K entries of h to be exactly zero. This solution h will have at most K non-zero entries. We provide the pseudo-code of SSD in Algorithm 1 and the corresponding MATLAB code in Appendix B. The longer C++ implementation is provided at power.itp.ac.cn/~zhouhj/codes.html. An an illustration, we show in Fig. 3 the traces of two SSD processes obtained on a 2000×10000 Gaussian matrix D for two planted solutions h0 with 600 non-zero entries. We see that the leading index l is not always reliable, sometimes the true value of h0l is actually zero. But the SSD algorithm is robust to these guessing mistakes. As long as the number of such mistakes is relatively small they will all be corrected by the backtrack process of Algorithm 1 (Fig. 3a and 3b). But if these guessing mistakes are too numerous (Fig. 3c and 3d), the backtrack process is unable to correct all of them and the resulting solution h will be dense. For Algorithm 1 to be successful, the only requirement is that the indexes of all the non-zero entries of h0 are removed from the working index set Φ in no more than M steps. If this condition is satisfied the backtrack process of the algorithm will then completely recover the planted solution h0 . The SSD algorithm has the same structure as the greedy OLS [8] and OMP [10, 11] algorithms. By care- 5 1 1 (a) 0.8 0.6 |h0l| |h0l| 0.6 0.4 0.2 0.2 0 12 12 (b) 10 (d) 10 8 ||z||1 8 ||z||1 0.4 0 6 6 4 4 2 2 0 V. 0 100 200 300 400 500 600 0 COMPARATIVE RESULTS (c) 0.8 0 decimation step 400 800 1200 1600 2000 decimation step FIG. 3: Two traces of the SSD process on a single Gaussian matrix with M = 2000 rows and N = 10000 columns. The planted solutions h0 for the left [(a), (b)] and right [(c), (d)] columns are different, but they both have the same number Nnz = 600 of non-zero entries (each of them is an i.i.d random value uniformly distributed within (−1, 1)). The horizontal axis denotes the step of the decimation. |h0l | is the l-th entry of h0 with l being P the identified leading index at this decimation step. ||z||1 = M i=1 |zi | is the `1 -norm of the residual signal vector z. For the left column, the decimation stops after K = 629 steps with all the non-zero entries of h0 being identified (the 29 mistakes are then all corrected by the followed backtrack process). For the right column, the decimation stops after K = 1948 steps with only 374 non-zero entries of h0 being identified (the followed backtrack process reports a solution that is dramatically different from h0 ). fully comparing these three algorithms we realize that they differ only in how to construct the guidance vector g. At the beginning of the n-th decimation step (n = 0, 1, . . .) the updated sampling matrix D has dimension M ×(N − n). Then OMP simply sets g = D T z so the µ-th entry is gµ = hz, dµ i, where dµ is the µ-th column of the current matrix D and z is the current residual vector. In OLS, gµ is computed by a slightly µ i . In SSD, g is the leastdifferent expression gµ = √hz,d µ µ We now test the performance of SSD on sparse reconstruction tasks involving both uncorrelated and correlated sampling matrices. As the measure of correlations max we consider the condition number Q ≡ λλmin , which is the ratio between the maximum (λmax ) and the minimum (λmin ) singular value of the sampling matrix D. An uncorrelated matrix has condition number Q ≈ 1, while a highly correlated or structured matrix has condition number Q  1. Notice that the RIP condition is severely violated for matrices with large Q values. Two types of sampling matrix are examined in our simulations: Gaussian: Each entry of the matrix is an identically and independently distributed (i.i.d) random real value drawn from the Gaussian distribution with mean zero and unit variance. Every two different columns dµ and dν of such a random matrix are almost orthogonal to 1 each other; that is, M hdµ , dν i ≈ √1M . The condition number Q of a Gaussian matrix is close to 1, and the RIP condition is satisfied. Correlated: The matrix D is obtained as the product of an M × R matrix D1 and a R × N matrix D2 , so D = D1 D2 . Both D1 and D2 are Gaussian random matrices as described above. As the rank number R approaches M from above, the entries in the composite matrix D are more and more correlated and the condition number Q increases quickly. The planted solutions h0 are sparse random vectors with a fraction ρ of non-zero entries. The positions of the ρN non-zero entries are chosen completely at random from the N possible positions. Two types of planted solutions (Gaussian or uniform) are employed. The non-zero entries of h0 are i.i.d random real values drawn from the Gaussian distribution with mean zero and unit variance or from the uniform distribution over (−1, +1), for the Gaussian-type and uniform-type h0 , respectively. The relative distance ∆ between h0 and the reconstructed solution h is defined as ∆≡ ||(h − h0 )||2 . ||h0 ||2 (17) hd ,d i squares solution of Dg = z, so g = D + z according to (4). After the leading index l of g is determined, these algorithms then modify D and z by the same rule (see the two equations in step-4 of the while loop of Algorithm 1). The total number of arithmetic operations performed in the n-th decimation step is approximately 6M (N −n) for OMP and 8M (M − n) for OLS; and for SSD this number is approximately 4(L + 1)M (N − n) if we use L repeats of the iteration (7) to update g. It may be reasonable to assume L ≤ 10, then SSD is roughly 5–7 times slower than OMP and OLS. On the other hand, the results in the next section will demonstrate that the guidance vector of SSD is much better than those of OMP and OLS, especially on correlated sampling matrices. If this relative distance is considerably small (that is, ∆ ≤ 10−5 ), we claim that the planted solution h0 has been correctly recovered by the algorithm. We fix the compression ratio to α = 0.2 in the numerical experiments. Two different values of N are considered, N = 103 and N = 104 . Many heuristic algorithms have been designed to solve the compressed sensing problem. Here we choose four representative algorithms for the comparative study, namely Minimum `1 -norm (ML1), OLS, OMP, and AMP. The algorithm ML1 tries to find a solution of (1) with PN minimized `1 -norm i=1 |hi |. Here we use the MATLAB toolbox L1 MAGIC [29]. The stop criterion for the primal-dual routine of this code is set to be pdtol = 10−3 6 1 (c) 0.8 0.4 0.4 ML1 N=104 0.2 ML1 N=103 0 (b) (d) 0 0.02 0.04 ρ 0.06 0.08 0.6 0 0 0.02 0.04 0.06 SSD N=104 0.03 0.05 ρ FIG. 4: Comparing the SSD and ML1 algorithms on two Gaussian sampling matrices D with compression level α = 0.2 (N = 103 and 104 , respectively). Left column [(a), (b)] and right column [(c), (d)] correspond to Gaussian-type and uniform-type planted solutions h0 , respectively. Each data point is obtained by averaging over 100 samples of h0 with the same sparsity ρ. In (a) and (c), s is the fraction of successfully reconstructed solutions among the 100 input h0 samples. Correspondingly, ∆ in (b) and (d) is the relative distance (mean and standard deviation) between h0 and the reconstructed solution h. The performance of SSD on Gaussian sampling matrices is compared with those of ML1 (Fig. 4), OLS and OMP (Fig. 5), and AMP (Fig. 6). Our simulation results demonstrate that, at fixed compression ratio α the transition between successful and unsuccessful reconstruction becomes sharper as N increases. At N = 104 and α = 0.2, when the planted solutions are Gaussian-type, SSD can successfully reconstruct the planted solutions with high probability (e.g., success rate s > 50%) if the signal sparsity is ρ ≤ 0.078. The corresponding values for ML1, OLS and OMP, and AMP are, respectively, ρ ≤ 0.04, 0.07 and 0.093. When the planted solutions are uniform-type, SSD can successfully reconstruct at sparsity ρ ≤ 0.067. The corresponding values for ML1, OLS and OMP, and AMP are, respectively, ρ ≤ 0.045, 0.065 and 0.079. It is encouraging to observe that SSD achieves much better performance than the `1 -norm based ML1. In comparison with ML1, the SSD algorithm is closer to `0 -norm minimization since it tries to find the non-zero entries of h0 but does not care about the magnitude of 0 0.02 0.04 0.06 0.08 ρ 1 1 (a) 0.8 (c) 0.8 0.6 0.6 0.4 0.4 AMP N=104 SSD N=104 0.2 AMP N=103 0 SSD N=103 0 (b) 0.8 (d) 0.8 ∆ 0.6 ∆ 0.6 0.4 0.4 SSD N=104 0.2 0 0.02 AMP N=104 0.2 SSD N=103 0.04 0.06 ρ Gaussian sampling matrix 0.09 OMP N=103 FIG. 5: Comparing the performances of SSD with OLS and OMP on Gaussian random matrices. The matrices and the planted solutions are the same as those used in Fig. 4. OLS has almost identical performance as OMP, so in (b) and (d) the standard deviations of the OLS results are not marked. 0 A. 0.07 0 3 ρ 0.2 following the literature. The OLS and OMP algorithms are implemented according to [8, 12, 13]. The AMP algorithm is implemented according to [22, 23]. The GaussBernoulli prior is assumed for the planted solution h0 in the AMP algorithm as in [22, 23], and the sparsity ρ of h0 is revealed to AMP as input. OLS N=10 OMP N=104 0.2 SSD N=103 0 0.01 0.08 OLS N=104 0.4 0.2 ML1 N=103 (d) 0.8 s 0 0.2 SSD N=103 (b) ∆ ∆ ∆ 0.2 SSD N=103 0 0.4 ML1 N=104 SSD N=104 0.2 OMP N=103 0.6 0.4 SSD N=104 0.4 OMP N=104 0.8 0.6 0.4 0.6 0 0.8 0.6 OLS N=103 0.2 SSD N=103 0 0.8 OLS N=104 0.4 s 0.2 SSD N=104 (c) 0.8 0.6 s s 0.6 s 0.6 1 (a) 0.8 s 1 (a) ∆ 1 0.8 0.08 0.1 0 AMP N=103 0 0.02 0.04 0.06 0.08 0.1 ρ FIG. 6: Comparing the performances of SSD and AMP on Gaussian random matrices. The matrices and the planted solutions are the same as those used in Fig. 4. these entries. The SSD algorithm slightly outperforms OLS and OMP on the Gaussian matrices. Because the different columns of a Gaussian random matrix D are almost orthogonal to each other, the pseudo-inverse D + does not differ very much from the transpose D T . This could explain why SSD only weakly improves over OLS and OMP. Similar small improvements of SSD over OLS and OMP are observed on uniform sampling matrices whose entries are i.i.d real values uniformly distributed in (−1, +1). These comparative results suggest that the SSD iteration process makes less guessing mistakes than the OLS and OMP iterations do. The AMP algorithm performs considerably better than SSD on the Gaussian matrices (Fig. 6). This may not be surprising since AMP is an global optimization approach. Compared with SSD, the AMP algorithm also takes more additional information of h0 as input, includ- 7 10 SSD 30 8 1 OMP 10 (a) hi ||z||2 ∆ 6 ∆ 6 20 4 0 4 SSD 2 -1 -1 0 0 2 1 hi0 SSD 2 0 2 10 (b) 8 (c) 1.5 (d) 1.5 50 100 150 200 1 ∆ 0 ∆ 0 1 decimation step OLS 0.5 FIG. 7: Comparing SSD and OMP on a single correlated measurement matrix D with N = 1000 columns and M = 280 rows. The protocol of generating this matrix is described in the main text. The planted solution h0 is a uniform-type random sparse vector with Nnz = 50 non-zero entries. The main figure shows how the `2 -norm ||z||2 of the residual signal vector z changes with the decimation step (plus points, SSD results; cross points, OMP results). The inset compares the entries h0i of the planted solution h0 and the corresponding entries hi of the recovered solution h. ing its sparsity level ρ and the probability distribution of its non-zero entries, which may not be available in some real-world applications. B. Correlated sampling matrix Although SSD in comparison with AMP does not give very impressive results on Gaussian random matrices, it works much better than AMP (and also OLS, OMP and ML1) on correlated matrices. Let us first consider an illconditioned 280×1000 matrix instance obtained by multiplying two random Gaussian matrices of size 280×200 and 200×1000. The condition number of this matrix is Q = ∞. The message-passing iteration of AMP quickly diverges on this instance and the algorithm then completely fails, even for very small sparsity ρ = 0.005. Similar divergence problem is experienced for the ML1 algorithm. OLS and OMP have no difficulty in constructing a solution h, but their solutions are rather dense and are much different from the planted solution h0 (Fig. 7, cross points). On the other hand, SSD is not affected by the strong correlations of this matrix and it fully reconstructs h0 (Fig. 7, plus points). From Fig. 7 we see that SSD initially causes a smaller decrease in the Euclidean length (`2 -norm) of the signal vector z than OMP (or OLS) does, but the slope of ||z||2 decreasing keeps roughly the same in later iterations. Figure 8 shows how the performances of SSD, OLS and OMP change with the sparsity ρ of the planted solutions h0 on another larger matrix of N = 104 , α = 0.2, and condition number Q = 3.84 × 105 . (The results of AMP and ML1 are not shown because they always fail to recover h0 .) We observe that OLS and OMP work only for sparsity ρ < 0.02, while SSD is successful up to spar- OLS 0.5 OMP OMP 0 0 0 0.02 0.04 ρ 0.06 0.08 0 0.02 0.04 0.06 0.08 ρ FIG. 8: Comparing the performances of SSD [(a), (b)] and OLS and OMP [(c), (d)] on a highly correlated sampling matrix D with N = 104 columns, compression level α = 0.2 and condition number Q = 3.84 × 105 . Left column [(a), (c)] corresponds to Gaussian-type planted solutions h0 , right column [(b), (d)] corresponds to uniform-type h0 . ρ is the sparsity of h0 ; ∆ is the relative distance (mean and standard deviation, over 100 random h0 samples) between h0 and the reconstructed solution h. sity ρ ≈ 0.072 for Gaussian-type h0 and up to ρ ≈ 0.06 for uniform-type h0 . Comparing Fig. 8 with Fig. 5 we see that SSD performs almost equally good on the highly correlated matrix but OLS and OMP are very sensitive to correlations of the matrix. To see how the algorithmic performance is affected by the condition number Q of the sampling matrices, we generate a set of 16 correlated 200 × 1000 matrices D according to the described protocol using different values of R = 200, 208, 220, 240, 260, 280, 300, 350, 400, 450, 500, 700, 1000, 2000, 3000, 8000. These matrices are labeled with index ranging from 1 to 16 in Fig. 9 and their corresponding condition numbers are Q = 318.37, 101.68, 42.95, 24.76, 17.72, 13.74, 10.93, 8.96, 7.27, 6.45, 5.81, 4.47, 4.00, 3.14, 2.97 and 2.73, respectively. We find that SSD is very robust to correlations (Fig. 9a and 9b) but the other algorithms are not: the performances of ML1, OLS and OMP, and AMP all severely deteriorate with the increasing of Q (Fig. 9c - 9j). We have also tested the algorithms on correlated matrices generated by some other more complicated protocols. These additional simulation results (not shown here) further confirm the high degree of insensitivity of SSD. This rather peculiar property should be very desirable in practical applications because it greatly relaxes the requirements on the sampling matrix. VI. CONCLUSION AND DISCUSSIONS In this paper we introduced the Shortest-Solution guided Decimation (SSD) algorithm for the compressed sensing problem and tested it on uncorrelated and cor- 8 1 1 (a) 0.8 0.4 0.2 8 4 7 3 6 2 5 1 0.6 s s 0.6 (b) 0.8 0.4 0.2 0 1 12 15 11 14 10 13 9 0 1 (c) 0.8 0.6 0.6 (d) s 0.8 s 16 0.4 0.4 0.2 0.2 0 1 0 1 (e) 0.6 0.6 (f) s 0.8 s 0.8 0.4 0.4 0.2 0.2 0 1 0 1 (g) 0.6 0.6 (h) s 0.8 s 0.8 0.4 0.4 0.2 0.2 0 1 0 1 (i) 0.6 0.6 (j) s 0.8 s 0.8 0.4 0.4 0.2 0.2 0 0.01 0 0.03 0.05 ρ 0.07 0.09 0 0.02 0.04 0.06 0.08 ρ FIG. 9: Comparing the algorithmic performances on 16 correlated 200 × 1000 sampling matrices D indexed from 1 (pluses, most highly correlated) to 16 (decorated circles, least correlated). Left column corresponds to Gaussian-type planted solutions h0 , right column corresponds to uniformtype h0 . The simulation results are obtained by SSD [(a), (b)], ML1 [(c), (d)], OLS [(e), (f)], OMP [(g), (h)] and AMP [(i), (j)], respectively. ρ is the sparsity of h0 ; s is the fraction of successfully reconstructed solutions among 100 random input h0 samples. problems (see [30] for an example in physics on quantum Monte Carlo data analysis). Existing algorithms in the literature were not designed for tackling highly correlated sampling matrices, and this challenging issue has begun to be discussed only very recently (see, e.g., the work of [31, 32] on orthogonal AMP). The SSD algorithm is a significant step along this direction. The demonstrated high degree of tolerance to correlations indicates that SSD can serve as a versatile and robust tool for different types of compressed sampling problems and sparse representation/approximation problems. Rigorous theoretical understanding is largely absent on why the SSD algorithm is highly tolerant to structural correlations in the sampling matrix. We feel that (i) viewing the sparse recovery problem from the angle of eigen-subspace projection (8) and (ii) recursively adjusting this eigen-projection by modifying the matrix D and the signal vector z are crucial to make SSD insensitive to correlations. We offered some qualitative arguments in Section III, especially through (8) and (10), on why the dense guidance vector g is useful to sparse reconstruction. More rigorous theoretical understanding on the SSD process needs to be pursued in the future. It looks quite promising to investigate the performance bound of SSD on ensembles of correlated matrices as a phase transition problem. In this paper we only considered the ideal noise-free situation; but for practical applications it will be necessary to take into account possible uncertainty in the sampling matrix D and the unavoidable measurement noise in the signal vector z. SSD is slower than OLS and OMP by a constant factor in terms of time complexity. To further accelerate the SSD process an easy adaptation is to fix a small fraction of the active indices instead of just one of them in each decimation step (see, for example, [16]). We also need to extend the SSD algorithm to complex-valued compressed sensing problems. Appendix A: Accelerated dual ascent process Let us denote by γ (t) the gap vector after the t-th iteration step of the dual ascent process (7), that is γ (t) ≡ z − Dg (t) . related sampling matrices. The SSD algorithm is a geometry-inspired deterministic algorithm that does not explicitly try to minimize a cost function. SSD outperforms OLS and OMP in recovering sparse planted solutions; and it is especially competitive in treating highly correlated or structured matrices, on which the tested other representative algorithms (ML1, OLS and OMP, and AMP) all fail. Mathematical and algorithmic studies [2, 7] on the compressed sensing problem have focused overwhelmingly on uncorrelated random matrices satisfying the restricted isometric property [25]. But the RIP incoherence condition can be severely violated in real-world practical (A1) Then after the (t + 1)-th iteration step, we have β (t+1) = β (t) + ε(t) γ (t) , (A2a) γ (t+1) = γ t − ε(t) DD T γ (t) = γ (t) − ε(t) η (t) , (A2b) where the auxiliary column vector η (t) is defined as η (t) ≡ D(D T γ (t) ) . (A3) Notice that the Euclidean length (`2 -norm) of γ (t+1) will be minimized by setting ε(t) = hγ (t) , η (t) i . hη (t) , η (t) i (A4) 9 This optimal value of ε(t) is used in the dual ascent process. Appendix B: MATLAB code As a simple demo we include here a MATLAB code which realizes the SSD algorithm in the most direct way. This code involves computing the pseudo-inverse of the matrix D, so it is not optimal in terms of time complexity. The more efficient implementation based on convex optimization (6) is documented at power.itp.ac.cn/~zhouhj/codes.html. f u n c t i o n [ h ] = s s d ( D, z , e p s i l o n ) [m, n]= s i z e (D) ; D0=D; z0=z ; g=p i n v (D) ∗ z ; support = [ ] ; remain =1:n ; w h i l e norm ( z )>e p s i l o n [ ˜ , l ]=max( abs ( g ) ) ; s u p p o r t =[ s u p p o r t , remain ( l ) ] ; a=D( : , l ) ; a u n i t=a / ( a ’ ∗ a ) ; z=z −(z ’ ∗ a ) ∗ a u n i t ; D=D−repmat ( a ’ ∗D,m, 1 ) . ∗ repmat ( a u n i t , 1 , s i z e (D, 2 ) ) ; D( : , l ) = [ ] ; [1] G.-M. Shi, D.-H. Liu, D.-H. Gao, Z. Liu, J. Lin, and L.J. Wang, “Advances in theory and application of compressed sensing,” Acta Electronica Sinica, vol. 37, pp. 1070–1081, 2009. [2] S. Foucart and H. Rauhut, A Mathematical Introduction to Compressive Sensing. New York: Springer, 2013. [3] E. Candès, J. Romberg, and T. Tao, “Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information,” IEEE Trans. Inf. Theory, vol. 52, pp. 489–509, 2006. [4] D. L. Donoho, “Compressed sensing,” IEEE Trans. Inf. Theory, vol. 52, pp. 1289–1306, 2006. [5] A. C. Gilbert, S. Guha, P. Indyk, S. Muthukrishnan, and M. Strauss, “Near-optimal sparse fourier representations via sampling,” in Proc. 34th Annueal ACM Symposium on Theory of Computing (STOC ’02). Montreal, Quebec, Canada: ACM, New York, 2002, pp. 152–161. [6] D. L. Donoho and M. Elad, “Optimally sparse representation in general (nonorthogonal) dictionaries via `1 minimization,” Proc. Ntal. Acad. Sci. USA, vol. 100, pp. 2197–2202, 2003. [7] Z. Zhang, Y. Xu, J. Yang, X. Li, and D. Zhang, “A survey of sparse representation: Algorithms and applications,” IEEE Access, vol. 3, pp. 490–530, 2015. [8] S. Chen, S. A. Billings, and W. Luo, “Orthogonal least squares methods and their application to non-linear system identification,” Int. J. Control, vol. 50, pp. 1873– 1896, 1989. [9] S. G. Mallat and Z. Zhang, “Matching pursuits with time-frequency dictionaries,” IEEE Trans. Signal Processing, vol. 41, pp. 3397–3415, 1993. remain ( l ) = [ ] ; g=p i n v (D) ∗ z ; end h=z e r o s ( n , 1 ) ; h ( s u p p o r t )=p i n v (D0 ( : , s u p p o r t ) ) ∗ z0 ; end Acknowledgment H.J.Z. thanks Jing He, Fengyao Hou and Hongbo Jin for help in computer simulations; P.Z. acknowledges helpful discussions with Dong Liu, Xiangming Meng and Chuang Wang; M.S. acknowledges the hospitality of ITPCAS during his stay as an intern student. H.J.Z. and P.Z. acknowledge the hospitality of Kavli Institute for Theoretical Sciences (KITS-UCAS) during the workshop “Machine Learning and Many-Body Physics” (June 28– July 7, 2017). This research was supported by the National Natural Science Foundation of China (grant numbers 11421063 and 11647601) and the Chinese Academy of Sciences (grant number QYZDJ-SSW-SYS018). The numerical computations were carried out at the HPC Cluster of ITP-CAS and the Tianhe-2 platform of the National Supercomputer Center in Guangzhou. [10] Y. C. Pati, R. Rezaiifar, and P. S. Krishnaprasad, “Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition,” in Proc. 27th Asilomar Conference on Signals, Systems and Computers. IEEE, 1993, pp. 40–44. [11] G. M. Davis, S. G. Mallat, and Z. Zhang, “Adaptive timefrequency decompositions,” Optical Engineering, vol. 33, pp. 2183–2191, 1994. [12] J. A. Tropp, “Greed is good: Algorithmic results for sparse approximation,” IEEE Trans. Inf. Theory, vol. 50, pp. 2231–2242, 2004. [13] J. A. Tropp and A. C. Gilbert, “Signal recovery from random measurements via orthogonal matching pursuit,” IEEE Trans. Inf. Theory, vol. 53, pp. 4655–4666, 2007. [14] W. Dai and O. Milenkovic, “Subspace pursuit for compressive sensing signal reconstruction,” IEEE Trans. Inf. Theory, vol. 55, pp. 2230–2249, 2009. [15] S. Chatterjee, K. V. S. Hari, P. Händel, and M. Skoglund, “Projection-based atom selection in orthogonal matching pursuit for compressive sensing,” in Proceedings of the 2012 National Conference on Communications. Kharagpur, India (3-5 Feb., 2012): IEEE, 2012. [16] J. Wang and P. Li, “Recovery of sparse signals using multiple orthogonal least squares,” IEEE Trans. Signal Processing, vol. 65, pp. 2049–2062, 2017. [17] J. Wen, J. Wang, and Q. Zhang, “Nearly optimal bounds for orthogonal least squares,” IEEE Trans. Signal Processing, vol. 65, pp. 5347–5356, 2017. [18] R. Gribonval and M. Nielsen, “Sparse representations in unions of bases,” IEEE Trans. Inf. Theory, vol. 49, pp. 3320–3325, 2003. 10 [19] D. L. Donoho, “For most large underdetermined systems of linear equations the minimal 1-norm solution is also the sparsest solution,” Commun. Pure and Applied Math., vol. 59, pp. 797–829, 2006. [20] R. Tibshirani, “Regression shrinkage and selection via the lasso,” J. R. Statist. Soc. B, vol. 58, pp. 267–288, 1996. [21] S. S. Chen, D. L. Donoho, and M. A. Saunders, “Atomic decomposition by basis pursuit,” SIAM review, vol. 43, pp. 129–159, 2001. [22] D. L. Donoho, A. Maleki, and A. Montanari, “Messagepassing algorithms for compressed sensing,” Proc. Natl. Acad. Sci. USA, vol. 106, pp. 18 914–18 919, 2009. [23] F. Krzakala, M. Mézard, F. Sausset, Y. F. Sun, and L. Zdeborová, “Statistical-physics-based reconstruction in compressed sensing,” Phys. Rev. X, vol. 2, p. 021005, 2012. [24] D. J. Thouless, P. W. Anderson, and R. G. Palmer, “Solution of ‘solvable model of a spin glass’,” Phil. Mag., vol. 35, pp. 593–601, 1977. [25] E. J. Candés and T. Tao, “Near optimal signal recovery from random projections: universal encoding strategies?” IEEE Trans. Inf. Theory, vol. 52, pp. 5406–5425, 2006. [26] M. Bayati and A. Montanari, “The dynamics of message [27] [28] [29] [30] [31] [32] passing on dense graphs, with applications to compressed sensing,” IEEE Trans. Inf. Theory, vol. 57, pp. 764–785, 2011. G. H. Golub and C. Reinsch, “Singular value decomposition and least squares solutions,” Numerische Mathematik, vol. 14, pp. 403–420, 1970. S. Boyd, N. Parikh, E. Chu, and B. Peleato, “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Foundations and Trends in Machine Learning, vol. 3, pp. 1–122, 2011. E. Candès and J. Romberg, “L1-magic: Recovery of sparse signals via convex programming,” URL: www.acm.caltech.edu/l1magic/downloads/l1magic.pdf, Tech. Rep., 2005. J. Otsuki, M. Ohzeki, H. Shinaoka, and K. Yoshimi, “Sparse modeling approach to analytical continuation of imaginary-time quantum monte carlo data,” Phys. Rev. E, vol. 95, p. 061302(R), 2017. J. Ma and L. Ping, “Orthogonal amp,” IEEE Access, vol. 5, pp. 2020–2033, 2017. S. Rangan, P. Schniter, and A. Fletcher, “Vector approximate message passing,” arXiv:1610.03082, 2016.
7cs.IT
An Automated Auto-encoder Correlation-based Health-Monitoring and Prognostic Method for Machine Bearings arXiv:1703.06272v1 [cs.LG] 18 Mar 2017 Ramin M. Hasani, Guodong Wang and Radu Grosu Cyber-Physical Systems Group, Vienna University of Technology, Austria ramin.hasani, guodong.wang, [email protected] Abstract This paper studies an intelligent ultimate technique for health-monitoring and prognostic of common rotary machine components, particularly bearings. During a run-to-failure experiment, rich unsupervised features from vibration sensory data are extracted by a trained sparse auto-encoder. Then, the correlation of the extracted attributes of the initial samples (presumably healthy at the beginning of the test) with the succeeding samples is calculated and passed through a moving-average filter. The normalized output is named autoencoder correlation-based (AEC) rate which stands for an informative attribute of the system depicting its health status and precisely identifying the degradation starting point. We show that AEC technique well-generalizes in several run-to-failure tests. AEC collects rich unsupervised features form the vibration data fully autonomous. We demonstrate the superiority of the AEC over many other state-of-the-art approaches for the health monitoring and prognostic of machine bearings. 1 Introduction In almost all industries health management of machines is notably essential. A key subsidiary of health management is condition-based monitoring (CBM) where one prognoses abnormal status of a machine based on extracted features from a group of implemented sensors and parameters. The CBM procedure therefore includes two steps; 1) Feature extraction during a run-to-failure experiment and two 2) Data processing for predicting the degradation starting point and monitoring the defect propagation during the test. Quite a large number of methods have been proposed for the prognostic of key machine components. In many cases, handcrafted time- and frequency-domain features are derived from the sensors mounted on the machine and are used directly or post-processed by numerous methods in order to predict the condition of the machine component [Lee et al., 2014]. Recently, on the other hand, artificial intelligence (AI) solutions have been vastly utilized in fault classification and condition monitoring [Jia et al., 2016; Sun et al., 2016; Thirukovalluru et al., 2016]. AI techniques significantly enhance the quality of the feature extraction and data processing. However, they have not yet realized a fullyautomated method without the use of prior knowledge for health monitoring tests. The main attributes of an ideal health-condition monitoring and prognostic method are described as follows: The method is able to collect unsupervised useful features from the available sensory data, regardless of its size, autonomously. Such data-driven procedure should enable the user to perform monitoring in both online and offline tests, while providing an intelligent trend on the health status of the system and precisely pointing out the degradation starting point. It is highly desirable that the method automatically combines the steps of the CBM process and be entirely human-labor independent. Moreover, the ideal approach is universal and can be feasibly applied to the prognostic of various key machine components such as bearings, gears and spindles. In the present study, we propose a novel prognostic method for machine bearings, as a key machine component which satisfies the main characteristics of an ideal CBM method. The technique is called auto-encoder-correlation-based (AEC) prognostic algorithm. We train a sparse auto-encoder for extracting unsupervised features from collected sensory data in several test-to-failure experiments and correspondingly, compute the Pearson correlation of the extracted features of the initial samples, with the upcoming samples. The output is then passes through a moving average (MA) filter. AEC algorithm then normalizes the output of the filter and accurately illustrates the health condition of the system. We evaluate the performance of our algorithm over several run-to-failure tests of machine bearings and prove its superiority in finding the degradation starting point compared to the existing methods. Accordingly, the paper is structured as follows. Section 2, describes the-state of-the-art methods employed for the CBM and prognostic. In Section 3, we delineate the design procedure of the AEC algorithm while recapitulating the sparse auto-encoder architecture and describing the rest of the method. In Section 4, we perform various experiments with AEC and represent our results correspondingly. Within Section 4, we qualitatively and qualitatively compare our method to the other approaches. We conclude our report in Section 5. In this section we describe the mechanism of the automated AEC general fault prognostic method during the runto-failure test of machine bearings. Figure 1 graphically illustrates the structure of the AEC. An autoencoder network is trained by using the Vibration data-samples. The autoencoder generates rich nonlinear features from the sensory data for each sample. Afterwards, the correlation coefficient matrix of the past samples until the current sample, is computed. The correlation coefficients of the features extracted for the samples generated at the beginning of the run-tofailure process, with the other available samples is normalized and correspondingly filtered by means of a moving average (MA) filter. This provides an output rate which can predicts the status of the system at each sampling time step. In the followings, we sketch our design procedures, in details. 1 x 20480 Decoding Comprehensive reviews on the useful prognostic methods for industrial machines including bearings have been proposed [Jardine et al., 2006; Lee et al., 2014]. Traditionally, time domain statistical features such as root mean squared (RMS), Kurtosis, Spectral Kurtosis and so on, have been utilised for monitoring the status of the machine key components [Qiu et al., 2006]. However such features fail to provide useful information on the status of the system in some cases and therefore are not generalizable. In this regard, selection of the proper statistical features which contain useful information, is a challenge which is addressed in many health monitoring methods [Yu, 2012a; Yu, 2012b]. Such approaches lack automation as well as generalization. Moreover, unsupervised feature extraction techniques such as principle component analysis (PCA)-based methods [He et al., 2007] followed by a post-processing stage such as hidden Markov model (HMM) for health degradation monitoring provided a reasonable prediction on the status of the system [Yu, 2012a]. Despite their attractive level of accuracy, such methods are also not automated and their generalization ability has not yet clearly shown. Moreover, combination of the frequency-domain feature extraction methods such as wavelet packet decomposition with HMM are also employed in the calculation of the remaining useful life (RUL) of the key machine components [Tobon-Mejia et al., 2012]. Tobon et al. proposed a useful trend on the RUL and successfully tested it on few bearing run-to-failure experiments. The approach is however, subjected to modifications to be utilized in the other test-cases [Tobon-Mejia et al., 2012]. Kalman filter (KF) is also used in condition monitoring [Reuben and Mba, 2014; Wang et al., 2016]. Reuben et al. proposed a method based on switching KF which can be simultaneously employed in the diagnostic and prognostic of the data [Reuben and Mba, 2014]. Wang et al. used an enhanced KF with expectation-maximization algorithm for providing accurate estimations on the health condition of the machines [Wang et al., 2016]. Such methods lack the fully automation property and are subjected to manual preprocessing. Data-driven approaches using AI techniques, have brought great advancements to the diagnostic and health condition monitoring of key machine components. Various architectures of neural networks in particular auto-encoders, are successfully employed for precise-classification of faults into different subgroups, by using pre-processed statistical time or frequency domain features and in general features extracted using prior knowledge [Yang et al., 2002; Jia et al., 2016; Sun et al., 2016; Thirukovalluru et al., 2016]. Although proposed methods are not fully autonomous, they are less human-labor dependent. However, such methods have not been yet utilized in the prognostic and condition monitoring fully autonomous. Here, for the first time, we train a sparse auto-encoder directly over the vibration data and compute the correlation of the extracted features and therefore, provide a comprehensive prognostic and health monitoring method which its performance is superior compared to many of the remarked approaches. 3 Auto-encoder Correlation-based (AEC) Fault Prognostic Method Encoding 2 Related Works mxm 1xm 1 x1000 1 x 20480 Correlation Coefficient 1xm Normalized Moving Average System Status m input samples Figure 1: The architecture of the AEC fault prognostic method. 3.1 Sparse Auto-encoder Revisit An auto-encoder [Boureau et al., 2008], tries to learn an abstract of the identity function, to estimate the same input patterns at its output. One can place constraints on the network by limiting the size of the hidden layer and presumably discover attractive features form the data. Let us define x ∈ RDx , a Dx -dimension input to the autoencoder; the encoder initially maps x to a lower dimension vector z ∈ RD , and correspondingly generates an estimation of x, x̂ ∈ RD : z = f (W x + b1 ); x̂ = f (W T z + b2 ), (1) where f , in our design, is a saturating linear transfer function denoted in Equation 2 , W ∈ RDx ×D stands for the weight matrix, and vectors b1 ∈ RD , b2 ∈ RDx represent the bias values.  0, if z ≤ 0 f (z) = z, if 0 < z < 1 (2)  1, if z ≥ 1 We define the following cost function to be optimized subsequently: C= N I 1 XX (xin − x̂in )2 + N n=1 i=1 | {z } mean squared error λRL2 | {z } + L2 regularization σRsparse | {z } (3) . sparsity regularization The first term in C is the mean squared error. The second term denotes an L2 regularization applied for preventing over-fitting, where λ is the regularization coefficient. L2 regularization is computed as follows: n RL2 = k 1 XX (wji )2 , 2 j i (4) where n and k are the number of samples(observations) and number of variables in the training data, respectively. The third term in the cost function determines an sparsity regularzation with an effectiveness coefficient, σ. Let the average output activation of a neuron i be denoted as: m ρ̂i = 1 X f (wiT xj + bi ), m j=1 (5) and define ρ as the desired output value of a neuron, One can measure their difference by using the Kullback-Leibler divergence function described below: Rsparse = D X KL(ρkρ̂i ) = i=1 D X (6) ρ 1−ρ ρ log( ) + (1 − ρ) log( ). ρ̂ 1 − ρ̂i i i=1 KL function outputs zero when ρ and ρ̂i are close to each other and increases when they diverge from each other. This implies sparsity in the network and it is defined in our cost function as the sparsity regularization, Rsparse . We then train the network by applying a scaled conjugate gradient (SCG) algorithm [Møller, 1993] using MATLAB’s Neural Network Toolbox. 3.2 deviation of B [Fisher, 1925]. The correlation coefficient matrix for the available samples during the run-to-failure test is calculated. The first column of the CC matrix depicts the correlation of the first sample data which is recorded at the beginning of the run-to-failure process, with the other available samples. We normalize this vector between zero and one, and define it as the criteria for predicting the faulty sample and consequently determine the health-status of the system. We finally, smoothen the shape of the output by passing it through a moving average filter. The filter is designed as follows: m̂ = 1 (y(n)+y(n−1)+· · ·+y(n−(wsize −1))). (8) wsize For the sample data y, the filter slides a sample-window of length wsize , over the data, and calculates the average of the covered data in each window. 4 Experiments with AEC In this section we evaluate the performance of our fault prognostic method by employing it in several run-to-failure experiments on bearings. We initially introduce the dataset contents together with the objective of the tests, and illustrate the performance of the AEC method in various run-to-failure tests. We finally benchmark our results with the state-of-theart methods in fault prognostic of the bearing machines. 4.1 IMS Bearing Data Set from PCoE NASA Datasets We use the bearing dataset provided by the the Center for Intelligent Maintenance Systems (IMS), University of Cincinnati [Lee et al., 2007], collected from the Prognostics Data Repository of NASA [PCoE, Accessed 2016]. The bearing test rig is shown in Figure 2. A shaft is coupled to a AC motor and is rotating at 2000 RP M while a 6000 lbs load is installed on it. Four force-lubricated bearings are mounted on the shaft. Accelerometers with high sensitivity are placed for each bearing for recording the vibrations (the position of the sensors are shown in the Figure 2). Three test-to-failure experiments Correlation Analysis, Normalization and Filtering For each training sample, D nonlinear features are constructed by the Auto-encoder. We calculate the linear dependencies of the abstract representation of each sample by utilizing the Pearson correlation coefficient (CC) which is described bellow for two samples A and B: D r(A, B) = 1 X Ai − µA Bi − µB )( ), ( D − 1 i=1 σA σB (7) where µA and σA are the mean and the standard deviation of A, respectively, and µB and σB are the mean and standard Figure 2: Bearing test implementation [Qiu et al., 2006]. Four bearings are set-up on a shaft and vibration data is collected in three run-to-failure tests. Table 1: IMS Bearing tests specification Experiment # of Samples sample size Faulty Bearing test-to-failure time S1 2156 B3 and B4 35 days S2 984 4 × 20480 B1 8 days S3 4448 4 × 20480 B3 31 days 4 × 20480 For our simulations, we only train the AE network on the faulty bearings therefore we will have four different simulated experiment cases as follows: 1) Dataset 1 bearing 3 (S1B3), 2)Dataset 1 Bearing 4 (S1B4), 3) Dataset 2 bearing 1 (S2B1) and 4) Dataset 3 Bearing 3 (S3B3). 4.2 Results We train the auto-encoder and consequently implement our prognostic method in MATLAB due to its compatibility with most of the industrial production systems and specially online test-to-failure environmental tools. The training process is performed on a Microsoft Azure NC-Series virtual machine powered by one NVIDIA Tesla K80 GPU. We demonstrate our method’s functionality in two general frameworks where in the first one we train the auto-encoder with all the available data, for each experiment, in order to monitor the status of the system. In the second framework, we train the auto-encoder with 70% of the data and keep 30% of it for testing in order to check the prediction power of the proposed method. The training time varies between 55 min and 80 min for each case, depending on the number of input samples. Since we only consider the vibration samples of one bearing in each simulation, the input samples’ dimension, under 20 kHz sampling frequency, is a 20480-length vector. We choose 1000 hidden units for the AE which enables us to extract 1000 features from each large input vector. We then calculate the correlation coefficient matrix of the input samples (depending on the framework in which we are working on, for the first case we feed in all the available data while for the second framework we dedicate 70% of the data for training and the network has to output a prediction on the status of the system based on the previously observed samples) and normilaze the correlation coefficient of the initial sample ( which is considered to represent the healthy status of the system) with the next samples. We then filter out the output and provide a representation of the status of the system. Framework1 - Health-Condition Monitoring Figure 3 illustrates the output of the AEC for the four simulations of the three run-to-failure experiments, where we monitor the recorded data. A high AEC rate corresponds to a Normalized AEC rate are performed independently. In such tests, failures usually happened at the end of the test [Qiu et al., 2006]. In the first experiment, two accelerometers are utilized for each bearing while in the second and third experiments one accelerometer is used. Datasets contain 1-second recordings from the accelerometers with a sampling frequency of 20KHz, every 10 min, during the run-to-failure tests [Qiu et al., 2006]. Table 1 represents the properties of the collected data in each experiment. 1 S1-Bearing 3 S1-Bearing 4 S2-Bearing 1 S3-Bearing 3 0.5 0 5 10 15 20 25 30 35 Time (days) Figure 3: AEC evaluation rate for four different datasets. For every dataset, our AEC platform generates a rich trend corresponding to the status of the bearing based on the vibration sensory data. One can feasibly detect abrupt changes in the AEC rate. The vertical dot lines corresponds to the sample time after which AEC platform start decreasing dramatically. This indicates the degradation starting point. A 250 200 450 400 650 600 850 800 1050 1000 1250 1200 1450 1400 1650 1600 1850 1800 2050 2000 B 250 200 450 400 650 600 850 800 1050 1000 1250 1200 1450 1400 1650 1600 1850 1800 2050 2000 C 150 100 250 200 350 300 450 400 550 500 650 600 750 700 850 800 950 900 D 720 500 1220 1000 1720 1500 2220 2000 2720 2500 3220 3000 3720 3500 1 0.5 0 1 0.5 0 1 0.5 0 1 0.5 0 4220 4000 Sample Figure 4: Visualization of the status of four different bearings in four run-to-failure experiments. The color bar represents the value of the normalized AEC rate. The higher is the rate (the more red is the color bar) the less probable it is for the system to be in a faulty condition. The horizontal axes shows the samples collected for the run-to-failure test in every experiments. A) S1B3, AEC rate recording. B) AEC for S1B4 C) AEC for S2B1. D) AEC for S3B3. healthy behavior of the system while a downward trend depicts starting point of an abnormal state. High AEC indicates more correlated samples with the initial healthy status of the system. AEC clearly displays the beginning of a faulty trend together with its propagation effect. It can also demonstrate a health-characteristic portfolio for the noisy dataset, S3B3 for which many other approaches have failed to provide a health-degradation characteristics. Figure 4 graphically indicates the status of the four experiments S1B3, S1B4, and S2B1 and S3B3 in parts A, B, C and D respectively. The Color bar represents the AEC rate from 0 (blue) to 1 (red). We can distinctly observe where a significant change in the rate is occurred and therefore stop the process. We call a sample abnormal, when its AEC rate is measured 90% below the recorded sample at t − 100. The AEC delicately indicates the start of a faulty status and represents its gradual propagation. Table 2 summarises the detection performance of our AEC method together with some of the existing data monitoring approaches, for the IMS dataset. Detection performance is defined as the sample-time (sample number) at which the algorithm notices initiation of a degradation. Therefore, an early fault-detection determines a better performance. Table 2: Detection performance. HMM-DPCA: Hidden Markov model with dynamic PCA, HMM-PCA: Hidden Markov model with PCA [Yu, 2012a]. MAS-Kortusis: Moving average spectral kurtosis [Kim et al., 2016]. VRCA: Variable-replacing-based contribution analysis [Yu, 2012a]. means that the dataset has not been analyzed in the corresponding experiment Algorithm AEC HMM-DPCA HMM-PCA RMS MAS-Kurtosis VRCA S1B3 S1B4 S2B1 S3B3 Degradation starting datapoint 2027 1641 547 2367 2120 1760 539 1780 538 2094 1730 539 No detection 1910 1650 710 No detection 1727 No detection Table 3: Prediction accuracy of the AEC method in different bearing run-to-failure tests Experiment S1B3-sensor1 S1B3-sensor2 S1B4-sensor1 S1B4-sensor2 S2B1 S3B3 Fault starting point 2120 2122 1681 1673 610 2435 Prediction Accuracy 95.68% 95.59% 98.14% 98.51% 93.60% 98.47% A 2030 1980 2050 2000 2070 2020 2090 2040 2110 2060 2130 2080 2150 2100 B 1950 2000 2000 2050 2050 2100 2100 2150 C 550 500 1050 1000 1550 1500 2050 2000 550 500 1050 1000 1550 1500 2050 2000 D We can observe that only AEC provides the degradation starting point for all the experiments. It is essential to mention that monitoring of the test-to-failure process of the experiment S3B3 is considerd as a hard challenge to be performed. Only few approaches can monitor its state while non provided the degradation starting point [Kim et al., 2016]. AEC provides a reasonable prediction on such dataset as well. Framework2 - Online Prognostic In the second framework, as discussed, we train the autoencoder over the first 70% of the available data in order to evaluate the prediction performance of the model in an online monitoring phase. Here, we study six cases including S1B3sensor1, S1B3-sensor2, S1B4-sensor1, S1B4-sensor2, S2B1 and S3B3 where Figure 5A to 5F represent the predicted AEC rate in each experiment respectively. A sample is defined as the initiation of an abnormal state where its AEC rate reaches 90% of the rate of the 100 steps earlier sample. The prediction process starts from the samples collected from day 5 on, since before that the status of the system has been considered to be normal [Qiu et al., 2006]. Using this definition, the degradation starting point is calculated with high level of accuracy and the propagation of fault is captured during the simulated run-to-failure test. Table 3 summarises the predicted degradation starting point together with the prediction accuracy in each experimnet. The prediction error is computed as the ratio of the deference between the predicted sample and the monitored fault starting point, to the total number of samples in each experiment. We also compare AEC with most of the existing methods for fault monitoring and prognostic systems over several attributes. Such qualifications are determined as follows: • Generalization: Ability of the method to provide clever results for various bearing status monitoring experiments. • Status Monitoring: Ability of the method to provide a useful health-status trend during the test-to-failure experiment of the bearings. E 250 200 450 400 650 600 850 800 F 1220 1000 2220 2000 3220 3000 4220 4000 Sample Figure 5: Online monitoring of the status of the system in different experiments: A) S1B3 first sensor B) S1B3 second sensor C) S1B4 first sensor D) S1B4 second sensor. E) S2B1 F) S3B3. The color-bar represents the AEC rate. The degradation starting point of the system in each experiment, with a high level of accuracy is predicted and AEC rate comprehensively elucidates how the fault propagates during each run-tofailure test. • Automated: a fully autonomous fault prognostic method • Unsupervised: Capability of the method to extract information from the sensory without any prior knowledge. • Detection Sensitivity: Ability of the method to provide a fast-enough alert on the starting point of the degradation in the test. • Fault-type Detection (Diagnostics): Ability of the method to detect a certain type of defect in the system and classify them into different fault classes. Table 4 comprehensively illustrates a qualitative comparison among various fault prognostic methods utilized for bearings, based on the mentioned attributes. The assessment on the performance of each method is carefully performed based on the provided results and the detailed specifications of the methods in their corresponding report. Under such evaluations, results suggest the superiority of the AEC algorithm over existing methods where it can precisely capture the degradation initial point and provides a useful trend for the fault spread while being autonomous. Algorithm AEC HMM-DPCA HMM-PCA RMS Kurtosis MAS-Kurtosis Spectral-ANN VRCA EET WPSE+EMD Fuzzy-BP SVM GA-SVR GLR-ARMA Ge ner ali zat sta ion tus mo nit Au ori tom ng ate uns d upe rvi sed De tec tio ns ens fau itiv l t -t ity ype det ect ion Table 4: Qualitative comparision of the performance of the existing approaches on the bearing dataset prognostic. HMM-DPCA: Hidden Markov model with dynamic PCA, HMM-PCA: Hidden Markov model with PCA [Yu, 2012a]. MAS-Kortusis: Moving average spectral kurtosis [Kim et al., 2016]. VRCA: Variablereplacing-based contribution analysis [Yu, 2012a]. EET: Energy Entropy trend [Kim et al., 2016]. WPSE-EMD: Wavelet packet sample Entropy [Wang et al., 2011] - Empirical mode decomposition [Lei et al., 2007]. SpectralANN: Third-order spectral + artificial neural networks [Yang et al., 2002]. Fuzzy-BP: Fuzzy logic with backpropagation [Satish and Sarma, 2005]. SVM: Support Vector Machine [Yang et al., 2007]. GA-SVR: Genetics algorithmSupport vector regression [Feng et al., 2009]. GLR-ARMA: Generalized likelihood ratio - Autoregressive moving average [Galati et al., 2008]. ++: Highly satisfies. +: Satisfies. -: The attribute is not covered -+: The attribute is fairly covered. + -+ -+ -+ + -+ - + + + + + + + + + + + + + - + + + + - ++ + + -+ -+ -+ + ++ + + + + + + + ++ -+ 5 Conclusions We introduced a new autonomous technique for fault prognostic in machine bearings. The method was based on an unsupervised feature extractions from sensors by means of an auto-encoder. Correlation analysis on the extracted features was performed and correspondingly useful trend on the status of the bearing during the test-to-failure was provided. We showed that AEC successfully monitors the status of the bearings in various experiments which confirms its generalization ability. AEC accurately predicts the degradation starting point while providing an informative trend on its propagation. Furthermore, AEC algorithm generates rich unsupervised features from the vibration data and is automated. For the future work we intend to improve the quality of our method and apply it to the prognostic of the other key machine components such as degradation of gears, cutting tools and spindles. One can also think of a more general solution where a deep convolutional auto-encoder is designed and trained and accordingly evaluate the health-status of the system, independently, without any other follow-up steps. References [Boureau et al., 2008] Y-lan Boureau, Yann L Cun, et al. Sparse feature learning for deep belief networks. pages 1185–1192, 2008. [Feng et al., 2009] Fu Zhou Feng, Dong Dong Zhu, Peng Cheng Jiang, and Hao Jiang. Ga-svr based bearing condition degradation prediction. In Key engineering materials, volume 413, pages 431–437. Trans Tech Publ, 2009. [Fisher, 1925] Ronald Aylmer Fisher. Statistical methods for research workers. Genesis Publishing Pvt Ltd, 1925. [Galati et al., 2008] F Antonio Galati, David Forrester, and Subhrakanti Dey. Application of the generalised likelihood ratio algorithm to the detection of a bearing fault in a helicopter transmission. Australian Journal of Mechanical Engineering, 5(2):169–176, 2008. [He et al., 2007] Qingbo He, Fanrang Kong, and Ruqiang Yan. Subspace-based gearbox condition monitoring by kernel principal component analysis. Mechanical Systems and Signal Processing, 21(4):1755–1772, 2007. [Jardine et al., 2006] Andrew KS Jardine, Daming Lin, and Dragan Banjevic. A review on machinery diagnostics and prognostics implementing condition-based maintenance. Mechanical systems and signal processing, 20(7):1483– 1510, 2006. [Jia et al., 2016] Feng Jia, Yaguo Lei, Jing Lin, Xin Zhou, and Na Lu. Deep neural networks: A promising tool for fault characteristic mining and intelligent diagnosis of rotating machinery with massive data. Mechanical Systems and Signal Processing, 72:303–315, 2016. [Kim et al., 2016] Seokgoo Kim, Sungho Park, Ju-Won Kim, Junghwa Han, Dawn An, Nam Ho Kim, and JooHo Choi. A new prognostics approach for bearing based on entropy decrease and comparison with existing methods. Annual Conference of the Prognostics and Health management Society, 2016. [Lee et al., 2007] J Lee, H Qiu, G Yu, J Lin, et al. Bearing data set. IMS, University of Cincinnati, NASA Ames Prognostics Data Repository, Rexnord Technical Services, 2007. [Lee et al., 2014] Jay Lee, Fangji Wu, Wenyu Zhao, Masoud Ghaffari, Linxia Liao, and David Siegel. Prognostics and health management design for rotary machinery systemsreviews, methodology and applications. Mechanical systems and signal processing, 42(1):314–334, 2014. [Lei et al., 2007] Yaguo Lei, Zhengjia He, Yanyang Zi, and Qiao Hu. Fault diagnosis of rotating machinery based on multiple anfis combination with gas. Mechanical systems and signal processing, 21(5):2280–2294, 2007. [Møller, 1993] Martin Fodslette Møller. A scaled conjugate gradient algorithm for fast supervised learning. Neural networks, 6(4):525–533, 1993. [PCoE, Accessed 2016] PCoE. PCoE, Prognostics Center of Excellence of NASA: The prognostics data repository. https://ti.arc.nasa.gov/tech/ dash/pcoe/prognostic-data-repository/, Accessed 2016. [Qiu et al., 2006] Hai Qiu, Jay Lee, Jing Lin, and Gang Yu. Wavelet filter-based weak signature detection method and its application on rolling element bearing prognostics. Journal of sound and vibration, 289(4):1066–1090, 2006. [Reuben and Mba, 2014] Lim Chi Keong Reuben and David Mba. Diagnostics and prognostics using switching kalman filters. Structural Health Monitoring, 13(3):296–306, 2014. [Satish and Sarma, 2005] B Satish and NDR Sarma. A fuzzy bp approach for diagnosis and prognosis of bearing faults in induction motors. In Power Engineering Society General Meeting, 2005. IEEE, pages 2291–2294. IEEE, 2005. [Sun et al., 2016] Wenjun Sun, Siyu Shao, Rui Zhao, Ruqiang Yan, Xingwu Zhang, and Xuefeng Chen. A sparse auto-encoder-based deep neural network approach for induction motor faults classification. Measurement, 89:171–178, 2016. [Thirukovalluru et al., 2016] Raghuveer Thirukovalluru, Sonal Dixit, Rahul K Sevakula, Nishchal K Verma, and Al Salour. Generating feature sets for fault diagnosis using denoising stacked auto-encoder. In Prognostics and Health Management (ICPHM), 2016 IEEE International Conference on, pages 1–7. IEEE, 2016. [Tobon-Mejia et al., 2012] Diego Alejandro Tobon-Mejia, Kamal Medjaher, Noureddine Zerhouni, and Gerard Tripot. A data-driven failure prognostics method based on mixture of gaussians hidden markov models. IEEE Transactions on Reliability, 61(2):491–503, 2012. [Wang et al., 2011] Fengtao Wang, Yangyang Zhang, Bin Zhang, and Wensheng Su. Application of wavelet packet sample entropy in the forecast of rolling element bearing fault trend. In Multimedia and Signal Processing (CMSP), 2011 International Conference on, volume 2, pages 12–16. IEEE, 2011. [Wang et al., 2016] Yu Wang, Yizhen Peng, Yanyang Zi, Xiaohang Jin, and Kwok-Leung Tsui. A two-stage datadriven-based prognostic approach for bearing degradation problem. IEEE Transactions on Industrial Informatics, 12(3):924–932, 2016. [Yang et al., 2002] D-M Yang, AF Stronach, P MacConnell, and J Penman. Third-order spectral techniques for the diagnosis of motor bearing condition using artificial neural networks. Mechanical systems and signal processing, 16(2-3):391–411, 2002. [Yang et al., 2007] Junyan Yang, Youyun Zhang, and Yongsheng Zhu. Intelligent fault diagnosis of rolling element bearing based on svms and fractal dimension. Mechanical Systems and Signal Processing, 21(5):2012–2024, 2007. [Yu, 2012a] Jianbo Yu. Health condition monitoring of machines based on hidden markov model and contribution analysis. IEEE Transactions on Instrumentation and Measurement, 61(8):2200–2211, 2012. [Yu, 2012b] Jianbo Yu. Local and nonlocal preserving projection for bearing defect classification and performance assessment. IEEE Transactions on Industrial Electronics, 59(5):2363–2376, 2012.
9cs.NE
arXiv:1711.02701v1 [math.GR] 7 Nov 2017 CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE S. MORTEZA MIRAFZAL Abstract. Let n > 3 and 0 < k < n2 are integers. In this paper, we want to investigate some algebraic properties of the line graph of the graph Qn (k, k +1) where Qn (k, k + 1) is the subgraph of the hypercube Qn which is induced by the set of vertices of weights k and k + 1. In the first step, we determine the automorphism groups of these graphs for all values of k. In the second step, we study their Cayley properties. We show that for k > 1, if n 6= 2k + 1, then the line graph of the graph Qn (k, k + 1) is a vertex-transitive non Cayley graph. Also, we show that the line graph of the graph Qn (1, 2) is a Cayley graph if and only if n is a power of a prime p. Keywords : Hypercube, Line graph, Automorphism group, Sharply 2-transitive group, Cayley graph AMS subject classifications. 05C25, 05C69, 94C15 1. Introduction In this paper, a graph Γ = (V, E) is considered as an undirected simple graph where V = V (Γ) is the vertex-set and E = E(Γ) is the edge-set. For all the terminology and notation not defined here, we follow [2,4,7,8]. The study of vertex-transitive graphs has a long and rich history in discrete mathematics. Prominent examples of vertex-transitive graphs are Cayley graphs which are important in both theory as well as applications. Vertex-transitive graphs that are not Cayley graphs, for which we use the abbreviation VTNCG, have been an object of a systematic study since 1980 [3,9]. In trying to recognize whether or not a vertex-transitive graph is a Cayley graph, we are left with the problem of determining whether the automorphism group contains a regular subgroup [2]. The reference [1] is an excellent source for studying graphs that are VTNCG. In particular, determining the automorphism group of a given graph can be very useful in determining wether this graph is a Cayley graph. In this 1 2 S. MORTEZA MIRAFZAL area of research, in algebraic graph theory, there are various works and some of the recent works in this scope are [3,9,14,15,19,20,21,22,24]. Let n ≥ 1 be an integer. The hypercube Qn is the graph whose vertex set is {0, 1}n , where two n-tuples are adjacent if they differ in precisely one coordinates. The hypercube Qn , has been extensively studied. Nevertheless, many open questions remain. Harary, Hayes, and Wu [10] wrote a comprehensive survey on hypercube graphs. In the graph Qn , the layer Lk is the set of vertices which contain k 1s, namely, vertices of weight k, 1 ≤ k ≤ n. We denote by Qn (k, k + 1), the subgraph of Qn induced by layers Lk and Lk+1 . If n = 2k + 1, then the graph Q2k+1 (k, k + 1) has been investigated from various aspects, by various authors and is called the middle layer cube or regular hyperstar graph [6,10,12,13,20,25]. It has been conjectured by Dejter, Erdos, and Havel [12] among others, that Q2k+1 (k, k + 1) is hamiltonian. In this paper, we want to investigate some algebraic properties of the line graph of the graph Qn (k, k+1). In particular, we want to study cayleyness of this graph. We can consider the graph Qn from another point of view. The Boolean lattice BLn , n ≥ 1, is the graph whose vertex set is the set of all subsets of [n] = {1, 2, ..., n}, where two subsets x and y are adjacent if their symmetric difference has precisely one element. In the graph BLn , the layer Lk is the set of k−subsets of [n]. We denote by BLn (k, k + 1), the subgraph of BLn induced by layers Lk and Lk+1 . It is an easy task to show that the graph Qn is isomorphic with the graph BLn , by an isomorphism that induces an isomorphism from Qn (k, k + 1) to BLn (k, k + 1). For this reason, in the sequel we work on the graph BL  n (k,n k+ 1) n and for abbreviation, we denote it by B(n, k). We know that k = n−k , so B(n, k) ∼ = B(n, n − k). Therefore, in the sequel we assume that k < n2 . 2. Preliminaries The group of all permutations of a set V is denoted by Sym(V ) or just Sym(n) when |V | = n. A permutation group G on V is a subgroup of Sym(V ). In this case we say that G act on V . If X is a graph with vertex-set X, then we can view each automorphism as a permutation of V , and so Aut(X) is a permutation group. Let G acts on V , we say that G is transitive ( or G acts transitively on V ), if there is just one orbit. This means that given any two element u and v of V , there is an element β of G such that β(u) = v. The graph Γ is called vertex transitive, if Aut(Γ) acts transitively on V (Γ). The action of Aut(Γ) on V (Γ) induces an action on E(Γ), by the rule β{x, y} = {β(x), β(y)}, β ∈ Aut(Γ), and Γ is called edge transitive if this action is transitive. CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE3 The graph Γ is called symmetric, if for all vertices u, v, x, y, of Γ such that u and v are adjacent, and x and y are adjacent, there is an automorphism α such that α(u) = x, and α(v) = y. It is clear that a symmetric graph is vertex transitive and edge transitive. For v ∈ V (Γ) and G = Aut(Γ), the stabilizer subgroup Gv is the subgroup of G containing all automorphisms which fix v. In the vertex transitive case all stabilizer subgroups Gv are conjugate in G, and consequently isomorphic. In this |G| case, the index of Gv in G is given by the equation, |G : Gv | = |G = |V (Γ)|. v| If each stabilizer Gv is the identity group, then every element of G, except the identity, does not fix any vertex, and we say that G acts semiregularly on V . We say that G act regularly on V if and only if G acts transitively and semiregularly on V , and in this case we have |V | = |G|. Let G be any abstract finite group with identity 1, and suppose Ω is a set of G, with the properties : (i) x ∈ Ω =⇒ x−1 ∈ Ω; (ii) 1 ∈ / Ω. The Cayley graph Γ = Γ(G; Ω) is the ( simple ) graph whose vertex-set and edge-set defined as follows : V (Γ) = G, E(Γ) = {{g, h} | g −1 h ∈ Ω}. It can be shown that a connected graph Γ is a Cayley graph if and only if Aut(Γ) contains a subgroup H, such that H acts regularly on V (Γ) [2, chap 16]. 3. Main results Definition 3.1. Let n ≥ 4 be an integer and [n] = {1, 2, ..., n}. Let k be an integer such that 1 ≤ k < n2 . The graph B(n, k) is a graph with the vertex set V = {v|v ⊂ [n], |v| ∈ {k, k + 1}} and the edge set E = {{v, w}|v, w ∈ V, v ⊂ w or w ⊂ v}. Example According to the Definition 3.1. the following figure shows B(5, 1) in the plane. 1 12 13 2 14 15 4 3 23 24 Figure 1: B(5,1) 5 25 34 35 45 4 S. MORTEZA MIRAFZAL Note that in the above figure i = {i}, ij = {i, j}. Remark: In the sequel, we denote every set {x1 , x2 ..., xt } by x1 x2 ...xt . We see that in Γ = B(n, k), if v = x1 ...xk ∈ P1 = {v | v ⊂ [n], |v| = k}, then N(v) = {x1 ..xk y1 , ..., x1 ...xk yn−k } where {x1 , ..., xk , y1 , ..., yn−k } = [n] = {1, ..., n}. Hence, deg(v) = |N(v)| = n−k. On the other hand, if w = x1 ...xk xk+1 ∈ P2 = {v | v ⊂ [n], |v| = k + 1}, then N(w) = {u | u ⊂ w, |u| = k} and hence |N(w)| = deg(w) = k + 1. Therefore, if k 6= n−1 , then we have 2 n−1 k + 1 6= n − k, and thus if k 6= 2 the graph B(n, k) is not a regular graph.  Since every vertex of B(n, k) which is in P1 is of degree n − k and |P1 | = nk then the number of edges of B(n, k) is (n − k) nk and the number of vertices of   n B(n, k) is nk + k+1 . Proposition 3.2. The graph B(n, k) is bipartite and connected. Proof. Let P1 = {v | v ∈ V (B(n, k)), |v| = k} and P2 = {v | v ∈ V (B(n, k)), |v| = k + 1}. Then from the definition of the graph B(n, k) it follows that V = V (B(n, k)) = P1 ∪ P2 , P1 ∩ P2 = ∅ and every edge e = {x, y} of B(n, k) is such that only one of x or y is in P1 and the other is in P2 . we now show that B(n, k) is a connected graph. Let x, y be two vertices of B(n, k). In the first step, let x, y are in P1 . Let x = x1 x2 ...xk , y = y1 y2 ...yk and |x1 ...xk ∩ y1 ...yk | = k − t, 0 ≤ t ≤ k − 1. We can show by induction on t that d(x, y) ≤ 2t, where d(x, y) is the distance of vertices x and y in B(n, k). Let |x ∩ y| = |x1 ...xk ∩ y1 ...yk | = k − 1, then we have x = x1 ...xk−1 u, y = x1 ...xk−1 v, for some u, v ∈ [n] = {1, ...n}, v 6= u. Now if z = x1 ...xk−1 uv then P : x, z, y is a path between x and y and we have d(x, y) = 2 = 2t, for t = 1. Suppose that the assertion is true for m = t, where 1 ≤ m < k − 1. Let | x ∩ y |= k − (m + 1). Let x = x1 ...xk−m−1 u1 ...um+1 , y = x1 ...xk−m−1 v1 ...vm+1 . Then for the vertices z1 = x1 ...xk−m−1 u1 ...um+1 v1 , z2 = x1 ...xk−m−1 u1 ...um v1 , we have | z2 ∩y |= k −m, | z2 ∩x |= k −1, so by the assumption of induction we have d(x, z2 ) = 2 and d(z2 , y) = 2m, therefor d(x, y) ≤ d(x, z2 ) + d(z2 , y) = 2 + 2m = 2(m + 1). (In fact, we can show that in this case, d(x, y) = 2(m + 1)). In the second step, let x ∈ P1 and y ∈ P2 . If x = x1 x2 ...xk , y = y1 y2 ...yk yk+1, then z = y1 ...yk ∈ P1 and z is adjacent to y and by what we have seen in the CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE5 first steep there is a path between x and z in B(n, k), and therefore there is path between x and y in B(n, k). In the last step, let x, y ∈ P2 . If x = x1 ...xk xk+1 , y = y1 ...yk xk+1 . Then, for z = x1 ...xk we have z ∈ P1 and z is adjacent to x, and so according to the second step, there is a path between y and z, and therefore there is a path between x and y.  By the method which we used in the proof of Proposition 3.2. we can deduce the following result. Corollary 3.3. If D is the diameter of B(n, k), then D = 2k + 2. We know that every vertex-transitive graph is a regular graph, so if Γ is not a regular graph, then Γ is not a vertex-transitive graph. Thus, if n 6= 2k + 1, then B(n, k) is not a vertex-transitive graph. Let V = V (B(n, k)) be the vertex set of B(n, k). Then, for each σ ∈ Sym([n]), the mapping fσ : V −→ V , fσ (v) = {σ(x)| x ∈ v}, v ∈ V is a bijection of V and is an automorphism of the graph B(n, k). In fact, for each edge e = {v, w}={x1...xk , x1 ...xk xk+1 }, we have fσ (e)={fσ (v), fσ (w)} = {σ(x1 )...σ(xk ), σ(x1 )...σ(xk )σ(xk+1 )}, and consequently fσ (e) is an edge of B(n, k). Similarly, if f = {x, y} is not an edge of B(n, k) then fσ (f ) = {σ(x), σ(y)} is not an edge of B(n, k). Therefore, if S = {fσ | σ ∈ Sym([n])}, then S is a subgroup of the group G = Aut(B(n, k)). In fact, we will show that if n 6= 2k + 1, then Aut(B(n, k)) = S , and if n = 2k + 1, then Aut(B(n, k)) = S × Z2 , where Z2 is the cyclic group of order 2. It is an easy task to show that S ∼ = Sym([n]). Proposition 3.4. If Γ = B(n, k), then Γ is edge-transitive. Moreover if n = 2k + 1, then Γ is vertex-transitive. Proof. If e1 = {x1 ...xk , x1 ...xk xk+1 }, e2 = {y1 ...yk , y1 ...yk yk+1 } are edges of Γ, then we define the mapping θ=  x1 , ..., xk , xk+1 , u1 , ..., un−k−1 y1 , ..., yk , yk+1, v1 , ..., vn−k−1  where {x1 , ...xk+1 , u1 , ..., un−k−1} = {1, ..., n} = {y1 , ..., yk+1, v1 , ..., vn−k−1}. 6 S. MORTEZA MIRAFZAL It is an easy task to show that θ ∈ Sym([n]). Therefore, fθ ∈ S = {fσ | σ ∈ Sym([n])} ≤ Aut(Γ), and we have fθ (e1 ) = e2 . We now assume that n = 2k + 1. For each vertex v in V = V (B(n, k)), let v c be the complement of the set v in [n]. We define the mapping α : V −→ V by the rule, α(v) = v c , for every v in V . Since the complement of a k-subset of the set [n] is a k + 1-subset of [n], then α is a well-defined mapping. We can see, by an easy argument that α is an automorphism of B(n, k), namely, α ∈ Aut(B(n, k)), also α is of order 2. We recall that the the group Sym([n]) acts k-homogeneously on the set [n], namely it is transitive on the set of all k-subsets of [n]. Let v, w are vertices in B(n, k). If v, w are k-subsets of [n], then there is some θ ∈ Sym([n]) such that fθ (v) = w. If v is a k-subset and w is a k + 1-subset of [n], then α(w) is a k-subset of [n], and hence there is some fθ ∈ Aut(B(n, k)) such that fθ (v) = α(w), and thus (αfθ )(v) = w.  In the sequel, we want to determine Aut(B(n, k)), the automorphism group of the graph B(n, k). Let Γ = Γ(V, E) be a graph. Let v0 , v1 , ..., vh ∈ V be a sequence of distinct vertices of Γ such that {vi , vi+1 } ∈ E, 1 ≤ i ≤ h − 1, then P : (v0 , v1 , ..., vh ) is called an h-path between v0 and vh and h is called the length of the path P . if vh is adjacent to v0 , then P is called an (h + 1)-cycle of Γ. Proposition 3.5. Let Γ = B(n, k). Then every 3-path of Γ is contained in a unique 6−cycle of Γ. Proof. Let P : (v0 , v1 , v2 , v3 ) be a 3-path in the graph Γ = B(n, k). We can assume that v0 = x1 x2 ...xk . Now it is an easy task to show that P must be in the following form, P : (v0 , v0 + y = v1 , v0 + y − xi = v2 , v0 + y − xi + z = v3 ), y ∈ [n] − v0 , y 6= z ∈ [n] − v0 , 1 ≤ i ≤ k, where v + α = v ∪ {α} and v − α = v − {α}. Now, if C : (v0 , v1 , v2 , v3 , v4 , v5 ) is a 6-cycle in B(n, k) = Γ, then the vertex v4 must be adjacent to v3 , whereas v5 must be adjacent to v0 . Hence v5 is in the form v0 + t, where y 6= t ∈ [n] − v0 . Therefore, v4 is a k-subset of (k + 1)-subsets v5 and v3 , say, v4 ⊆ v3 ∩ v5 . In other words, v4 is a k-subset of [n] such that v4 ⊆ v3 = x1 ...xi−1 xi+1 ...xk yz ∩ x1 x2 ...xi−1 xi xi+1 ...xk t = v5 . Now since t 6= y, this is possible only if t = z, and therefore we must have v4 = x1 ...xi−1 xi+1 ...xk z. Thus, the following 6-cycle C is the unique 6-cycle that contains the give 3-path P , CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE7 C : (x1 ...xk , x1 ...xk y, x1 ...xi−1 xi+1 ...xk y, x1 ...xi−1 xi+1 ...xk yz, x1 ...xi−1 xi+1 ...xk z, x1 x2 ...xi−1 xi xi+1 ...xk z).  Let Γ be a graph and G = Aut(Γ). For a vertex v of Γ let Lv be the set of all elements g of Gv such that g fixes each element of N(v). Let Lvw = Lv ∩ Lw . Lemma 3.6. Let Γ be a graph such that the degree of every vertex in Γ, is greater than 1. Let G = Aut(Γ). If v is a vertex of Γ of degree b, and w is an element of N(v) of minimum degree m, then | Gv |≤ b!(m − 1)! | Lvw |. Proof. Let Y = N(v) and Φ : Gv −→ Sym(Y ) be defined by the rule, Φ(g) = g|Y for any element g in Gv , where g|Y is the restriction of g to Y . In fact, Φ is a v is isomorphic with group homomorphism and ker(Φ) = Lv . Thus, the group G Lv |Gv | a subgroup of Sym(Y ). Since, |Y | = deg(v) = b, therefore |Lv | ≤ b!, and thus |Gv | ≤ (b!)|Lv | . Let w be an element of N(v) of degree l and Z = N(w) − {v}, and Ψ : Lv −→ Sym(Z) is defined by Ψ(h) = h|Z , for any element h in Lv . Then the kernel of the homomorphism Ψ is Lvw and since |Z| = l − 1, thus | Lv | ≤ (l − 1)!|Lvw |. We now have |Gv | ≤ b!(l − 1)!|Lvw |. Now, if w is an element in N(v) of minimum degree m, then we deduce the result.  From the previous lemma it follows that, if Γ is a regular graph of degree m, then for every edge {v, w} of Γ we have |Gv | ≤ m!(m − 1)!|Lvw |. Theorem 3.7. Let n ≥ 4, [n] = {1, ..., n} and 1 ≤ k < n2 . Let Γ = B(n, k) be the graph with vertex set V = {v|v ⊆ [n], |v| ∈ {k, k + 1}} and edge set E = {{v, w}|v, w ∈ V, v ⊂ w or w ⊂ v}. If Γ is non regular (n 6= 2k + 1), then Aut(Γ) ∼ = Sym([n]), and if Γ is regular (n = 2k + 1), then Aut(Γ) ∼ = Sym([n]) ×Z2 where Z2 is the cyclic group of order 2. Proof. Let G = Aut(Γ) and v ∈ V be such that |v| = k, and w ∈ N(v). In the first step, we show that Lvw = {1}. In other words, we show that if f ∈ Lvw , then f is the identity mapping on V , say, f (u) = u, for every vertex in V . Let x be a vertex of Γ of distance 2 from v. If x is adjacent to w, then f (x) = x. If x is not adjacent to w, then there is a vertex y adjacent to v such that vyx is a 2-path of Γ. Then xyvw is a 3-path of the graph Γ = B(n, k). We let C : xyvwtu be the unique 6-cycle that contains the 3-path xyvw. Then f (C) is the 6-cycle f (x)yvwtf (u), thus C and f (C) contains the 3-path yvwt, hence f (C) = C. Therefore, f|V (C) is an automorphism of the 6-cycle C that fixes the 2-path wvy, and hence f fixes all vertices of this cycle, and hence we have f (x) = x. We 8 S. MORTEZA MIRAFZAL know, by Proposition 3.2. that the graph Γ is a connected graph, hence we can show by induction on the d(v, u) ( d(v, u) is the distance of the vertex u from the vertex v ), u ∈ V , that f (u) = u. We now want to show that if B(n, k) is non regular, then |Aut(B(n, k))| ≤ n!, and if B(n, k) is regular, then |Aut(B(n, k))| ≤ 2(n!) . In the first step, assume B(n, k) is non regular, namely, 2k 6= n − 1. Let v be a vertex of the graph Γ such that |v| = k. We know that Sym([n]) ≤ Aut(Γ), hence the set O = {σ(v) | σ ∈ Sym([n])} is a subset of V containing of all k-subset of [n]. Let O1 = {g(v) | g ∈ Aut(Γ)}. Since v is of degree n − k, then every vertex in O1 is of degree n − k, and hence each element of the set O1 is a k-subset of [n], and therefore we have O1 ⊆ O. On the other hand, since Sym([n]) ⊆ Aut(Γ), then O ⊆ O1 , and consequently we have O1 = O. In other words, O is an orbit of the group G = Aut(Γ) on the set V . Therefore, by the orbit-stabilizer theorem,  |G| n , and hence |G| = |O| |G | = |Gv |. Since every vertex that we have |O| = |G v k v| adjacent to the vertex v is of degree k + 1, then by the Lemma 3.6, we have; |Aut(Γ)| = |G| = n k  |Gv | ≤ n k  (k + 1 − 1)!(n − k)! =n! Now since S = {fσ | σ ∈ Sym([n])} ≤ Aut(Γ) , we deduce that S = Aut(Γ) and hence Aut(Γ) ∼ = Sym([n]). We now assume that n = 2k + 1. Note that, in this case,  Γ is a regular graph, n n n the degree of each vertex is k + 1, and |V |= k + k+1 = 2 k . We know, by Proposition 3.4. that B(2k + 1, k) is a vertex transitive graph. Therefore, by orbit-stabilizer theorem and proposition 3.6. we have; |Aut(Γ)| = |G| =2 n k  |Gv | ≤ 2 n k  (k + 1 − 1)!(k + 1)! = n! (k!)(k + 1)!=2(n!) 2 (k!)(k+1)! Let α be the mapping which is defined in the proof of Proposition 3.4. We assert that α 6= fθ for every θ ∈ Sym([n]). In fact, If fθ = α for some θ ∈ Sym[n], Since o(α) = 2 (o(α) = the order of α) then, o(fθ ) = o(θ) = 2. Note that θ has no fixed points, say θ(x) 6= x, for every x ∈ [n]. In fact if x ∈ [n], and θ(x) = x, then for the k-set v = {x, y1 , ..., yk−1} ⊆ [n], we have fθ (v) = {θ(x), θ(y1 ), ..., θ(yk−1)} = {x, θ(y1 ), ..., θ(yk−1 )}, so x ∈ fθ (v)∩v, and hence fθ (v) 6= v c = α(v), which is a contradiction. Therefore θ is of the form θ = (x1 , y1 )...(xm , ym ), where (xi , yi ) is a transposition of Sym([n]). This implies CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE9 that n = 2m, which is a contradiction, because n = 2k + 1, namely, n is an odd integer. We assert that, for every θ ∈ Sym([n]), we have fθ α = αfθ . In fact, if v = {x1 , ..., xk } is a k-subset of [n], then there are yj ∈ [n], 1 ≤ j ≤ k + 1, such that [n] = {x1 , ..., xk , y1, ..., yk+1}. Now we have, fθ α(v) = fθ {y1 , ..., yk+1} = {θ(y1 ), ..., θ(yk+1)}. On the other hand, we have αfθ (v) = α{θ(x1 ), ..., θ(xk )} = {θ(y1 ), ..., θ(yk+1)}, because [n] = θ[n] = {θ(x1 ), ..., θ(xk ), θ(y1 ), ..., θ(yk+1)}. Therefore we have, fθ α(v) = αfθ (v). Similarly, we can show that if w is a k + 1-subset of [n], then we have fθ α(w) = αfθ (w). We now deduce that fθ α = αfθ . Now, if we let H = {fθ α | θ ∈ Sym[n]}, then H is a subgroup of Aut(B(n, k)) of order 2(n!), and hence Aut(B(n, k)) = H. If we let K = {fθ | θ ∈ Sym([n])}, then K and < α > are normal subgroups of H, and therefore we have H ∼ = K× < α > ∼ which implies that Aut(B(n, k)) = Sym([n]) × Z2 .  Let Γ be a graph. The line graph L(Γ) of the graph Γ is constructed by taking the edges of Γ as vertices of L(Γ), and joining two vertices in L(Γ) whenever the corresponding edges in Γ have a common vertex. It is an easy task to show that if θ ∈ Aut(Γ), then the mapping f (θ) : V (L(Γ)) → V (L(Γ)) defined by; f (θ)({u, v}) = {θ(u), θ(v)}, {u, v} ∈ E(Γ) is an automorphism of the graph L(Γ). Hence, it is clear that if a graph Γ is edge-transitive, then its line graph is vertex transitive. There is an important relation between Aut(Γ) and Aut(L(Γ)). In fact, we have the following result [2, chapter 15]. Theorem 3.8. The mapping θ : Aut(Γ) → Aut(L(Γ)) defined by the rule, θ(g){u, v}={g(u), g(v)}, g ∈ Aut(Γ), {u, v} ∈ E(Γ) is a group homomorphism and in fact we have; (i) θ is a monomorphism provided Γ 6= K2 ; (ii) θ is an epimorphism provided Γ is not K4 , K4 with one edge deleted, or K4 with two adjacent edges deleted. Let [n] = {1, ..., n}, n ≥ 4 and Γ = B(n, k). We let the graph Γ1 = L(Γ), the line graph of the graph Γ. Then, each vertex in Γ1 is of the form {A, Ay}, where A ⊆ [n], |A| = k, y ∈ [n] − A and Ay = A ∪ {y}. Two vertices {A, Ay} and {B, Bz} are adjacent in Γ1 if and only if A = B and y 6= z, or Ay = Bz and 10 S. MORTEZA MIRAFZAL A, B are distinct k-subset of Ay. In other words, if A = x1 ...xk ⊆ [n], thus for the vertex v = {A, Ay1 } of Γ1 = L(B(n, k)), we have; N(v) = {{A, Ay2 }, ..., {A, Ayn−k }, {Ay1 − {x1 }, Ay1 }, ..., {Ay1 − {xk }, Ay1 }}. Hence, the graph L(B(n, k)) is a regular graph of valency n − k − 1 + k = n − 1. In other words, the degree of each vertex in the graph L(B(n, k)) is independent of k. In fact, the graph L(B(n, k)) is a vertex-transitive graph, because by Theorem 3.4. the graph B(n, k) is an edge-transitive graph. The following figure shows the graph L(B(4, 1)) in the plane. 1,13 1,12 1,14 2,12 4,41 2,23 3,23 2,24 4,24 3,31 Figure 2: L(B(4,1)) 4,43 3,34 Note that in the above figure i, ij = {{i}, {i, j}}. The graph L(B(n, k)) has some interesting properties, for example, if n, k are odd integer, then L(B(n, k)) is a hamiltonian graph. In fact, if v is a vertex in B(n, k), then deg(v) ∈ {k+1, n−k}, and therefore, the degree of each vertex in the graph B(n, k) is an even integer, and hence B(n, k) is eulerian [4]. Consequently, the graph L(B(n, k)) is a hamiltonian graph. We know that the graph L(B(n, k)) is a vertex-transitive graph. There is a well known conjecture in graph theory which asserts that almost all vertex-transitive connected graphs are hamiltonian [18]. Depending on this conjecture and what is mentioned in above, it seems that the following conjecture has an affirmative answer. CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE11 conjecture The line graph of B(n, k), namely, L(B(n, k)) is a hamiltonian graph. A graph Γ is called an integral graph, if all of its eigenvalues are integer. The notion of integral graphs was first introduced by F. Harary and A.J. Schwenk in 1974 [11]. In general, the problem of characterizing integral graphs seems to be very difficult. There are good surveys in this area (for example [5]). In the scope of present paper, we have the following result [23]. Fact Let n > 3 be an integer. Then, the graph L(B(n, 1)) is a vertex-transitive integral graph with distinct eigenvalues −2, −1, 0, n − 2, n − 1. We now, by Theorem 3.7. and Theorem 3.8. have the following result. Theorem 3.9. Let n ≥ 4, [n] = {1, ..., n}, 1 ≤ k < n2 . If Γ = B(n, k) and n 6= 2k + 1, then Aut(L(Γ)) ∼ = = Sym([n]). If n = 2k + 1, then Aut(L(Γ)) ∼ Sym([n]) × Z2 We now proceed to determine for what values of n, k, the graph L(B(n, k)) is a Cayley graph. A permutation group G, acting on a set V , is k-homogeneous if its induced action on V {k} is transitive, where V {k} is the set of all k-subsets of V . Also we say that G is k-transitive if G is transitive on V (k) , where V (k) is the set of k-tuples of distinct elements of V . Note that if G is k-homogeneous, then we n! ||G|. If the group G have nk ||G|, and if G is k-transitive, then we have (n−k)! (k) acts regularly on V , then G is said to be sharply k-transitive on V . This means that for given two k-tuples in V (k) , there is a unique permutation in G mapping one k-tuple to the other. We need the following result [7. Theorem 9.4B, 16, 17], which is a very deep result in group theory. Theorem 3.10. Let G be a k-homogeneous group on a finite set Ω, |Ω| = n, where 2 ≤ k ≤ n2 . Then G is (k − 1)-transitive, and with the following exceptions G is k-transitive: (a) k = 4 and, G = P GL2 (8), P ΓL2 (8), P ΓL2 (32); (b) k = 3 and, P SL2 (q) ≤ G ≤ P ΣL1 (q), q ≡ 3 (mod 4); (c) k = 3 and, G = AGL1 (8), AΓL1 (8), AΓL1 (32); (d) k = 2 and, ASL1 (q) ≤ G ≤ AΣL1 (q), q ≡ 3 (mod 4). Also, we need the following result [26, chap 7] in the sequel. 12 S. MORTEZA MIRAFZAL Theorem 3.11. Let G be a sharply 2-transitive permutation group on a finite set V . Then the degree of G is pm for some prime p. Moreover, G is similar to a subgroup of Af f (W ) which contains the translation group where W is a vector space of dimension m over GF (p). We now proceed to prove the most important result of our work. Theorem 3.12. Let n, k are integers, 3 < n, 1 ≤ k < n2 and n 6= 2k + 1. Then the graph L(B(n, k)) is a non Cayley graph if each of the following holds, (i) k ≥ 2 (ii) k = 1 and n is not a power of a prime integer. Proof. On the contrary, assume that the graph Γ = L(B(n, k)) is a Cayley graph, then the automorphism group Aut(Γ) contains a subgroup G such that G acts regularly on the vertex set of Γ [2, chap 16]. We know by Theorem 3.7. and Theorem 3.8. that Aut(Γ) = {fθ | θ ∈ Sym([n])}. We let G1 ={θ | fθ ∈ G}, then G1 is a subgroup of Sym([n]) which is isomorphic with the group G, and G1 is (k + 1)-homogeneous on the set [n] = {1, 2, ..., n}. Note that each vertex v = {A, Ax} in the graph L(B(n, k)) consist of a k-subset and a (k + 1)-subset of [n] and the group G acts transitively on the vertex-set of the graph Γ. In fact, if A, B are given (k +1)-subsets of the set [n], then we choose k-subsets C, D of A, B respectively, and thus {A, C}, {B, D} are vertices of the graph Γ = L(B(n, k)), and hence there is some element fθ ∈ G such that fθ ({A, C}) = {θ(A), θ(C)} = {B, D}, which implies that θ(A) = B, where θ ∈ G1 . Now, by comparing the order of the group G1 with orders of the groups which appear in the cases a,b,c,d in Theorem 3.10. we conclude by Theorem 3.10. that the group G1 is a (k + 1)-transitive permutation group on the set [n]. Hence, if u1 = (x1 , x2 , ..., xk , xk+1 ), is a (k + 1)-tuple of distinct elements of [n], then for u2 = (x1 , xk+1 , xk , ..., x3 , x2 ), there is an element θ ∈ G1 such that, θ(u1 ) = (θ(x1 ), θ(x2 ), ..., θ(xk ), θ(xk+1 )) = u2 = (x1 , xk+1 , xk , ..., x3 , x2 ) Now, for the k-subset A = {x2 , ..., xk , xk+1 } we have; θ(A) = {θ(x2 ), θ(x3 ), ..., θ(xk ), θ(xk+1 )} = A Note that if k = 1, then θ can be the identity element of the group G1 , but if k > 1, then θ 6= 1, and hence in the first step we assume that k > 1. Therefore, if we consider the k-subset A = {x2 , ..., xk , xk+1 } of [n], then v = [A, Ax1 ] is a vertex of the graph Γ = L(B(n, k)), and thus, for the element fθ in the group G we have, fθ (v) = [θ(A), θ(Ax1 )] = [A, Aθ(x1 )] = [A, Ax1 ] = v CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE13 which is a contradiction, because 1 6= fθ ∈ G and the group G acts regularly on the vertex set of the graph Γ. Consequently, if k > 1, then the graph L(B(n, k)) is a vertex-transitive non Cayley graph. We now assume that k = 1. Before proceeding, we mention that we do not luckily need Theorem 3.10. however, this theorem do not work in the sequel. We know that |V | = n(n − 1) and G is a subgroup of Aut(Γ) which is regular on the set V , thus |G| = n(n − 1) and hence |G1 | = n(n − 1). We assert that G1 is 2-transitive on the set [n]. If (i, j) and (r, s) are 2-tuples of distinct elements of [n], then [i, ij] and [r, rs] are vertices of the graph L(B(n, 1)), and thus there is some fθ in G such that fθ ([i, ij]) = [θ(i), θ(i)θ(j)] = [r, rs] which implies that for θ ∈ G1 we have θ(i) = r, θ(j) = s, namely θ(i, j) = (r, s). Therefore, G1 is a 2-transitive group on [n] of order n(n − 1), and hence G is sharply 2-transitive on [n]. Therefore, by Theorem 3.11. the integer n is of the form pm for some prime p. In other words, if n is not a power of a prime, then the graph L(B(n, 1)) has no subgroup G in its automorphism group such that G acts regularly on the vertex set of L(B(n, 1)), and hence this graph is not a Cayley graph.  The above theorem do not say anything if n is a power of a prime, but we can show that the graph L(B(4, 1)) which is displayed in Figure 2. is a Cayley graph. In fact we have the following result. Proposition 3.13. Let G = A4 , the alternating group of degree 4 on the set [4]={1, 2, 3, 4}. Let ρ = (1, 2, 3) and a = (1, 2)(3, 4). If Γ is the Cayley graph Cay(G; S) where S = {ρ, ρ2 , a}, then Γ is isomorphic with B(L(4, 1)). In other words, L(B(4, 1)) is a Cayley graph. Proof. Let b = (1, 3)(2, 4), c = (1, 4)(2, 3). Now, since H = {1, ρ, ρ2 } is a subgroup of G, then G = H ∪ aH ∪ bH ∪ cH. Note that K = {1, a, b, c}, is an abelian subgroup of the group G, with the property that the order of each non identity element of G is 2, and in G we have ab = c, bc = a, ca = b. We know that in the Cayley graph Cay(G; S), each vertex v is adjacent to every vertex vs, s ∈ S and hence if v ∈ {a, b, c}, then N(v) = {va, vρ, vρ2}, where N(v) is the set of neighbours of v. Now a simple computation show that Figure 3, displays the graph Cay(A4 ; S) in the plane, which is isomorphic with the graph L(B(4, 1)). In fact, we have, 14 S. MORTEZA MIRAFZAL ρ−2 cρ2 =ρ−2 (1, 4)(2, 3)ρ2=(3, 4)(1, 2)=a ∈ S, which implies that ρ2 is adjacent to cρ2 . (aρ)−1 cρ=ρ−1 (ac)ρ= ρ−1 bρ=ρ−1 (1, 3)(2, 4)ρ=a ∈ S, which implies that aρ is adjacent to cρ. (aρ2 )−1 bρ2 = ρ−2 abρ2 = ρ−2 cρ2 = ρ−2 (1, 4)(2, 3)ρ2= (3, 4)(1, 2)= a ∈ S, which implies that aρ2 is adjacent to bρ2 . cb = a ∈ S which implies that c is adjacent to b. Also, note that H, aH, bH, cH, are 3-cliques in Cay(G; S).  ρ 1 ρ2 a cρ2 aρ cρ 2 aρ bρ2 c bρ Figure 3: Cay(A4 ; {(1, 2, 3), (1, 3, 2), (1, 2)(3, 4)}) b We now want to show that if n = pm , for some prime p, then the line graph of B(n, 1), namely, the graph L(B(n, k)) is a Cayley graph. In the first step, note that in L(B(n, 1)), the subgraph induced by the set Ci = {[i, ij | j ∈ [n], j 6= i}, 1 ≤ i ≤ n, is a (n − 1)-clique. Also, V (L(B(n, 1))) = (∪Ci )i∈[n] and for each pair of cliques Ci , Cj in L(B(n, 1) there is exactly one pair of vertices vi ∈ Ci , vj ∈ Cj , say [i, ij], [j, ji], such that vi is adjacent to vj . In fact, every regular graph Γ of order n(n − 1) and valency n − 1 with these properties is isomorphic with L(B(n, 1)). Theorem 3.14. Let Γ be a regular graph of order n(n − 1) and valency n − 1. Suppose that in Γ there are n disjoint (n−1)-cliques D1 , ..., Dn , such that V (Γ) = CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE15 (∪Di )i∈[n] and for each pair of distinct cliques Di , Dj in Γ there is exactly one pair of vertices vi , vj such that vi ∈ Di , vj ∈ Dj and vi is adjacent to vj . Then, Γ is isomorphic with L(B(n, 1)). Proof. In the first step, note that each vertex v in a (n − 1)−clique D is adjacent to exactly one vertex w which is not in D, because v is of degree n − 1. We now, choose one of the cliques in Γ and label it by C1 . we let vertices in C1 are {v[1, 12], ..., v[1, 1n]}. If D is a clique in Γ different from C1 , then there is exactly one integer j, 2 ≤ j ≤ n, such that v[1, 1j] is adjacent to exactly one vertex of D, say, vD . Then, we label the clique D by Cj . We now label the vertices in Cj as follows, If v ∈ Cj , then there is exactly one i, i ∈ {1, 2, ..., n}, i 6= j such that v is adjacent to exactly one vertices in Ci , now in such a case, we label v by v[j, ij]. Now, it is an easy task to show that the mapping φ : V (L(B(n, k))) −→ V (Γ), defined by the rule, φ([j, ij]) = v[j, ij] is a graph isomorphism.  Let H, K are groups, with H acting on K in such a way that the group structure of K is preserved ( for example H is a subgroup of automorphisms of the group K). So for each u ∈ K and x ∈ H the mapping u −→ ux is an automorphism of K ( Note that the action of H on K is not specified directly). The semi-direct product of K by H denoted by K ⋊ H is the set, K ⋊ H = {(u, x) | u ∈ K, x ∈ H } with binary operation (u, x)(v, y) = (uv x , xy) −1 Theorem 3.15. if n = pm , for some prime p, then the line graph of B(n, 1), namely, the graph L(B(n, 1)) is a Cayley graph. Proof. Consider the finite field GF (n) and let K be the group K = (GF (n), +). For each 0 6= a ∈ K, we define the mapping fa : K −→ K, by the rule fa (x) = ax, x ∈ K. Then, fa is an automorphism of the group K and H = {fa | 0 6= a ∈ K} is a group ( with composition of functions ) of order n − 1 which is isomorphic with the multiplicative group of the field GF (pm ). If we let G = K ⋊ H, then G is a well defined group of order n(n − 1). Note that G is not an abelian group. Let T = {(0, h) | h ∈ H}. Then, T is a subgroup of order n − 1 in the group G which is isomorphic with H and [G : T ] = n, where [G : T ] is the index of T in G. Hence, there are elements b1 , ..., bn in G such that G = b1 T ∪ ... ∪ bn T , and if 2 i 6= j, then bi T ∩ bj T = ∅. Note that f−1 ∈ H and f−1 = i, where i is the identity element of H. Then, for the element α = (1, f−1), we have, 16 S. MORTEZA MIRAFZAL α2 = (1, f−1 )(1, f−1 ) = (1 + (−1)1, (f−1 )2 )= (0, i) = e where e is the identity element of G. Note that α ∈ / T. We now let Γ = Cay(G; S), where S = (T − {e}) ∪ {α}. Note that S = S −1 , because T is a subgroup of G and α2 = 1 (and consequently α−1 = α ∈ S). Since, in the graph Γ vertices x, y are adjacent if and only if x−1 y ∈ S, then for each i, 1 ≤ i ≤ n the subgraph induced by the set Ci = bi T , is a (n − 1)-clique in Γ. Since α ∈ / T , then Ci ∩ Ci α = ∅. In fact, if v = bi t = bi t1 α, t1 , t ∈ T , then t = t1 α, and hence α ∈ T which is a contradiction. Therefore, if v ∈ Cj , then v is adjacent to vα and vα ∈ Ci , i 6= j. Since Γ is a regular graph of valency n − 1, then for each vertex v ∈ Ci there is exactly one j, j 6= i such that v is adjacent to exactly one vertex w in Cj . Now, by Theorem 3.14. we conclude that Γ is isomorphic with L(B(n, 1)), and therefore the graph L(B(n, 1)) is a Cayley graph.  References [1] Brian Alspach, Cayley graphs, Topics in Algebraic Graph Theory, section 6, Cambridge University Press (2005). [2] N. L. Biggs, Algebraic Graph Theory (Second edition), Cambridge Mathematical Library (Cambridge University Press, Cambridge, 1993). [3] N. Biggs, Some odd graph theory, Ann. New York Acad. Sci. 319 (1979) 71-81. [4] J. A. Bondy, U. S. R. Murty, Graph Theory, Springer, 2008. [5] D. Cvetkovic, Z. Rodosavljevic, and S.K. Simic, Errata, A survey on integral graphs, Univ. Beograde. Publ. Elektrotehn. Fak. Ser. Mat. 15 (2004), 112. [6] Cristina Dalfo, Miquel Angel Fiol, Margarida Mitjana, On Middle Cube Graphs, Electronic Journal of Graph Theory and Applications 3 (2) (2015), 133145. [7] J.D. Dixon, B. Mortimer, Permutation Groups, Springer-Verlag, New York, 1996. [8] C. Godsil, G. Royle, Algebraic Graph Theory, Springer 2001. [9] C. D. Godsil, More odd graph theory, Discrete Mathematics 32 (1980). 205-207. [10] F. Harary, J. P. Hayes, and H. J. Wu, A survey of the theory of hypercube graphs, Comp. Math. Appl. 15 (1988), no. 4, 277289. [11] F. Harary and A.J. Schwenk, Which graphs have integral spectra?, In Graphs and Combinatorics, (eds. R. Bari and F. Harary), (Proc. Capital Conf., George Washington Univ., Washington, D.C., 1973), Lecture Notes in Mathematics 406, Springer-Verlag, Berlin (1974), 45-51. [12] I. Havel, Semipaths in directed cubes, in M. Fiedler (Ed.), Graphs and other Combinatorial Topics, TeunebnerTexte Math., Teubner, Leipzig (1983). CAYLEY PROPERTIES OF LINE GRAPHS OF CONSECUTIVE LAYERS OF HYPERCUBE17 [13] Jong-Seok Kim, Eddie Cheng, Laszlo Liptak and Hyeong-Ok Lee, Embedding hypercubes, rings, and odd graphs into hyper-stars, International Journal of Computer Mathematics, Vol. 86, No. 5, May 2009, 771-778 [14] Gareth A. Jones, Automorphisms and regular embeddings of merged Johnson graphs, European Journal of Combinatorics 26 (2005) 417435 [15] Gareth A. Jones, Robert Jajcay, Cayley properties of merged Johnson graphs, J Algebr Comb (2016) 44:1047-1067. [16] W. Kantor, k-homogeneous groups, Math. Z. 124 (1972) 261-265. [17] D. Livingstone, A. Wagner, Transitivity of finite permutation groups on unordered sets, Math. Z. 90 (1965) 393-403. [18] L. Lovasz, Problem 11 in: Combinatorial structures and their applications, (Proc. Calgary Internat. Conf., Calgary, Alberta, 1969), Gordon and Breach, New York, 1970, pp. 243246 [19] S. Morteza Mirafzal. On the symmetries of some classes of recursive circulant graphs, Transactions on Combinatorics, Volume 3, Issue 1, March 2014, 1-6. [20] S. Morteza Mirafzal, On the automorphism groups of regular hyperstars and folded hyperstars, Ars Comb, 123, 75-86 (2015). [21] S. Morteza Mirafzal, Some other algebraic properties of folded hypercubes, Ars Comb. 124, 153-159 (2016). [22] S. Morteza Mirafzal, More odd graph theory from another point of view, Discrete Mathematics, 341 (2018), 217-220. [23] S. Morteza Mirafzal, A class of integral graphs constructed from the hypercube, 2017, arXiv:1711.00488v1. [24] S. Morteza Mirafzal, A note on the automorphism groups of Johnson graphs, 2017, arXiv: 1702.02568v4. [25] T. Mutze and F. Weber. Construction of 2-factors in the middle layer of the discrete cube. J. Combin. Theory Ser. A, 119(8):1832-1855, 2012. [26] Derek J. S. Robinson, A Course in the Theory of Groups, Springer-verlag, 1982. Department of Mathematics, Lorestan University, Khoramabad, Iran E-mail address: [email protected] E-mail address: [email protected]
4math.GR
arXiv:1711.03028v2 [cs.PL] 13 Dec 2017 Simplicity: A New Language for Blockchains Russell O’Connor [email protected] 2017-12-13 Abstract Simplicity is a typed, combinator-based, functional language without loops and recursion, designed to be used for crypto-currencies and blockchain applications. It aims to improve upon existing crypto-currency languages, such as Bitcoin Script and Ethereum’s EVM, while avoiding some of the problems they face. Simplicity comes with formal denotational semantics defined in Coq, a popular, general purpose software proof assistant. Simplicity also includes operational semantics that are defined with an abstract machine that we call the Bit Machine. The Bit Machine is used as a tool for measuring the computational space and time resources needed to evaluate Simplicity programs. Owing to its Turing incompleteness, Simplicity is amenable to static analysis that can be used to derive upper bounds on the computational resources needed, prior to execution. While Turing incomplete, Simplicity can express any finitary function, which we believe is enough to build useful “smart contracts” for blockchain applications. 0 License This work is licensed under a Creative Commons “Attribution 4.0 International” license. 〈https://creativecommons.org/licenses/by/4.0/deed.en〉 1 Introduction Blockchain and distributed ledger technologies define protocols that allow large, ad-hoc, groups of users to transfer value between themselves without needing to trust each other or any central authority. Using public-key cryptography, users can sign transactions that transfer ownership of funds to other users. To prevent transactions from conflicting with each other, for example when one user attempts to transfer the same funds to multiple different users at the same time, a consistent sequence of blocks of transactions is committed using a proof of work scheme. This proof of work is created by participants called miners. Each user verifies every block of transactions; among multiple sequences of valid blocks, the sequence with the most proof of work is declared to be authoritative. 1 Bitcoin [20] was the first protocol to use this blockchain technology to create a secure and permissionless crypto-currency. It comes with a built-in programming language, called Bitcoin Script [6, 22], which determines if a transaction is authorized to transfer funds. Rather than sending funds to a specific party, users send funds to a specific Bitcoin Script program. This program guards the funds and only allows them to be redeemed by a transaction input that causes the program to return successfully. Every peer in the Bitcoin network must execute each of these programs with the input provided by the transaction data and all these programs must return successfully in order for the given transaction to be considered valid. A typical program specifies a public key and simply requires that a valid digital signature of the transaction for that key be provided. Only someone with knowledge of the corresponding private key can create such a signature. Funds can be guarded by more complex programs. Examples range from simpler programs that require signatures from multiple parties, permitting escrow services [14], to more complex programs that allow for zero-knowledge contingent payments [19], allowing for trustless and atomic purchases of digital data. This last example illustrates how Bitcoin Script can be used to build smart contracts, which allow parties to create conditional transactions that are enforced by the protocol itself. Because of its Script language, Bitcoin is sometimes described as programmable money. 1.1 Bitcoin Script Bitcoin Script is a stack-based language similar to Forth. A program in Bitcoin Script is a sequence of operations for its stack machine. Bitcoin Script has conditionals but no loops, thus all programs halt and the language is not Turing complete. Originally, these programs were committed as part of the output field of a Bitcoin transaction. The program from the output being redeemed is executed starting with the initial stack provided by the input redeeming it. The program is successful if it completes without crashing and leaves a non-zero value on the top of stack. Later, a new option called pay to script hash (P2SH) [1] was added to Bitcoin. Using this option, programs are committed by specifying a hash of the source code as part of the output field of a Bitcoin transaction. The input field of a redeeming Bitcoin transaction then provides both the program and the initial stack for the program. The transaction is valid if the hash of the provided program matches the hash specified in the output being redeemed, and if that program executes successfully with the provided input, as before. The main effect here is moving the cost of large programs from the person sending funds to the person redeeming funds. Bitcoin Script has some drawbacks. Many operations were disabled by Bitcoin’s creator, Satoshi Nakamoto [21]. This has left Bitcoin Script with a few arithmetic (multiplication was disabled), conditional, stack manipulation, hash2 ing, and digital-signature verification operations. In practice, almost all programs found in Bitcoin follow a small set of simple templates to perform digital signature verification. However, Bitcoin Script also has some desirable properties. All Bitcoin Script operations are pure functions of the machine state except for the signature-verification operations. These signature-verification operations require a hash of some of the transaction data. Together, this means the program’s success or failure is purely a function of the transaction data. Therefore, the person creating a transaction can know whether the transaction they have created is valid or not. Bitcoin Script is also amenable to static analysis, which is another desirable property. The digital-signature verification operations are the most expensive operations. Prior to execution, Bitcoin counts the number of occurrences of these operations to compute an upper bound on the number of expensive calls that may occur. Programs whose count exceeds a certain threshold are invalid. This is a form of static analysis that ensures the amount of computation that will be done isn’t excessive. Moreover, before committing a program to an output, the creator of the program can ensure that the amount of computation that will be done will not be excessive. 1.2 Ethereum and the EVM Ethereum [31] is another crypto-currency with programmable transactions. It defines a language called EVM for its transactions. While more expressive and flexible than Bitcoin Script, the design of Ethereum and the EVM has several issues. The EVM is a Turing-complete programming language with a stack, random access memory, and persistent storage. To prevent infinite loops, execution is limited by a counter called gas, which is paid for in Ethereum’s unit of account, Ether, to the miner of the block containing the transaction. Static analysis isn’t practical with a Turing-complete language. Therefore, when a program runs out of gas, the transaction is nullified but the gas is still paid to the miner to ensure they are compensated for their computation efforts. Because of direct access to persistent storage, EVM programs are a function of both the transaction and the state of the blockchain at the point the transaction is inserted into the blockchain. This means users cannot necessarily know what the result of their transaction will be when they create it, nor can they necessarily know how much gas will be consumed. Users must provide enough gas to cover the worst-case use scenario and there is no general purpose algorithm that can compute that bound. In particular, there is no practical general purpose way to tell if any given program will run out of gas in some context either at redemption time or creation time. There have been some efforts to perform static analysis on a subset of the EVM language [5], but these tools are limited (e.g. they do not support programs with loops). Unlike Bitcoin, there are many instances of ad-hoc, one-off, special purpose programs in Ethereum. These programs are usually written in a language called 3 Solidity [12] and compiled to the EVM. These ad-hoc programs are regularly broken owing to the complex semantics of both Solidity and the EVM; the most famous of these failures were the DAO [8] and Parity’s multiple signature validation program [26]. 1.3 A New Language In this paper, we propose a new language that maintains or enhances the desirable properties that Bitcoin Script has while adding expressiveness. Our design goals are: • Create an expressive language that provides users with the tools needed to build novel programs and smart contracts. • Enable static analysis that provides useful upper bounds on the amount of computation required. • Minimize bandwidth and storage requirements and enhance privacy by removing unused code at redemption time. • Maintain Bitcoin’s design of self-contained transactions whereby programs do not have access to any information outside the transaction. • Provide formal semantics that facilitate easy reasoning about programs using existing off-the-shelf proof-assistant software. A few of these goals deserve additional explanation: Static analysis allows the protocol to place limits on the amount of computation a transaction can have, so that nodes running the protocol are not overly burdened. Furthermore, the static analysis can provide program creators with a general purpose tool for verifying that the programs they build will always fit within these limits. Additionally, it is easy for the other participants in a contract to check the bounds on the smart contract’s programs themselves. Self-contained transactions ensure that execution does not depend on the global state of the blockchain. Once a transaction’s programs have been validated, that fact can be cached. This is particularly useful when transactions are being passed around the network before inclusion in the blockchain; once included in the blockchain, the programs do not need to be executed again. Finally, formal semantics that work with proof-assistant software provide the opportunity for contract developers to reason about their programs to rule out logical errors and to help avoid scenarios like the DAO and Parity’s multisignature program failure. Like Bitcoin Script and the EVM, our language is designed as low-level language for executing smart contracts, not as a language for coding in directly. As such, we expect it to be a target for other, higher-level, languages to be compiled to. We call our new language Simplicity. 4 s:A`B t:B`C comp s t : A ` C iden : A ` A unit : A ` 1 t:A`B injl t : A ` B + C t:A`C injr t : A ` B + C s:A×C `D t:B×C `D case s t : (A + B) × C ` D s:A`B t:A`C pair s t : A ` B × C t:A`C take t : A × B ` C t:B`C drop t : A × B ` C Figure 1: Typing rules for the terms of core Simplicity. 2 Core Simplicity Simplicity is a typed combinator language. Each well-typed Simplicity expression is associated with two types, an input type and an output type. Every expression denotes a function from its input type to its output type. 2.1 Types in Simplicity Types in Simplicity come in three flavors. • The unit type, written as 1, is the type with one element. • A sum type, written as A + B, contains the tagged union of values from either the left type A or the right type B. • A product type, written as A × B, contains pairs of elements with the first one from the type A and the second one from the type B. There are no recursive types in Simplicity. Every type in Simplicity only contains a finite number of values; the number of possible values a type contains can be computed by interpreting the type as an arithmetic expression. 2.2 Terms in Simplicity The term language for Simplicity is based on Gentzen’s sequent calculus [13]. We write a type-annotated Simplicity expression as t : A ` B where t a Simplicity expression, A is the expression’s input type, and B is the expression’s output type. 5 The core of Simplicity consists of nine combinators for building expressions. They capture the fundamental operations for the three flavors of types in Simplicity. The typing rules for these nine combinators is given in Figure 1. We can classify the combinators based on the flavor of types they support. • The unit term returns the singular value of the unit type and ignores its argument. • The injl and injr combinators create tagged values, while the case combinator, Simplicity’s branching operation, evaluates one of its two subexpressions based on the tag of the first component of its input. • The pair combinator creates pairs, while the take and drop combinators access first and second components of a pair respectively. • The iden and comp combinators are not specific to any flavor of type. The iden term represents the identity function for any type and the comp combinator provides function composition. Simplicity expressions form an abstract syntax tree. The leaves of this tree are either iden or unit terms. The nodes are one of the other seven combinators. Each node has one or two children depending on which combinator the node represents. Precise semantics are given in the next section. Extensions to this core set of combinators is given in Section 4. 2.3 Denotational Semantics of Simplicity Before giving the semantics of Simplicity terms, we need notations for the values of Simplicity types. • We write hi : 1 for the singular value of the unit type. • We write σ L (a) : A + B when a : A for left-tagged values of the sum type. • We write σ R (b) : A + B when b : B for right-tagged values of the sum type. • We write ha, bi : A × B when a : A and b : B for values of the pair type. We emphasize that these values are not directly representable in Simplicity because Simplicity expressions can only denote functions; we use these values only to define the functional semantics of Simplicity. Simplicity’s denotational semantics are recursively defined. For an expression t : A ` B, we define its semantics JtK : A → B as follows. 6 JidenK(a) := a Jcomp s tK(a) := JtK(JsK(a)) JunitK(a) := hi Jinjl tK(a) := σ L (JtK(a)) Jinjr tK(a) := σ R (JtK(a)) Jcase s tKhσ L (a), ci := JsKha, ci Jcase s tKhσ R (b), ci := JtKhb, ci Jpair s tK(a) := hJsK(a), JtK(a)i Jtake tKha, bi := JtK(a) Jdrop tKha, bi := JtK(b) We have formalized the language and semantics of core Simplicity in the Coq proof assistant [29]. The formal semantics in Coq are the official semantics of Simplicity, and for core Simplicity, it is short enough that it fits in Appendix A of this paper. Having semantics in a general purpose proof assistant allows us to formally reason both about programs written in Simplicity and about algorithms that analyze Simplicity programs. 2.4 Completeness Simplicity cannot express general computation. It can only express finitary functions, because each Simplicity type contains only finitely many values. However, within this domain, Simplicity’s set of combinators is complete: any function between Simplicity’s types can be expressed. Theorem 2.1 (Finitary Completeness) Let A and B be Simplicity types. Let f : A → B be any function between these types. Then there exists some core Simplicity expression t : A ` B such that JtK = f . We have verified this theorem with Coq. This theorem holds because functions between finite types can be described, in principle, by a lookup table that maps inputs to outputs. In principle, such a lookup table can be encoded as a Simplicity expression that does repeated case analysis on its input and returns a fixed-output value for each possible case. However, using this theorem to construct Simplicity expressions is not practical. For example, a lookup table for the compression function for SHA-256 [24], which maps 768 bits to 256 bits, would be astronomical in size, requiring 2776 bits. To create practical programs in Simplicity, we need to take advantage of structured computation in order to succinctly express functions. 7 2.5 Example Programs The combinators of core Simplicity may seem paltry, so in this section we illustrate how we can construct programs in Simplicity. We begin by defining a type for a bit, 2, as the sum of two unit types. 2 := 1 + 1 We choose an interpretation of bits as numbers where we define the lefttagged value as denoting zero and the right tagged value as denoting one. dσ L hie2 := 0 dσ R hie2 := 1 We can write Simplicity programs to manipulate bits. For example, we can define the not function to flip a bit. not : 2 ` 2 not := comp (pair iden unit) (case (injr unit) (injl unit)) By recursively taking products, we can define types for multi-bit words. 21 := 2 22n := 2n × 2n For example, the 232 type can represent 32-bit words. We recursively define the interpretation of pairs of words as numbers, choosing to use big-endian order. dha, bie22n := dae2n · 2n + dbe2n We can write a half-adder of two bits in Simplicity. half-adder : 2 × 2 ` 22 half-adder := case (drop (pair (injl unit) iden)) (drop (pair iden not)) We can prove the half-adder expression correct. Theorem 2.2 (Half Adder Correct) Let a, b : 2 be two bits. Then dJhalf-adderKha, bie22 = dae2 + dbe2 We have proven this theorem in Coq. This particular theorem can be proven by exhaustive case analysis (there are only four cases) and equational reasoning using Simplicity’s denotational semantics. We continue and define a full adder by combining two half adders. From there we can build ripple-carry adders for larger word sizes by combining full 8 adders from smaller word sizes. The interested reader can find the Simplicity expressions for these full adders in Appendix B. Continuing, we can build multipliers and other bit-manipulation functions. These can be combined to implement more sophisticated functions. We have written the SHA-256 block compression function in Simplicity. Using 256-bit arithmetic, we have also constructed expressions for elliptic curve operations over the Secp256k1 curve [9] that Bitcoin uses, and we have built a form of ECDSA signature validation [23] in Simplicity. To gain an understanding of the size of Simplicity expressions, let us examine our implementation of the SHA-256 block compression function, sha-256-block : 2256 × 2512 ` 2256 . Our Simplicity expression consists of 3 274 442 combinators. However, this counts the total number of nodes in the abstract syntax tree that makes up the expression. Several sub-expressions of this expression are duplicated and can be shared. Imagine taking the abstract syntax tree and sharing identical sub-expressions to create a directed acyclic graph (DAG) representing the same expression. Counting this way, the same expression contains only 1 130 unique typed sub-expressions, which is the number of nodes that would occur in the DAG representing the expression. Taking advantage of shared sub-expressions is critical because it makes the representation of typical expressions exponentially smaller in size. We choose to leave sub-expression sharing implicit in Simplicity’s term language. This ensures that Simplicity’s semantics are not affected by how sub-expressions are shared. However, we do transmit and store Simplicity expressions in a DAG format. This DAG representation of expressions is also important when we consider static analysis in Section 3.3. Using our formal semantics of Simplicity in Coq, we have proven our implementation of SHA-256 is correct. Theorem 2.3 (SHA-256 Correct) Let a : 2256 and b : 2512 . Let sha-256-block : 2256 × 2512 ` 2256 be our Simplicity implementation of the SHA-256 block compression function. Let SHA256Block : 2256 × 2512 → 2256 be the SHA-256 block compression function. Then Jsha-256-blockKha, bi = SHA256Blockha, bi Our reference implementation of the SHA-256 compression function in Coq1 is taken from the Verified Software Toolchain (VST) project [3] where they use it as their reference implementation for proving OpenSSL’s C implementation of SHA-256 correct [2]. If we combine our Coq proof with the VST project’s Coq proof, we would get a formal proof that our Simplicity implementation of SHA-256 matches OpenSSL’s C implementation of SHA-256. 1 The type of the reference implementation for the SHA-256 compression function in Coq actually uses lists of 32-bit words. To simplify the presentation here, we have omitted the translation between representations of the compression function’s inputs and outputs. 9 3 The Bit Machine One of the design goals for Simplicity is to be able to compute a bound on the computation costs of evaluating a Simplicity program. While the denotational semantics of Simplicity are adequate for determining the functional behavior of Simplicity programs, we need operational semantics to provide a measure of computational resources used. To do this, we create an abstract machine, called the Bit Machine, tailored for evaluating Simplicity programs. The Bit Machine is an abstract imperative machine whose state consists of two non-empty stacks of data frames. One stack holds read-only frames, and the other stack holds write-only frames. A data frame consists of an array of cells and a cursor pointing either at one of the cells or pointing just beyond the end of the array. Each cell contains one of three values: a zero bit, a one bit, or an undefined value. The Bit Machine has a set of instructions that manipulate the two stacks and their data frames. Notionally, we will write a frame like in the following example. [010?1?1] This frame contains 7 cells. The ? character denotes a cell with an undefined value. The 0 and 1 characters denotes cells with the corresponding bit value. The frame’s cursor is pointing to the underscored cell. When a frame’s cursor is pointing past the end of the array, we will write an underscore after the array’s cells like the following. [010?1?1] Table 1 illustrates an example of a possible state of the Bit Machine. This example contains a read-frame stack that has four data frames and a write-frame stack that has two data frames. The top frame of the read-frame stack is called the active read frame, and the top frame of the write-frame stack is called the active write frame. read frame stack write frame stack [10011??110101000] [0000] [] [10] [11??1101] [111??] Table 1: Example state for the Bit Machine The Bit Machine has ten instructions to manipulate its state, which we describe below. • nop: This instruction doesn’t change the state of the machine. 10 • write(b): This instruction writes bit value b to the cell under the active write frame’s cursor and advances the cursor by one cell. – The value b must be either 0 or 1 or else the machine crashes. – The active write frame’s cursor must not be beyond the end of the array or else the machine crashes. – The cell written to must have an undefined value before writing to it or else the machine crashes. • copy(n): This instruction copies n cells from the active read frame, starting at its cursor, to the active write frame, starting at its cursor, and advances the active write frame’s cursor by n cells. – There must be at least n cells between the active read frame’s cursor and the end of its array or else the machine crashes. – There must be at least n cells between the active write frame’s cursor and the end of its array and they all must have an undefined value before writing to them or else the machine crashes. – Note that undefined values can be copied. • skip(n): This instruction advances the active write frame’s cursor by n cells. – This instruction is allowed to advance the cursor to the point just past the end of the array; however if n is large enough that it would advance it past this point, the machine crashes instead. • fwd(n): This instruction moves the active read frame’s cursor forward by n cells. – This instruction is allowed to advance the cursor to the point just past the end of the array; however if n is large enough that it would advance it past this point, the machine crashes instead. • bwd(n): This instruction moves the active read frame’s cursor backwards by n cells. – If this instruction would move the cursor before the beginning of the array, the machine crashes instead. • newFrame(n): This instruction allocates a new frame with n cells and pushes it onto the write-frame stack, making it the new active write frame. – The cursor for this new frame starts at the beginning of the array. – The cells of the new frame are initialized with undefined values. • moveFrame: This instruction pops a frame off the write-frame stack and pushes it onto the read-frame stack. 11 – The moved frame has its cursor reinitialized to the beginning of the array. – If this would leave the machine with an empty write frame stack, the machine crashes instead. • dropFrame: This instruction pops a frame off the read-frame stack and deallocates it. – If this would leave the machine with an empty read-frame stack, the machine crashes instead. • read: This instruction doesn’t modify the state of the machine. Instead it returns the value of the bit under the active read frame’s cursor to the machine’s operator. – if the value under the active read frame’s cursor is undefined, or if it is past the end of its array, the machine crashes instead. The Bit Machine is deliberately designed to crash at anything resembling undefined behavior. 3.1 Bit Machine Values We can use the Bit Machine to evaluate Simplicity programs on their inputs. First, we define how many cells are needed to hold the values of a given type. bitSize(1) := 0 bitSize(A + B) := 1 + max(bitSize(A), bitSize(B)) bitSize(A × B) := bitSize(A) + bitSize(B) The unit type doesn’t need any bits to represent its one value. A value of sum type needs one bit for its tag and then enough bits to represent either of its left or right values. A value of product type needs space to hold both its values. We precisely define a representation of values for Simplicity types as array of cells below: phiq1 := [] padl(A,B) pσ (a)qA+B := [0] · [?] · paqA L padr(A,B) pσ R (b)qA+B := [1] · [?] · pbqB := pha, biqA×B paqA · pbqB For the notation above, · denotes the concatenation of arrays of cells and n [b] denotes an array of n cells all containing b. 12 The padding for left and right values fills the array with sufficient undefined values so that the array ends up with the required length. padl(A, B) := max(bitSize(A), bitSize(B)) − bitSize(A) padr(A, B) := max(bitSize(A), bitSize(B)) − bitSize(B) Below are some examples of values represented as arrays of cells for the Bit Machine. We define the inverse of d·e2n to be b·c2n that maps numbers to the values that represent them. pσ L (b3c22 )q22 +2 = [011] pσ R (b0c2 )q22 +2 = [1?0] The array of cells contains a list of the tags from the sum types and that is about it. Notice that values of a multi-bit word type, 2n , have exactly n cells and the representation is identical to its big-endian binary representation. 3.2 Operational Semantics The operational semantics for Simplicity are given by recursively translating a Simplicity expression into a sequence of instructions for the Bit Machine. Figure 2 defines ⟪t : A ` B⟫∗ , which results in a sequence of instructions for the Bit Machine that evaluates the function JtK. We have formalized the Bit Machine in Coq and Figure 2’s translation of Simplicity expressions into Bit Machine instructions. We have verified, with Coq, that our Bit Machine implementation of Simplicity respects Simplicity’s denotational semantics. Theorem 3.1 (Correctness of Operational Semantics) Let t : A ` B be any Simplicity expression. Let v : A be any value of type A. Initialize a Bit Machine with • the value pvqA as the only frame on the read-frame stack with its cursor at the beginning of the frame, and bitSize(B) • the value [?] as the only frame on the write-frame stack with its cursor at the beginning of the frame. After executing the instructions ⟪t : A ` B⟫∗ , the final state of the Bit Machine has • the value pvqA as the only frame on the read-frame stack, with its cursor at the beginning of the frame, and • the value pJtK(v)qB as the only frame on the write-frame stack, with its cursor at the end of the frame. 13 ⟪iden : A ` A⟫∗ := copy(bitSize(A)) ⟪comp s t : A ` C⟫∗ := newFrame(bitSize(B)); ⟪s : A ` B⟫∗ ; moveFrame; ⟪t : B ` C⟫∗ ; dropFrame ⟪unit : A ` 1⟫ := nop ⟪injl t : A ` B + C⟫∗ := write(0); skip(padl(B, C)); ⟪t : A ` B⟫∗ ∗ ⟪injr t : A ` B + C⟫∗ := write(1); skip(padr(B, C)); ⟪t : A ` C⟫∗ ⟪case s t : (A + B) × C ` D⟫∗ := match read with  0 → fwd(1 + padl(A, B));     ⟪s : A × C ` D⟫∗ ;    bwd(1 + padl(A, B))  1 → fwd(1 + padr(A, B));     ⟪t : B × C ` D⟫∗ ;   bwd(1 + padr(A, B)) ⟪pair s t : A ` B × C⟫∗ := ⟪s : A ` B⟫∗ ; ⟪t : A ` C⟫∗ ⟪take t : A × B ` C⟫∗ := ⟪t : A ` C⟫∗ ⟪drop t : A × B ` C⟫∗ := fwd(bitSize(A)); ⟪t : B ` C⟫∗ ; bwd(bitSize(A)) Figure 2: Operational Semantics for Simplicity using the Bit Machine. In particular, the Bit Machine never crashes during this execution. The fact that the Bit Machine never crashes means that during execution it never reads from an undefined cell, nor does it ever write to a defined cell. This means that, if one implements the Bit Machine on a real computer, one can use an ordinary array of bits to represent the array of cells and cells that are supposed to hold undefined values can be safely set to any bit value. As long as this implementation only executes instructions translated from Simplicity and started from a proper initial state, the resulting computation will be the same as if one had used an explicit representation for undefined values. 3.3 Static Analysis Using the Bit Machine, we can measure computational resources needed by a Simplicity program. For instance we can: • count the number of instructions executed by the Bit Machine. • count the number of cells copied by the Bit Machine. 14 extraCellBnd(iden : A ` A) := 0 extraCellBnd(comp s t : A ` C) := bitSize(B)+ max(extraCellBnd(s : A ` B), extraCellBnd(t : B ` C)) extraCellBnd(unit : A ` 1) := 0 extraCellBnd(injl t : A ` B + C) := extraCellBnd(t : A ` B) extraCellBnd(injr t : A ` B + C) := extraCellBnd(t : A ` C) extraCellBnd(case s t : (A + B) × C ` D) := max(extraCellBnd(s : A × C ` D), extraCellBnd(t : B × C ` D)) extraCellBnd(pair s t : A ` B × C) := max(extraCellBnd(s : A ` B), extraCellBnd(t : A ` C)) extraCellBnd(take t : A × B ` C) := extraCellBnd(t : A ` C) extraCellBnd(drop t : A × B ` C) := extraCellBnd(t : B ` C) cellBnd(t : A ` B) := bitSize(A) + bitSize(B) + extraCellBnd(t : A ` B) Figure 3: Definition of cellBnd. • count the maximum number of cells in both stacks at any point during execution. • count the maximum number of frames in both stacks at any point during execution. The first two are measurements of time used by the Bit Machine, and the last two are measurements of space used by the Bit Machine. Using simple static analysis, we can quickly compute an upper bound on these sorts of resource costs. In this paper, we will focus on the example of counting the maximum number of cells in both stacks at any point during execution. Figure 3 defines a function cellBnd that computes an upper bound on the maximum number of cells that are needed during execution. Theorem 3.2 (Static Analysis of Cell Usage) Let t : A ` B be any Simplicity expression. Let v : A be any value of type A. Initialize a Bit Machine as specified in Theorem 3.1. The maximum number of cells in both stacks of the Bit Machine at any point during the execution of ⟪t : A ` B⟫∗ from this initial state never exceeds cellBnd(t : A ` B). We have formalized the above static analysis and proven the above theorem in Coq. 15 These kinds of static analyses are simple recursive functions of Simplicity expressions, and the intermediate results for sub-expressions can be shared. By using a DAG for the in-memory representation of Simplicity expressions, we can transparently cache these intermediate results. This means the time needed to compute static analysis is proportional to the size of the DAG representing the Simplicity expression, as opposed to the time needed for dynamic analysis such as evaluation, which may take time proportional to the size of the tree representing the Simplicity expression. The Bit Machine is an abstract machine, so we can think of these sorts of static analyses as bounding abstract resource costs. As long as the abstract resource costs are limited, then the resource costs of any implementation of Simplicity will also be limited. These sorts of precise static analyses of resource costs are more sophisticated than what is currently available for Bitcoin Script. Notice that the definition of cellBnd does not directly reference the Bit Machine, so limits on the bounds computed by these static analyses can be imposed on protocols that use Simplicity without necessarily requiring that applications use the Bit Machine for evaluation. While we do use an implementation of the Bit Machine in our prototype Simplicity evaluator written in C, others are free to explore other models of evaluation. For example, the Bit Machine copies data to implement the iden combinator, but another model of evaluation might create shared references to data instead. 3.3.1 Tail Composition Optimization Tail call optimization is an optimization used in many languages where a procedure’s stack frame is freed prior to a call to another procedure when that call is the last command of the procedure. The comp combinator in Simplicity behaves much like a procedure call, and we can implement an analogous optimization for the translation of Simplicity to the Bit Machine. Interested readers can find this tail composition optimized translation, ⟪t : A ` B⟫tco off , defined in Appendix C, along with a static analysis of its memory use. 3.4 Jets Evaluation of a Simplicity expression with the Bit Machine recursively traverses the expression. Before evaluating some sub-expression t : A ` B, the Bit Machine is always in a state where the active read frame is of the form r1 · pvqA · r2 for some value v : A and some arrays r1 and r2 , and where the cursor is placed at the beginning of the pvqA array slice. Furthermore the active write frame is of the form w1 · [?] bitSize(B) · w2 for some arrays w1 and w2 , and where the cursor is placed at the beginning of bitSize(B) the [?] array slice. 16 After the evaluation of the sub-expression t : A ` B, the active write frame is of the form w1 · pJtK(v)qB · w2 and where the cursor is placed at the beginning of the w2 array slice. Taking an idea found in Urbit [32], we notice that if we recognize a familiar sub-expression t : A ` B, the interpreter may bypass the BitMachine’s execution of ⟪t : A ` B⟫∗ and instead directly compute and write pJtK(v)qB to the active write frame. Following Urbit, we call such a familiar expression and the code that replaces it a jet. Jets are essential for making Simplicity a practical language. For our Blockchain application we expect to have jets for at least the following expressions: • arithmetic operations (addition, subtraction, and multiplication) from 8-bit to 256-bit word size, • comparison operations (less than, less than or equal to, equality) from 8-bit to 256-bit word size, • logical bitwise operation for 8-bit to 256-bit word sizes, • constant functions for every possible 8-bit word, • compression functions from hash functions such as SHA-256’s compression function, • elliptic curve point operations for the Secp256k1 curve [9], and • digital signature validation for ECDSA [23] or Schnorr [28] signatures. We take advantage of the fact that the representation of the values used for arithmetic expressions in the Bit Machine match the binary memory format for real hardware. This lets us write these jets by directly reading from and writing to data frames. Jets have several nice properties: • Jets provide a formal specification of their behavior. The implementation of a jet must produce output identical to the output that would be produced by the Simplicity expression being replaced. There is no possibility for an ambiguous interpretation of what a jet computes. • Jets cannot accidentally introduce new behavior or new side effects because they can only replicate the behavior of Simplicity expressions. To add new behavior to Simplicity we must explicitly extend Simplicity (see Section 4). • Jets are transparent when it comes to reasoning about Simplicity expressions. Jets are logically equal to the code they replace. Therefore, when proving properties of one’s Simplicity code, jets can safely be ignored. 17 Naturally, we expect jetted expressions to have properties already proven and available; this will aid reasoning about Simplicity programs that make use of jets. Because jets are transparent, the static analyses of resource costs are not affected by their existence. To encourage the use of jets, we anticipate discounts to be applied to the resource costs of programs that use jets based on the estimated savings of using jets. When a suitably rich set of jets is available, we expect the bulk of the computation specified by a Simplicity program to be made up of these jets, with only a few combinators used to combine the various jets. This should bring the computational requirements needed for Simplicity programs in line with existing blockchain languages. In light of this, one could consider Simplicity to be a family of languages, where each language is defined by a set of jets that provide computational elements tailored for its particular application. 4 Integration with Blockchains Core Simplicity is language that does pure computation. In order to interact with blockchains we extend Simplicity with new combinators. 4.1 Transaction Digests The main operation used in Bitcoin Script is OP CHECKSIG which, given a public key, a digital signature, and a SigHash type [15], generates a digest of the transaction in accordance with the SigHash type and validates that the digital signature for the digest is correct for the given public key. This operation allows users to create programs that require their signatures for their transactions to be authorized. In core Simplicity we can implement, and jet, the digital signature validation algorithm. However, it is not possible to generate the transaction digest because core Simplicity doesn’t have access to the transaction data. To remedy this, we add a new primitive combinator to Simplicity sighash : SigHashType ` 2256 where SigHashType := (1 + 2) × 2 is a Simplicity type suitable for encoding all possible SigHash types. This combinator returns the digest of the transaction for the given SigHash type. Together with the Simplicity implementation of digital signature verification, we can implement the equivalent of Bitcoin’s OP CHECKSIG. We can add other primitives to Simplicity to access specific fields of transaction data in order to implement features such as Bitcoin’s timelock operations [30, 7]. While Simplicity avoids providing direct access to persistent storage, one could imagine an application where transactions contain data for transactional updates to a persistent store. Simplicity could support primitives 18 to read the details of these transactional updates and thereby enforce any set of programmable rules on them. 4.2 Merklized Abstract Syntax Tree Recall that when using P2SH, users commit to their program by hashing it and placing that hash in the outputs of transactions. Only when redeeming their funds does the user reveal their program, whose hash must match the committed hash. Pay to Merklized Abstract Syntax Tree, or P2MAST [17], enhances the P2SH idea. Instead of hashing a linear encoding of a Simplicity expression, we use the SHA-256’s block compression function, SHA256Block : 2256 × 2512 → 2256 , to recursively hash Simplicity sub-expressions. This computes a Merkle root of Simplicity’s abstract syntax tree that we denote by #(·) and define as #(iden) := SHA256Blockhtagiden , b0c2512 i #(comp s t) := SHA256Blockhtagcomp , h#(s), #(t)ii #(unit) := SHA256Blockhtagunit , b0c2512 i #(injl t) := SHA256Blockhtaginjl , h#(t), b0c2256 ii #(injr t) := SHA256Blockhtaginjr , h#(t), b0c2256 ii #(case s t) := SHA256Blockhtagcase , h#(s), #(t)ii #(pair s t) := SHA256Blockhtagpair , h#(s), #(t)ii #(take t) := SHA256Blockhtagtake , h#(t), b0c2256 ii #(drop t) := SHA256Blockhtagdrop , h#(t), b0c2256 ii #(sighash) := SHA256Blockhtagsighash , b0c2512 i where tagc : 2256 is an appropriate unique set of initial vectors per combinator. We use the SHA-256 hash of the combinator name for its tag value. When computing Merkle roots, like other kinds of static analysis, the intermediate results of sub-expressions can be shared. Bitcoin Script cannot share sub-expressions in this manner due to the linear encoding of Bitcoin Script programs. Another advantage of Merkle roots is that unused branches of case expressions can be pruned at redemption time. Each unused branch can be replaced with the value of its Merkle root. This saves on bandwidth, storage costs, and enhances privacy by not revealing more of a Simplicity program than necessary. Again, this is something not possible in Bitcoin Script. To enable redemption of pruned Simplicity expressions, we add two new combinators to replace the case combinator when pruning. h : 2256 t:B×C `D assertr h t : (A + B) × C ` D s:A×C `D h : 2256 assertl s h : (A + B) × C ` D 19 These assertion combinators follow the same form as the case combinator, except one branch is replaced by a hash. The semantics of these combinators require that the first component of their input be σ L or σ R as appropriate and then they evaluate the available branch. The h : 2256 values do not affect the semantics; they instead influence the Merkle root computation. #(assertl s h) := SHA256Blockhtagcase , h#(s), hii #(assertr h t) := SHA256Blockhtagcase , hh, #(t)ii Notice that we use tagcase for the tags of the assertions. During redemption, one can replace case statements with appropriate assertions while still matching the committed Merkle root of the whole expression. #(case s t) = #(assertl s #(t)) = #(assertr #(s) t) As long as the assertions hold, the computation remains unchanged. If an assertion fails, because you pruned off a branch that was actually necessary, then the computation fails and a transaction trying to redeem funds in that manner is invalid. Because failure is now a possible result during evaluation, we add a combinator fail to allow one to develop programs that use assertions. fail : A ` B #(fail) := SHA256Blockhtagfail , b0c2512 i When combined with the signature verification expression, one can build the equivalent of Bitcoin’s OP CHECKSIGVERIFY operation to assert that a signature is valid. Degenerate assertions can also be used to enhance privacy by mixing entropy into Merkle roots of sub-expressions. Given t : A ` B the expression comp (pair (injl iden) unit) (assertl (take t) h) : A ` B is semantically identical to t, but mixes h into its Merkle root computation. When used inside branches that are likely to be pruned, this prevents adversaries from effectively grinding out Simplicity expressions to see if they match the hash of the missing branch. The Merkle root of an expression does not commit to its types. We use first-order unification [27] to perform type inference on Simplicity expressions, replacing any remaining type variables with the unit type. Because the types of pruned branches are discarded, the inferred types may end up smaller than in the originally committed program. When this happens, the memory requirements for evaluation with the Bit Machine may also decrease. 20 4.3 Witness Values During redemption, the user must provide inputs, such as digital signatures and other witness data, in order to authorize a transaction. Rather than passing this input as an argument to the Simplicity program, we embed such witness values directly into the Simplicity expressions using the witness combinator. b:B witness b : A ` B Semantically, the witness combinator just denotes a constant function, which is something we can already write in core Simplicity. The difference lies in its Merkle root computation. #(witness b) := SHA256Blockhtagwitness , b0c2512 i The value b is not committed by the Merkle root. This allows the user to set witness value at redemption time, without affecting the expression’s Merkle root. Users can use witness combinators at places where digital signatures are needed and at places where choices are made at redemption time. Using witness combinators enhances privacy because they are pruned away when they occur in unused branches. This leaves little evidence that there was an optional input at all. The amount of witness data allowed at redemption time is limited at commitment time because each witness data type is finite and there can only be a finite number of witness combinators committed. This limits the computational power of Simplicity. For example, it is not possible to create a Simplicity program that allows hashing of an unbounded amount of witness data in order to validate a digital signature. However, it is possible to create a Simplicity program that allows a large, but bounded, amount of witness data to be hashed that is more than will ever be needed in practice. Thanks to pruning, only the code used to hash the amount of witness data that actually occurs need be provided at redemption time. Type inference determines the minimal type for witness values. This prevents them from being filled with unnecessary data. The witness combinator is not allowed to be used in jets. 4.4 Extended Simplicity Semantics In order to accommodate these extensions to core Simplicity, we need to broaden Simplicity’s semantics. We use a monad, M, to capture the new effects of these extensions. M(A) := Trans → A⊥ This monad is a combination of an environment monad (also called a reader monad) with an exception monad. 21 This monad provides implicit access to a value of Trans type, which we define to be the type of transaction data for the particular blockchain. During evaluation, it is filled with the transaction containing the input redeeming the Simplicity program being evaluated. This is used to give semantics to the sighash and other similar primitives. The monad also adds a failure value to the result type, denoted by ⊥ : A⊥ This allows us to give semantics to assertions and fail. Given an expression t : A ` B, we denote this extended semantics by JtKM : A → M(B). The core Simplicity semantics are lifted in the natural way so that JtKM (a) = λe : Trans.JtK(a) holds whenever t is composed of only core Simplicity combinators. The extended set of combinators have the following semantics JsighashKM (a) := λe. MakeSigHash(a, e) Jassertl s hKM hσ L (a), ci := λe.JsKM ha, ci(e) Jassertl s hKM hσ R (b), ci := λe.⊥ Jassertr h tKM hσ L (a), ci := λe.⊥ Jassertr h tKM hσ R (b), ci := λe.JtKM hb, ci(e) JfailKM (a) := λe.⊥ Jwitness bKM (a) := λe.b where MakeSigHash(a, e) is a function that returns a hash of a given transaction e in accordance with the given SigHash type a. The operational semantics are also extended to support our new combinators by providing the Bit Machine with access to the transaction data and by adding an explicit crash instruction to support assertions and fail. We note that the effects captured by our monad are commutative and idempotent.2 While Simplicity’s operational semantics implicitly specify an order of evaluation, the extended denotational semantics are independent of evaluation order. This simplifies formal reasoning about Simplicity programs that use the extended semantics. That said, we expect the majority of Simplicity program’s sub-expressions to be written in core Simplicity whose denotational semantics contain no effects at all, making reasoning about them simpler still. 4.5 Using Simplicity Programs in Blockchains Simplicity programs are Simplicity expressions of type p : 1 ` 1, that may use any of our extended combinators. Users transact by constructing their Simplic2 We use the terms ‘commutative’ and ‘idempotent’ in the sense of King and Wadler [16] as opposed to the traditional category theoretic definition of an idempotent monad. 22 ity program and computing its Merkle root #(p). They have their counterparty create a transaction that sends funds to that hash. Later, when a user wants to redeem their received funds, they create a transaction whose input contains a Simplicity program whose Merkle root matches the previous hash. At this point they have the ability to set the witness values and prune any unneeded branches from case expressions. The witness combinators handle the program’s effective inputs, so the program p is evaluated at the value hi : 1. No output is needed because the program can use assertions to fail in case of invalid witnesses. If the execution completes successfully, without failing, the transaction is considered valid. The basic signature program that mimics Bitcoin’s basic signature program is composed of the following core Simplicity expressions checkSig : Signature ×(PubKey ×2256 ) ` 2 pubKey : A ` PubKey where checkSig checks whether a given signature validates for a given public key and message hash, and pubKey returns a user’s specific public key. These expressions can be combined into a basic signature verification program. basicSigVerify b c := comp (pair (witness b) (pair pubKey (comp (witness c) sighash))) (comp (pair checkSig unit) (case fail unit)) Other, more complex programs can be built to perform multi-signature checks, to implement sophisticated smart contracts such as zero-knowledge contingent payments, or to create novel smart contracts. 5 Results and Future Work In many ways, Simplicity is best characterized by what features it leaves out rather than what features it contains. • Simplicity has no state. Purely functional, expression-based languages facilitate equational reasoning about the semantics of expressions. For example, there are no concerns about aliased references to a global heap, so there is no need to work with separation logic or Hoare logic. • Simplicity has no named variables. Using combinators lets us avoid dealing with binders and environments for bound variables. This helps keep our interpreter and static analyses simple and further eases equational reasoning about Simplicity expressions. 23 • Simplicity has no function types and therefore no higher-order functions. While it is possible to compute upper bounds of computation resources of expressions in the presence of function types, it likely that those bounds would be so far above their actual needs that such analysis would not be useful. • Simplicity has no unbounded loops or recursion. It is possible to build smart contracts with state carried through loops using covenants [25], without requiring unbounded loops within Simplicity itself. Bounded loops, such as the 64 rounds needed by our SHA-256 implementation, can be achieved by unrolling the loop. Because of sub-expression sharing, this doesn’t unreasonably impact program size. We do not directly write Simplicity, rather we use functions written in Coq or Haskell to generate Simplicity. These languages do support recursion and we use loops in these meta-languages to generate unrolled loops in Simplicity. Throughout this paper we have noted which theorems we have verified with Coq. Other proofs are under development. In particular, we plan to formally verify the denotational and operational semantics of the full Simplicity language, including assertions and blockchain primitives. To validate the suitability of Simplicity, we will be building example smart contracts in a test blockchain or sidechain [4] application using Simplicity. We also plan to use the VST project [3] to prove the correctness of our C implementation of the Bit Machine. This would let us formally verify that the assembly code generated by the CompCert compiler [18] from our C implementation respects Simplicity’s formal semantics. In particular, we would be able to prove that substituting jets, such as SHA-256, with fast C or assembly implementations preserves the semantics of Simplicity. Simplicity is designed as a low-level language interpreted by blockchain software. We anticipate higher-level languages will be used for development and compiled to Simplicity. Ivy [10] and the Σ-State Authentication Language [11], are existing efforts that may be suitable for being compiled to Simplicity. If these higher-level languages come with formal semantics of their own, we will have the opportunity to prove correct the compiler to Simplicity for these languages. For the time being, generating Simplicity with our Haskell and Coq libraries is possible. 6 Conclusion We have defined a new language designed to be used for crypto-currencies and blockchains. It could be deployed in new blockchain applications, including sidechains [4], or possibly in Bitcoin itself. Simplicity has the potential to be used in any application where finitary programs need to be transported and executed under potentially adversarial conditions. Our language is bounded, without loops, but is expressive enough to represent any finitary function. These constraints allow for general purpose static 24 analysis that can effectively bound the amount of computational resources needed by a Simplicity program prior to execution. Simplicity has simple, functional semantics, which make formal reasoning with software proof assistants relatively easy. This provides the means for people who develop smart contract to formally verify the correctness of their programs. We have written several low-level functions in Simplicity such as addition, subtraction, and multiplication for various finite-bit words and formally verified their correctness. With these we have built mid-level functions such as elliptic curve addition and multiplication, ECDSA signature validation, and a SHA256 compression function. This is already sufficient to create simple single and multi-signature verification programs in Simplicity. We have formally verified our SHA-256 compression function is correct and have plans to formally verify the remaining functions. 25 A Simplicity Semantics in Coq Below is the formal definition of core Simplicity as expressed in Coq [29]. The Term type is the type of well-typed Simplicity expressions. The eval function provides the denotational semantics of well-typed Simplicity expressions. B Full Word Adders in Simplicity Below we recursively define Simplicity programs for ripple-carry full-adders for any 2n -bit word size. A full-adder takes two n-bit words and a carry-in bit as inputs and returns a carry-out bit and an n-bit word. full-addern : (2n × 2n ) × 2 ` 2 × 2n full-adder1 := comp (pair (take half-adder) (drop iden)) (comp (pair (take (take iden)) (comp (pair (take (drop iden)) (drop iden)) half-adder)) (pair (case (drop (take iden)) (injr unit)) (drop (drop iden)))) full-adder2n := comp (pair (take (pair (take (take iden)) (drop (take iden)))) (comp (pair (take (pair (take (drop iden)) (drop (drop iden)))) (drop iden)) full-addern )) (comp (pair (drop (drop iden)) (comp (pair (take iden) (drop (take iden))) full-addern )) (pair (drop (take iden)) (pair (drop (drop iden)) (take iden)))) Theorem B.1 (Full Adder Correct) Let n be a power of two. Let a, b : 2n be two n-bit words. Let c : 2 be a bit. Then dxe2 · 2n + dye2n = dae2n + dbe2n + dce2 where Jfull-adderKhha, bi, ci = hx, yi 26 We have verified the above theorem in Coq. We have similarly defined multiplication for 2n -bit words and proven its correctness theorem in Coq. C Tail Composition Optimization We define a variant of the translation of Simplicity to the Bit Machine, ⟪·⟫∗ , to add a tail composition optimization (TCO). This optimization moves the dropFrame instruction earlier, potentially reducing the memory requirements for execution by the Bit Machine. This is analogous to the tail call optimization found in other languages. Our new definition will be a pair of mutually recursive tco functions, ⟪·⟫tco off and ⟪·⟫on . tco The definition of ⟪·⟫off is identical to that of ⟪·⟫∗ , replacing ⟪·⟫∗ by ⟪·⟫tco off , except for the ⟪comp s t : A ` C⟫tco off clause which is given below. ⟪comp s t : A ` C⟫tco off := newFrame(bitSize(B)); tco ⟪s : A ` B⟫tco off ; moveFrame; ⟪t : B ` C⟫on In the tail position of the comp combinator, we removed the dropFrame tco instruction and call ⟪·⟫tco on instead. The definition of ⟪·⟫on is given in Figure 4. We have formally verified in Coq the following correctness theorem for ⟪·⟫tco off . Theorem C.1 (Correctness of TCO Operational Semantics) Let t : A ` B be any Simplicity expression. Let v : A be any value of type A. Initialize a Bit Machine with • the value pvqA as the only frame on the read-frame stack with its cursor at the beginning of the frame, and bitSize(B) • the value [?] as the only frame on the write-frame stack with its cursor at the beginning of the frame. After executing the instructions ⟪t : A ` B⟫tco off , the final state of the Bit Machine has • the value pvqA as the only frame on the read-frame stack with its cursor at the beginning of the frame, and • the value pJtK(v)qB as the only frame on the write-frame stack with its cursor at the end of the frame. In particular, the Bit Machine never crashes during this execution. The proof proceeds by establishing that the machine state transformation induced by executing the instructions ⟪t : A ` B⟫tco off ; dropFrame 27 ⟪iden : A ` A⟫tco on := copy(bitSize(A)); dropFrame tco ⟪comp s t : A ` C⟫tco on := newFrame(bitSize(B)); ⟪s : A ` B⟫on ; moveFrame; ⟪t : B ` C⟫tco on ⟪unit : A ` 1⟫tco on := dropFrame tco ⟪injl t : A ` B + C⟫tco on := write(0); skip(padl(B, C)); ⟪t : A ` B⟫on tco ⟪injr t : A ` B + C⟫tco on := write(1); skip(padr(B, C)); ⟪t : A ` C⟫on ⟪case s t : (A + B) × C ` D⟫tco on := match read with  0 → fwd(1 + padl(A, B));    ⟪s : A × C ` D⟫tco on  1 → fwd(1 + padr(A, B));   ⟪t : B × C ` D⟫tco on tco tco ⟪pair s t : A ` B × C⟫tco on := ⟪s : A ` B⟫off ; ⟪t : A ` C⟫on tco tco ⟪take t : A × B ` C⟫on := ⟪t : A ` C⟫on tco ⟪drop t : A × B ` C⟫tco on := fwd(bitSize(A)); ⟪t : B ` C⟫on Figure 4: Operational semantics for Simplicity using the Bit Machine with TCO. and the instructions ⟪t : A ` B⟫tco on are identical. We would like an improved static analysis of the memory use of this TCO execution. Figure 5 defines the static analysis cellBndtco (t : A ` B) which bounds the memory use of the TCO execution. The static analysis becomes somewhat more intricate with the more complex translation. But we may proceed with confidence because we have a formal verification in Coq of the following theorem. Theorem C.2 (Static Analysis of Cell Usage with TCO) Let t : A ` B be any Simplicity expression. Let v : A be any value of type A. Initialize a Bit Machine as specified in Theorem C.1. The maximum number of cells in both stacks of the Bit Machine at any point during the execution of ⟪t : A ` B⟫tco off from this initial state never exceeds cellBndtco (t : A ` B). The proof proceeds by establishing that the additional memory used tco by ⟪t : A ` B⟫tco off and ⟪t : A ` B⟫on in any machine state is no more than max(n1 , n2 ) and max(n1 −m, n2 ) respectively where hn1 , n2 i = extraCellBndtco (t : A ` B) and m is the number of cells in the active read frame before executing ⟪t : A ` B⟫tco on . There is a possibility for a head composition optimization where the newFrame(n) instruction is delayed in order to potentially save memory. 28 It is unclear to us if this is worth the added complexity, so we have not pursued this yet. Acknowledgements Thank you to Shannon Appelcline for his help editing this paper. 29 extraCellBndtco (iden : A ` A) := h0, 0i extraCellBndtco (comp s t : A ` C) := let hn1 , n2 i = extraCellBndtco (s : A ` B) in let hm1 , m2 i = extraCellBndtco (t : B ` C) in let b = bitSize(B) in hmax(b + n1 , m1 , b + m2 ), b + n2 i extraCellBnd tco extraCellBnd tco (unit : A ` 1) := h0, 0i (injl t : A ` B + C) := extraCellBndtco (t : A ` B) extraCellBndtco (injr t : A ` B + C) := extraCellBndtco (t : A ` C) extraCellBndtco (case s t : (A + B) × C ` D) := let hn1 , n2 i = extraCellBndtco (s : A × C ` D) in let hm1 , m2 i = extraCellBndtco (t : B × C ` D) in hmax(n1 , m1 ), max(n2 , m2 )i extraCellBndtco (pair s t : A ` B × C) := let hn1 , n2 i = extraCellBndtco (s : A ` B) in let hm1 , m2 i = extraCellBndtco (t : A ` C) in hm1 , max(n1 , n2 , m2 )i tco extraCellBnd (take t : A × B ` C) := extraCellBndtco (t : A ` C) extraCellBndtco (drop t : A × B ` C) := extraCellBndtco (t : B ` C) cellBndtco (t : A ` B) := let hn1 , n2 i = extraCellBndtco (t : A ` B) in bitSize(A) + bitSize(B) + max(n1 , n2 ) Figure 5: Definition of cellBndtco . 30 References [1] G. Andresen. BIP16: Pay to script hash. Bitcoin Improvement Proposal, 2012. https://github.com/bitcoin/bips/blob/master/ bip-0016.mediawiki. [2] A. W. Appel. Verification of a cryptographic primitive: ‘-256. ACM Trans. Program. Lang. Syst., 37(2):7:1–7:31, April 2015. [3] A. W. Appel. Verifiable C. http://vst.cs.princeton.edu/download/ VC.pdf, July 2016. [4] A. Back, M. Corallo, L. Dashjr, M. Friedenbach, G. Maxwell, A. Miller, A. Poelstra, J. Timón, and P. Wuille. Enabling blockchain innovations with pegged sidechains, 2014. https://www.blockstream.com/sidechains. pdf. [5] K. Bhargavan, A. Delignat-Lavaud, C. Fournet, A. Gollamudi, G. Gonthier, N. Kobeissi, N. Kulatova, A. Rastogi, T. Sibut-Pinote, N. Swamy, and S. Zanella-Béguelin. Formal verification of smart contracts: Short paper. In Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security, PLAS ’16, pages 91–96, New York, NY, USA, 2016. ACM. [6] bitcoinwiki. Script. https://en.bitcoin.it/w/index.php?title= Script&oldid=61707, 2016. [7] BtcDrak, M. Friedenbach, and E. Lombrozo. BIP112: Checksequenceverify. Bitcoin Improvement Proposal, 2015. https://github.com/bitcoin/ bips/blob/master/bip-0112.mediawiki. [8] V. Buterin. CRITICAL UPDATE Re: DAO Vulnerability. https://blog.ethereum.org/2016/06/17/ critical-update-re-dao-vulnerability/, June 2016. [9] Certicom Research. Standards for Efficient Cryptography 2: Recommended Elliptic Curve Domain Parameters. Standard SEC2, Certicom Corp., Mississauga, ON, USA, September 2000. [10] Chain. Announcing ivy playground, May 2017. https://blog.chain. com/announcing-ivy-playground-395364675d0a. [11] A. Chepurnoy. σ-state authentication language, an alternative to bitcoin script. Poster Session at the 21st International Conference on Financial Cryptography and Data Security, April 2017. [12] Ethereum. Solidity Documentation: Release 0.4.14. https://media. readthedocs.org/pdf/solidity/develop/solidity.pdf, June 2017. 31 [13] G. Gentzen. Investigations into logical deduction. In M.E. Szabo, editor, The collected papers of Gerhard Gentzen, Studies in logic and the foundations of mathematics, chapter 3. North-Holland Pub. Co., 1969. [14] S. Goldfeder, J. Bonneau, R. Gennaro, and A. Narayanan. Escrow protocols for cryptocurrencies: How to buy physical goods using bitcoin. http://fc17.ifca.ai/preproceedings/paper_122.pdf, April 2017. To appear in the proceedings of the 21st International Conference on Financial Cryptography and Data Security. [15] Bitcoin Developer Guide. Signature hash types, 2014. https://bitcoin. org/en/developer-guide#signature-hash-types. [16] D. J. King and P. Wadler. Combining Monads, pages 134–143. Springer London, London, 1993. [17] J. Lau. BIP114: Merkelized abstract syntax tree. Bitcoin Improvement Proposal, 2016. https://github.com/bitcoin/bips/blob/master/ bip-0114.mediawiki. [18] X. Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52(7):107–115, 2009. [19] G. Maxwell. Zero-knowledge contingent payment, 2011. https://en. bitcoin.it/wiki/Zero_Knowledge_Contingent_Payment. [20] S. Nakamoto. Bitcoin: A peer-to-peer electronic cash system. http:// bitcoin.org/bitcoin.pdf, November 2008. [21] S. Nakamoto. misc changes. https://github.com/bitcoin/bitcoin/ commit/4bd188c4383d6e614e18f79dc337fbabe8464c82, August 2010. https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@131. [22] S. Nakamoto. Re: Transactions and Scripts: DUP HASH160 ... EQUALVERIFY CHECKSIG. https://bitcointalk.org/index.php? topic=195.msg1611#msg1611, June 2010. [23] National institute of standards and technology. FIPS pub 186-4 federal information processing standards publication digital signature standard (dss). 2013. [24] National institute of standards and technology. FIPS 180-4, secure hash standard, federal information processing standard (FIPS), publication 1804. Technical report, DEPARTMENT OF COMMERCE, August 2015. [25] R. O’Connor. Covenants in elements alpha, 2016. Blog post, https:// blockstream.com/2016/11/02/covenants-in-elements-alpha.html. [26] Parity. The multi-sig hack: A postmortem, July 2017. https:// paritytech.io/blog/the-multi-sig-hack-a-postmortem.html. 32 [27] M. S. Paterson and M. N. Wegman. Linear unification. Journal of Computer and System Sciences, 16(2):158 – 167, 1978. [28] C. P. Schnorr. Efficient identification and signatures for smart cards. In Proceedings of CRYPTO ’89, 1989. [29] The Coq Development Team. The Coq Proof Assistant Reference Manual: Version 8.6. https://coq.inria.fr/refman/, 2016. Bitcoin Improvement [30] P. Todd. BIP65: Op checklocktimeverify. Proposal, 2014. https://github.com/bitcoin/bips/blob/master/ bip-0065.mediawiki. [31] G. Wood. Ethereum: A secure decentralised generalised transaction ledger, 2014. http://gavwood.com/paper.pdf. [32] C. Yarvin, P. Monk, A. Dyudin, and R. Pasco. Urbit: A solid-state interpreter, May 2016. http://media.urbit.org/whitepaper.pdf. 33
6cs.PL
Efficient Algorithms for Outlier-Robust Regression Adam R. Klivans ∗ Pravesh K. Kothari† Raghu Meka ‡ arXiv:1803.03241v2 [cs.LG] 9 Mar 2018 March 12, 2018 Abstract We give the first polynomial-time algorithm for performing linear or polynomial regression resilient to adversarial corruptions in both examples and labels. Given a sufficiently large (polynomial-size) training set drawn i.i.d. from distribution D and subsequently corrupted on some fraction of points, our algorithm outputs a linear function whose squared error is close to the squared error of the best-fitting linear function with respect to D, assuming that the marginal distribution of D over the input space is certifiably hypercontractive. This natural property is satisfied by many well-studied distributions such as Gaussian, strongly log-concave distributions and, uniform distribution on the hypercube among others. We also give a simple statistical lower bound showing that some distributional assumption is necessary to succeed in this setting. These results are the first of their kind and were not known to be even informationtheoretically possible prior to our work. Our approach is based on the sum-of-squares (SoS) method and is inspired by the recent applications of the method for parameter recovery problems in unsupervised learning. Our algorithm can be seen as a natural convex relaxation of the following conceptually simple nonconvex optimization problem: find a linear function and a large subset of the input corrupted sample such that the least squares loss of the function over the subset is minimized over all possible large subsets. ∗ UT Austin [email protected] University and Institute for Advanced Study. [email protected]. ‡ University of California, Los Angeles [email protected] † Princeton 1 Introduction An influential recent line of work has focused on developing robust learning algorithms– algorithms that succeed on a data set that has been contaminated with adversarially corrupted outliers. It has led to important achievements such as efficient algorithms for robust clustering and estimation of moments [LRV16, DKK+ 16, CSV17, KS17c, KS17a] in unsupervised learning and efficient learning of halfspaces [KLS09, DKS17] with respect to malicious or “nasty noise” in classification. In this paper, we continue this line of work and give the first efficient algorithms for performing outlier-robust least-squares regression. That is, given a training set drawn from distribution D and arbitrarily corrupting an η fraction of its points (by changing both labels and/or locations), our goal is to efficiently find a linear function (or polynomial in the case of polynomial regression) whose least squares loss is competitive with the best fitting linear function for D. We give simple examples showing that unlike classical regression, achieving any non-trivial guarantee for robust regression is information-theoretically impossible without making assumptions on the distribution D. In this paper, we study the case where the marginal of D on examples in the well-studied class of hypercontractive distributions. Many natural distributions such as Gaussians, strongly log-concave distributions, and product distributions on the hypercube with bounded marginals fall into this category. To complement our algorithmic results, we also show that for the class of hypercontractive distributions, the bounds on the loss of the linear function output by our algorithm is optimal in its dependence on the fraction of corruptions η up to multiplicative constants. 1.1 Outlier-Robust Regression We formally define the problem next. In the following, we will use the following notations for brevity: For a distribution D on ’d × ’ and for a vector ℓ ∈ ’d , let errD (ℓ)  (x,y)∼D [(hℓ, xi − y)2 ] and let opt(D)  min ℓ∈’d errD (ℓ) be the least error achievable. In the classical least-squares linear regression problem, we are given access to i.i.d. samples from a distribution D over ’d × ’ and our goal is to find a linear function ℓ : ’d → ’ whose squared-error—errD (ℓ)—is close to the best possible, opt(D). In outlier-robust regression, our goal is similar with the added twist that we only get access to a sample from the distribution D where up to an η fraction of the samples have been arbitrarily corrupted. Definition 1.1 (η-Corrupted Samples). Let D be a distribution on ’d × ’. We say that a set U ⊆ ’d × ’ is an η-corrupted training set drawn from D if it is formed in the following fashion: generate a set X of i.i.d samples from D and arbitrarily modify any η fraction to produce U. Observe that the corruptions can be adaptive, that is, they can depend on the original uncorrupted sample X in an arbitrary way as long as |U ∩ X |/|X | > 1 − η.1 Our goal—which we term outlier-robust regression—now is as follows: Given access to an ηcorrupted training set U drawn from D, find a linear function ℓ whose error errD (ℓ) under the true distribution D is small. 1In unsupervised learning, this has been called the strong adversary model of corruptions and is the strongest notion of robustness studied in the context. 1 1.2 Statement of Results Our main results give outlier-robust least-squares regression algorithms for hypercontractive distributions. Definition 1.2 (4-Hypercontractivity). A distribution D on ’d is (C, 4)-hypercontractive if for all ℓ ∈ ’d , x∼D [hx, ℓi 4] 6 C 2 · x∼D [hx, ℓi 2]2 . In addition, we say that D is certifiably (C, 4)-hypercontractive if there is a degree 4 sum-of-squares proof of the above inequality. Observe that 4-hypercontractivity is invariant under arbitrary affine transformation, and in particular, doesn’t depend on the condition number of the covariance of the distribution. We will elaborate on the notion of certifiability later on (once we have the appropriate preliminaries). For the time being, we note that many well-studied distributions including (potentially non-spherical) Gaussians, affine transformations of isotropic strongly log-concave distributions, the uniform distribution on the Boolean hypercube, and more generally, product distributions on bounded domains are known to satisfy this condition with C a fixed constant. Theorem 1.3. [Informal] Let D be a distribution on ’d × [−M, M] and let DX be its marginal distribution on ’d which is certifiably (C, 4)-hypercontractive. Let ℓ ∗  arg min ℓ errD (ℓ) have polynomial bit-complexity. Then for all ε > 0 and η < c/C 2 for a universal constant c > 0, there exists an algorithm A with run-time poly(d, 1/η, 1/ε, M) that given a polynomial-size η-corrupted training set U, outputs a linear function ℓ such that with probability at least 1 − ε, √ √ errD (ℓ) 6 (1 + O( η)) · opt(D) + O( η) (x,y)∼D [(y − hℓ ∗ , xi)4 ] + ε. The above statement assumes that the marginal distribution is (certifiably) hypercontractive with respect to its fourth moments. Our results improve for higher-order certifiably hypercontractive distributions DX ; see Theorem 5.1 for details. In the realizable case where (x, y) ∼ D satisfies y  hℓ ∗ , xi for some ℓ ∗ , the guarantee of Theorem 1.3 becomes errD (ℓ) 6 ε; in particular, the error approaches zero at a polynomial rate. We also get analogous results for outlier-robust polynomial regression. See Theorem A.3. We also give a simple argument (see Section 6) to show that the above guarantee is optimal in its dependence on η up to the O(1) factors: even for distributions supported on ’d × [−1, 1], √ √ it is statistically impossible to achieve an error bound of (1 + o( η))opt + o( η) under the same assumptions. Our result is a outlier-robust analog of agnostic regression problem - that is, the non-realizable setting. In addition, our guarantees makes no assumption about the condition number of the covariance of DX and thus, in particular, holds for DX with poorly conditioned covariances. Alternately, we give a similar guarantee for ℓ 1 regression when the condition number of covariance of DX is bounded without any need for hypercontractivity (see Theorem 5.9). We show that in the absence of distributional assumptions (such as hypercontractivity) it is statistically impossible to obtain any meaningful bounds on robust regression in Section 6. Application to Learning Boolean Functions under Nasty Noise. Our work has immediate applications for learning Boolean functions in the nasty noise model, where the learner is presented with an η-corrupted training set that is derived from an uncorrupted training set of the form (x, f (x)) 2 with x drawn from D on {0, 1} n and f is an unknown Boolean function. The goal is to output a hypothesis h with x [h(x) , f (x)] as small as possible. The nasty noise model is considered the most challenging noise model for classification problems in computational learning theory. Applying a result due to [KKMS08] (c.f. Theorem 5) for learning with respect to adversarial label noise only (standard agnostic learning) and a generalization of Theorem 1.3 to higher degree polynomials (see Theorem A.3) we obtain the following: Corollary 1.4. Let C be a class of Boolean functions on n variables such that for every c ∈ C there exists a (multivariate) polynomial p of degree d(ε) with x∼D [(p(x) − c(x))2 ] 6 ε. Assume that d(ε) is a constant for any ε  O(1) and that D is (C, 4) hypercontractive for polynomials of degree d(ε 2 ). 2 Then C can be learned in the nasty noise model in time n O(d(ε )) via an output hypothesis h such that √ x∼D [h(x) , c(x)] 6 O( η) x∼D [(p(x) − c(x))4 ] + ε. One of the main conclusions of work due to [KKMS08] is that the existence of low-degree polynomial approximators for a concept class C implies learnability for C in the agnostic setting. Corollary 1.4 shows that existence of low-degree polynomial approximators and hypercontractivity of D imply learnability in the harsher nasty noise model. We note that Corollary 1.4 gives an incomparable set of results in comparison to recent work of [DKS17] for learning polynomial threshold functions in the nasty noise model. Concurrent Works. Using a set of different techniques, Diakonikolas, Kamath, Kane, Li, Steinhardt and Stewart [DKK+ 18] and Prasad, Suggala, Balakrishnan and Ravikumar [PSBR18] also obtained robust algorithms for regression in the setting where data (x, y) is generated via the process: y  hw, xi + e for an fixed unknown vector w and zero mean noise e. 1.3 Our Approach In this section, we give an outline of Theorem 1.3. At a high level, our approach resembles several recent works [MSS16, BM16, PS17, KS17c, HL17] starting with the pioneering work of [BKS15] that use the Sum-of-Squares method for designing efficient algorithms for learning problems. An important conceptual difference, however, is that previous works have focused on parameter recovery problems. For such problems, the paradigm involves showing that there’s a simple (in the “SoS proof system”) proof that a small sample uniquely identifies the underlying hidden parameters (referred to as “identifiability”) up to a small error. In contrast, in our setting, samples do not uniquely determine a good hypothesis as there can be multiple hypotheses (linear functions) that all have low-error on the true distribution. Our approach thus involves establishing that there’s a “simple” proof that any low-error hypotheses that is inferred from the observed (corrupted) sample has low-error on the true distribution (we call this certifiability of a good hypothesis). To output a good solution in our approach (unlike in cases where there are uniqueness results), we have to crucially rely on the convexity (captured in the SoS proof system) of the empirical loss function. Part One: Certifying that a linear function has low loss. Let X be an uncorrupted sample from the underlying distribution D and suppose we are given an η-corruption U  {(u 1 , v1 ), (u 2 , v2 ), . . . , (u n , v n )} of X. Let D̂ 2 be the uniform distribution on X. Our goal is to 2We use superscript ˆ to denote empirical quantities and superscript ′ to denote quantities on corrupted samples. 3 come up with a linear function ℓ that has low error on D̂ given access only to U. By standard generalization bounds, this will also imply that ℓ has low error on D with high probability. It is important to observe that even without computational constraints, that is, information theoretically, it is unclear why this should at all be possible. To see why, let’s consider the following natural strategy: brute-force search over all subsets T of U of size (1 − η)|U | and perform leastsquares regression to obtain linear function ℓ T with empirical loss εT . Then, output ℓ T with minimal empirical loss εT over all subsets T. Since some subset T ∗ of size (1 − η)|U | will be a proper subset of the uncorrupted sample, the empirical loss of ℓ T ∗ will clearly be small. However, a priori, there’s nothing to rule out the existence of another subset R of size (1 − η)|U | such that the optimal regression hypothesis ℓ R on R has loss smaller than that of ℓ T ∗ while ℓ R has a large error on the D̂. This leads to the following interesting question on certifying a good hypothesis: given a linear function ℓ that has small empirical loss with respect to some subset T of (1 − η) fraction of the corrupted training set U, can we certify that its true loss with respect to X is small? We can phrase this as a more abstract “robust certification” question: given two distributions D1 (=uniform distribution on X above) and D2 (=uniform distribution on T above) on ’d × ’ that are η close in total variation distance, and a linear function ℓ that has small error on D2 , when can we certify a good upper bound on the error of ℓ on D1 ? Without making any assumptions on D1 , it is not hard to construct examples where we can give no meaningful bound on the error of a good hypothesis ℓ on D1 (see Section 6). More excitingly, we show an elementary proof of a “robust certifiability lemma” that proves a statement as above whenever D1 has hypercontractive one dimensional marginals. The loss with respect to D1 increases as a function of the statistical distance and the degree of hypercontractivity. Applying our certification lemma, it thus suffices to find a subset T of U of size > (1 − η)|U | and a linear function ℓ such that the least squares error of ℓ over T is small. Part Two: Inefficient Algorithm via Polynomial Optimization. Coming back to the question of efficient algorithms, the above approach can appear hopeless in general since simultaneously finding ℓ and a subset T of size (1 − η)|U | that minimizes the error of ℓ w.r.t. uniform distribution on T is a non-convex quadratic optimization problem. At a high-level, we will be able to get around this intractability by observing that the proof of our robust certifiability lemma is “simple” in a precise technical sense. This simplicity allows us to convert such a certifiability proof into an efficient algorithm in a principled manner. To describe this connection, we will first translate the naive idea for an algorithm above into a polynomial optimization problem. For concreteness in this high-level description, we suppose that for (x, y) ∼ D, the distribution on x is (C, 4)-hypercontractive for a fixed constant C and [y 4 ]  O(1). Further, it can also be shown that, with high probability, D̂ is also (O(1), 4)-hypercontractive as long as the size of the original uncorrupted sample X is large enough. Following the certification lemma, our goal is to use U to find a distribution D ′ and a linear b It is easy to function ℓ such that 1) the loss of ℓ with respect to D ′ is small and 2) D ′ is close to D. phrase this as a polynomial optimization problem. To do so we will look for X ′  {(x1′ , y1′ ), . . . , (x ′n , yn′ )} and weights w 1 , w 2 , . . . , w n ∈ {0, 1} with Í ′ ′ ′ i w i > (1 − η)n and (x i , y i )  (u i , v i ) if w i  1. Let D be the uniform distribution on D. Clearly, the condition on weights w ensures that the statistical distance between D̂, D ′ is at most η. Ideally, we intend w i ’s to be the indicators of whether or not the i’th sample is corrupted. We now try 4 to find ℓ that minimizes the least squares error on D ′ . This can be captured by the following Í optimization program: min w,ℓ,X′ (1/n) i (yi′ − hℓ, x ′i i)2 where (w, ℓ, X ′) satisfy the polynomial system of constraints: Ín       i1 w i  (1 − η) · n      2  wi  wi    ∀i ∈ [n].  P  w i · (u i − x ′i )  0 ∀i ∈ [n].          ′  w i · (v i − y )  0  ∀ i ∈ [n]. i   (1.1) In this notation, our robust certifiability lemma implies that for any (w, ℓ, X ′) satisfying P, √ √ errD̂ (ℓ) 6 (1 + O( η)) · errD ′ (ℓ) + O( η). (1.2) b / opt(D) (up to It is easy to show that the minimum of the optimization program opt(D) ′ standard generalization error) by setting X  X and w i  1 if and only if i’th sample is uncorrupted. By the above arguments, solutions to the above program satisfy the bound stated in Theorem 1.3. Unfortunately, this is a quadratic optimization problem and is NP-hard in general. We are now ready to describe the key idea that allows us to essentially turn this hopelessly inefficient algorithm into an efficient one. This exploits a close relationship between the simplicity of the proof of robust certifiability and the success of a canonical semi-definite relaxation of (1.1). Part Three: From Simple Proofs to Efficient Algorithms. Suppose that instead of finding a single solution to the program in (1.1), we attempt to find a distribution µ supported on (w, ℓ, X ′) Í that satisfy P and minimizes µ [(1/n) i (yi′ − hℓ, x ′i i)2 ]. Let optµ be the minimum value. Then, as Equation 1.2 holds for all (w, ℓ, X ′) satisfying P, it also follows that (w,ℓ,X ′ )∼µ √ √ [errD̂ (ℓ)] 6 (1 + O( η)) optµ +O( η). (1.3) A priori, we appear to have made our job harder. While computing a distribution on solutions is no easier than computing a single solution, even describing a distribution on solutions appears to require exponential resources in general. However, by utilizing the convexity of the square loss, we can show that having access to just the first moments of µ is enough to recover a good solution. Formally, by the convexity of the square loss, the above inequality yields: errD̂  µ  [ℓ] 6 (w,ℓ,X ′ )∼µ √ √ [errD̂ (ℓ)] 6 (1 + O( η)) optµ +O( η). (1.4) All of the above still doesn’t help us in solving program 1.1 as even finding first moments of distributions supported on solutions to a polynomial optimization program is NP-Hard. The key algorithmic insight is to observe that we can replace distributions µ by an efficiently computable (via the SoS algorithm) proxy called as pseudo-distributions without changing any of the conclusions above. In what way is a pseudo-distribution a proxy for an actual distribution µ satisfying P? It turns out that if a polynomial inequality (such as the one in (1.2)) can be derived from P via a low-degree sum-of-squares proof, then (1.3) remains valid even if we replace µ in (1.3) by a pseudo-distribution µ̃ of large enough degree. Roughly speaking, the SoS degree of a proof measures the “simplicity” of the proof (in the “SoS proof system”). In other words, facts with simple proofs holds not just for distributions but also for pseudo-distributions. 5 Thus, the important remaining steps are to show that 1) the inequality (1.2) (which is essentially the conclusion of our robust certifiability lemma) and 2) the convexity argument in (1.4) has a lowdegree SoS proof. We establish both these claims by relying on standard tools such as the SoS versions of the Cauchy-Schwarz and Hölder’s inequalities. We give a brief primer to the SoS method in Section 4 that includes rigorous definitions of concepts appearing in this high-level overview. 1.4 Related Work The literature on grappling with outliers in the context of regression is vast, and we do not attempt a survey here3. Many heuristics have been developed modifying the ordinary least squares objective with the intent of minimizing the effect of outliers (see [RL87]). Another active line research is concerned with parameter recovery, where each label y in the training set is assumed to be from a generative model of the form θ T x + e for some (usually independent) noise parameter e and unknown weight vector θ ∈ ’d . For example, the recovery properties of LASSO and related algorithms in this context have been intensely studied (see e.g., [XCM10], [LW11]). For more challenging noise models, recent work due to Du, Balakrishnan, and Singh [DBS17] studies sparse recovery in the Gaussian generative setting in Huber’s ε-contamination model, which is similar but formally weaker than the noise model we consider here. It is common for “robust regression” to refer to a scenario where only the labels are allowed to be corrupted adversarially (for example, see [BJKK17] and the references therein), or where the noise obeys some special structure (e.g., [HS10]) (although there are some contexts where both the covariates (the x’s) and labels may be subject to a small adversarial corruption [CCM13]). What distinguishes our setting is 1) we do not assume the labels come from a generative model; each (x, y) element of the training set is drawn iid from D and 2) we make no assumptions on the structure or type of noise that can affect a training set (other than that at most an η fraction of points may be affected). In contrast to the parameter recovery setting, our goal is similar to that of agnostic learning: we will output a linear function whose squared error with respect to D is close to optimal. From a technical standpoint, as discussed before our work follows the recent paradigm of converting certifiability proofs to algorithms. Previous applications in machine learning have focused on various parameter-recovery problems in unsupervised learnings. Our work is most closely related to the recent works on robust unsupervised learning (moment estimation and clustering) [KS17c, HL17, KS17b]. 2 Preliminaries and Notation 2.1 Notation We will use the following notations and conventions throughout: For a distribution D on ’d × ’ and function f : ’d → ’, we define errD ( f )  (x,y)∼D [( f (x) − y)2 ]. For a vector ℓ ∈ ’d , we abuse notation and write errD (ℓ) for (x,y)∼D [(hℓ, xi − y)2 ]. For a real-valued random variable X, and integer k > 0, we let kX kk  [X k ]1/k . 3Even the term “robust” is very overloaded and can now refer to a variety of different concepts. 6 2.2 Distribution Families Our algorithmic results for a wide class of distributions that include Gaussian distributions and others such as log-concave and other product distributions. We next define the properties we need for the marginal distribution on examples to satisfy. Definition 2.1 (Certifiable hypercontractivity). For a function C : [k] → ’+ , we say a distribution D on ’d is k-certifiably C-hypercontractive if for every r 6 k/2, there’s a degree k sum of squares proof of the following inequality in variable v: D hx, vi 2r  6 C(r) hx, vi D 2 r . Many natural distribution families satisfy certifiable hypercontractivity with reasonably growing functions C. For instance, Gaussian distributions, uniform distribution on Boolean hypercube satisfy the definitions with C(r)  cr for a fixed constant c. More generally, all distributions that are affine transformations of isotropic distributions satisfying the Poincaré inequality [KS17a], are also certifiably hypercontractive. In particular, this includes all strongly log-concave distributions. Certifiable hypercontractivity also satisfies natural closure properties under simple operations such as affine transformations, taking bounded weight mixtures and taking products. We refer the reader to [KS17c] for a more detailed overview where certifiable hypercontractivity is referred to as certifiable subgaussianity. 3 Robust Certifiability The conceptual core of our results is the following robust certifiability result: for nice distributions (e.g., as defined in Definition 2.1), a regression hypothesis inferred from a large enough ε-corrupted sample has low-error over the uncorrupted distribution. 3.1 Robust Certifiability for Arbitrary Distributions We begin by giving a robust certifiability claim for arbitrary distributions for L1 regression. The error that we incur depends on the L2 squared loss of the best fitting regression hypothesis, and in particular, we do not obtain consistency in the statistical sense: i.e, the error incurred by the regression hypothesis does not vanish even in the “realizable” case when, in the true uncorrupted distribution, there’s a linear function that correctly computes all the labels. In Section 6, we show that if we make no further assumption on the distribution, then this is indeed inherent and that achieving consistency under adversarial corruptions is provably impossible without making further assumptions. In the following subsection, we show that assuming that the moments of the underlying uncorrupted distribution are “bounded” (i.e., linear functions of the distribution are hypercontractive), one can guarantee consistency even under the presence of adversarial outliers. While the certifiability statements are independently interpretable, for the purpose of robust regression, it might be helpful to keep in mind that D corresponds to uniform distribution on large enough sample from the unknown uncorrupted distribution while D ′ corresponds to the uniform distribution on the sample that serves as the “certificate”. Lemma 3.1 (Robust Certifiability for L1 Regression). Let D, D ′ be two distributions on ’d × ’ with marginals D, D ′ on ’d , respectively. Suppose kD − D ′ kTV 6 η and further, that the ratio of the largest 7 to the smallest eigenvalue of the 2nd moment matrix of D is at most κ. Then, for any ℓ, ℓ ∗ ∈ ’d such that kℓ ∗ k2 > kℓ k, D |hℓ, xi − y| 6 D |hℓ, xi − y| + 2κ 1/2 η1/2 ′ q y 2 + 2κ 1/2 η1/2 · D q D (y − hℓ ∗ , xi)2 . Proof. Let G be a coupling between D, D ′. That is, G is a joint distribution on (x, y), (x ′ , y ′) such that  the marginal on (x ′ , y ′) is D ′ and the marginal on (x, y) is D satisfying G 1 (x, y)  (x ′ , y ′)  1 − η. Let errD ′ (ℓ)  D ′ | y − hℓ, xi|. We have: D | y − hℓ, x ′i|  G  1 (x, y)  (x ′ , y ′) | y − hℓ, xi)| + 6 errD ′ (ℓ) + r G  1 (x, y) , (x ′ , y ′) √ q  errD ′ (ℓ) + η (y − hℓ, xi)2 . G q 2  1 (x, y) , (x ′ , y ′) · | y − hℓ, xi| D (y − hℓ, xi)2 D Now, we must have: D (y − hℓ, xi)2 6 2 D y 2 + 2 D hℓ, xi 2 . For any ℓ ∗ , D hℓ ∗ , xi 2 6 2 D y 2 + 2 D (y − hℓ ∗ , xi)2 . Since the all eigenvalues of D xx ⊤ are within κ of each other and kℓ ∗ k2 > kℓ k, κ · D hℓ ∗ , xi 2 . Plugging in the above estimate gives the lemma. D hℓ, xi 2 6  3.2 Robust Certifiability for Hypercontractive Distributions The main result of this section is the following lemma. Lemma 3.2 (Robust Certifiability for L2 Regression). Let D, D ′ be distributions on ’d × ’ such that kD − D ′ kTV 6 ε and the marginal DX of D on x is k-certifiably C-hypercontractive for some C : [k] → ’+ and for some even integer k > 4. Then, for any ℓ, ℓ ∗ ∈ ’d and any η such that 2C(k/2)η1−2/k < 0.9, we have: errD (ℓ) 6 (1 + O(C(k/2))η 1−2/k ) · errD ′ (ℓ) + O(C(k/2))η 1−2/k ·  D ∗ (y − hℓ , xi) k  2/k . Proof. Fix a vector ℓ ∈ ’d ; for brevity, we write errD for errD (ℓ) and errD ′ for errD ′ (ℓ) in the following. Let G be a coupling between D, D ′. That is, G is a joint distribution on (x, y), (x ′ , y ′) such that  the marginal on (x ′ , y ′) is D ′ and the marginal on (x, y) is D satisfying G 1 (x, y)  (x ′ , y ′)  1 − η.   Let ((x, y), (x ′ , y ′)) ∼ G. Writing 1  1 (x, y)  (x ′ , y ′) + 1 (x, y) , (x ′ , y ′) , we obtain: [(y − hℓ, xi)2 ]     [1 (x, y)  (x ′ , y ′) (y − hℓ, xi)2 ] + [1 (x, y) , (x ′ , y ′) · (y − hℓ, xi)2 ]   [1 (x, y)  (x ′ , y ′) (y ′ − hℓ, x ′i)2 ] + [1 (x, y) , (x ′ , y ′) · (y − hℓ, xi)2 ] 6 errD ′ +   [1 (x, y) , (x ′ , y ′) 6 errD′ + η1−2/k ·  (y − hℓ, xi)k 8 k/k−2  2/k . ]  1−2/k  (y − hℓ, xi)k  2/k (3.1) Here, the inequality uses the Hölder’s inequality for the second term and the fact that  ′ ′ 2 2 G 1 (x, y)  (x , y ) (y − hℓ, xi) 6 D ′ (y − hℓ, xi)  err D ′ (ℓ) for the first term. We next bound k y − hℓ, xi kk . By Minkowski’s inequality, k y − hℓ, xi kk 6 k y − hℓ ∗ , xi kk + khℓ − ℓ ∗ , xi kk . Now, by using hypercontractivity of DX , we get khℓ − ℓ ∗ , xik 6 Further, p C(k/2) · khℓ − ℓ ∗ ix k2 . (3.2) khℓ − ℓ ∗ , xi2 6 k y − hℓ ∗ , xi k2 + k y − hℓ, xi k2 6 k y − hℓ ∗ , xi kk + k y − hℓ, xi k2 . Combining the above three inequalities, we get k y − hℓ, xi kk 6 (1 + p C(k/2))k y − hℓ ∗ , xi kk + Therefore, as (a + b)2 6 2a 2 + 2b 2 and 2(1 + p p C(k/2)k y − hℓ, xi k2 . C(k/2))2 6 8C(k/2), k y − hℓ, xi kk2 6 8C(k/2))k y − hℓ ∗ , xi kk2 + 2C(k/2)errD . Substituting the above into Equation 5.4, we get errD 6 errD ′ + 8η1−2/k C(k/2) · k y − hℓ ∗ , xi kk2 + 2η1−2/k C(k/2)err D . Rearranging the inequality and observing that 1/(1 − 2η1−2/k C(k/2)) 6 1 + O(C(k/2))η1−2/k gives us errD 6 (1 + O(C(k/2))η1−2/k )errD ′ + O(C(k/2))η1−2/k · k y − hℓ ∗ , xi kk2 , proving the claim.  The argument for the above lemma also extends straightforwardly to polynomial regression (see Appendix A): 4 Sum of Squares proofs and Sum of Squares Optimization In this section, we define pseudo-distributions and sum-of-squares proofs. See the lecture notes [BS16] for more details and the appendix in [MSS16] for proofs of the propositions appearing here. Let x  (x1 , x2 , . . . , x n ) be a tuple of n indeterminates and let ’[x] be the set of polynomials with real coefficients and indeterminates x1 , . . . , x n . We say that a polynomial p ∈ ’[x] is a sum-of-squares (sos) if there are polynomials q 1 , . . . , q r such that p  q 12 + · · · + q 2r . 9 4.1 Pseudo-distributions Pseudo-distributions are generalizations of probability distributions. We can represent a discrete (i.e., finitely supported) probability distribution over ’n by its probability mass function D : ’n → Í ’ such that D > 0 and x∈supp(D) D(x)  1. Similarly, we can describe a pseudo-distribution by its mass function. Here, we relax the constraint D > 0 and only require that D passes certain low-degree non-negativity tests. Concretely, a level-ℓ pseudo-distribution is a finitely-supported function D : ’n → ’ such that Í Í 2 x D(x)  1 and x D(x) f (x) > 0 for every polynomial f of degree at most ℓ/2. (Here, the summations are over the support of D.) A straightforward polynomial-interpolation argument shows that every level-∞-pseudo distribution satisfies D > 0 and is thus an actual probability distribution. We define the pseudo-expectation of a function f on ’d with respect to a pseudodistribution D, denoted ˜ D(x) f (x), as ˜ D(x) f (x)  Õ x D(x) f (x) . (4.1) The degree-ℓ moment tensor of a pseudo-distribution D is the tensor D(x) (1, x1 , x2 , . . . , x n )⊗ℓ . In particular, the moment tensor has an entry corresponding to the pseudo-expectation of all monomials of degree at most ℓ in x. The set of all degree-ℓ moment tensors of probability distribution is a convex set. Similarly, the set of all degree-ℓ moment tensors of degree d pseudodistributions is also convex. Key to the algorithmic utility of pseudo-distributions is the fact that while there can be no efficient separation oracle for the convex set of all degree-ℓ moment tensors of an actual probability distribution, there’s a separation oracle running in time n O(ℓ) for the convex set of the degree-ℓ moment tensors of all level-ℓ pseudodistributions. Fact 4.1 ([Sho87, Par00, Nes00, Las01]). For any n, ℓ ∈ Ž, the following set has a n O(ℓ) -time weak separation oracle (as defined in [GLS81]):  ˜ D(x) (1, x1 , x2 , . . . , x n )⊗d | degree-d pseudo-distribution D over ’n (4.2) . This fact, together with the equivalence of weak separation and optimization [GLS81] allows us to efficiently optimize over pseudo-distributions (approximately)—this algorithm is referred to as the sum-of-squares algorithm. The level-ℓ sum-of-squares algorithm optimizes over the space of all level-ℓ pseudo-distributions that satisfy a given set of polynomial constraints—we formally define this next. Definition 4.2 (Constrained pseudo-distributions). Let D be a level-ℓ pseudo-distribution over ’n . Let A  { f1 > 0, f2 > 0, . . . , f m > 0} be a system of m polynomial inequality constraints. We say that D satisfies the system of constraints A at degree r, denoted D r A, if for every S ⊆ [m] and every Í sum-of-squares polynomial h with deg h + i∈S max { deg f i , r }, ˜ Dh · We write D Ö fi > 0 . i∈S A (without specifying the degree) if D 0 A holds. Furthermore, we say that D ℓ 2−n Î r A · kh k · i∈S k f i k, holds approximately if the above inequalities are satisfied up to an error of where k·k denotes the Euclidean norm4 of the cofficients of a polynomial in the monomial basis. ℓ 4The choice of norm is not important here because the factor 2−n swamps the effects of choosing another norm. 10 We remark that if D is an actual (discrete) probability distribution, then we have D A if and only if D is supported on solutions to the constraints A. We say that a system A of polynomial constraints is explicitly bounded if it contains a constraint of the form {kx k 2 6 M}. The following fact is a consequence of Fact 4.1 and [GLS81], Fact 4.3 (Efficient Optimization over Pseudo-distributions). There exists an (n + m)O(ℓ) -time algorithm that, given any explicitly bounded and satisfiable system5 A of m polynomial constraints in n variables, outputs a level-ℓ pseudo-distribution that satisfies A approximately. A property of pseudo-distributions that we will use frequently is the following: Fact 4.4 (Hölder’s inequality). Let f , 1 be SoS polynomials. Let p, q be positive integers so that 1/p+1/q  1. Then, for any pseudo-distribution µ̃ of degree r > pq · de 1( f ) · de 1(1), we have: ( ˜ µ̃ [ f · 1])pq 6 ˜ [ f p ]q · ˜ [1 q ]p In particular, for all even integers k > 2, and polynomial f with de 1( f ) · k 6 r, ( ˜ µ̃ [ f ])k 6 ˜ µ̃ [ f k ]. 4.2 Sum-of-squares proofs Let f1 , f2 , . . . , f r and 1 be multivariate polynomials in x. A sum-of-squares proof that the constraints { f1 > 0, . . . , f m > 0} imply the constraint {1 > 0} consists of polynomials (p S )S⊆[m] such that Õ 1 S⊆[m] p S · Πi∈S f i . (4.3) We say that this proof has degree ℓ if for every set S ⊆ [m], the polynomial p S Πi∈S f i has degree at most ℓ. If there is a degree ℓ SoS proof that { f i > 0 | i 6 r} implies {1 > 0}, we write: { f i > 0 | i 6 r} ℓ {1 > 0} . (4.4) Sum-of-squares proofs satisfy the following inference rules. For all polynomials f , 1 : ’n → ’ and for all functions F : ’n → ’m , G : ’n → ’k , H : ’p → ’n such that each of the coordinates of the outputs are polynomials of the inputs, we have: { f > 0, 1 > 0} A , A ℓ { f + 1 > 0} A A ℓ ℓ B, B A ℓ·ℓ′ ℓ′ ℓ { f > 0}, A A ℓ+ℓ′ ℓ′ {1 > 0} { f · 1 > 0} C (transitivity) C {F > 0} {F(H) > 0} ℓ (addition and multiplication) {G > 0} ℓ·deg(H) {G(H) > 0} (substitution) . Low-degree sum-of-squares proofs are sound and complete if we take low-level pseudodistributions as models. Concretely, sum-of-squares proofs allow us to deduce properties of pseudo-distributions that satisfy some constraints. 5Here, we assume that the bitcomplexity of the constraints in A is (n + m)O(1) . 11 Fact 4.5 (Soundness). If D proof A r′ B, then D r·r ′+r ′ r B. A for a level-ℓ pseudo-distribution D and there exists a sum-of-squares If the pseudo-distribution D satisfies A only approximately, soundness continues to hold if we require an upper bound on the bit-complexity of the sum-of-squares A r ′ B (number of bits required to write down the proof). In our applications, the bit complexity of all sum of squares proofs will be n O(ℓ) (assuming that all numbers in the input have bit complexity n O(1) ). This bound suffices in order to argue about pseudo-distributions that satisfy polynomial constraints approximately. The following fact shows that every property of low-level pseudo-distributions can be derived by low-degree sum-of-squares proofs. Fact 4.6 (Completeness). Suppose d > r ′ > r and A is a collection of polynomial constraints with degree Í at most r, and A ⊢ { ni1 x 2i 6 B} for some finite B. Let {1 > 0} be a polynomial constraint. If every degree-d pseudo-distribution that satisfies D satisfies D r ′ {1 > 0}, then for every ε > 0, there is a sum-of-squares proof A d {1 > −ε}. r A also We will use the following standard sum-of-squares inequalities: Fact 4.7 (SoS Hölder’s Inequality). Let f1 , f2 , . . . , f n and 11 , 12 , . . . , 1n be SoS polynomials over ’d . Let p, q be integers such that 1/p + 1/q  1. Then, f1 ,..., f n ,11 ,...,1n pq ( 1Õ f i 1i n i ! pq n 1Õ p fi 6 n i1 !q n 1Õ q 1i n i1 !p ) Fact 4.8. For any a1 , a2 , . . . , a n , a1 ,a2 ,...,a n k ( Õ ( i a i )k 6 n k Õ i a ik !) 5 Algorithm In this section, we present and analyze our robust regression algorithms. We begin by setting some notation that we will use throughout this section: 1. D denotes the uncorrupted distribution on ’d × ’. In general, calligraphic letters will denote distributions on example-label pairs. D  Dx will denote the marginal distribution on x. 2. We will write X  ((x1 , y1 ), (x2 , y2 ), . . . , (x n , yn )) to denote the uncorrupted input sample of size n drawn according to D. For some bound B on the bit-complexity of linear functions, we will write opt(D) for the optimum least squares error of any linear function of bit complexity B on D. Recall that the bit complexity of a linear function is the number of bits required to write down all of its coefficients. b for the uniform distribution on the sample X. D bx will denote the b  D 3. We will write D b We marginal distribution on x. Note that our algorithm does not get direct access to D or D. b for the optimum least squares error of any linear function of bit complexity will write opt(D) b B on D. 12 4. We will write U  ((u 1 , v1 ), (u 2 , v2 ), . . . , (u n , v n )) to denote an η-corruption of X, i.e., U is obtained by changing η fraction of the example-label pairs. Our algorithm gets access to U. 5. For ℓ ∈ ’d , and M > 0, let ℓ M : ’d → ’ denote the truncated linear function defined as follows: ( hb ℓ, xi if |hb ℓ, xi| 6 M ℓ M (x)  . sign(hb ℓ, xi) · M otherwise. 5.1 Robust Least Squares Regression In this section, we present our Robust Least Squares Regression algorithm. The main goal of this section is to establish the following result. Theorem 5.1. Let D be a distribution on ’d × [−M, M] for some positive real M such the marginal on ’d is (C, k)-certifiably hypercontractive distribution. Let optB (D)  min ℓ D [(y − hℓ, xi)2] where the minimum is over all ℓ ∈ ’d of bit complexity B. Let ℓ ∗ be any such minimizer. Fix any even k > 4 and any ε > 0. Let X be an i.i.d. sample from D of size n > n 0  poly(d k , B, M, 1/ε). Then, with probability at least 1 − ε over the draw of the sample X, given any η-corruption U of X and η as input, there is a polynomial time algorithm (Algorithm 5.2) that outputs a ℓ ∈ ’d such that for C  C(k/2), errD (ℓ M ) < (1 + O(C)η 1−2/k ) optB (D) + O(C)η 1−2/k  D ∗ (y − hℓ , xi) k  2/k + ε. By an entirely analogous argument, we also get a similar guarantee for outlier-robust polynomial regression. We defer the details to Section A. We need the boundedness assumption on the labels y (that they lie in [−M, M]) and the bounded bit-complexity assumption on the linear functions (B) mainly to obtain generalization bounds for linear regression as are often used even for regression without corruptions. Further note that specializing the above to the case k  4 gives Theorem 1.3. Following the outline described in the introduction, we first define a set of polynomial inequalities which will be useful in our algorithm: Let η > 0 be a parameter and consider the following system of polynomial inequalities in variables w ∈ ’n , ℓ ∈ ’d , x1′ , . . . , x ′n ∈ ’d : PU,η Ín       i1 w i  (1 − η) · n      2  wi  wi    ∀i ∈ [n].   ′  w i · (u i − x i )  0 ∀i ∈ [n].           w i · (v i − y ′)  0  ∀ i ∈ [n]. i   (5.1) Observe that this system is feasible: use w i  1 if (x i , yi )  (u i , v i ) and 0 otherwise (i.e., w i  1 if and only if the i’th example was corrupted) and taking (x ′i , yi′)  (x i , yi ) for all i ∈ [n]. We are now ready to describe our algorithm for robust L2 regression. Algorithm 5.2 (Algorithm for Robust L2 Linear Regression via sum-of-squares). Given: • η: A bound on the fraction of adversarial corruptions. • U: An η-corruption of a labeled sample X of size n sampled from a (C, k)-certifiably hypercontractive distribution D. 13 Operation: 1. Find a level-k pseudo-distribution µ̃ that satisfies PU,η and minimizes ˜ µ̃  1 n Ín ′ i1 (y i − hℓ, x ′i i)2 is this minimum value. 2. Output b ℓ  ˜ µ̃ ℓ.  k/2  k/2 c SOS be a positive real number so that opt c SOS . Let opt 5.2 Analysis of the Algorithm We now analyze the algorithm and prove Theorem 5.1. The analysis can be broken into two modular steps: (1) Bounding the optimization error (roughly translates to bounding the empirical error) and (2) Bounding the generalization error. Concretely, we break down the analysis into the following c k  (1/n) two steps. Let opt Ín i1 (y i − hℓ ∗ , xi)k  2/k and optk (D)  (x,y)D [(y − hℓ ∗ , xi)k ]2/k . Lemma 5.3 (Bounding the optimization error). Under the assumptions of Theorem 5.1 (and following the above notations), with probability at least 1 − ε, 1−2/k b c SOS + O(C(k/2)) · η1−2/k · opt c k. errD ) · opt b ( ℓ) 6 (1 + C(k/2)η Lemma 5.4 (Bounding the generalization error). Under the assumptions of Theorem 5.1, with probability at least 1 − ε, the following hold: c SOS 6 opt(D) + ε. 1. opt 2. errD (b ℓ M )) 6 errDb (b ℓ) + ε. c k 6 optk (D) + ε. Given such an inequality, Theorem 5.1 Ideally, we would liked to have opt would follow immediately from the above two lemmas. A small technical issue is that we cannot prove such an inequality as we don’t have good control on the moments of (y − hℓ ∗ , xi)k . However, we can exploit the robust setting to get around this issue by essentially truncating large values - since the distribution with truncated values will be close in statistical distance to the actual distribution. We remark that the proof of Lemma 5.4 follows standard generalization arguments for the most part. We defer the proofs of the above lemmas to the appendix and proceed to finish analyzing our algorithm. With Lemma 5.3, 5.4 in hand, we are now ready to prove our main theorem. We just c k. need the following lemma to get around bounding opt Lemma 5.5. For every distribution D on ’d × ’ such that v  ED (y − hℓ ∗ , xi)k < ∞, there exists a distribution F such that kD − F kTV < η and (y − hℓ ∗ , xi)k is bounded absolutely bounded in the support of F by v/η.  Proof. Set F  D | (y − hℓ ∗ , xi)k 6 v/η . Then, by definition F satisfies the property that (y−hℓ ∗ , xi)k is bounded by v/η in the support of F . Further, by Markov’s inequality, the probability of the event we conditioned on is at least 1 − η. This completes the proof.  Observe that an η corrupted sample from D can be thought of as an 2η corrupted sample from F . Since (y − hℓ ∗ , xi)k is bounded in F , it allows us to use Hoeffding bound for concentration to show that the empirical expectation of (y − hℓ ∗ , xi)k converges to its expectation under D. 14 Proof of Theorem 5.1. Let X be an i.i.d. sample from D of size n and D̂ be the uniform distribution on X. Let v  D (y − hℓ ∗ , xi)k . Without loss of generality, by using Fact 5.5, we can assume that (y − hℓ ∗ , xi)k is bounded above by v/η in D. Using Hoeffding’s inequality, if n > v log (1/δ)/ηε 2 , c k  D̂ [(y − hℓ ∗ , xi)k ] 6 D (y − hℓ ∗ , xi)k + ε  optk +ε. then with probability at least 1 − δ, opt Therefore, by Lemmas 5.3, 5.4, and the above observation, we get that with probability at least 1 − O(ε), errD (ℓ M ) 6 (1 + O(C)η1−2/k ) · opt(D) + O(C)η1−2/k · optk +O(Cε). The theorem now follows by choosing ε to be a sufficiently small constant times the parameter desired.  5.2.1 Bounding the Optimization Error We now prove Lemma 5.3. While the proof can appear technical, it’s essentially a line-by-line translation of the robust certifiability Lemma A. Proof Outline. The rough idea is to exploit the following abstract property of pseudodistributions: If a collection of polynomial inequalities P  {p i (z) > 0, i ∈ [r]} SOS-imply another polynomial inequality q(z) > 0, then for any pseudo-distribution µ̃ of appropriately high degree (depending on the degree of the SOS proof) that satisfies the inequalities in P also satisfies q, that is ˜ µ̃ [q] > 0. Further, the SoS algorithm allows us to compute pseudo-distributions satisfying a set of polynomial inequalities efficiently. b and the Now, let (w, ℓ, X ′) satisfy the inequalities PU,η . Then, by Lemma A, applied to D uniform distribution on X ′, we get errD b (ℓ) 6 (1 + cCη 1−2/k ) (1/n) n Õ i1 (yi′ − hℓ, x ′i i)2 ! c k, + cCη1−2/k · opt for some universal constant c > 0. To view the above inequality as a polynomial inequality in variables w, ℓ, X ′, we rephrase it as Í follows. For brevity, let err(w, ℓ, X ′)  (1/n) ni1 (yi′ − hℓ, x ′i i)2 . Then, errD̂ (ℓ) − err(w, ℓ, X ′)  k/2 k/2 ck . 6 η k/2−1 · 2Θ(k) C k err(w, ℓ, X ′)k/2 + η k/2−1 · 2Θ(k) C k · opt We show that the above version of the robust certifiability lemma has a SOS proof; that is, viewing the above inequality as a polynomial inequality in variables w, ℓ, X ′, this inequality has a SOS proof starting from the polynomial inequalities PU,η . Thus, by the property of pseud-densities at the beginning of this sketch, a pseudo-density µ̃ as in our algorithm satisfies an analogue of the above inequality which after some elementary simplifications gives us a bound of the form ˜ µ̃ [err b (ℓ)] 6 (1 + cCη1−2/k ) · opt c SOS + cCη1−2/k opt c k. D As it stands, the above inequality is not very useful for us as it does not tell us which ℓ to choose. However, for any degree at most k/2 polynomial p, we also have that ( ˜ µ̃ [p(w, ℓ)])2 6 ˜ [p(w, ℓ)2 ] (see Fact 4.4). Applying this to each (yi − hℓ, x i i), we get that 1−2/k ˜ ˜ c SOS + cCη1−2/k opt c k, ) · opt errD b (ℓ)] 6 (1 + cCη b ( µ̃ [ℓ]) 6 µ̃ [err D proving the claim. We next formalize the above approach starting with a SOS proof of Lemma A. We defer the proof of the lemma to Section 5.2.2. 15 Lemma 5.6 (SoS Proof of Robust Certifiability of Regression Hypothesis). Let X be a collection of b the uniform distribution on x1 , x2 , . . . , x n is k-certifiably n labeled examples in ’d × ’ such that D, hypercontractive and all the labels y1 , y2 , . . . , yn are bounded in [−M, M]. Let U be an η-corruption of X. Let (w, ℓ, X ′) satisfy the set of system of polynomial equations PU,η . Let errD̂ (ℓ) be the quadratic Í polynomial (x,y)∼D̂ (y−hℓ, xi)2 in vector valued variable ℓ. Let err(w, ℓ, X ′) be the polynomial n1 i 6 n (yi′ − hℓ, x ′i i)2 in vector valued variables w, ℓ, x1′ , . . . , x ′n . Then, for any ℓ ∗ ∈ ’d of bit complexity at most B < poly(n, d k ), C  C(k/2) and any η such that 100Cη1−2/k < 0.9, AU,η ℓ k errD̂ (ℓ) − err(w, ℓ, X ′)  k/2 6 η k/2−1 · 2Θ(k) C k err(w, ℓ, X ′)k/2 + η k/2−1 · 2Θ(k) C k ! n 1Õ (yi − hℓ ∗ , x i i)k . (5.2) n i1 Moreover, the bit complexity of the proof is polynomial in n and d k . We also need the following lemma (that follows from appropriate matrix concentration results) from [KS17c] stating that the uniform distribution on a sufficiently large set of i.i.d samples from a hypercontractive distribution also satisfy hypercontractivity. This allows us to argue that the b is also hypercontractive when D is. uncorrupted empirical distribution D Lemma 5.7 (Lemma 5.5 of [KS17c]). Let D be a (C, k)-certifiably hypercontractive distribution on ’d . Let X be an i.i.d. sample from D of size n > Ω((d k/2 log (d/δ))k/2 ). Then, with probability at least 1 − δ over the draw of X, the uniform distribution D over X is (2C, k)-certifiably hypercontractive. We can now prove Lemma 5.3. Proof of Lemma 5.3. If n > Θ̃(d k/2 log (d/ε)k/2 ), then by Lemma 5.7, with probability at least 1 − ε, b on X is (2C, k)-hypercontractive. the uniform distribution D Since µ̃ is a pseudo-distribution of level k, combining Fact 4.5 and Lemma 5.6, we must have for C  C(k/2), ˜ µ̃ err (ℓ) − err(w, ℓ, X ) D̂ ′  k/2 6 O(C k/2 k/2−1 η )· ˜ µ̃ err(w, ℓ, X ) ′ k/2 +O(C k/2 k/2−1 η )·  D̂ ∗ (y − hℓ , xi) k  . (5.3) Taking 2/kth powers of both sides of the above equation and recalling the definition of c c k , we get optSOS , opt 2/k c SOS + O(C)η1−2/k opt ck . ( ˜ µ̃ errD̂ (ℓ) − errD ′ (ℓ))k/2 )2/k 6 O(C)η1−2/k · opt Now, by Fact 4.4, ( ˜ µ̃ [errD̂ (ℓ) − err(w, ℓ, X ′)])k/2 6 ˜ µ̃ [(errD̂ (ℓ) − err(w, ℓ, X ′))]k/2 and thus, ˜ µ̃ err (ℓ) 6 (1 + O(C)η1−2/k ) · opt c SOS + O(C)η1−2/k opt ck. D̂ Finally, by another application of Fact 4.4, we have that for every i, (yi − hx i , ˜ µ̃ [ℓ]i)2 6 ˜ µ̃ [(yi hx i , ℓi)2 ]; in particular, err b ( ˜ µ̃ [ℓ]) 6 ˜ µ̃ err (ℓ). Thus, we have D̂ D 1−2/k ˜ c SOS + O(C)η1−2/k opt c k, ) · opt errD b ( µ̃ [ℓ]) 6 (1 + O(C)η proving the lemma. 16  5.2.2 Proof of Lemma 5.6 Here we prove Lemma 5.6. The proof is similar in spirit to that of Lemma A but we need to adapt the various steps to a form suitable for SOS proof system. Proof of Lemma 5.6. For brevity, we write errD for errD (ℓ). Let w ′ ∈ {0, 1} n be given by w ′i  w i iff ith sample is uncorrupted in U and 0 otherwise. Then, Í observe that i w ′i  s for s > (1 − 2η)n. Then, ( ) 1Õ 2 (1 − w ′i )2 6 2η . w′ n Let errw′ (ℓ)  1 n i Ín i1 4 w,ℓ w ′i (v i − hℓ, u i i)2 . We have: n n Õ 1Õ ′ 2 errD (ℓ)  w i (yi − hℓ, x i i) + (1 − w ′i ) · (yi − hℓ, x i i)2 n i1 i1 On the other hand, we also have: 4 w,ℓ n n Õ 1Õ ′ 2 w i (yi − hℓ, x i i) 6 (yi′ − hℓ, x ′i i)2  errD ′ (ℓ) . n i1 i1 Combining the above and using the sum-of-squares vesion of the Hölder’s inequality, we have: k w,ℓ n 1Õ ′ (errD (ℓ) − errD (ℓ))  (1 − w ′i ) · (yi − hℓ, x i i)2 n k′ i1 n 1Õ (1 − w ′i ) 6 n i1 62 k ′ −1 η k ′ −1 1 n ! k′−1 n Õ i1 ! k′ n 1Õ (yi − hℓ, x i i)k n i1 ! ! (yi − hℓ, x i i)k . (5.4) Next, using the sum-of-squares inequality (a + b)k 6 2k a k + 2k b k , we have: k ℓ ( ! ! n n n Õ Õ 1Õ k ∗ k k 1 k 1 (yi − hℓ, x i i) 6 2 (yi − hℓ , x i i) + 2 hℓ − ℓ ∗ , x i i k n n n i1 i1 i1 !) (5.5) By certifiable hypercontractivity of Dx  D, we have: k ℓ ! ! k′  n n  Õ  1Õ  ′ 1 hℓ − ℓ ∗ , x i i k 6 C(k)k hℓ − ℓ ∗ , x i i 2  n n  i1 i1         Again, by using the sum-of-squares inequality (a + b)k 6 2k a k + 2k b k , we have: k ℓ ! k′ ! k′ ! k′  n n n  Õ Õ  1Õ  ′ ′ 1 1 6 2k hℓ − ℓ ∗ , x i i 2 (yi − hℓ, x i i 2 + 2k (yi − hℓ ∗ , x i i 2  n n  n i1 i1 i1  17        Finally, using the sum-of-squares version of Hölder’s inequality again, we have: k ℓ ! k′  n n   1Õ  1Õ 6 (yi − hℓ ∗ , x i i)2 (yi − hℓ ∗ , x i i)k  n n  i1 i1  Combining the above with (5.5), we have:        k ℓ ! ! ! k′  n n n  Õ Õ  1Õ  1 1 (yi − hℓ, x i i)k 6 O(C(k/2))k (yi − hℓ ∗ , x i i)k + O(C(k/2))k (y − hℓ, x i i)2  n n n  i1 i1 i1         (5.6) Thus, together with (5.4), we have: k ℓ ′ ′ (errD (ℓ) − errD ′ (ℓ))k 6 η k −1 · O(C(k/2))k (errD (ℓ))k +η ′ k ′ −1 · O(C(k/2)) k n 1Õ (yi − hℓ ∗ , x i i)k n i1 ! (5.7) Using the sum of squares inequality δ k a k 6 (2δ)k (a − b)k + (2δ)k b k for any a, b and even k, and ′ applying it with a  errD (ℓ), b  errD ′ (ℓ) and δ  η k −1 · O(C(k/2))k and rearranging, we have: k ℓ ′ ′ (1 − δ) (errD (ℓ) − errD ′ (ℓ))k 6 η k −1 · O(C(k/2))k (errD′ (ℓ))k +η k ′ −1 ′ · O(C(k/2))k n 1Õ (yi − hℓ ∗ , x i i)k n · O(C(k/2))k n 1Õ (yi − hℓ ∗ , x i i)k n i1 ! (5.8) ! (5.9) For δ < 0.9, this implies: k ℓ ′ ′ (errD (ℓ) − errD ′ (ℓ))k 6 η k −1 · O(C(k/2))k (errD ′ (ℓ))k +η k ′ −1 ′ i1 This completes the proof.  5.2.3 Bounding the Generalization Error In this section we prove Lemma 5.4. The lemma follows from standard concentration inequalities combined with standard generalization bounds for linear regression. Proof of Lemma 5.4(1). Let ℓ ∗ be a linear function of bit complexity at most B that achieves the c SOS 6 err b (ℓ ∗ ) by optimum least squares regression error on D. We will first show that opt D exhibiting a feasible pseudo-density. To see this, consider the point-mass density, µ̃, supported on the following point: (w, ℓ ∗ , X ′) where w i  1 if (x i , yi )  (u i , v i ) and 0 otherwise (i.e., w i  1 if and 18 only if the i’th example was uncorrupted) and (x ′i , yi′)  (x i , yi ) for all i ∈ [n]. Clearly, µ̃ is a feasible  k/2 Í solution to the optimization progam 5.2 and ˜ µ̃ [err(w, ℓ, X)k/2]  (1/n)( ni1 (yi − hℓ ∗ , x i i)2 )  ∗ k/2 ∗ c SOS 6 err b (ℓ ). errD b (ℓ ) . It follows that opt D We next argue that errDb (ℓ ∗ ) is close to errD (ℓ ∗ ) for n sufficiently big. Let Z be the random variable (y − hℓ ∗ , xi)2 for (x, y) ∼ D. Note that errDb (ℓ ∗ ) is the average of n independent draws of the random variable Z. Also note that [Z]  opt(D). We will next bound the variance of Z. We have, for (x, y) ∼ D, [Z 2 ]  [(y − hℓ ∗ , xi)4 ] 6 2 [y 4 ] + 2 [hℓ ∗ , xi 4 ] 6 2M 4 + 2C 2 ( [hℓ ∗ , xi 2 ])2 , where the last inequality follows by hypercontractivity. Now, [hℓ ∗ , xi 2 ] 6 2 [(y − hℓ ∗ , xi)2 ] + 2 [y 2 ] 6 2 opt(D) + 2M 2 6 4M 2 as opt(D) 6 M 2 (the 0 function achieves this error). Combining the above we get that [Z 2 ]  O(M 4 ). Thus, for some n 0  O(1/ε 3 )(M 4 ), if we take n > n 0 independent samples Z1 , Z2 , . . . , Z n of Z, Í then [| n1 ni1 Z i − [Z]| > ε] 6 ε. Thus, with probability at least 1 − ε, errDb (ℓ ∗ ) 6 opt(D) + ε. The claim now follows.  Part (2) of Lemma 5.4 follows from standard generalization arguments such as the following claim applied to ℓ M . We omit the details. Fact 5.8 (Consequence of Theorem 10.1 in [MRT12]). Let H be a class of functions over ’d such that each h ∈ H can be described in B bits. Suppose each function in H takes values in [−M, M] for some positive real M. Let D be a distribution on ’d × [−M, M] and let (x1 , y1 ), . . . , (x n , yn ) be n i.i.d samples from D for n > n 0  O(M 2 B log (1/δ)/ε 2 ). Then, with probability at least 1 − δ over the draw of X, for every ℓ ∈ H, (x,y)∼D (y − h(x))2 6 (1/n) n Õ i1 (yi − h(x i ))2 + ε . 5.3 Robust L1 Regression In this section, we present our robust L1 regression algorithm. Our main goal is the following theorem. Theorem 5.9. Let D be an arbitrary distribution on ’d × Y for Y ⊆ [−M, M] for a positive real M. Let κ be the ratio of the maximum to the minimum eigenvalue of the covariance matrix of D, the marginal of D on x. Let opt(D) be the minimum of D | y − hℓ, xi| over all ℓ that have bit complexity bounded above by B. Let ℓ ∗ be any such minimizer and η > 0 be an upper bound on the fraction of corruptions. For any ε > 0, let X be an i.i.d. sample from D of size n > n 0 for some n 0  O(1/ε 2 ) · (M 2 kℓ ∗ k24 + d log (d)kΣk/η). Then, with probability at least 1 − ε over the draw of the sample X, given any η-corruption U of X and η as input, there’s a polynomial time algorithm (Algorithm 5.11) that outputs a function f : ’d × ’ such that: s  q √ | y − f (x)| < opt(D) + O( κη)( y2 + (y − hℓ ∗ , xi)2 ) + ε . D (x,y)∼D D Remark 5.10. The lower bound example in Lemma 6.2 also shows that the above bound is tight in the dependence on η and κ. 19 As in the previous section, our algorithm will find pseudo-distributions satisfying a set of polynomial inequalities that encode the hypotheses of the robust certifiability lemma and the “error” polynomial. Let AU,η,Q be the following system of polynomial equations:       ∀i      ∀i     AU,η,Q : ∀ i          ∀i     ∀i  Ín i1 ∈ [n]. w i · (v i − yi′)  0 ∈ [n]. ∈ [n] w 2i  w i w i · (u i − x ′i )  0 ∈ [n]. ∈ [n] w i  (1 − η) · n   τ′i > (yi′ τ′i > −(yi′ − − kℓ k22 hℓ, x ′i i) hℓ, x ′i i) 6Q 2              (5.10)               This system of equations takes as parameters the input sample U and a bound on the fraction of outliers η. We can now describe our algorithm for robust L1 regression. Algorithm 5.11 (Algorithm for Robust L1 Linear Regression via Sum-of-Squares). Given: An η-corruption U of a labeled sample X of size n from an arbitrary distribution D. The Euclidean norm of the best fitting L1 regression hypothesis for D, Q. Operation: 1. find a level-4 pseudo-distribution µ̃ that satisfies AU,η,Q and minimizes 2. Return ℓ̂  ˜ µ̃ ℓ. 1 n Ín i1 2 τi . Analysis of Algorithm. The plan of this subsection and the proofs are essentially analogous to the ones presented in the previous subsection. We will split the analysis into bounding the optimization and generalization errors as before. Let optSoS be the L1 error of ℓ̂ output by Algorithm 5.11 and let ℓ ∗ be the optimal hypothesis for D. Lemma 5.12 (Bounding the Optimization Error). Under the assumptions of Theorem 5.9 (and following the above notations), c SOS + 2κ 1/2 η1/2 err b (b ℓ) 6 opt D v t n Õ i1 yi2 + 2κ 1/2 η1/2 errD (ℓ ∗ ) . Lemma 5.13 (Bounding the Generalization Error). Under the assumptions of Theorem 5.9, with probability at least 1 − ε, c SOS 6 opt(D) + ε. 1. opt 2. errD (b ℓ M )) 6 errDb (b ℓ) + ε. 3. 1 n Ín i1 yi2 6 D y2. 20 The proofs of the above two lemmas are entirely analogous to the ones presented in the previous section. The main technical ingredient as before is a SoS version of the robust certifiability result. Since this is the only technical novelty in this subsection, we present the statement and proof of this result below and omit the other proofs. Lemma 5.14 (SoS Proof of Robust Certifiability for L1 Regression). Let X be a collection of n labeled examples in ’d such that D, the uniform distribution on x1 , x2 , . . . , x n has 2nd moment matrix with all eigenvalues within a factor κ of each other. Let U be an η-corruption of X. Let w, ℓ, X ′ , τ′ satisfy the set of system of polynomial equations AU,η,Q . Let τi satisfy τ2i  (yi −hℓ, x i i)2 and τi > 0 for every i. Then, for any ℓ ∗ ∈ ’d such that kℓ ∗ k2 6 Q, n n 1Õ 1Õ ′ τi 6 τi + 2κ 1/2 η1/2 n n w,τ′ ,X ′ AU,η,Q 4 i1 i1 v t n 1Õ 2 yi + 2κ 1/2 η1/2 · n i1 v t n 1Õ (yi − hℓ ∗ , x i i)2 . n i1 Proof of Lemma 5.14. For every i ∈ [n], define w ′i  w i iff (x i , yi ) is uncorrupted in U. Í 2  that i w ′i  s for s > (1 − 2ε)n and that w w 2i − w i  0 . Then, 2 w′ Thus, we have: 4 w,ℓ,τ′ ( ) 1Õ (1 − w ′i )2 6 2ε n i Then, observe . n n n Õ 1Õ 1Õ ′ τi  w i τi + (1 − w ′i ) · τi n n i1 i1 i1 Further, it’s easy to verify by direct expansion that:  w i (x i − x ′i )  0, w i (yi − yi′)  0 | ∀ i As a result, we have: 4 w,ℓ,τ′ 4 w′  w ′i (τi − τ′i )  0 | ∀ i n n n 1Õ ′ ′ Õ 1Õ τi  w i τi + (1 − w ′i ) · τi n n i1 i1 i1 Ín Ín Í Í For brevity, let’s write errD (ℓ)  i1 i1 τi and errD′ (ℓ)  ni1 ni1 τ′i . Then, we have: Using the sum-of-squares vesion of the Cauchy-Shwarz inequality, we have: 4 w,ℓ,τ′ n 1Õ (1 − w ′i ) · τi (errD (ℓ) − errD′ (ℓ))2  n i1 n 1Õ (1 − w ′i ) 6 n i1 6ε n 1Õ n i1 !2 !2 n 1Õ (yi − hℓ, x i i)2 n i1 (yi − hℓ, x i i)2 . (5.11) Next, we have: 4 ℓ ( n n n 1Õ 1Õ 1Õ (yi − hℓ, x i i)2 6 2 (yi − hℓ ∗ , x i i)2 + 2 hℓ − ℓ ∗ , x i i)2 n n n i1 i1 i1 21 ) . Further, we also have: 4 ℓ ( n n n 1Õ 1Õ 1Õ ∗ ∗ 2 2 hℓ − ℓ , x i i) 6 2 hℓ, x i i) + 2 hℓ , x i i)2 n n n i1 i1 i1 ) Using that for any PSD matrix A, we have the SoS inequality kx k22 kAkmin 6 x ⊤ Ax 6 kx k22 kAkmax where kAkmax and kAkmin are the largest and smallest singular values of A, respectively, we have: 4 ℓ Finally, we also have: 4 ℓ ( ( n n 1Õ 1Õ ∗ hℓ, x i i)2 6 κ hℓ , x i i)2 n n i1 i1 ) n n n 1Õ ∗ 1Õ 1Õ 2 2 ∗ 2 hℓ , x i i) 6 (yi − hℓ , x i i) + 2 yi n n n i1 i1 i1 ) Combining the above inequalities with (5.11) yields the lemma.  6 Statistical Limits of Outlier-Robust Regression Here we exhibit statistical lower bounds for what can be achieved for outlier-robust regression. In particular, these simple examples illustrate strong separations between regression and regression in the presence of contamination and also demonstrate that several of the assumptions we make are necessary. Necessity of Distributional Assumptions. A classical result in analysis of regression is consistency of the least-squares estimator when the labels are bounded. Concretely, let D be a distribution on ’d × [−1, 1]. Let (x1 , y1 ), . . . , (x n , yn ) be i.i.d samples from D. Let ℓ̂  Í arg min ℓ ni1 (yi − hℓ, x i i)2 , be the least-squares estimator. Then, (say, via Theorem 11.3 in O(d) [GKKW02]) errD (ℓ̂) 6 n + 8 · arg min ℓ errD (ℓ). In particular, in the realizable-case, i.e., when (x, y) ∼ D satisfies y  hℓ ∗ , xi, the error of the least-squares estimator approaches zero as n → ∞ irrespective of the marginal distribution DX . Given the above bound, it is natural to ask if we could get a similar marginal-distribution independent bound in the presence of outliers: Does there exist an estimator which achieves error h(η) with η-fraction of corruptions for some function h : ’ → ’ with h → 0 as η → 0? It turns out that this is statistically impossible in the presence of sample contamination. Lemma 6.1. There is a universal constant c > 0 such that the following holds. For all η > 0, there is no algorithm that given η-corrupted samples6 (x, y) from distributions D̃ on ’d × [−1, 1] finds a hypothesis vector ℓ ∈ ’d such that [errD̃ (ℓ)] < c. Proof. Suppose there is an algorithm as above. Let δ  η/(2 − η) and let κ > 2 be sufficiently large to be chosen later. Let D be the distribution of the random variable on ’2 × ’ samples as follows: 1) Sample α uniformly at random from [−1, 1]; 2) With probability 1 − η output ((α, α), α); 3) With probability η output ((κ · α, α), α). Note that for (x, y) ∼ D, y  hℓ, xi for ℓ  (0, 1). 6The lemma also holds in the weaker Huber’s contamination model even though we do not study this model in this work. 22 Similarly, let D ′ be the distribution of the random variable on ’2 × ’ samples as follows: 1) Sample α uniformly at random from [−1, 1]; 2) With probability 1 − η output ((α, α), α); 3) With probability η output ((α, κ · α), α). Note that for (x ′ , y ′) ∼ D, y ′  hℓ ′ , x ′i for ℓ  (1, 0). It follows from a few elementary calculations that for any w ∈ ’2 , errD (w) + errD ′ (w) > ηκ 2 Ω(1) · 1+ηκ2 . √ It follows that for some universal constant c > 0, and κ  1/ η, min(errD (w), errD ′ (w)) > c. Finally, let D ′′ be the distribution of the random variable sampled as follows: 1) Sample α uniformly at random from [−1, 1]; 2) With probability 1 − δ output ((α, α), α); 3) With probability δ/2 output ((κ · α, α), α); 4) With probability δ/2 output ((α, κ · α), α). Note that D ′′ can be obtained by a (η/2)-corruption of D as well as D ′. On the other hand, for any w ∈ ’2 , one of errD (w), errD ′ (w) is at least c where c is the constant from the previous lemma. Thus no algorithm can output a good hypothesis for both D or D ′ . The claim now follows.  Optimality of Our Algorithm for Hypercontractive Distributions. We also show that the addi√ tive O( η) dependence in our bounds is necessary for 4-hypercontractive distributions. Lemma 6.2. There is a universal constants c, C > 0 such that the following holds. For all η > 0, there is no algorithm that given η-corrupted samples from distributions D̃ on ’d × ’ with (1) D̃X (C, 4)certifiably hypercontractive, and (2) E[y 4 ] 6 C, finds a hypothesis vector w ∈ ’d such that [errD̃ (w)]   √ √ (1 + o( η)) · min ℓ ∗ ∈’d errD̃ (ℓ ∗ ) + o( η). ˜ as in the lemma efficiently finds The above should be compared with Theorem 1.3 which for cD  √ √ ∗ a ℓ with [errD̃ (ℓ)  (1 + O( η)) · min ℓ ∗ ∈’d errD̃ (ℓ ) + O( η). Thus Theorem 1.3 is optimal for the class of 4-hypercontractive distributions up to multiplicative constants. Proof Sketch. Fix some δ  Θ(η) to be chosen later. For brevity, let U be the uniform distribution on [−1, 1] and let Z be the distribution of the random variable sampled as follows: 1) With probability 1 − δ, sample α uniformly at random from [−1, 1] and output η · α; 2) With probability δ/2 output 1/δ 1/4 ; 3) With probability δ/2 output −1/δ 1/4 . It follows from standard calculations that Z is (C 1 , 4)-certifiably hypercontractive for a fixed constant C 1 . Further, if we let X  (U, Z) for U, Z generated independently, then X is also (C 1 , 4)certifiably hypercontractive; we skip the details from this sketch. Now let ℓ  (1, 1) and ℓ ′  (1, −1). Let D be the distribution of (X, hℓ, Xi +U) for U independent from X; similarly, let D ′ be the distribution of (X, hℓ ′ , Xi + U). We first claim that kD − D ′ kTV k  O(δ). To see this, let us consider a coupling between D, D ′ obtained by choosing the same X for both. Then, with probability 1−δ over X, |hℓ, Xi−hℓ ′, Xi| 6 2δ; further, whenever this happens, the statistical distance between hℓ, Xi + U and hℓ ′ , Xi + U is at most O(δ). Therefore, kD − D ′ kTV  O(δ). Finally, note that √ [(hℓ, Xi − hℓ ′ , Xi)2]  4 [Z 2 ] > 4δ(1/δ1/4 )2  4 δ. Therefore, for any w, √ [(hw, Xi − hℓ, Xi)2] + [(hw, Xi − hℓ ′ , Xi)2 ] > 4 δ. √  In particular, for any w, max [(hw, Xi − hℓ, Xi)2], [(hw, Xi − hℓ ′ , Xi)2 ] > 2 δ. Now, note that for any w, errD (w)  E[U 2 ] + [(hw, Xi − hℓ, Xi)2] and a similar equality holds for errD ′ (w). 23 √ Combining the above we get that for any w, max(errD (w), errD ′ (w)) > [U 2 ] + 2 δ. Note that min ℓ ∗ errD (ℓ ∗ )  [U 2 ] and the same holds for D ′ as well. Finally, as kD − D ′ kTV  O(δ) 6 η, by setting δ  Θ(η) appropriately. Therefore, D, D ′ could be η-corruptions of each other and no √ √ w could get error better than [U 2 ] + 2 δ  [U 2 ] + Ω( η) on both of them. The claim now follows.  References [BJKK17] Kush Bhatia, Prateek Jain, Parameswaran Kamalaruban, and Purushottam Kar, Consistent robust regression, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, 2017, pp. 2107–2116. 6 [BKS15] Boaz Barak, Jonathan A. Kelner, and David Steurer, Dictionary learning and tensor decomposition via the sum-of-squares method [extended abstract], STOC’15—Proceedings of the 2015 ACM Symposium on Theory of Computing, ACM, New York, 2015, pp. 143– 151. MR 3388192 3 [BM16] Boaz Barak and Ankur Moitra, Noisy tensor completion via the sum-of-squares hierarchy, COLT, JMLR Workshop and Conference Proceedings, vol. 49, JMLR.org, 2016, pp. 417– 445. 3 [BS16] Boaz Barak and David Steurer, Proofs, beliefs, and algorithms through the lens of sum-ofsquares, 2016, Lecture notes in preparation, available on http://sumofsquares.org. 9 [CCM13] Yudong Chen, Constantine Caramanis, and Shie Mannor, Robust sparse regression under adversarial corruption, ICML, JMLR Workshop and Conference Proceedings, vol. 28, JMLR.org, 2013, pp. 774–782. 6 [CSV17] Moses Charikar, Jacob Steinhardt, and Gregory Valiant, Learning from untrusted data, Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017, 2017, pp. 47–60. 1 [DBS17] Simon S. Du, Sivaraman Balakrishnan, and Aarti Singh, Computationally efficient robust estimation of sparse functionals, CoRR abs/1702.07709 (2017). 6 [DKK+ 16] Ilias Diakonikolas, Gautam Kamath, Daniel M. Kane, Jerry Zheng Li, Ankur Moitra, and Alistair Stewart, Robust estimators in high dimensions without the computational intractability, CoRR abs/1604.06443 (2016). 1 [DKK+ 18] Ilias Diakonikolas, Gautam Kamath, Daniel M. Kane, Jerry Li, Jacob Steinhardt, and Alistair Stewart, Sever: A robust meta-algorithm for stochastic optimization, Preprint (2018). 3 [DKS17] Ilias Diakonikolas, Daniel M. Kane, and Alistair Stewart, Learning geometric concepts with nasty noise, CoRR abs/1707.01242 (2017). 1, 3 24 [GKKW02] László Györfi, Michael Kohler, Adam Krzyzak, and Harro Walk, A distribution-free theory of nonparametric regression, Springer series in statistics, Springer, 2002. 22 [GLS81] M. Grötschel, L. Lovász, and A. Schrijver, The ellipsoid method and its consequences in combinatorial optimization, Combinatorica 1 (1981), no. 2, 169–197. MR 625550 10 [HL17] Sam B. Hopkins and Jerry Li, Mixture models, robustness, and sum of squares proofs, 2017. 3, 6 [HS10] Matthew A. Herman and Thomas Strohmer, General deviants: An analysis of perturbations in compressed sensing, J. Sel. Topics Signal Processing 4 (2010), no. 2, 342–349. 6 [KKMS08] Adam Tauman Kalai, Adam R. Klivans, Yishay Mansour, and Rocco A. Servedio, Agnostically learning halfspaces, SIAM J. Comput. 37 (2008), no. 6, 1777–1805. 3 [KLS09] Adam R. Klivans, Philip M. Long, and Rocco A. Servedio, Learning halfspaces with malicious noise, Journal of Machine Learning Research 10 (2009), 2715–2740. 1 [KOTZ14] Manuel Kauers, Ryan O’Donnell, Li-Yang Tan, and Yuan Zhou, Hypercontractive inequalities via sos, and the frankl-rödl graph, SODA, SIAM, 2014, pp. 1644–1658. 26 [KS17a] [KS17b] Pravesh K. Kothari and Jacob Steinhardt, Better agnostic clustering via relaxed tensor norms, CoRR abs/1711.07465 (2017). 1, 7 , Better agnostic clustering via relaxed tensor norms, 2017. 6 [KS17c] Pravesh K. Kothari and David Steurer, Outlier-robust moment-estimation via sum-ofsquares, CoRR abs/1711.11581 (2017). 1, 3, 6, 7, 16 [Las01] Jean B. Lasserre, New positive semidefinite relaxations for nonconvex quadratic programs, Advances in convex analysis and global optimization (Pythagorion, 2000), Nonconvex Optim. Appl., vol. 54, Kluwer Acad. Publ., Dordrecht, 2001, pp. 319–331. MR 1846160 10 [LRV16] Kevin A. Lai, Anup B. Rao, and Santosh Vempala, Agnostic estimation of mean and covariance, CoRR abs/1604.06968 (2016). 1 [LW11] Po-Ling Loh and Martin J. Wainwright, High-dimensional regression with noisy and missing data: Provable guarantees with non-convexity, CoRR abs/1109.3714 (2011). 6 [MRT12] Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar, Foundations of machine learning, Adaptive computation and machine learning, MIT Press, 2012. 19 [MSS16] Tengyu Ma, Jonathan Shi, and David Steurer, Polynomial-time tensor decompositions with sum-of-squares, CoRR abs/1610.01980 (2016). 3, 9 [Nes00] Yurii Nesterov, Squared functional systems and optimization problems, High performance optimization, Appl. Optim., vol. 33, Kluwer Acad. Publ., Dordrecht, 2000, pp. 405–440. MR 1748764 10 25 [Par00] Pablo A Parrilo, Structured semidefinite programs and semialgebraic geometry methods in robustness and optimization, Ph.D. thesis, Citeseer, 2000. 10 [PS17] Aaron Potechin and David Steurer, Exact tensor completion with sum-of-squares, Proceedings of the 30th Conference on Learning Theory, COLT 2017, Amsterdam, The Netherlands, 7-10 July 2017, 2017, pp. 1619–1673. 3 [PSBR18] A. Prasad, A. Sai Suggala, S. Balakrishnan, and P. Ravikumar, Robust Estimation via Robust Gradient Estimation, ArXiv e-prints (2018). 3 [RL87] Peter J. Rousseeuw and Annick M. Leroy, Robust regression and outlier detection, Wiley Series in Probability and Mathematical Statistics: Applied Probability and Statistics, John Wiley & Sons, Inc., New York, 1987. MR 914792 6 [Sho87] N. Z. Shor, Quadratic optimization problems, Izv. Akad. Nauk SSSR Tekhn. Kibernet. (1987), no. 1, 128–139, 222. MR 939596 10 [XCM10] Huan Xu, Constantine Caramanis, and Shie Mannor, Robust regression and lasso, IEEE Trans. Information Theory 56 (2010), no. 7, 3561–3574. 6 A Outlier-Robust Polynomial Regression Our arguments also extend straightforwardly to get similar guarantees for polynomial regression. We elaborate on these next. The following extends the definition of hypercontractivity to polynomials. Definition A.1 (Certifiable polynomial hypercontractivity). For a function C : [k] → ’+ , we say a distribution D on ’d is k-cerifiably (C, t)-hypercontractive if for every r such that 2rt 6 k, there is a degree k sum of squares proof of the following inequality in variable P where p stands for hP, x ⊗t i.   r D p(x)2r 6 (C(r) D p(x)2 . Many natural distributions satisfy certifiably hypercontractivity [KOTZ14] for polynomials such as gaussian distributions and the product distributions on the hypercube {0, 1} n with all coordinate marginals in (0, 1). Our results will apply to all such distributions. Next, we state an extension of our robust certification lemma for polynomial regression. The proof is essentially the same as that of . Lemma A.2 (Robust Generalization for polynomial regression). Fix k, t ∈ Ž and let D, D ′ be distributions on ’d × ’ such that kD − D ′ kTV 6 ε and the marginal DX of D on x is k-certifiably (C, t)-hypercontractive for some C : [k] → ’+ and for some even integer k > 4. Then, for any degree at most t polynomials p, p ∗ : ’d → ’, and any ε such that 2C(k/2)ε 1−2/k < 0.9, we have: errD (p) 6 (1 + O(C(k/2))ε 1−2/k ) · errD ′ (p) + O(C(k/2))ε 26 1−2/k ·  D ∗ (y − p (x)) k  2/k . Theorem A.3. Let D be a distribution on ’d × [−M, M] for some positive real M such the marginal on ’d is (C, k)-certifiably hypercontractive distribution for degree t polynomials. Let optB (D)  min p D [(y − p(x))2 ] where the minimum is over all polynomials p of degree t and bit complexity B. Let p ∗ be any such minimizer. Fix any even k > 4 and any ε > 0. Let X be an i.i.d. sample from D of size n > n 0  poly(d k , B, M, 1/ε). Then, with probability at least 1 − ε over the draw of the sample X, given any η-corruption U of X and η as input, there is a polynomial time algorithm (Algorithm 5.2) that outputs a ℓ ∈ ’d such that for C  C(k/2), errD (p M ) < (1 + O(C)η 1−2/k ) optB (D) + O(C)η 27 1−2/k  D ∗ (y − p (x)) k  2/k + ε.
2cs.AI
arXiv:1704.07549v2 [math.RT] 26 Apr 2017 CATEGORIFICATION OF SIGN-SKEW-SYMMETRIC CLUSTER ALGEBRAS AND SOME CONJECTURES ON g-VECTORS PEIGEN CAO MIN HUANG FANG LI Abstract. Using the unfolding method given in [12], we prove the conjectures on sign-coherence and a recurrence formula respectively of g-vectors for acyclic sign-skew-symmetric cluster algebras. As a following consequence, the conjecture is affirmed in the same case which states that the gvectors of any cluster form a basis of Zn . Also, the additive categorification of an acyclic sign-skewe symmetric cluster algebra A(Σ) is given, which is realized as (C Q , Γ) for a Frobenius 2-Calabi-Yau e category C Q constructed from an unfolding (Q, Γ) of the acyclic exchange matrix B of A(Σ). 1. Introduction Cluster category was introduced by [2] for an acyclic quiver. In general, we view a Hom-finite 2-Calabi-Yau triangulated category C which has a cluster structure as a cluster category, see [1]. In fact, the mutation of a cluster-tilting object T in C categorifies the mutation of a quiver Q, where the quiver Q is the Gabriel quiver of the algebra EndC (T ). Cluster character gives an explicit correspondence between certain cluster objects of C and all the clusters of A(Σ(Q)), where Σ(Q) means the seed associated with Q. For details, see [10], [14] and [15]. Thus, cluster category and cluster character are useful tools to study a cluster algebra. Let A(Σ) be a cluster algebra with principal coefficients at Σ = (X, Y, B), where B is an n × n sign-skew-symmetric integer matrix, Y = (y1 , · · · , yn ). The celebrate Laurent phenomenon says that A is a subalgebra of Z[yn+1 , · · · , y2n ][X ±1 ]. Setting deg(xi ) = ei , deg(yj ) = −bj , then Z[yn+1 , · · · , y2n ][X ±1 ] becomes to a graded algebra, where {ei | i = 1, · · · , n} is the standard basis of Zn and bi is the i-th column of B. Under such Zn -grading, the cluster algebra A is a graded subalgebra, in which the degree of a homogenous element is called its g-vector; furthermore, each cluster variable x in A(Σ) is homogenous, denoted its g-vector as g(x). For details, see [9]. It was conjectured that Conjecture 1.1. ([9], Conjecture 6.13) For any cluster X ′ of A(Σ) and all x ∈ X ′ , the vectors g(x) are sign-coherent, which means that the i-th coordinates of all these vectors are either all non-negative or all non-positive. Such conjecture has been proved in the skew-symmetrizable case in ([11], Theorem 5.11). Conjecture 1.2. ([9], Conjecture 7.10(2)) For any cluster X ′ of A(Σ), the vectors g(x), x ∈ X ′ form a Z-basis of the lattice Zn . 0 0 B ;t0 B ;t0 In terms of cluster pattern, fixed a regular tree Tn , for any vertices t and t0 of Tn , let g1;t , · · · , gn;t denote the g-vectors of the cluster variables in the seed Σt with respect to the principal coefficients seed Σt0 = (X0 , Y, B0 ). When set different vertices to be principal coefficients seeds, it is conjectured that the g-vectors with respect to a fixed vertex t of Tn have the following relation. Date: version of April 27, 2017. 1 2 PEIGEN CAO MIN HUANG FANG LI k Conjecture 1.3. ([9], Conjecture 7.12) Let t1 −− t2 ∈ Tn and let B 2 = µk (B 1 ). For a ∈ [1, n] and B 1 ;t1 B 2 ;t2 t ∈ Tn , assume ga;t = (g1t1 , · · · , gnt1 ) and ga;t = (g1t2 , · · · , gnt2 ), then  −g t1 if i = k; k (1) git2 = g t1 + [bt1 ]+ g t1 − bt1 min(g t1 , 0) if i 6= k. i ik k ik k Remark 1.4. (1) As is said in Remark 7.14 of [9], it is easy to see that Conjectures 1.1 and 1.3 imply Conjecture 1.2. (2) In the skew-symmetrizable case, the sign-coherence of the c-vectors can deduce Conjectures 1.1 and 1.3, see [13], where the given method strongly depends on the skew-symmetrizability. So far, the similar conclusion have not been given in the sign-skew-symmetric case. Further, the signcoherence of the c-vectors has been proved in [12] for the acyclic sign-skew-symmetric case, because this is equivalent to F -polynomial has constant term 1, see [9]. Therefore, for the acyclic sign-skewsymmetric case, it is interesting to study directly Conjectures 1.1 and 1.3. Unfolding of skew-symmetrizable matrices is introduced by Zelevinsky, whose aim is to characterize skew-symmetrizable cluster algebras using the version in skew-symmetric case. The second and third authors of this paper improved in [12] such method to arbitrary sign-skew-symmetric matrices. e F, Γ) of any acyclic m × n matrix B, e and According to this previous work, there is an unfolding (Q, e Q also a 2-Calabi-Yau Frobenius category C with Γ action constructed. Our motivation and the main results of this paper are two-fold. (1) Give the Γ-equivariant cluster character for C Q , which can be regarded as the additive categorification of the cluster algebra A(Σ(Q)). See Theorem 3.5 and Theorem 3.6. (2) Solve Conjectures 1.1 and 1.3 in the acyclic case. See Theorem 4.7 and Theorem 5.5. As a consequence, in the same case, Conjecture 1.2 follows to be affirmed. 2. An overview of unfolding method In this section, we give a brief introduction of the concept of unfolding of totally sign-skewsymmetric cluster algebras and some necessary results in [12]. For any sign-skew-symmetric matrix B ∈ M atn×n (Z), one defines a quiver ∆(B) as follows: the vertices are 1, · · · , n and there is an arrow from i to j if and only if bij > 0. B is called acyclic if ∆(B) is acyclic, a cluster algebra is called acyclic if it has an acyclic exchange matrix, see [3]. A locally finite ice quiver is a pair (Q, F ) where Q is a locally finite quiver without 2-cycles or loops and F ⊆ Q0 is a subset of vertices called frozen vertices such that there are no arrows among vertices of F . For a locally finite ice quiver (Q, F ), we can associate an (infinite) skewsymmetric row and column finite (i.e. having at most finite nonzero entries in each row and column) matrix (bij )i∈Q0 ,j∈Q0 \F , where bij equals to the number of arrows from i to j minus the number of arrows from j to i. In case of no confusion, for convenience, we also denote the ice quiver (Q, F ) as (bij )i∈Q0 ,j∈Q0 \F . We say that an ice quiver (Q, F ) admits the action of a group Γ if Γ acts on Q such that F is stable under the action. Let (Q, F ) be a locally finite ice quiver with an action of a group Γ (maybe infinite). For a vertex i ∈ Q0 \ F , a Γ-loop at i is an arrow from i to h · i for some h ∈ Γ, a Γ-2-cycle at i is a pair of arrows i → j and j → h · i for some j ∈ / {h′ · i | h′ ∈ Γ} and h ∈ Γ. Denote by [i] the orbit set of i under the action of Γ. Say that (Q, F ) has no Γ-loops (respectively, Γ-2-cycles) at [i] if (Q, F ) has no Γ-loops (Γ-2-cycles, respectively) at any i′ ∈ [i]. CATEGORIFICATION OF CLUSTER ALGEBRAS AND CONJECTURES ON g-VECTORS 3 Definition 2.1. (Definition 2.1, [12]) Let (Q, F ) = (bij ) be a locally finite ice quiver with an group Γ action. Denote [i] = {h · i | h ∈ Γ} the orbit of vertex i ∈ Q0 \ F . Assume that (Q, F ) admits no Γ-loops and no Γ-2-cycles at [i], we define an adjacent ice quiver (Q′ , F ) = (b′i′ j ′ )i′ ∈Q0 ,j ′ ∈Q0 \F from (Q, F ) to be the quiver by following: (1) The vertices are the same as Q, (2) The arrows are defined as   −bjk , if j ∈ [i] or k ∈ [i], P |bji′ |bi′ k +bji′ |bi′ k | b′jk = , otherwise.  bjk + 2 i′ ∈[i] ′ Denote (Q , F ) as µ e[i] ((Q, F )) and call µ e[i] the orbit mutation at direction [i] or at i under the action Γ. In this case, we say that (Q, F ) can do orbit mutation at [i]. Note that if Γ is the trivial group {e}, then the definition of orbit mutation of a quiver is the same as that of quiver mutation (see [7][8]). Definition 2.2. (Definition 2.4, [12]) (i) For a locally finite ice quiver (Q, F ) = (bij )i∈Q0 ,j∈Q0 \F with a group Γ (maybe infinite) action, let Q0 (respectively, F ) be the orbit sets of the vertex set Q0 (respectively, the frozen vertex set F ) under the Γ-action. Assume that m = |Q0 | < +∞, m−n = |F | and Q has no Γ-loops and no Γ-2-cycles. Define a sign-skew-symmetric matrix B(Q, F ) = (b[i][j] )[i]∈Q0 ,[j]∈Q0 \F to (Q, F ) satisfying (1) the P bi′ j for [i] ∈ Q0 , [j] ∈ Q0 \ F . size of the matrix B(Q, F ) is m × n; (2) b[i][j] = i′ ∈[i] (ii) For an m × n sign-skew-symmetric matrix B, if there is a locally finite ice quiver (Q, F ) with a group Γ such that B = B(Q, F ) as constructed in (i), then we call (Q, F, Γ) a covering of B. (iii) For an m × n sign-skew-symmetric matrix B, if there is a locally finite quiver (Q, F ) with an action of group Γ such that (Q, F, Γ) is a covering of B and (Q, F ) can do arbitrary steps of orbit mutations, then (Q, F, Γ) is called an unfolding of B; or equivalently, B is called the folding of (Q, F, Γ). Remark 2.3. The definition of unfolding is slight different with that in [12] where the definition was just applied to square matrices. By Lemma 2.5 of [12], we have the following consequence. Lemma 2.4. If (Q, F, Γ) is an unfolding of B, for any sequence [i1 ], · · · , [is ] of orbits of Q0 \ F under the action of Γ, then (e µ[is ] · · · µ e[is ] (Q, F ), Γ) is a covering of µ[is ] · · · µ[i1 ] B. By Theorem 2.16 of [12], we have e ∈ M atm×n (Z) (m ≥ n) is an acyclic sign-skew-symmetric matrix, then B e has Theorem 2.5. If B e e an unfolding (Q, F, Γ), where Q is given using of Construction 2.6 in [12]. ! ! T B B −B ′ ′ e is e e . Since B Proof. Assume B = with B ∈ M atn×n (Z). Denote B = B′ 0 B′ e ′ ∈ M atm×m (Z) is acyclic. According to Construction 2.6 and Theorem 2.16 of [12], B e′ acyclic, B ′ e Γ). Let F ⊂ Q e 0 be the vertices of Q e 0 corresponding to B . Thus, it is clear has an unfolding (Q, e e that (Q, F, Γ) is an unfolding of B.  e is strongly almost finite, that is, Q e is locally finite and Remark 2.6. In [12], we proved that Q has no path of infinite length. 4 PEIGEN CAO MIN HUANG FANG LI This theorem means that an acyclic matrix is always totally sign-skew-symmetric. Thus, we can define a cluster algebra via an acyclic matrix. e ∈ M atm×n (Z) (m ≥ n), assume (Q, e F, Γ) is an unfolding of B. e Denote Q e0 For an acyclic matrix B e 0 and F . Let Σ e = Σ(Q) e = (X, e Ye , Q) e be the seed associated and F be the orbits sets of vertices in Q e e e e e = (X, Y, B) e be the with (Q, F ), where X = {xu | u ∈ Q0 \ F }, Y = {yv | v ∈ F }. Let Σ = Σ(B) e where X = {x[i] | [i] ∈ Q e 0 \ F }, Y = {y[j] | [j] ∈ F }. It is clear that there is seed associated with B, a surjective algebra homomorphism: e 0 \ F, j ∈ F ] → Q[x±1 , y[j] | [i] ∈ Q e 0 \ F , [j] ∈ F ] π : Q[xi±1 , yj | i ∈ Q [i] (2) such that π(xi ) = x[i] and π(yj ) = y[j] . e define µ For any cluster variable xu ∈ X, e[i] (xu ) = µu (xu ) if u ∈ [i]; otherwise, µ e[i] (xu ) = xu if e = {e e and µ e ±1 ) = {e e u 6∈ [i]. Formally, write µ e[i] (X) µ[i] (x) | x ∈ X} e[i] (X µ[i] (x)±1 | x ∈ X}. Lemma 2.7. (Lemma 7.1, [12]) Keep the notations as above. Assume that B is acyclic. If [i] is an e 0 \ F , then orbit of vertices with i ∈ Q e for any j ∈ Q e0 \ F , (1) µ e[i] (xj ) is a cluster variable of A(Q) e is algebraic independent over Q[yj | j ∈ F ]. (2) µ e[i] (X) e := (e e Ye , µ e is a seed. Thus, we can define µ By Lemma 2.7, µ e[i] (Σ) µ[i] (X), e[i] (Q)) e[is ] µ e[is−1 ] · · · µ e[i1 ] (x) e and µ e for any sequence ([i1 ], [i2 ], · · · , [is ]) of orbits in and µ e[is ] µ e[is−1 ] · · · µ e[i1 ] (X) e[is ] µ e[is−1 ] · · · µ e[i1 ] (Σ) Q0 . Theorem 2.8. (Theorem 7.5, [12]) Keep the notations as above with an acyclic sign-skew-symmetric e then π : A(Σ) e → A(Σ) is a surjective algebra matrix B and π as defined in (2). Restricting π to A(Σ), e = morphism satisfying that π(e µ[jk ] · · · µ e[j1 ] (xa )) = µ[jk ] · · · µ[j1 ] (x[i] ) ∈ A(Σ) and π(e µ[jk ] · · · µ e[j1 ] (X)) µ[jk ] · · · µ[j1 ] (X) for any sequences of orbits [j1 ], · · · , [jk ] and any a ∈ [i]. e is also with In case A(Σ) with principal coefficients, from Lemma 2.4, we may assume that A(Σ) L L Ze[i] , ei → e[i] be the group homomorphism, principal coefficients. Let λ : Zei → where L e0 \F i∈Q Zei (resp. L e0 \F i∈Q e0 \F [i]∈Q e 0 \F [i]∈Q e 0 \ F } (resp. Ze[i] ) is the free abelian group generated by {ei | i ∈ Q e 0 \ F }). Under such group homomorphism, A(Σ) e becomes a Zn -graded algebra such {e[i] | [i] ∈ Q any cluster variable x is homogenous with degree λ(g(x)). Theorem 2.9. Keep the notations as in Theorem 2.8. If A(Σ) with principal coefficients, then the e is a Zn -graded surjective homomorphism. restriction of π to A(Σ) Proof. Since λ(g(xi )) = e[i] = g(x[i] ) and λ(g(yj )) = −b[j] = g(y[j] ), where b[j] is the [j]-th column ±1 e e e e of B. Further, because {x±1 i , yj | i ∈ Q0 \ F, j ∈ Q0 } is a generator of Q[xi , yj | i ∈ Q0 \ F, j ∈ Q0 ], thus π is homogenous. Then our result follows by Theorem 2.8.  3. Cluster character in sign-skew-symmetric case e ∈ M atm×n (Z) be an acyclic sign-skew-symmetric matrix, (Q, e F, Γ) be an unfolding of B e Let B e e e e e e given in Theorem 2.5. Denote Σ = (X, Y , Q) and Σ = (X, Y, B) be the seeds corresponding to (Q, F ) e and B. e F, Γ), we constructed a 2-Calabi-Yau Frobenius category C Qe in [12] such that Γ acts From (Q, e on it exactly, i.e. each h ∈ Γ acts on C Q as an exact functor. Furthermore, there exists a cluster e e where T0 is the tilting subcategory T0 of C Q such that the Gabriel quiver of T0 is isomorphic to Q, CATEGORIFICATION OF CLUSTER ALGEBRAS AND CONJECTURES ON g-VECTORS 5 e subcategory of the stable category C Q corresponding to T0 . For details, see Lemma 4.15 of [12]. Since e e C Q is a Hom-finite 2-Calabi-Yau Frobenius category, C Q follows to be a Hom-finite 2-Calabi-Yau e triangulated category. Write [1] as the shift functor in C Q . For any object X and subcategory X of e e C Q , we denote by X and X the corresponding object and subcategory of C Q respectively. Since the e e action of the group Γ on C Q is exact, C Q also admits an exact Γ-action. e Since C Q is a Frobenius category, by the standard result, see [1], we have that e Lemma 3.1. Ext1C Qe (Z1 , Z2 ) ∼ = Ext1C Qe (Z1 , Z2 ) for all Z1 , Z2 ∈ C Q . e e given The category C Q can be viewed as an additive categorification of the cluster algebra A(Σ) e from Q. For details, refer to [10] and [15]. Although the authors of [10] and [15] deal with the cluster e e is algebras of finite ranks, it is easy to see that these results still hold in C Q since Q′′ , as well as Q, a strongly almost finite quiver. Denote T0 = add(T ′ ∪ T ′′ ), where T ′ and T ′′ respectively consist of the indecomposable objects e and Ye of Σ. e correspondent to cluster variables in the clusters X e e Let U be the subcategory of C Q generated by {X ∈ C Q | HomC Qe (T [−1], X) = 0, ∀ T ∈ T ′′ }. f For any X ∈ U, let T 1 → T 0 → X → T 1 [1] be the triangle with f the minimal right T0 e approximation. By Lemma 3.1, T0 is a cluster tilting subcategory of C Q . Applying HomC Qe (T , −) to the triangle for all T ∈ T0 , we have T 1 ∈ T0 . The index of X is defined as e indT0 (X) = [T 0 ] − [T 1 ] ∈ K0 (T0 ) ∼ = Z|Q0 | . e We may assume that {Xi | i ∈ Recall that the Gabriel quiver of T0 is isomorphic to Q. e 0 } is the complete set of the indecomposable objects of T0 . For any L ∈ modT0 , we denote Q L ei (dimk (L(Xi )))i∈Qe0 ∈ Z as its dimensional vector. e0 i∈Q e e 0 \F , After the preparations, we give the definition of cluster character CC( ) on C Q . For any i ∈ Q e is strongly almost finite, we can set since Q Y Y b′ b e ybi = xjji yj ′j i ∈ Q[x±1 i , yj | i ∈ Q0 \ F, j ∈ F ]. e0 \F j∈Q j ′ ∈F For each rigid object X ∈ U, we define eindT0 (X) CC(X) = x X L a∈ χ(Gra (HomC Qe (−, X[1]))) Zei e i∈Q 0 ea = Πxai i for a = (ai )i∈Qe0 ∈ where x L Y e0 \F j∈Q ybj aj , Zei , Gra (HomC (−, X[1])) is the quiver Grassmannian e0 i∈Q whose points are corresponding to the sub-T0 -representations of HomC Qe (−, X[1]) with dimension vector a, and χ is the Euler characteristic with respect to étale cohomology with proper support. It e is easy to see that CC(X) ∈ Q[x±1 i , yj | i ∈ Q0 \ F, j ∈ F ]. Theorem 3.2. Keeps the notations as above. Then (1) CC(Ti ) = xi for all Ti ∈ T ′ . (2) CC(X ⊕ X ′ ) = CC(X)CC(X ′ ) for any objects X, X ′ ∈ U. (3) CC(X)CC(Y ) = CC(Z) + CC(Z ′ ) for X, Y ∈ U with dimExt1C Qe (X, Y ) = 1 and the two non-splitting triangles: Y → Z → X → Y [1] and X → Z ′ → Y → X[1]. Proof. This theorem can be proved similarly as that of ([10], Theorem 3.3) using of local finiteness e since it is strongly almost finite. of Q  6 PEIGEN CAO MIN HUANG FANG LI Like [5], for any X ∈ U, we define ind′T0 (X) = λ(indT0 (X)) ∈ L Ze[i] . e0 [i]∈Q For each rigid object X ∈ U, using the definition of π in (2), we define the Γ-equivariant cluster character as follows: Y X λ(a) ind′ X CC ′ (X) = π(CC(X)) = x T0 yb[j] [j] , χ(Gra HomC Qe (−, X[1])) a∈ L Zei e0 \F [j]∈Q e i∈Q 0 a where xa = Πx[i][i] for a = (a[i] ) e0 \F [i]∈Q ∈ L e 0 \F [i]∈Q Ze[i] and yb[i] = π(b yi ) = Inspired by Definition 3.34 of [5], we give the following definition, Q e0 \F [j]∈Q Q b x[j][j][i] b ′ y[j[j′ ] ][i] . e0 \F [j ′ ]∈Q m L e X k, X ′ ∼ Definition 3.3. Two objects X, X ′ ∈ C Q are said to be equivalent modulo Γ if X ∼ = = m L k=1 X ′k with add{h · X k | h ∈ Γ} = add{h · X ′k | h ∈ Γ} for every k and indecomposables X k , X ′k . k=1 Similar to Lemma 3.49 of [5], we have the following lemma, Lemma 3.4. The Laurent polynomial CC ′ (X) depends only on the class of X under equivalent e modulo Γ for and X ∈ C Q . Proof. We need only to prove that CC ′ (X) = CC ′ (h · X) for h ∈ Γ by Theorem 3.2(2). It follows immediately from that ind′T0 (X) = ind′T0 (h·X) and χ(Gra HomC Qe (−, X[1])) = χ(Grh·a HomC Qe (−, h·  X[1])). Using the algebra homomorphism π and Theorem 3.2, we have the following theorem at once, Theorem 3.5. Keeps the notations as above. Then (1) CC ′ (Ti ) = x[i] for all T i ∈ T ′ . (2) CC ′ (X ⊕ X ′ ) = CC ′ (X)CC ′ (X ′ ) for any two objects X, X ′ ∈ U. (3) CC ′ (X)CC ′ (Y ) = CC ′ (Z) + CC ′ (Z ′ ) for X, Y ∈ U with dimExt1C Qe (X, Y ) = 1 satisfying two non-splitting triangles: Y → Z → X → Y [1] and X → Z ′ → Y → X[1]. e Following [14], we say X ∈ C Q to be reachable if it belongs to a cluster-tilting subcategory which can be obtained by a sequence of mutations from T0 with the mutations do not take at the objects in T ′′ . It is clear that any reachable object belongs to U. Following Theorem 4.1 of [14], we have the following result: Theorem 3.6. Keep the notations as above. Then the cluster character CC ′ ( ) gives a surjection from the set of equivalence classes of indecomposable reachable objects under equivalent modulo Γ of e C Q to the set of clusters variables of the cluster algebra A(Σ). Proof. By Theorem 3.5, the proof is similar as that of Theorem 4.1 in [14].  4. Sign-coherence of g-vectors Keep the notations in Section 3. In this section, we will prove the sign-coherence of g-vectors for acyclic sign-skew-symmetric cluster algebras. For convenience, suppose that A(Σ) is an acyclic sign-skew-symmetric cluster algebra with principal coefficients at Σ. ! B e F, Γ) according Since B is acyclic, is acyclic, too. We can construct an unfolding (Q, In e of (Q, e F, Γ) is with principal to Theorem 2.5. It is easy to check that the corresponding seed Σ e coefficients, where Σ is the seed associate to (Q, F ). CATEGORIFICATION OF CLUSTER ALGEBRAS AND CONJECTURES ON g-VECTORS 7 Proposition 4.1. Assume that X is an object of U given in Section 3. (i) CC(X) admits a g-vector (gi )i∈Qe0 \F which is given by gi = [indT0 (X) : Ti ] for each i. P (ii) CC ′ (X) admits a g-vector (g[i] )[i]∈Q0 \F which is given by g[i] = [indT0 (X) : Ti′ ] for each i′ ∈[i] i. e is strongly almost finite, the proof is the same one as that of ([15], Proof. (i) Since the quiver Q e Proposition 3.6) using of the local finiteness of Q. (ii) is obtained immediately from (i).  e Let h ∈ Γ be either of finite order or without fixed points. Define C Q h the K-linear category e whose objects are the same as that of C Q , and whose morphisms consist of HomC Qe (X, Y ) = h L HomC Qe (h′ · X, Y ) for all objects X, Y . We view this category as a dual construction of the h′ ∈Γ′ category ChQ in [12]. e e Denote by C Q h (T0 ) the subcategory of C Q h consisting of all objects T ∈ T0 . e Lemma 4.2. The category C Q h is Hom-finite if either (i) the order of h is finite, or (ii) Q has no fixed points under the action of h ∈ Γ. Proof. The proof is similar to that of Lemma 6.1 in [12].  e Q e Q e Q In the sequel, assume that C h (T0 ) is Hom-finite. Let F : C → modC h (T0 )op be the functor e e mapping an object X to the restricting of C Q h (−, X) to C Q h (T0 ). For each indecomposable object T of T0 , denote by ST the simple quotient of F (T ) via ST (T ′ ) = EndC (T )/J if T ′ ∼ = T and e ′ ′ ∼ ′ Q 6 T , for any object T of C h , where J is the Jacobson radical of EndC Qe (T ). ST (T ) = 0 if T = h e Lemma 4.3. Keep the notations as above. For any morphism fe : F (M ) → F (N ) in modC Q h (T0 )op e e with M, N ∈ C Q , there exists f : M → N in C Q h such that F (f ) = fe. e d Proof. Let T 1 → T 0 → M → T 1 [1] be the triangle such that d is a minimal right T0 -approximation. e Since T0 is a cluster tilting subcategory of C Q , we have T 1 ∈ T0 . Applying F to the above trie′ d′ angle, we have F (T 1 ) → F (T 0 ) → F (M ) → 0. Similarly, there is a triangle T ′ 1 → T ′ 0 → N → T ′ 1 [1], and F (T ′ 1 ) → F (T ′ 0 ) → F (N ) → 0. Since T 0 , T ′ 0 , T 1 , T ′ 1 ∈ T0 , it follows that e F (T 0 ), F (T ′ 0 ), F (T 1 ), F (T ′ 1 ) are projective in modC Q h (T0 )op . Thus, fe can be lift to the following commutative diagram: / F (T 0 ) / F (M ) /0 F (T 1 ) fe1  F (T ′ 1 ) fe0  / F (T ′ 0 ) fe  / F (N ) / 0, e By the Yoneda Lemma, there exist f1 : T 1 → T ′ 1 and f0 : T 0 → T ′ 0 in C Q h such that F (f1 ) = fe1 L L HomC Qe (h′ · T 0 , T ′ 0 ) such that HomC Qe (h′ · T 1 , T ′ 1 ) and f0 ∈ and F (f0 ) = fe0 . Thus, f1 ∈ h′ ∈Γ′ h′ ∈Γ′ L / L h′ · T 0 / L h′ · M   T ′1 / T ′0  /N h′ ∈Γ′ h′ · T 1 f1 h′ ∈Γ′ f0 /0 h′ ∈Γ′ / 0, 8 PEIGEN CAO MIN HUANG FANG LI e commutes. Since C Q h (T0 ) is Hom-finite, we may assume that only finite h′ ∈ Γ′ appear in the upper triangle, which means that there exists a finite subset I of Γ′ such that L ′ L ′ L ′ /0 / / h · T0 h ·M h · T1 h′ ∈I h′ ∈I f1 h′ ∈I f0  T ′1  / T′ 0 commutes. Thus, there exists f ∈ L h′ ∈I  /N HomC Qe (h′ · T 0 , T ′ 0 ) ⊆ / 0, L h′ ∈Γ′ HomC Qe (h′ · T 0 , T ′ 0 ) such that the above diagram commutes. This commutative diagram induces F (T 1 ) fe1  F (T ′ 1 ) / F (T ) 0 fe0  / F (T ′ 0 ) / F (M ) /0 F (f )  / F (N ) / 0. Therefore, we have F (f ) = fe.  f′ f Lemma 4.4. Assume that for X ∈ U, the category add({h · X | h ∈ Γ}) is rigid. Let T 1 → T 0 → e X → T 1 [1] be a triangle in C Q with f a minimal right T0 -approximation. If X has not any direct summand in T0 [1], then F (f ′ ) F (f ) F (T 1 ) −→ F (T 0 ) −→ F (X) → 0 is a minimal projective resolution of F (X). Proof. Since X does not have direct summand in T0 [1], f ′ is right minimal. Otherwise, if f ′ is not right minimal, then f ′ has a direct summand as T ′ → 0, thus T ′ [1] is a direct summand of X. This is a contradiction. First, we prove that F (f ) is a projective cover of F (X). For any projective representation F (T )e e e of C Q h and surjective morphism u : F (T )e → F (X) → 0, where T ∈ C Q h , e ∈ EndC Qe (T ) is h an idempotent. By Yoneda Lemma, there exists g ∈ HomC Qe (T , X) such that F (g) = u. Since h F (T )e and F (T 0 ) are projective, there exist v : F (T 0 ) → F (T )e and w : F (T ) → F (T 0 ) such that F (f ) = F (g)v and F (g) = F (f )w. Thus, F (f ) = F (f )wv. Similarly, by Yoneda Lemma, there exist g ′ ∈ HomC Qe (T 0 , T ) and g ′′ ∈ HomC Qe (T , T 0 ) such that F (g ′ ) = v, F (g ′′ ) = w. Thus, h h F (f ) = F (f )wv is equivalent to f = f ◦ g ′′ ◦ g ′ . We may assume g ′′ ◦ g ′ = (gh′ )h′ ∈Γ′ , then f = f ◦ (g ′′ ◦ g ′ ) = (f gh′ )h′ ∈Γ . Thus f = f ge and 0 = f gh′ = 0 for any h′ 6= e, where e is the identity of Γ′ . Further, since f is a right minimal T0 -approximation and h′ T 0 ∈ T0 . Therefore, for any e 6= h′ ∈ Γ, gh′ ∈ J(h′ T 0 , T 0 ) and ge is an isomorphism. Using Lemma 5.10 of [12], g ′′ ◦ g ′ = (gh′ )h′ ∈Γ′ is an isomorphism. Thus, F (T 0 ) is a direct summand of F (T )e. Similarly, because f ′ is right minimal, F (f ′ ) induces a projective cover of ker(F (f )). Our result follows.  Inspired by (Proposition 2.1, [4]), (Lemma 3.58, [5]) and (Lemma 3.5, [15]), we have: f′ f Lemma 4.5. Assume X ∈ U such that add({h · X | h ∈ Γ}) is rigid, and T 1 → T 0 → X → T 1 [1] e is a triangle in C Q and f is a minimal right T -approximation. If T is a direct summand of T 0 for e indecomposable object T ∈ C Q , then h · T is not a direct summand of T 1 for any h ∈ Γ. Proof. By Lemma 2.3 and Lemma 2.4 of [12], we may assume that h has no fixed points or finite e order. By Lemma 4.2, C Q h is Hom-finite. For any h′ ∈ Γ′ and T ′ ∈ T , applying HomC Qe (h′ · T ′ , −) CATEGORIFICATION OF CLUSTER ALGEBRAS AND CONJECTURES ON g-VECTORS 9 to the triangle, we get ′ ′ ′ Hom ′ e (h CQ ′ ·T ′ ,f ) −→ HomC Qe (h · T , T 1 ) → HomC Qe (h · T , T 0 ) HomC Qe (h′ · T ′ , X) → 0. Since f is minimal, we get a minimal projective resolution of F (X), F (T 1 ) → F (T 0 ) → F (X) → 0. To prove that h · T is not a direct summand of T 1 , it suffices to prove that F (T ) is not a direct summand of F (T 1 ), or equivalently Ext1 (F (X), ST ) = 0, where ST is the simple quotient of F (T ). As F (T 0 ) → F (X) is the projective cover of F (X) and F (T ) is a direct summand of F (T 0 ), then g : F (T 1 ) → ST , since F (T 1 ) is projective, there is a non-zero morphism pe : F (X) → ST . For any e g = peqe. there exists qe : F (T 1 ) → F (X) such that e Let T be a lifting of T , by Lemma 3.1, we have T ∈ T and T is non-projective. Moreover, since T is indecomposable, we can choose T is indecomposable. By Lemma 5.3 of [12], there is an admissible short exact sequence 0 → Y → T ′ → T → 0. Since T has no Γ-loop, by the dual version of Lemma 5.11 (2) of [12], and Lemma 3.1, we have ST ∼ = F (Y [1]). L e HomC Q (h′ · Thus, according to Lemma 4.3, lifting qe, ge and pe as q, g, p in C Q h , where q ∈ h′ ∈Γ′ L L g = peqe and HomC Qe (h′ · T 1 , Y [1]) and p ∈ HomC Qe (h′ · X, Y [1]). Since e T 1 , X), g ∈ h′ ∈Γ′ h′ ∈Γ′ Hom(F (T ), F (Y [1])) ∼ = HomC Qe (T , Y [1]), we obtain g = p ◦ q. h L L e Q Since C h is Hom-finite, we may assume that g ∈ HomC Qe (h′ · HomC Qe (h′ ·T 1 , Y [1]) and q ∈ h′ ∈I ′ T 1 , X) for a finite subset I ⊆ Γ . According to the composition of morphisms in P ′ h · q), equivalently, we have the following commutative diagram: means g = p( h′ ∈I e C Qh, g = p◦q h′ ∈I L ′ h · X[1] h′ ∈I P P h′ ·f ′ h′ ·q / L h′ · T 1 rr rrr r r rr L ′ yr p h ·X h′ ∈I g P h′ ·f / L h′ · T 0 h′ ∈I / L h′ · X h′ ∈I  / Y [1], h′ ∈I P Since add({h · X | h ∈ Γ}) is rigid, we have g( h′ · f ′ ) = 0. Therefore, g factor through P ′ e h · f . Thus, in C Q h , g factors through f . By the arbitrary of g, we get a surjective map HomC Qe (T 0 , Y [1]) ։ HomC Qe (T 1 , Y [1]). Since HomC Qe (T i , Y [1]) ∼ = Hom(F (T i ), F (Y [1])) = h h h Hom(F (T i ), ST ) for i = 1, 2, we get Hom(F (T 0 ), ST ) → Hom(F (T 0 ), ST ) is surjective. There fore, we obtain Ext1 (F (X), ST ) = 0. Our result follows. Corollary 4.6. Let X be an object of C such that add({h · X | h ∈ Γ}) is rigid. If ind′T0 (X) has no negative coordinates, then X ∈ T . f′ f Proof. Assume T 1 → T 0 → X → T 1 [1] is a triangle and f is a minimal right T -approximation. According to Lemma 4.5, T 0 and T 1 have no direct summands which have the same Γ-orbits. Further, since ind′T (X) has no negative components. Therefore, by the definition of ind′T0 , we obtain T 1 = 0. Thus, X ∼  = T0 ∈ T . Using the above preparation, we now can prove Conjecture 1.1 for all acyclic sign-skew-symmetric cluster algebras. The method of the proof follows from that of Theorem 3.7 (i) in [15]. Theorem 4.7. The conjecture 1.1 on sign-coherence holds for all acyclic sign-skew-symmetric cluster algebras. 10 PEIGEN CAO MIN HUANG FANG LI Proof. For any cluster Z = {z1 , · · · , zn } of A(Σ), by Theorem 3.6, we associate a cluster tilting e subcategory T of C Q which obtained by a series of mutations of T0 and the mutations do no take at T ′′ . Precisely, there are n indecomposable objects {Xj | j = 1, · · · , n} such that T = add({h·Xj | j = j j 1, · · · , n} ∪ T ′′ ) and CC ′ (Xi ) = zi for i = 1, · · · , n. By Proposition 4.1, the g-vector g[1] , · · · , g[n] of P j zj is given by g[i] = [indT0 (Xj ) : Ti′ ]. i′ ∈[i] fj ′ s s Suppose that there exist s and s′ such that g[i] > 0 and g[i] < 0. Assume that T j 1 → T j 0 → Xj → T j 1 [1] be the triangle with f j is a minimal right T0 -approximation for j = s, s′ . Thus, there ′ exist h, h′ ∈ Γ such that h · Ti (respectively, h′ · Ti ) is a direct summand of T s 0 (respectively, T s 1 ). Furthermore, in the triangle M j=s,s′ the morphism L T j 1 → M L T j=s,s′ j j=s,s′ 0 → fj M j=s,s′ Xj → M T j 1 [1], j=s,s′ f is a minimal right T0 -approximation. According to Lemma 4.5, h′ · Ti is not a j j=s,s′ ′ direct summand of T s follows. 1 since h · Ti is a direct summand of T s 0 . This is a contradiction. Our result  5. The recurrence of g-vectors Theorem 5.1. ([6]) Conjecture 1.3 holds true for all finite rank skew-symmetric cluster algebras. It is easy to see that the above theorem can be extended to the situation of infinite rank skewsymmetric cluster algebras, that is, we have: Theorem 5.2. Conjecture 1.3 holds true for all infinite rank skew-symmetric cluster algebras. We first give the following easy lemma. Lemma 5.3. Let (Q, F, Γ) be the unfolding of a matrix B and A = A(Σ(Q, F )). For any sequence of orbits ([i1 ], · · · , [is ]) and a ∈ Q0 , there exist finite subsets Sj ⊆ [ij ], j = 1, · · · , s such that Q Q µk (xa ) = µ e[is ] · · · µ e[i1 ] (xa ) for all finite subsets Vj , j = 1, · · · , s, satisfying Sj ⊆ Vj ⊆ µk · · · k∈Vs k∈V1 [ij ], j = 1, · · · , s. Proof. Since µ e[is ] · · · µ e[i1 ] (xa ) is determined by finite vertices of Q0 , there exist finite subsets Sj ⊆ Q Q µk (xa ) = µ e[is ] · · · µ e[i1 ] (xa ). Then for all finite subµk · · · [ij ], j = 1, · · · , s such that k∈S1 k∈Ss Q Q sets Vj , j = 1, · · · , s satisfying Sj ⊆ Vj ⊆ [ij ], j = 1, · · · , s, we have µk · · · µk (xa ) = k∈Vs µ e[is ] · · · µ e[i1 ] (xa ). k∈V1  e Ye , Q) Let A1 (respectively, A2 ) be the cluster algebra with principal coefficients at Σ1 = (X, e ′ , Ye ′ , µ (respectively, Σ2 = (X e[k] (Q))). For any sequence ([i1 ], · · · , [is ]) of orbits of Q0 and a ∈ Q0 = µ e (Q) µ e[k] (Q0 ), denote g Q,a = (giQ )i∈Q0 (respectively, g µe[k] (Q),a = (gi [k] )i∈Q0 ) be the g-vector of the cluster variable µ e[is ] · · · µ e[i1 ] (xa ) (respectively, µ e[is ] · · · µ e[i1 ] µ e[k] (x′a ). As a consequence of Theorem 5.2, we have the following property. Proposition 5.4. Keep the notations as above. The following recurrence holds:   −giQ if i ∈ [k]; µ e[k] (Q) P P (3) gi = Q Q Q bik′ min(gk′ , 0) if i 6∈ [k].  gi + ′ [bik′ ]+ gk′ − ′ k ∈[k] k ∈[k] CATEGORIFICATION OF CLUSTER ALGEBRAS AND CONJECTURES ON g-VECTORS 11 Proof. By Lemma 5.3, for j = 1, · · · , s, there exist finite subsets Sj1 ⊆ [ij ] (respectively, Sj2 ⊆ [ij ]) Q Q such that g Q,a (respectively, g µe[k] (Q),a ) is the g-vector of the cluster variable µt · · · µt (xa ) t∈Vs1 t∈V11 Q Q µt · · · (respectively, µt µ e[k] (x′a )) for all finite subsets Vj1 (respectively, Vj2 ) satisfying that t∈Vs2 t∈V11 ⊆ ⊆ [ij ] (respectively, Sj2 ⊆ Vj2 ⊆ [ij ]). Choose Sj = Sj1 ∪ Sj2 , we have g Q,a and g µe[k] (Q),a as Q Q Q Q µt µ e[k] (x′a ) respectively. µt · · · µt (xa ) and µt · · · the g-vectors of the cluster variables Sj1 Vj1 t∈S1 t∈Ss t∈S1 t∈Ss For any finite subset T ⊆ [k], denote by AT the cluster Q algebra with principal coefficients at Q µk′ (Q) µk′ (Q),a Q ′ e T , Ye T , ΣT = (X µk′ (Q)). Denote by g k′ ∈T = (gik ∈T )i∈Q0 the g-vector of the cluster k′ ∈TQ Q Q µk′ (xTa ). µt µt · · · variable k′ ∈T Q t∈S1 t∈Ss Q µt µ e[k] (x′a ) is only determined by finite vertices of Q0 , µt · · · Since the cluster variable t∈S1 t∈Ss µ e (Q) gi [k] Q k′ ∈T µk′ (Q) there exists a finite subset S ⊆ [k] such that = gi for any finite set T satisfying S ⊂ T ⊆ [k]. Furthermore, by Theorem 5.2, for any subset T ⊆ Q0 , we have  Q µk′ (Q) −giQ if i ∈ T ; ′ k ∈T P P (4) gi = giQ + [bik′ ]+ gkQ′ − bik′ min(gkQ′ , 0) if i 6∈ T. k′ ∈T k′ ∈T Therefore, the result holds.  Theorem 5.5. Conjecture 1.3 holds true for all acyclic sign-skew-symmetric cluster algebras. That is, let B = (b[i][j] ) ∈ M atn×n (Z) be a sign-skew-symmetric matrix which is mutation equivalent to [k] an acyclic matrix and let t1 −− t2 ∈ Tn and B 2 = µ[k] (B 1 ). For [a] ∈ {[1], · · · , [n]} and t ∈ Tn , 2 1 B ;t2 B ;t1 t2 t2 t1 t1 ), then , · · · , g[n] = (g[1] ) and g[a];t , · · · , g[n] = (g[1] assume g[a];t  −g t1 t2 [k] = (5) g[i] g t1 + [bt1 ]+ g t1 − bt1 min(g t1 , 0) [i] [i][k] [k] [i][k] [k] if [i] = [k]; if [i] 6= [k]. i1 is Proof. By Lemma 2.4 and Theorem 2.5, let (Q, Γ) be an unfolding of B. Assume t1 −− t′2 · · · t′s −− t. P µe[k] (Q) P Q t2 t1 = gi′ = gi′ . By Proposition 4.1 and Lemma By Theorem 2.9, we have g[i] and g[i] ′ ′′ 4.5, for k , k ∈ [k], both min( P k′ ∈[k] gkQ′ i′ ∈[i] and gkQ′′ i′ ∈[i] are non-negative or non-positive. Thus, k′ ∈[k] gkQ′ , 0). Using Proposition 5.4, if [i] = [k], then t2 = g[i] X µ e gi′[k] (Q) P k′ ∈[k] t2 = g[i] X (giQ′ + i′ ∈[i] The result holds. min(gkQ′ , 0) = min( X k′ ∈[k] P k′ ∈[k] [bti′1k′ ]+ gkQ′ − X =− X min(gkQ′ , 0) = t1 giQ′ = −g[i] ; i′ ∈[i] i′ ∈[i] if [i] 6= [k], since P Q t1 gK ′ , 0) and b[i][k] = P bi′ k , then i′ ∈[i] t1 t1 t1 1 1 , 0). min(g[k] − bt[i][k] ]+ g[k] bti′1k′ min(gkQ′ , 0)) = g[i] + [bt[i][k] k′ ∈[k]  Acknowledgements: This project is supported by the National Natural Science Foundation of China (No.11671350 and No.11571173). 12 PEIGEN CAO MIN HUANG FANG LI References 1. A. B. Buan, O. Iyama, I. Reiten and J. Scott, Cluster structures for 2-Calabi-Yau categories and unipotent groups. Compositio Math. 145 (2009), 1035-1079. 2. A. B. Buan, R. Marsh, M. Reineke, I. Reiten and G. Todorov, Tilting theory and cluster combinatorics, Adv. Math. 204 (2006), no.2, 572-618. 3. A. Berenstein, S. Fomin and A. Zelevinsky, Cluster algebras III: Upper bound and Bruhat cells. Duke Mathematical Journal. Vol.126, No.1(2005). 4. R. Dehy, B. Keller, On the combinatorics of rigid objects in 2-Calabi-Yau categories. Int. Math. Res. Not.(2008), doi:10.1093/imrn/rnn029. 5. L. Demonet, Categorification of skew-symmerizable cluster algebras. Algebr Represent Theory, 14, 1087-1162, 2011. 6. H. Derksen, J. Weyman, and A. Zelevinsky, Quivers with potentials and their representations II: applications to cluster algebras. J. Amer. Math. Soc., 23(3):749-790, 2010. 7. S. Fomin, A. Zelevinsky, Cluster algebras I: Foundations. J. Amer. Math. Soc. 15, 497-529(2002). 8. S. Fomin, A. Zelevinsky, Cluster algebras II: Finite type classification. Inven. Math. 154, 63-121(2003). 9. S. Fomin, A. Zelevinsky, Cluster algebras IV: Coefficients, Comp. Math. 143, 112-164, 2007. 10. C.J. Fu, B. Keller, On cluster algebras with coefficients and 2-CalabiCYau categories. Trans. Am. Math. Soc. 362(2), 859-895 (2010). 11. M. Gross, P. Hacking, S. Keel, M. Kontsevich, Canonical bases for cluster algebras, arXiv:1411.1394v1 [math.AG], 2014. 12. M. Huang, F. Li, Unfolding of sign-skew-symmetric cluster algebras and applications to positivity and Fpolynomials, arXiv:1609.05981. 13. T. Nakanishi, A. Zelevinsky, On tropical dualities in cluster algebras, Contemp. Math. 565 (2012) 217-226. 14. P.-G. Plamondon, Cluster characters for cluster categories with infinite-dimensional morphism spaces, Adv. Math. 227 (2011), 1-39. 15. P.-G. Plamondon, Cluster algebras via cluster categories with infinite-dimensional morphism spaces, Compositio Math. 147, 1921-1954, 2011. Peigen Cao Department of Mathematics, Zhejiang University (Yuquan Campus), Hangzhou, Zhejiang 310027, P.R.China E-mail address: [email protected] Min Huang Department of Mathematics, Zhejiang University (Yuquan Campus), Hangzhou, Zhejiang 310027, P.R.China E-mail address: [email protected] Fang Li Department of Mathematics, Zhejiang University (Yuquan Campus), Hangzhou, Zhejiang 310027, P.R.China E-mail address: [email protected]
0math.AC
arXiv:1712.02043v1 [stat.ME] 6 Dec 2017 Dynamic adaptive procedures for false discovery rate estimation and control Peter MacDonald and Kun Liang Department of Statistics and Actuarial Science University of Waterloo December 7, 2017 Abstract In the multiple testing problem with independent tests, the classical linear step-up procedure controls the false discovery rate (FDR) at level π0 α, where π0 is the proportion of true null hypotheses and α is the target FDR level. The adaptive procedures can improve power by incorporating estimates of π0 , which typically rely on a tuning parameter. For the fixed adaptive procedures that set their tuning parameters before seeing the data, the properties of the conservative FDR estimation and finite sample FDR control hold simultaneously. Less is known about the dynamic adaptive procedures whose tuning parameters are determined by the data. We show that, if the tuning parameter is chosen according to a left-to-right stopping time (LRS) rule from a fixed candidate set, the corresponding adaptive procedure estimates the FDR conservatively and controls the FDR as well. Furthermore, even if the tuning parameter candidates are random, such as p-values, we are able to prove the finite sample control of the FDR by using a series of LRS approximations. Consequently, the finite sample FDR control property is established for most existing dynamic adaptive procedures. 1 Introduction Powerful modern computers have introduced large-scale data sets to diverse fields of research, and testing of hundreds or even thousands of hypotheses simultaneously has 1 become commonplace in statistical applications such as genetics, neural science, and astronomy. Since its inception in Benjamini and Hochberg (1995), the false discovery rate (FDR), the expected proportion of false positives, has been widely adopted as an error measure for such large-scale problems. Much research effort has been made to improve Benjamini and Hochberg’s initial method, in particular developing efficient estimators of the FDR that lead to powerful procedures with proper FDR control. In this paper, we provide the proof of finite sample FDR control for a large class of dataadaptive procedures. First we briefly review the literature. Consider the classical problem of testing m independent simultaneous null hypotheses, of which m0 are true and m1 “ m ´ m0 are false. Denote the associated p-values by p1 , p2 , ..., pm and the ordered p-values by pp1q ď ¨ ¨ ¨ ď ppmq . For t P r0, 1s, define the following empirical processes (Storey et al., 2004): V ptq “ #tnull pi : pi ď tu, Sptq “ #talternative pi : pi ď tu, Rptq “ V ptq ` Sptq. Then the FDR at a p-value cut-off t P p0, 1s is defined as  „ V ptq . FDRptq “ E Rptq _ 1 For a fixed FDR threshold α, Benjamini and Hochberg (1995) proposed a linear step-up FDR controlling procedure (the BH procedure) which sets the p-value cut off at ppkq , where k “ maxti : ppiq ď iα{mu. The procedure has been shown to control the FDR conservatively at level π0 α under independence, where π0 “ m0 {m is the proportion of true nulls (Benjamini and Yekutieli, 2001). To tighten the FDR control, we could use the adaptive procedure that applies the BH procedure at the threshold of α{π̂0 , where π̂0 is preferably a conservative estimate of π0 . Instead of finding a rejection region to control the FDR, Storey (2002) proposed to estimate the FDR for a fixed rejection region. When Rptq ą 0 and under the usual assumptions that true null p-values are independent and uniformly distributed on p0, 1q, a natural estimator for FDRptq arises as mπ̂0 t ÊrV ptqs z “ . FDRptq “ Rptq Rptq 2 The FDR control and FDR estimation approaches are intricately connected. With π̂0 “ 1, the BH procedure can be viewed as finding the largest p-value whose FDR estimate is below or equal to the target FDR threshold. For a fixed tuning parameter λ P r0, 1q, Storey (2002) proposed a widely used π0 estimator as π̂0 pλq “ z leads to Using π̂0 pλq in FDR m ´ Rpλq . p1 ´ λqm z λ ptq “ mπ̂0 pλqt , FDR Rptq _ 1 z λ ptq is a conservative estimator of and Liang and Nettleton (2012) showed that FDR z z λ ptqs ě FDRptq. To control the FDR in the adaptive procedure, FDRptq, i.e., ErFDR it is a good practice to bound π̂0 away from zero, and Storey et al. (2004) proposed an asymptotically equivalent estimator: π̂0‹ pλq “ m ´ Rpλq ` 1 . p1 ´ λqm z leads to conservative estimation of the Because π̂0‹ pλq ě π̂0 pλq, using π̂0‹ pλq in FDR FDR. On the other hand, Storey et al. (2004) showed that the adaptive procedure with π̂0‹ pλq controls the FDR. Furthermore, if we use π0 -estimators that are more conservative than π̂0‹ pλq in the adaptive procedures, the FDR control can also be guaranteed (Liang and Nettleton, 2012). Such examples include the two-stage procedure of Benjamini et al. (2006) and the one-stage and two-stage procedures of Blanchard and Roquain (2009). We will refer to the adaptive procedures that use fixed λ parameters as the fixed adaptive procedures. In summary, for the fixed adaptive procedures, the conservative FDR estimation and the FDR control are closely related in that one will almost always imply the other. In practice, the selection of λ amounts to a trade-off between the bias and variance of π̂0 pλq and should depend on the data at hand. We will refer to the adaptive procedures that use data to select λ as the dynamic adaptive procedures. Interestingly, Liang and Nettleton (2012) showed that if λ is chosen according to a certain stopping time rule, then conservative π0 and FDR estimation can still be guaranteed. Examples include the lowest-slope procedure of Benjamini and Hochberg (2000) and the rightboundary procedure of Liang and Nettleton (2012). However, it is unclear whether such dynamic adaptive procedures still control the FDR in finite samples. In this 3 paper, we strive to prove the FDR control for a large class of dynamic adaptive procedures, which include the right-boundary procedure as a special case. Furthermore, we are able to extend our proof of FDR control to the lowest-slope procedure and the quantile adaptive procedure of Benjamini et al. (2006), neither of which are strictly in our defined class. The lowest-slope procedure is historically important in the field of multiple testing and especially in the FDR literature. The lowest-slope π0 -estimator was first proposed in Hochberg and Benjamini (1990) to control familywise error rate (FWER), and its idea can be traced back to Schweder and Spjøtvoll (1982). According to Benjamini (2010), Benjamini and Hochberg attempted but could not show that the least-slope procedure controls the FDR and presented the non-adaptive BH procedure in Benjamini and Hochberg (1995) as a result. As the earliest adaptive FDR procedure, the least-slope procedure is widely used, but its control of the FDR has not been theoretically established. We organize the rest of the paper as follows. In Section 2, we introduce the models adopted for this paper and show the conservative FDR estimation results. In Section 3, we present the FDR control results for dynamic adaptive procedures. Finally, we discuss the identifiability issue and draw conclusions in Section 4. Technical proofs are postponed until the appendix. 2 2.1 Conservative FDR estimation Two-group Model We adopt the widely used two-group model, which was considered in Efron et al. (2001), Storey (2002), Genovese and Wasserman (2004), among many others. Suppose, for i “ 1, . . . , m, $ & Hi % P |H i i „ Bernoullip1 ´ π0 q, „ p1 ´ Hi qUniformp0, 1q ` Hi F1 , where Hi ’s are independent indicator variables for being false nulls, Pi ’s are conditionally independent given Hi ’s, and F1 is an arbitrary continuous distribution supported on the interval p0, 1q. From this model it follows that M0 „ Binomialpm, π0 q, where M0 “ 4 řm i“1 p1 ´ Hi q is the total number of true null hypotheses. Compared to the classical model of Benjamini and Hochberg (1995), the two-group model introduces a random number of true null hypotheses and also implies independence among the alternative p-values. A less restrictive model could allow dependence among the alternative p-values, and we call it the relaxed two-group model. More specifically, we assume as before, for i “ 1, . . . , m, Hi „ Bernoullip1´π0 q, and null p-values follow Uniformp0, 1q and are independent of each other and also independent of the alternative p-values. Except the random M0 , the relaxed two-group model is parallel to model used in Benjamini and Hochberg (1995). 2.2 Conservative estimation z λ ptq is a conservative estimator of We first show that, for any fixed λ parameter, FDR FDRptq. Theorem 1. Under the relaxed two-group model, z λ ptqs ě FDRptq ErFDR for all t P r0, 1s and any fixed λ P r0, 1q. This result can be seen as the two-group analogue of Theorems 1 and 2 of Liang and Nettleton (2012). The proof of this result demonstrates the connection between results under the original model of Benjamini and Hochberg (1995) with fixed m0 , and our relaxed twogroup model with random M0 . In particular, by conditioning on the possible values of M0 , and for each appealing to the corresponding fixed effects result, the random effects result can be easily shown. Conservative estimation can also be shown under the random effects framework for dynamic λ selection procedures, when λ is an appropriate stopping time. Theorem 2. Under the relaxed two-group model, suppose λ is a stopping time with respect to the filtration tFs usPr0,1q , where Fs “ σp1tpi ďuu , 0 ď u ď s, i “ 1, ..., mq, and 5 λ ď τ ă 1 with probability 1 for some τ P p0, 1q. Then Erπ̂0 pλqs ě π0 . The proof of Theorem 2 is contained in the appendix. For each s P r0, 1q, the information contained in the σ-algebra Fs can be thought of as the location of all p-values smaller than or equal to s. We require that λ is a stopping time with respect to tFs usPr0,1q , the same filtration that appears in Liang and Nettleton (2012). However, their Lemmas 1–3, which appear by the same names in the appendix of this paper, contain an error, since their proposed martingale is not adapted to the filtration tFs usPr0,1q . Thus in the versions of Lemmas 1–3 which appear in this paper, we define a slightly richer filtration which distinguishes between null and alternative p-values, so that the proposed martingale is adapted to the filtration. It should be noted that this technical error also appears in the analogous results and proofs in Storey et al. (2004). Theorem 4 of Liang and Nettleton (2012), here Theorem 3, also holds under the relaxed two-group model. The proof of Theorem 3 follows a similar approach to the adapted proofs of Theorems 1 and 2 and is omitted. Theorem 3. Under the relaxed two-group model, suppose λ is a stopping time with respect to the filtration tFs usPr0,1q and 0 ă κ ď λ ď τ ă 1 with probability 1 for some κ and τ P p0, 1q. Then, for all t P r0, κs, z λ ptqs ě FDRptq. ErFDR Theorems 1 to 3 provide pleasing results regarding the conservative estimation of π0 and FDR, in both the adaptive and dynamic adaptive cases. Next, we present our main result, the finite sample control of the FDR for dynamic adaptive procedures. 3 Finite sample FDR control We first characterize the dynamic λ-selection rules for which we will prove FDR control. 6 3.1 λ selection rules To prove FDR control for fixed adaptive procedure, Storey et al. (2004) views t as a time running from λ to 0 and V ptq and Rptq as random processes. Unfortunately, if we use the general stopping rule used in Theorem 2 and 3 to select λ, we would know all the p-values smaller or equal to λ and there will be no random processes. However, if we restrict our attention to a subclass of the stopping rule, the proof is still possible. We begin by formally defining the right-boundary procedure, but our result will extend to a wider class of stopping time rules of which the right-boundary procedure is a special case. For k ě 1, consider a fixed finite λ candidate set Λ “ tλ1 , . . . , λk u that divides the interval (0, 1] into k ` 1 bins with boundaries at λ0 ” 0 ă λ1 ă . . . ă λk ă λk`1 ” 1 such that the ith bin is pλi´1 , λi s for i “ 1, . . . , k ` 1. We can construct a series of π0 -estimators at candidate λ values as π̂0˚ pλi q “ m ´ Rpλi q ` 1 , p1 ´ λi qm i “ 1, . . . , k. Then the right-boundary procedure chooses the index for λj to be j “ mint1 ď i ď k : π̂0˚ pλi q ě π̂0˚ pλi´1 qu if such i exists and k otherwise. That is, we choose λ as the right boundary of the first bin where the π0 estimate at its right boundary is larger or equal to that at its left boundary. Let Ni denote the number of p-values falling into the i-th bin, i.e., Ni “ Rpλi q ´ Rpλi´1 q “ #tpj : pj P pλi´1 , λi su. Then it is straightforward to show that the right-boundary procedure is equivalent to stopping at the first bin where Ni m ´ Rpλi´1 q ` 1 ď . λi ´ λi´1 1 ´ λi´1 Thus, another interpretation of the right-boundary procedure is to choose the first bin whose p-value density is less or equal to its tail average. This stopping rule compare the current bin count Ni to a function of Rpλi´1 q, which is the sum of past bin counts, ři´1 i.e., Rpλi´1 q “ j“1 Nj . The right-boundary procedure also operates in a remarkably similar spirit to the lowestslope procedure of Benjamini and Hochberg (2000), one of the common procedures which we will consider in Section 3.3. Instead of using a fixed λ candidate set, Benjamini and Hochberg (2000) uses a random grid tpp1q , ..., ppmq u. Under our notation, since i “ Rpppiq q, their 7 procedure operates by calculating for each 1 ď i ď m the slope, Si “ 1 ´ ppiq , m ´ Rpppiq q ` 1 and stopping at ppjq , where j is the smallest i such that Si ă Si´1 . Their estimator of π0 is then π̂0LSL “ m ´ Rpppjq q ` 1 1 “ , mSj mp1 ´ ppjq q which is exactly π̂0˚ pλq with tuning parameter λ “ ppjq . When the same slope-based procedure is applied to a fixed grid Λ, it can be easily shown that the stopping time index is the smallest i such that Si ă Si´1 ðñ m ´ Rpλi´1 q ` 1 Ni ă , λi ´ λi´1 1 ´ λi´1 which is nearly equivalent (modulo the strictness of the inequality) to the stopping rule using the right-boundary procedure with bins bounded by Λ. In general, we will require a finite candidate set Λ, but allow the stopping rule to depend on any functions of the past bin counts. More specifically, a λ selection rule on a fixed candidate set Λ “ tλ1 , λ2 , ..., λk u with 0 ă λ1 ă . . . ă λk ă 1 is said to have the left-to-right stopping time property (and we say that it is an LRS selection rule) if λi is selected when i is the smallest index in t1, . . . , ku such that Ni P Ci , where Ci is a subset of t0, ..., mu and can depend on the past bin counts. That is, C1 can be any subset of t0, . . . , mu, and for 2 ď i ď k, Ci “ Ci pN1 , ..., Ni´1 q Ď t0, ..., mu. In order for the selection rule to always terminate, we can have Ck “ t0, ..., mu. As a concrete example, ř λi ´λi´1 the right-boundary procedure sets Ci “ tinteger j : j ď pm ´ jăi Nj ` 1q 1´λ u i´1 for i “ 1, . . . , k ´ 1. Such a rule resembles a search from left-to-right which evaluates a stopping condition at each candidate value and stops the first time the condition is satisfied. 3.2 LRS procedures control the FDR Consider a fixed λ candidate set Λ “ tλ1 , λ2 , ..., λk u Ď rκ, τ s such that 0 ă κ “ λ1 ă λ2 ă . . . ă λk´1 ă λk “ τ ă 1. When λ is selected dynamically from Λ, we define the following FDR estimator ‹ z ptq FDR λ “ $ & mπ̂0‹ pλqt Rptq_1 % 1 8 t ď κ, t ą κ. ‹ z λ appears at first to be restrictive as it limits the possible range The definition of FDR of rejection thresholds to r0, λ1 q. In practice, we can set λ1 not too small, say λ1 “ 0.05, and it will be unlikely that the above restriction will affect the final rejection threshold. We refer readers to Remark 1 of Storey et al. (2004) for a more detailed justification. Furthermore, for any function F : r0, 1s Ñ R, define the α-level thresholding functional by tα pF q “ supt0 ď t ď 1 : F ptq ď αu. Then the LRS selection rule leads to the control of the FDR. Theorem 4. Under the two-group model, suppose λ is selected from a fixed candidate ‹ z λ qu ď α. grid Λ by an LRS selection rule, then FDRttα pFDR We leave the details of the proof to the appendix, but give a proof sketch at the end of this subsection. Since a fixed λ selection rule has the LRS property with |Λ| “ 1, Theorem 4 also offers (under the stronger assumption of full independence) an alternative proof of finite sample FDR control to Theorem 3 of Storey et al. (2004). The alternative proof also provides a nice probabilistic interpretation of the upper bound on FDR at the threshold ‹ z λ q. In particular, our proof avoids bounding m ´ Rpλq above by m0 ´ V pλq, as tα pFDR in the proof of Theorem 3 in Storey et al. (2004). For any i “ 1, . . . , m, we have ‹ z qq FDRptα pFDR λ ď α ¨ P ppi null | pi ą λq ¨ P pRpλq ă mq « α ¨ P ppi null | pi ą λq. This inequality gives an alternate justification for the control property of the original BH procedure (which is equivalent to fixing λ “ 0), as P ppi null | pi ą 0q “ P ppi nullq “ π0 and P pRp0q ă mq “ 1. It also motivates the selection of an optimal λ which is not too close to 0 to tighten the FDR control. Furthermore, if λ is chosen too close to 1, the resulting π0 -estimator could have high variance. These observations provide a justification to bound λ away from 0 and 1 in Theorem 3 and in the next subsection. Proof Sketch of Theorem 4 By applying martingale arguments similar to Storey et al. (2004), and by the definition 9 ‹ z λ , we first get the FDR upper bound as of FDR  „ ‹ V pλ1 q 1´λ z FDRptα pFDRλ qq ď αE . m ´ Rpλq ` 1 λ1 Thus it suffices to show that the expectation on the right-hand side is bounded above by 1. The expectation is a weighted sum over all choices of λ with weights being the probabilities each candidate λ is selected. Then the LRS property of the selection rule gives the sets Ci , i “ 1, ..., k, that allow this summation over the candidate λ values to be re-indexed as a summation over the possible values of the bin counts, pN1 , ..., Nk q. By the independence of the p-values in the two-group model, the binning process can be seen as a discretization of the overall p-value mixture density, and hence, the vector of bin counts pN1 , ..., Nk q will follow a multinomial distribution with m trials and probability vector pq1 , ..., qk q, where qj “ P ppi P pλj´1 , λj sq. Based on the distribution result of bin counts, we show that each term in the summation is less than or equal to the probability of some combinations of bin counts, pN1 , ..., Nk q. Then the proof follows by showing those combinations are non-overlapping due to the sequential nature of the LRS procedures. 3.3 Extension to other procedures Although LRS selection rules encompass a large class of dynamic λ-selection rules, there are still some procedures prevalent in the literature which are not covered. In particular the lowest-slope procedure of Benjamini and Hochberg (2000) referenced above and the quantile adaptive procedure described in Benjamini et al. (2006) which selects λ “ ppkq for some prespecified 1 ď k ď m are commonly used stopping time rules that are not strictly LRS. Although the grid of candidate values remains finite in both cases, it is made up of the p-values themselves, and so is itself adaptive, and cannot be fixed prior to observing the data. Nonetheless, we are able to use our Theorem 4 to prove the finite sample control property of minor modifications of both of these procedures by approximating them with LRS procedures. We modify the procedures slightly to bound the possible values of λ away from 0 and 1. 10 Definition 1 (modified BH00 procedure). Let 0 ă κ ă τ ă 1 be fixed. If there are strictly fewer than 2 p-values in the interval pκ, τ q, select λLSL “ τ . Otherwise, let ppn1 q ď ppn1 `1q ď ... ď ppn2 q denote the ordered p-values in the interval pκ, τ q. Let λLSL “ ppjq where j “ mintn1 ` 1 ď i ď n2 : π̂0‹ pppiq q ą π̂0‹ pppi´1q qu if such j exists, and λLSL “ τ otherwise. Intuitively, bounding λ away from 0 and 1 can avoid high bias and high variance of the π0 -estimator, respectively. In practice, to control the FDR at level α, it is sensible to reject only p-values smaller than α, and we can set κ ď α. The τ can be set close to 1, say, τ “ 0.95. Overall, especially when the total number of tests m is sufficiently large, the modification is minor and keeps the most sensible region of the λ parameter. Similarly, we modify the quantile adaptive procedure of Benjamini et al. (2006) as follows: Definition 2 (modified k-quantile procedure). Let 0 ă κ ă τ ă 1 and integer 1 ď k ď m be fixed. Select Q-k λ “ $ ’ ’ p ’ & pkq κ ’ ’ ’ % τ ppkq P pκ, τ q, ppkq P p0, κs, ppkq P rτ, 1q. Then we show that modified procedures control the FDR in finite samples. Theorem 5. Under the two-group model, suppose λLSL is selected using the modified z ‹ LSL qq ď α. BH00 procedure, then FDRptα pFDR λ Theorem 6. Under the two-group model, suppose λQ-k is selected using the modified ‹ z λQ-k qq ď α. k-quantile procedure, then FDRptα pFDR Theorem 5 is the first time the finite sample FDR control has been proven for the lowest-slope procedure of Benjamini and Hochberg (2000), and Theorem 6 is analogous to Theorem 2 in Benjamini et al. (2006). We prove Theorem 5 by showing that the modified BH00 procedure is the limit of a series of LRS procedures, and more details can be found in a proof sketch at the end of this subsection. The full proof of Theorem 11 5 is given in the appendix, and the sequence of LRS procedures used in the proof of Theorem 6 is also given, from which point its proof follows a similar but simpler structure to that of Theorem 5. Although the developments in this section do not rigorously ensure FDR control for every general stopping time rule, they do motivate the idea that for any reasonable stopping time rule which is bounded away from 0 and 1, it is possible to construct an LRS approximation similar to those detailed in the appendix. For example, we could modify the BH00 procedure to check the stopping conditions less often, say at every fifth p-value or every fifth percentile of p-values. Then we can make corresponding modification to the approximating sequence of LRS procedures and prove the finite sample control of the FDR following the structure of our proof of Theorem 5. Proof Sketch of Theorem 5 Briefly, we will bound the FDR of the modified BH00 procedure below α by showing it is the limit of a sequence of FDR’s of carefully constructed LRS procedures with progressively finer candidate grids. These procedures are described in full in the appendix. Then Theorem 4 ensures that each term of the sequence is bounded below α, which allows us to conclude that the limit is bounded below α, as desired. More specifically, we aim to show pointwise convergence of our LRS approximation to the modified BH00 procedure. We first identify the set of p-value realizations for which this convergence is either difficult or impossible to prove, and we demonstrate that this set of realizations comprises a null set with respect to the probability measure on p0, 1qm induced by the two-group model. Then, for any fixed realization of p-values outside this null set, we show that the tuning parameter λ, the π0 -estimator π̂0‹ pλq, and the proportion of false discoveries from our LRS approximation all converge pointwisely to the corresponding quantities from the modified BH00 procedure. The FDR for a given procedure is the expectation of the false discovery proportion, which is a bounded random variable. Hence, we use the bounded convergence theorem to show the convergence in expectation. 12 4 4.1 Discussion and conclusions Identifiability and purity The discussion after Theorem 4 in Section 3.2 begins to shed some light on how the identifiability issues with estimation of π0 discussed in Section 3.1 of Genovese and Wasserman (2004) manifest themselves in the context of FDR control. Following the proof of Theorem 4 in the dynamic λ case, especially Lemma 4, we see that ‹ z λ qq ď α ¨ sup P ppi null | pi ą λq. FDRptα pFDR λPΛ There may in fact be no λ for which P ppi null | pi ą λq “ 1, a result of F1 having a non-zero uniform component, termed impurity by Genovese and Wasserman (2004). Such purity issues are the reason that we cannot, without further assumptions on F1 , find an unbiased estimator for π0 , and can only conclude conservatism. The effects of such bias carry through to the estimation of FDR, and the thresholding procedure, and can intrinsically bound the FDR of the procedure below the target level α. 4.2 Conclusions In this paper, we first completed the finite sample proof of FDR control for a large class of dynamic adaptive procedures on a fixed candidate set, namely the LRS procedures. We later extend the FDR control result to the procedures where the λ candidate set can be random. In summary, all existing dynamic adaptive procedures that conservatively estimate the FDR have been shown to control the FDR in finite samples. Our results strengthen the connection between the FDR estimation approach and the FDR control approach. With a conservative FDR estimator, we can use the step-up procedure to find the largest p-value whose FDR estimate is below the target FDR level and controls the FDR as a result. Such connection is the most evident for fixed adaptive procedures through the work of Storey et al. (2004) and Liang and Nettleton (2012), and we establish such connection for dynamic adaptive procedures in this paper. The FDR estimation approach is more direct, and the conservative FDR estimation is much 13 easier to establish than the finite sample control of the FDR. Such insight could be useful in the future to design and evaluate new procedures. Through simulation, the right-boundary procedure was shown in Liang and Nettleton (2012) to have better power than various adaptive and dynamic adaptive procedures prevalent in the literature while maintaining the FDR control. Our results provide the theoretical guarantee of finite sample FDR control for the right-boundary procedure. Because no new procedure is proposed, we did not carry out simulation here, and readers can refer to the simulation studies contained in Liang and Nettleton (2012). Our results are established under the widely used two-group model. In future work, it would be valuable to prove Theorem 4 in the original framework of Benjamini and Hochberg (1995), or under the relaxed two-group model. In moving to the two-group model, the allowance for dependence among alternative p-values is lost. Appendix: Proofs A.1 Proof of Theorem 1 The results of Theorems 1 and 2 in Liang and Nettleton (2012) give the required inequality for fixed M0 “ m0 . That is, for all t P r0, 1s, and m0 P t0, ..., mu, z λ ptq ´ FDRptq | M0 “ m0 s ě 0. ErFDR Then the inequality follows since z λ ptq ´ FDRptqs ErFDR “ “ ` ˘ z λ ptq ´ FDRptq | M0 s E ErFDR m ÿ z λ ptq ´ FDRptq | M0 “ m0 sP pM0 “ m0 q ErFDR m0 “0 ě 0. ˝ 14 A.2 Martingale Lemmas for Theorems 2 and 3 The following three lemmas are easy to verify. Lemma 1 can be verified directly by definition, Lemma 2 is an application of optional stopping theorem (Karlin and Taylor, 1975), and Lemma 3 is an application of optional sampling theorem (Doob, 1953). These lemmas are analogous to results in Liang and Nettleton (2012) and Storey et al. (2004), but their statements have been slightly altered to correct an error that appeared in both those papers, wherein under their original formulations the proposed martingale was not adapted to the proposed filtration. Let H0 be the set of index of all true null hypotheses. Define the filtration tGs usPr0,1q by Gs “ σp1tiPH0 u , 1tpi ďuu , 0 ď u ď s, i “ 1, . . . , mq. Note that tFs usPr0,1q is a subfiltration of tGs usPr0,1q , so that if λ is a stopping time with respect to tFs usPr0,1q , it follows that it is a stopping time with respect to tGs usPr0,1q . Lemma 1. Under the conditions of Theorem 1, the process * " m0 ´ V psq 1´s sPr0,1q is a martingale with time running forwards with respect to the filtration tGs usPr0,1q . Lemma 2. If λ is a stopping time with respect to tFs usPr0,1q and λ ď τ ă 1 with probability 1 for some τ P p0, 1q, then „  m0 ´ V pλq E “ m0 . 1´λ Lemma 3. If λ is a stopping time with respect to tFs usPr0,1q and 0 ă κ ď λ ď τ ă 1 with probability 1 for some κ and τ P p0, 1q, then for any t P r0, κs, ˇ  „ m0 ´ V ptq m0 ´ V pλq ˇˇ . Gt “ E 1´λ ˇ 1´t Lemma 2 is used in the proof of Theorem 2 below, and Lemma 3 is needed to prove Theorem 3, whose proof follow the same approach as in proofs of Theorem 1 and 2 and is omitted. 15 A.3 Proof of Theorem 2 Erπ̂0 pλqs “ ě “ “ “ ˆ ˙ m ´ Rpλq 1 E m 1´λ ˙ ˆ 1 M0 ´ V pλq E m 1´λ " ˆ ˙* 1 M0 ´ V pλq ˇˇ M0 E E m 1´λ 1 ErM0 s m π0 . where the second to last equality follows from Lemma 2. A.4 ˝ Proof of Theorem 4 For k ě 1, consider a fixed λ candidate set Λ “ tλ1 , . . . , λk u that divides the interval (0, 1] into k ` 1 bins with boundaries at λ0 ” 0 ă λ1 ă . . . ă λk ă λk`1 ” 1 such that the ith bin is pλi´1 , λi s for i “ 1, . . . , k ` 1. For 1 ď i ď k, let Ni denote the number of p-values falling into the i-th bin, i.e., Ni “ Rpλi q ´ Rpλi´1 q “ #tpj : pj P pλi´1 , λi su. We will denote a single realization of a bin count by ni for 1 ď i ď k. For 1 ď i ď k, let qi denote the probability that a p-value falls into the i-th bin, that is qi “ P ppj P pλi´1 , λi sq. In general, r̈ applied to qi , Ni , or ni for 1 ď i ď k will denote the cumulative sum Ăi “ ři Nj “ N1 ` ... ` Ni . We require the following from 1 to i. For instance, N j“1 distributional results, as well as two lemmas. A.4.1 Distributional results Under the two-group model introduced in Section 2, it follows that the bin counts of pvalues have a multinomial distribution, that is pN1 , N2 , ..., Nk q „ MULTpm, q1 , q2 , ..., qk q. 16 Note that such a result follows immediately from the independence of the p-values and requires no further assumption on their distributions on r0, 1s. By the properties of the multinomial distribution we have pN1 , ..., Ni q „ MULTpm, q1 , ..., qi q for 1 ď i ď k and V pλ1 q | N1 „ BINpN1 , because by Bayes Law, P ppi null | pi ď λ1 q “ λ1 π0 q q1 P ppi ďλ1 |pi nullqP ppi nullq P ppi ďλ1 q “ λ1 π0 q1 , for any i “ 1, . . . , m. A.4.2 Lemmas for Theorem 4 Lemma 4. For 1 ď i ď k, p1 ´ λi qπ0 ď max P ppj null | pj ě λi q ď 1. 1ďiďk 1 ´ qri Proof. The bound follows from the probabilistic interpretation of each term of p1´λi qπ0 1´r qi . By Bayes Law, for every 1 ď i ď k, p1 ´ λi qπ0 P ppj ě λi | pj nullqP ppj nullq “ “ P ppj null | pj ě λi q ď 1. 1 ´ qri P ppj ě λi q Lemma 5. For 1 ď i ď k, ˇ „  1 ´ λi V pλ1 q ˇˇ E N1 “ n1 , ..., Ni “ ni P pN1 “ n1 , ..., Ni “ ni q m´n ri ` 1 λ1 ˇ $ ’ ’ if n1 “ 0 ’0 ’ & ď P pN1 “ n1 ´ 1q if n1 ą 0 and i “ 1 ’ ’ ’ ’ %P pN “ n ´ 1, N “ n , . . . , N “ n q if n ą 0 and 2 ď i ď k 1 1 2 2 i i 1 Proof. ˇ  1 ´ λi V pλ1 q ˇˇ N1 “ n1 , ..., Ni “ ni P pN1 “ n1 , ..., Ni “ ni q E m´n ri ` 1 λ1 ˇ “ ‰ p1 ´ λi q “ E V pλ1 q | N1 “ n1 P pN1 “ n1 , ..., Ni “ ni q. λ1 pm ´ n ri ` 1q „ 17 ˝ “ ‰ If n1 “ 0, E V pλ1 q | N1 “ n1 “ 0, so case 1 is shown. Because V pλ1 q | N1 “ n1 „ BINpn1 , λ1q1π0 q, if n1 ą 0 and 2 ď i ď k, the expectation equals to “ “ “ ď n1 λ1 π0 p1 ´ λi q P pN1 “ n1 , ..., Ni “ ni q λ1 pm ´ n ri ` 1q q1 m! n1 q n1 ¨ ¨ ¨ qini p1 ´ qri qm´rni p1 ´ λi qπ0 q1 pm ´ n r i ` 1q n1 !n2 ! ¨ ¨ ¨ ni !pm ´ n ri q! 1 p1 ´ λi qπ0 m! q n1 ´1 ¨ ¨ ¨ qini p1 ´ qri qm´rni `1 1 ´ qri pn1 ´ 1q!n2 ! ¨ ¨ ¨ ni !pm ´ n ri ` 1q! 1 p1 ´ λi qπ0 P pN1 “ n1 ´ 1, N2 “ n2 , . . . , Ni “ ni q 1 ´ qri P pN1 “ n1 ´ 1, N2 “ n2 , . . . , Ni “ ni q. The first step is because pN1 , ..., Ni q „ MULTpm, q1 , ..., qi q, and the last step is due to Lemma 4. The proof for the case of n1 ą 0 and i “ 1 follows similar steps and is omitted. A.4.3 ˝ Proof of the theorem By the martingale properties of V ptq t derived in Lemmas 3 and 4 of Storey et al. (2004) and since λ1 “ mintλ1 , ..., λk u, we have that t V tptq : 0 ď t ă λ1 u is a martingale with time running backwards with respect to the filtration Gt1 “ σp1tiPH0 u , 1tpi ďsu , t ď s ď ‰ “ V ptλ q λ1 , i “ 1, . . . , mq. Thus we have that E tλα | Gλ1 1 “ V λpλ11 q , and similar to Theorem α 3 of Storey et al. (2004), it is straightforward to show that „  ‹ V pλ1 q 1´λ z FDRptα pFDRλ qq ď E α . m ´ Rpλq ` 1 λ1 For k “ 1, λ always takes on the fixed value λ1 , and we present here a derivation of the upper bound which differs from that used in Storey et al. (2004), although their 18 argument can also be applied. ‹ z λ qq FDRptα pFDR ď “ „ E α  V pλ1 q 1 ´ λ1 m ´ Rpλ1 q ` 1 λ1  m ÿ „ 1 ´ λ1 V pλ1 q ˇˇ ˇ N1 “ n1 P pN1 “ n1 q E α m´n r1 ` 1 λ1 ˇ n “0 1 ď α m ÿ P pN1 “ n1 ´ 1q n1 “1 “ α m´1 ÿ P pN1 “ sq s“0 “ αp1 ´ P pN1 “ mqq “ αp1 ´ q1m q ď α. The third step is by Lemma 5, and we observe the crucial fact that the possible values of N1 are effectively shifted down by 1. For k ě 2, the proof is more technically involved but follows the same spirit. For any index set C “ tc1 , ..., cℓ u, let C p´1q “ tc1 ´ 1, ..., cℓ ´ 1uzt´1u be the index set shifting down by 1, and let C “ t0, . . . , muzC be the complement of C. Then for k ě 3, 19 ‹ ď “ “ z λ qq FDRptα pFDR „  1´λ V pλ1 q E α m ´ Rpλq ` 1 λ1 ˇ  „ k ÿ 1 ´ λi V pλ1 q ˇˇ λ “ λi P pλ “ λi q E α ri ` 1 λ1 ˇ m´N i“1 ˇ „  ÿ 1 ´ λ1 V pλ1 q ˇˇ E α N “ n 1 1 P pN1 “ n1 q m ´ n1 ` 1 λ1 ˇ n1 PC1 ˇ  „ ÿ ÿ 1 ´ λ2 V pλ1 q ˇˇ N “ n , N “ n E α ` 1 1 2 2 P pN1 “ n1 , N2 “ n2 q m´n r2 ` 1 λ1 ˇ n PC n1 PC 1 ` 2 2 k ÿ ÿ ÿ ¨¨¨ ni PCi i“3 n1 PC 1 n2 PC 2 ď „ α ` ÿ ÿ “ ÿ ÿ ¨¨¨ ` ÿ ni PCi P pN1 “ sq ` p´1q ÿ ÿ P pN1 “ n1 ´ 1, N2 “ n2 q ÿ  P pN1 “ n1 ´ 1, ..., Ni “ ni q p´1q sPC1 k ÿ ÿ n1 PC 1 zt0u n2 PC2 i“3 n1 PC 1 zt0u n2 PC 2 ÿ ˇ  1 ´ λi V pλ1 q ˇˇ N1 “ n1 , ..., Ni “ ni P pN1 “ n1 , ..., Ni “ ni q m´n ri ` 1 λ1 ˇ P pN1 “ n1 ´ 1q ` n1 PC1 zt0u k ÿ „ α „ E α sPC 1 ÿ ¨¨¨ i“3 sPC p´1q n2 PC 2 1 ď αp1 ´ P pN1 “ mqq “ αp1 ´ q1m q ď α. ÿ ni PCi ÿ P pN1 “ s, N2 “ n2 q n2 PC2  P pN1 “ s, ..., Ni “ ni q In the third step, we rewrite the condition λ “ λi equivalently in terms of the values of Ni ’s, i ď k. Because the sequential nature of the LRS procedure, the terms in the third step represent a sequential and complete partition of the probability space of the bin counts, pN1 , . . . , Nk q. The fourth step is by Lemma 5, and as a result, the indexes of N1 for all terms are effectively shifted down by 1. The third-to-last step is due to the observation that the probability of N1 “ m is never tallied in the terms of the summation. The proof when k “ 2 is identical to the k ě 3 case, removing terms where necessary from the expressions above. ˝ 20 A.5 A.5.1 Proof of Theorem 5 Definitions Definition 3 (LRS approximation to the modified BH00 procedure with grid Λ). For a finite candidate set Λ “ tλ1 , ..., λk u with k ě 3 and κ ď λ1 ă . . . ă λk ď τ , take λ0 ” 0 and define the bin counts Ni , i “ 1, ..., k as in Section 3.1. For any index 3 ď j ď k, let the set of non-empty bin indexes that are smaller than j be Lj “ t2 ď ℓ ď j ´ 1 : Nℓ ą 0u, and denote the bin index for the previous p-value as $ & maxtL u L ‰ H, j j ℓpjq “ % 0 L “ H. j Select λpSLP-LRSq “ λk‹ where k ‹ “ mintj : 3 ď j ď k and π̂0‹ pλj q ą π̂0‹ pλℓpjq q and Nj ą 0 and Rpλj q ´ Rpκq ě 2u if such k ‹ exists, and k ‹ “ k otherwise. This procedure is clearly LRS. In considering a given λj , it compares π̂0‹ evaluated at λj to π̂0‹ evaluated at a smaller candidate value from Λ. Unlike the right-boundary procedure in Liang and Nettleton (2012), we restrict the comparisons to the right boundaries of non-empty bins. The requirement that Rpλj q ´ Rpκq ě 2 is introduced so that j is always sufficiently large that there is a previous non-empty bin on the interval rκ, τ s with which to compare π0 -estimators. Definition 4. For a positive integer k ě 2, define the λ candidate set Λk “ tκu Y ppκ, τ q X t kℓ : ℓ “ 1, . . . , k ´ 1uq Y tτ u. Λk is defined such that the maximum distance between any two adjacent λ candidate values is at most 1{k, which goes to zero as k Ñ 8. Next, we define the set of p-value realizations that we want to exclude from our proof. We are interested in the LRS approximation to BH00 with grid Λk , which we will denote as the LRS-Λk procedure. Furthermore, we denote the λ selected by the LRS-Λk procedure as λk and the tuning parameter selected by the modified BH00 procedure as λ‹ ” λLSL . 21 Definition 5. For m ě 1, define λ‹ “ λ‹ pp1 , ..., pm q to be the tuning parameter selected on a realization of the two-group model with m p-values by the modified BH00 procedure described in Definition 1. Define the following conditions for i, j “ 1, ..., m with i ‰ j: p1q pi “ pj p2q π̂0‹ ppi q “ π̂0‹ ppj q p3q p4q ‹ z λ‹ ptq “ α lim FDR tÑp` i z ‹ ‹ ptq “ α lim FDR λ tÑp´ i p5q pi “ κ. pmq Let Ω0 “ tpp1 , ..., pm q P p0, 1qm : pp1 , ..., pm q satisfies one or more of p1q to p5q. pmq Next, we define a related set of p-value realizations, which is a superset of Ω0 but with probability zero (see Lemmas 6–8). Definition 6. For m ě 1, define the following conditions for ℓ, k P N, i, j “ 1, ..., m with i ‰ j: p11 q pi “ pj p21 q pi “ 1 ´ p31 q pi p41 q pi p51 q pi p61 q pi ℓ kp1 ´ pj q ˆ ˙´1 αk αk 1` “ ℓ ℓ ℓpj “1´ αk αp1 ´ τ qℓ “ k “ κ. Let B pmq “ tpp1 , ..., pm q P p0, 1qm : pp1 , ..., pm q satisfies one or more of p11 q to p61 qu. A.5.2 Outline of Proof of Theorem 5 In order to prove Theorem 5, we need to bound the FDR of the modified BH00 procedure below a constant α. We do this by showing it is the limit of a sequence of FDR’s of LRS procedures, in particular the LRS-Λk procedure, k ě 2. As described in the proof sketch in Section 3, we need to show the convergence of the 22 proportion of false discoveries below the rejection threshold produced by the procedure pointwise almost everywhere over the set of possible realizations of the two-group model. pmq Ω0 as defined above contains all the realizations for which pointwise convergence is either difficult or impossible to prove, and in Lemmas 6–8 we show it comprises a null set with respect to the measure induced by the two-group model, by showing it is contained in a null set. This is the reason for introducing B pmq above: it is much more convenient pmq to show it is a null set, and that it contains Ω0 . Next we need to show pointwise convergence for a fixed realization outside of B pmq . Lemmas 9–11 show that the tuning parameter λ which is selected from a fixed realization by the LRS-Λk procedure converges to the tuning parameter selected by the modified BH00 procedure. Lemma 12 extends this convergence to the π0 -estimator evaluated at these tuning parameters, and Lemmas 13 and 14 extend it finally to the proportion of false discoveries below the rejection threshold produced by these procedures, the expectation of which is the FDR of the procedure. Finally, we apply the bounded convergence theorem to extend this pointwise convergence to convergence in expectation to complete the proof of Theorem 5. A.5.3 Lemmas for Theorem 5 pmq Lemma 6. Ω0 Ď B pmq . pmq Proof. First suppose m ě 2. Suppose ω “ pp1 , ..., pm q P Ω0 . If ω satisfies (1), then ω will satisfy (11 ), and ω P B pmq . Similarly, if ω satisfies (5), then ω will satisfy (61 ), and ω P B pmq . If ω satisfies (2), then we must have for some i ‰ j, m ´ Rppj q ` 1 m ´ Rppi q ` 1 “ , mp1 ´ pi q mp1 ´ pj q or equivalently pi “ 1 ´ m ´ Rppj q ` 1 , pm ´ Rppi q ` 1qp1 ´ pj q 23 which implies condition p21 q is satisfied for positive integers ℓ “ m ´ Rppj q ` 1 and k “ m ´ Rppi q ` 1. Note that by Definition 1, λ‹ is selected from the finite set tp1 , ..., pm , τ u. If ω satisfies condition (3) for some i, and λ‹ “ pi , then we have α“ pi pm ´ Rppi q ` 1q , p1 ´ pi qpRppi q _ 1q or equivalently pi “ αpRppi q _ 1q m ´ Rppi q ` 1 ˆ ˙´1 αpRppi q _ 1q , 1` m ´ Rppi q ` 1 which implies condition (31 ) is satisfied for positive integers ℓ “ m ´ Rppi q ` 1 and k “ Rppi q _ 1. If ω satisfies condition (3) for some i, and λ‹ “ pj for some j ‰ i, then we have α“ pi pm ´ Rppj q ` 1q , p1 ´ pj qpRppi q _ 1q or equivalently pj “ 1 ´ pi pm ´ Rppj q ` 1q , αpRppi q _ 1q which implies condition (41 ) is satisfied for positive integers ℓ “ m ´ Rppi q ` 1 and k “ Rppi q _ 1. If ω satisfies condition (3) for some i, and λ‹ “ τ , then we have α“ pi pm ´ Rpτ q ` 1q , p1 ´ τ qppRppi q ´ 1q _ 1q or equivalently pi “ αp1 ´ τ qppRppi q ´ 1q _ 1q , pm ´ Rpτ q ` 1q which implies condition (51 ) is satisfied for positive integers k “ m ´ Rpτ q ` 1 and ℓ “ pRppi q ´ 1q _ 1. The proof for condition (4) is parallel to the above proof for condition (3) and is omitted. pmq So it follows that Ω0 Ď B pmq , as desired. The case for m “ 1 follows similarly, but only violations of conditions (3)–(5) need to be considered. ˝ Lemma 7. Suppose pp1 , ..., pm´1 q P pB pm´1q qC “ r0, 1sm´1zB pm´1q . Then Am “ tpm P p0, 1q : pp1 , ..., pm q P B pmq u is at most countable. 24 Proof. Suppose pp1 , ..., pm q “ ω P B pmq . If ω satisfies condition p11 q, then since pp1 , ..., pm´1 q P pB pm´1q qC , we must have pm P P “ tp1 , ..., pm´1 u. If ω satisfies condition p21 q, then we must have pm “ 1 ´ ℓ kp1´pj q for some k, ℓ P N, j “ 1, ..., m ´ 1, which implies pm P Π “ t1 ´ ℓ : k, ℓ P N, j “ 1, ..., m ´ 1u. kp1 ´ pj q If ω satisfies condition p31 q, then we must have pm “ αk ℓ p1 αk ´1 ℓ q ` for some k, ℓ P N, which implies pm P F1 “ t αk αk ´1 p1 ` q : k, ℓ P Nu. ℓ ℓ If ω satisfies condition p41 q then we must have either pm “ 1 ´ 1, ..., m ´ 1, or pj “ 1 ´ ℓpm αk ℓpj αk for some k, ℓ P N, j “ for some k, ℓ P N, j “ 1, ..., m ´ 1, which implies pm P F2 “ t1 ´ ℓpj : k, ℓ P N, j “ 1, ..., m ´ 1u αk or pm P F3 “ t αkp1 ´ pj q : k, ℓ P N, j “ 1, ..., m ´ 1u. ℓ Similarly, If ω satisfies condition p51 q, then we must have pm “ αkp1´τ q ℓ for some k, ℓ P N, which implies pm P F4 “ t αkp1 ´ τ q : k, ℓ P Nu. ℓ If ω satisfies condition (6’), then pm P tκu. Notice that P, Π, F1 , F2 , F3 , and F4 are all countable. Hence, Am Ď P Y Π Y F1 Y F2 Y F3 Y F4 Y tκu, and Am is at most countable. ˝ Lemma 8. Let P pmq denote the probability measure induced by the two-group model with m p-values. Then P pmq pB pmq q “ 0. Proof. We prove the result by induction on m. The base case m “ 1 is clear, since if there is only one p-value, only conditions p31 q, p51 q, and p61 q can be satisfied, and we 25 have B p1q “ r0, 1s X ˜# αk ℓ + " ¸ * ˆ ˙´1 αp1 ´ τ qℓ αk : k, ℓ P N Y : k, ℓ P N Y tκu , 1` ℓ k and clearly B p1q is countable, and therefore a null set with respect to P p1q . For the inductive step we note that the independence of the p-values makes the measure induced by the two-group model take on a product structure, that is P pm1 `m2 q “ P pm1 q ˆ P pm2 q . Thus, we have P pmq pB pmq q “ Er1B pmq s “ ż p0,1qm 1B pmq dP pmq “ ż p0,1qm´1 Partitioning p0, 1qm´1 into B pm´1q Y pB pm´1q qC , we get ż ż ż pmq pmq p1q pm´1q P pB q “ 1B pmq dP dP ` B pm´1q ż pB pm´1q qC p0,1q 1B pmq dP p1q dP pm´1q . p0,1q ż 1B pmq dP p1q dP pm´1q . p0,1q The outer integral in the first term is zero, since by induction B pm´1q is a null set with respect to P pm´1q , and the inner integral in the second term is zero for each fixed pp1 , ..., pm´1 q P pB pm´1q qC by Lemma 7. Hence the entire expression is zero, and by induction, the result holds. ˝ Lemma 9. Let ω “ pp1 , ..., pm q P pB pmq qC be a fixed realization of the two-group model. Then there exists K P N such that for all k ě K, each bin bounded by selection grid Λk contains at most one p-value. Proof. The lemma is vacuously true if m “ 1, so we may assume m ě 2. Since ω P pB pmq qC , by Lemma 6 we have that pi ‰ pj for all i, j “ 1, ..., m, i ‰ j. Thus we may define the quantity ǫp “ mintppiq ´ ppi´1q : 2 ď i ď mu ą 0. Let K be sufficiently large that 1 K ă ǫp , then it is straightforward to see that, for all k ě K, the bin width of Λk is at most 1{k ă ǫp , and there cannot be two p-values in the same bin. ˝ Lemma 10. Let ω “ pp1 , ..., pm q P pB pmq qC be a fixed realization of the two-group model. Suppose there are at least 2 p-values in the interval pκ, τ q. By Lemma 9, let 26 Kp P N be such that for all k ě Kp , each bin bounded by selection grid Λk contains at most one p-value. Let n1 and n2 be the ordered index of the smallest and largest p-value in the interval pκ, τ q, respectively, as in Definition 1. For i “ n1 , ..., n2 and k ě Kp , define λkpiq P Λk to be the grid value from Λk corresponding to the right boundary of the bin containing ppiq . Then there exists K ě Kp such that for all k ě K and i “ n1 , ..., n2 , the modified BH00 procedure selects ppiq as its tuning parameter if and only if the LRSΛk procedure selects λkpiq as its tuning parameter. Proof. Since ω P pB pmq qC , by Lemma 6 we have that π̂0‹ ppi q ‰ π̂0‹ ppj q for all i, j “ 1, ..., m, i ‰ j. Thus we may define the quantity γπ “ 1 mint|π̂0‹ pppiq q ´ π̂0‹ pppi´1q q| : 2 ď i ď mu ą 0. 2 For i “ n1 , ..., n2 , define the real function fi pxq “ m´i`1 mp1´xq . Each fi is a continuous function in x at ppiq P p0, 1q. For each i “ n1 , ..., n2 let ǫi ą 0 be sufficiently small that for all x with |x ´ ppiq | ă ǫi , ˇ ˇ ˇm ´ i ` 1 m ´ i ` 1 ˇˇ ă γπ , ´ |fi pxq ´ fi pppiq q| “ ˇˇ mp1 ´ xq mp1 ´ ppiq q ˇ then define ǫπ “ mintǫn1 , ..., ǫn2 u ą 0. Let K be sufficiently large that 1 K ă ǫπ , and that K ě Kp . Note that since they are right boundaries, ppi`1q ą λkpiq ě ppiq for all i “ n1 , ..., n2 , which says that we must have Rpλkpiq q “ Rpppiq q “ i. Also note that λkpiq P rppiq , ppiq ` ǫπ q, which implies that |λkpiq ´ ppiq | ă ǫπ . Combining these observations, we have π̂0‹ pλkpiq q “ m´i`1 mp1 ´ λkpiq q P pπ̂0‹ pppiq q ´ γπ , π̂0‹ pppiq q ` γπ q. The definition of γπ then implies that π0‹ pλkpiq q and π0‹ pppiq q are sufficiently close to each other that comparisons of the estimator evaluated at consecutive p-values will produce the same outcome as comparisons of the estimator evaluated at the right boundaries of the non-empty bins that contain these p-values. From this we conclude that for i “ m1 , ..., m2 , the modified BH00 procedure selects ppiq as its tuning parameter if and only if the LRS approximation procedure with grid Λk selects λkpiq , for all k ě K. 27 ˝ Recall that λk is the tuning parameter selected by the LRS-Λk procedure, and λ‹ is the tuning parameter selected by the modified BH00 procedure. Lemma 11. For any fixed realization of the two-group model ω “ pp1 , ..., pm q P pB pmq qC , λk Ñ λ‹ as k Ñ 8. Proof. If there are fewer than 2 p-values in the interval pκ, τ q, then both the LRS-Λk and the modified BH00 procedures will always return τ , and the convergence holds trivially. On the other hand, if there are at least 2 p-values in the interval pκ, τ q, by Lemma 10, there exists Kπ such that for all k ě Kπ and i “ n1 , ..., n2 , the modified BH00 procedure selects ppiq as its tuning parameter if and only if the LRS-Λk procedure selects λkpiq . For any ǫ ą 0, let K be sufficiently large that K ě Kπ and 1 K ă ǫ. Then for all k ě K, it follows that λk is the right boundary of the bin containing λ‹ and |λk ´λ‹ | ă 1 k ď Thus, λk Ñ λ‹ as k Ñ 8. Lemma 12. 1 K ă ǫ. ˝ For any fixed realization of the two-group model ω “ pp1 , ..., pm q P pB pmq qC , π̂0‹ pλk q Ñ π̂0‹ pλ‹ q as k Ñ 8. Proof. If there are fewer than 2 p-values in the interval pκ, τ q, λk “ λ‹ “ τ , and the convergence holds trivially. So we may assume there are at least 2 p-values in the interval pκ, τ q. Recall that π̂0‹ pλq “ m ´ Rpλq ` 1 . mp1 ´ λq Following Lemma 10 and the proof of Lemma 11, there exists K such that for all k ě K, λk is the right boundary of the bin containing λ‹ , and thus, Rpλk q “ Rpλ‹ q. Then the proof follows by noting that π̂0‹ pλq is a continuous function of λ and λk Ñ λ‹ as k Ñ 8 due to Lemma 11. ˝ ‹ ‹ z λ‹ to be the estimated FDR function specifying λ “ λ‹ , and FDR z λk to be Define FDR ‹ z ¨ pt´ q “ the estimated FDR function specifying λ “ λk . Define for both functions FDR 0 z ‹ ptq and FDR z ‹ pt` q “ lim ` FDR z ‹ ptq. Define n1 as the ordered index of limtÑt´ FDR ¨ ¨ 0 ¨ tÑt 0 0 the smallest p-value in the interval pκ, τ q as in Definition 1. Then we have the following lemma. 28 Lemma 13. For any fixed realization of the two-group model ω “ pp1 , ..., pm q P pB pmq qC with at least 1 p-value in the interval p0, κq and at least 2 p-values in the interval pκ, τ q, z ‹ ‹ pp˘ q ă α if there exists K P N such that for all k ě K, and i “ 1, ..., n1 ´ 1, FDR λ piq ‹ z λk pp˘ q ă α. and only if FDR piq Proof. Since ω P pB pmq qC , by Lemma 6, we may define the quantities ‹ and z ‹ pp´ q ´ α| : i “ 1, ..., n1 ´ 1u ą 0 γ´ “ mint|FDR λ piq ‹ z ‹ pp` q ´ α| : i “ 1, ..., n1 ´ 1u ą 0. γ` “ mint|FDR λ piq Define γF “ mintγ´ , γ` u. For each i “ 1, ..., n1 ´ 1, define the continuous functions gi pxq “ mppiq x i and hi pxq “ mppiq x. pi ´ 1q _ 1 By Lemma 12 and continuity of gi and hi , there exists Ki such that for all k ě Ki , |gi pπ̂0‹ pλk qq ´ gi pπ̂0‹ pλ‹ qq| ă γF , and |hi pπ̂0‹ pλk qq ´ hi pπ̂0‹ pλ‹ qq| ă γF . Let K “ maxtK1 , ..., Kn1 ´1 u, then it follows that K is as required. Lemma 14. ˝ For any fixed realization of the two-group model ω “ pp1 , ..., pm q P pB pmq qC , there exists K P N such that for all k ě K, ‹ ‹ z k qq z ‹ qq V ptα pFDR V ptα pFDR λ λ “ . ‹ ‹ z z Rptα pFDRλk qq _ 1 Rptα pFDRλ‹ qq _ 1 Proof. If there are no p-values in the interval p0, κq, then V and R will always count 0 p-values, regardless of the selection of λ, and the result holds trivially for K “ 1. Thus we may assume there is at least 1 p-value in the interval p0, κq. 29 If there are fewer than 2 p-values in the interval pκ, τ q, then both the LRS-Λk and the modified BH00 procedures will always return τ , and the result holds trivially for K “ 1. Thus we may assume there are at least 2 p-values in the interval pκ, τ q. Define n1 as the ordered index of the smallest p-value in the interval pκ, τ q as in Definition 1. By Lemma 13, there exists K such that for all k ě K and i “ 1, ..., n1 ´ 1, ‹ ‹ z ‹ pp˘ q ă α if and only if FDR z k pp˘ q ă α. Intuitively, for k ě K, Lemma 13 FDR λ λ piq piq ‹ ‹ z λk q and tα pFDR z λ‹ q lead to the same set of rejections implies that the thresholds tα pFDR and furthermore the same false discovery proportion. More specifically, consider k ě K. Define ‹ ‹ ‹ ‹ z λ‹ pp` q ă α ă FDR z λ‹ pp´ qu I‹ “ ti : 1 ď i ď n1 ´ 1, FDR pi´1q piq and z λk pp` q ă α ă FDR z λk pp´ qu Ik “ ti : 1 ď i ď n1 ´ 1, FDR pi´1q piq where we take p` p0q ” 0. By the selection of k ě K, it follows that I‹ “ Ik . ‹ ‹ z λk q and tα pFDR z λ‹ q are within the If I‹ “ Ik “ H, then it follows that both tα pFDR interval pppn1 ´1q , κs, and we reject the smallest n1 ´ 1 p-values using both procedures. ‹ ‹ z k q and tα pFDR z ‹ q are within the If I‹ “ Ik ‰ H, then it follows that both tα pFDR λ λ interval pppim ´1q , ppim q s, where im “ maxti : i P I‹ u “ maxti : i P Ik u. This implies both R and V count the same number of total and null p-values respectively at either threshold. In summary, in both cases, we have for all k ě K. A.5.4 z ‹ ‹ qq z ‹ k qq V ptα pFDR V ptα pFDR λ λ “ ‹ ‹ z z Rptα pFDRλk qq _ 1 Rptα pFDRλ‹ qq _ 1 ˝ Proof of the theorem ‹ z λk as in Lemma 13. Since the tuning parameter for this estimate is selected Define FDR z ‹ k qq ď α for all k. using an LRS rule, by Theorem 4, FDRptα pFDR λ Notice that for all k and for any realization ω P p0, 1qm of the two-group model, we have ‹ z λk qq V ptα pFDR P r0, 1s, ‹ z k qq _ 1 Rptα pFDR λ 30 such that the sequence of random variables " z ‹ k qq *8 V ptα pFDR λ ‹ z Rptα pFDRλk qq _ 1 k“1 is uniformly bounded. By Lemma 14, this sequence converges pointwise on pB pmq qC , and hence pointwise P pmq -a.e. by Lemma 8, to the random variable { ‹ ‹ qq V ptα pFDR λ { ‹ ‹ qq_1 . Rptα pFDR λ Thus, by bounded convergence theorem, we have ‹ z k qq lim FDRptα pFDR λ kÑ8 z k qq  V ptα pFDR λ ‹ kÑ8 z Rptα pFDRλk qq _ 1 ‹ „ z λk qq  V ptα pFDR “ E lim ‹ kÑ8 Rpt pFDR z k qq _ 1 α λ „ z ‹ ‹ qq  V ptα pFDR λ “ E ‹ z λ‹ qq _ 1 Rptα pFDR ‹ z ‹ qq. “ FDRptα pFDR λ “ lim E „ ‹ ‹ z λ‹ qq ď α, as desired. Hence by properties of real sequences, we must have FDRptα pFDR ˝ A.6 LRS Approximation to the Modified k-quantile Procedure Definition 7 (LRS approximation to the modified k-quantile procedure with grid Λ). For a finite candidate set Λ “ tλ1 , ..., λℓ u Ď rκ, τ s, define Ni , i “ 1, ..., ℓ as in Section 3.1. Define λQ-k-LRS “ λk‹ , where k ‹ “ mint1 ď j ď l : Rpλj q ě ku if such k ‹ exists, and k ‹ “ ℓ otherwise. Theorem 6 follows by a similar argument to the proof of Theorem 5, applying this procedure to the sequence of finite grids tΛk u8 k“1 given in Definition 4. 31 References Y. Benjamini and Y. Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B, 57(1):289–300, 1995. Y. Benjamini and Y. Hochberg. On the adaptive control of the false discovery rate in multiple testing with independent statistics. Journal of Educational and Behavioral Statistics, 25(1):60–83, 2000. Y. Benjamini and D. Yekutieli. The control of the false discovery rate in multiple testing under dependency. Annals of statistics, 29(4):1165–1188, 2001. Y. Benjamini, A.M. Krieger, and D. Yekutieli. Adaptive linear step-up procedures that control the false discovery rate. Biometrika, 93(3):491–507, 2006. Yoav Benjamini. Discovering the false discovery rate. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(4):405–416, 2010. G. Blanchard and E. Roquain. Adaptive false discovery rate control under independence and dependence. Journal of Machine Learning Research, 10:2837–2871, 2009. J Doob. Stochastic Processes. New York: Wiley, 1953. B. Efron, R. Tibshirani, J.D. Storey, and V. Tusher. Empirical Bayes analysis of a microarray experiment. Journal of the American Statistical Association, 96(456): 1151–1160, 2001. C. Genovese and L. Wasserman. A stochastic process approach to false discovery control. Annals of Statistics, 32(3):1035–1061, 2004. Yosef Hochberg and Yoav Benjamini. More powerful procedures for multiple significance testing. Statistics in medicine, 9(7):811–818, 1990. S Karlin and H Taylor. A First Course in Stochastic Processes. New York: Academic Press, 1975. K. Liang and D. Nettleton. Adaptive and dynamic adaptive procedures for false discovery rate control and estimation. Journal of the Royal Statistical Society, Series B, 74(1):163–182, 2012. 32 T. Schweder and E. Spjøtvoll. Plots of p-values to evaluate many tests simultaneously. Biometrika, 69(3):493–502, 1982. J.D. Storey. A direct approach to false discovery rates. Journal of the Royal Statistical Society, Series B, 64(3):479–498, 2002. J.D. Storey, J.E. Taylor, and D. Siegmund. Strong control, conservative point estimation and simultaneous conservative consistency of false discovery rates: a unified approach. Journal of the Royal Statistical Society, Series B, 66(1):187–205, 2004. 33
10math.ST
International Journal of Computational Science 1992-6669 © Global Information Publisher 20xx, Vol. x, No. x, xx-xx DNA Sequencing via Quantum Mechanics and Machine Learning Henry Yuen1, Fuyuki Shimojo1,2, Kevin J. Zhang1,3, Ken-ichi Nomura1, Rajiv K. Kalia1, Aiichiro Nakano1,1, and Priya Vashishta1 1 Collaboratory for Advanced Computing and Simulations, Department of Computer Science, Department of Physics & Astronomy, Department of Chemical Engineering & Materials Science, University of Southern California, Los Angeles, CA 90089-0242, USA (hyuen, knomura, rkalia, anakano, priyav)@usc.edu 2 Department of Physics, Kumamoto University, Kumamoto 860-8555, Japan [email protected] 3 Harvard University, Cambridge, MA 02138 [email protected] Abstract. Rapid sequencing of individual human genome is prerequisite to genomic medicine, where diseases will be prevented by preemptive cures. Quantum-mechanical tunneling through single-stranded DNA in a solid-state nanopore has been proposed for rapid DNA sequencing, but unfortunately the tunneling current alone cannot distinguish the four nucleotides due to large fluctuations in molecular conformation and solvent. Here, we propose a machine-learning approach applied to the tunneling current-voltage (I-V) characteristic for efficient discrimination between the four nucleotides. We first combine principal component analysis (PCA) and fuzzy c-means (FCM) clustering to learn the “fingerprints” of the electronic density-of-states (DOS) of the four nucleotides, which can be derived from the I-V data. We then apply the hidden Markov model and the Viterbi algorithm to sequence a time series of DOS data (i.e., to solve the sequencing problem). Numerical experiments show that the PCA-FCM approach can classify unlabeled DOS data with 91% accuracy. Furthermore, the classification is found to be robust against moderate levels of noise, i.e., 70% accuracy is retained with a signal-to-noise ratio of −26 dB. The PCA-FCM-Viterbi approach provides a 4fold increase in accuracy for the sequencing problem compared with PCA alone. In conjunction with recent developments in nanotechnology, this machine-learning method may pave the way to the much-awaited rapid, low-cost genome sequencer. 1 Corresponding Author. Fax: +1 (213) 821-2664, Email: [email protected]. 1 Keywords: DNA sequencing, quantum tunneling, current-voltage characteristic, principal component analysis, fuzzy c-means clustering, hidden Markov model, Viterbi algorithm. 1 Introduction DNA sequencing determines the order of four nucleotide bases—adenine (A), guanine (G), cytosine (C), and thymine (T)—that constitute a DNA molecule. State-of-the-art methods for DNA sequencing, while much improved from the technology used to first sequence the human genome [1, 2], are still costly and time consuming. Today individuals can get their full genome sequenced for about 50,000 USD [3]. Lower-cost, rapid sequencing of individual DNA would enable genomic medicine, where diseases are prevented by preemptive cures. Consequently, the quest for the so-called “ultra-low cost sequencer” (ULCS) is motivating much research into alternative ways of genome sequencing. One of the active avenues toward ULCS is nanopore sequencing, which infers the base sequence by probing the changes in certain physical signals as the DNA strand threads through a ~2 nm nanopore [4]. Deamer and Akeson survey prospects for different approaches to nanopore sequencing in Ref. 5. While traditional sequencing methods usually require massive replication of the DNA, a nanopore sequencer in principle requires only a single strand. Possibility of nanopore DNA sequencing has been studied by electrically driving a DNA molecule in an electrolyte solution through a biological nanopore and then measuring the changes in ionic current through the nanopore induced by blockaded ions [6, 7]. For example, Ashkenasy et al. have investigated single-nucleotide identification capabilities of α-hemolysin nanopore sequencers in Ref. 8. Other groups have tried alternative approaches such as using exonuclease enzymes to cleave individual nucleotides, which are fed to a detection system in order [9]. However, the poor signal-to-noise ratio and the stringent environmental conditions of these schemes have motivated other groups to explore solid-state alternatives involving silicon-based materials [10, 11]. Advantages of using solid-state nanopores include a wider range of operable environmental conditions and the ability to embed sensors directly onto the pore [12]. In spite of the potential of solid-state nanopores for DNA sequencing, distinguishing between the four bases (A, G, C, and T) based on the ionic current through the nanopores remains difficult. This has led several groups to instead measure the transverse electronic tunneling current between electrodes attached to the nanopore. Jauregui et al. have performed first-principles calculations to indicate the feasibility of transverse current-based sequencing [13], whereas Gracheva et al. have suggested the use of MOS capacitor membranes for constructing similar DNA sequencers [14]. Lagerqvist et al. have extended this idea further by proposing to analyze the distribution of transverse current values for each nucleotide as the DNA molecule translocates through the nanopore [15]. This can be accomplished by slowing the speed of DNA translocation, allowing the device to take multiple measurements of the same nucleotide. Though the distributions reveal 2 more about the structure of the passing nucleotide, the distributions of the four nucleotides still show high degrees of overlap and thus the sequencing process is prone to large errors. The main contribution of this paper is an algorithm, which applies machine-learning techniques to quantum-mechanical tunneling current, in order to sequence single-stranded DNA. Our approach mitigates the problem of indistinguishability of the DNA bases as well as that of noise. Here, we distinguish the nucleotides using their electronic-structure information in the form of the electronic density of states (DOS), which can be acquired by a nanopore device by capturing electronic tunneling current values flowing across the nanopore diameter over a range of voltages. The DOS can then be computed from the derivative of the resulting current-voltage (I-V) curve. In fact, several groups have measured the DOS of DNA using scanning tunneling microscopy [16-18], and one group has conducted theoretical investigations of nanopore-based DOS measurements of DNA molecules [19]. Though the DOS provides the “fingerprints” of the four nucleotides, the I-V characteristics still suffer from large noises due to fluctuations in molecular conformation and solvent (i.e., water molecules and ions). In this paper, we introduce a machine-learning approach to address this problem. We first use principal component analysis (PCA) [20] to algorithmically learn the distinguishing features between the DOS between the four bases, and use these features to predict the identities of an unknown DOS. PCA allows the projection of DOS onto a smalldimensional feature space, in which the four DNA bases form highly disjoint clusters. Then, a given DOS is classified relatively easily [21] by employing the fuzzy c-means (FCM) clustering approach [22]. Finally, we take advantage of the similarity of the DNA sequencing problem to speech recognition and employ the hidden Markov model [23] and the Viterbi algorithm [24] to determine the most likely base sequence from noisy observation. Our numerical experiments demonstrate that the accuracy of nanopore sequencing is significantly improved by the PCA-FCMViterbi approach. This paper is organized as follows: Section 2 presents the PCA-FCM-Viterbi algorithm. Performance of the algorithm is evaluated in section 3, and conclusions are drawn in section 4. 2 Method In this section, we first formulate the DNA sequencing problem in the context of tunneling current-based nanopore sequencing. We then present our PCA-FCM-Viterbi approach to the sequencing problem. 2.1 Statement of the Problem Let (s1,...,sn) ∈ {A,T,G,C}n be a sequence of n bases in single-stranded DNA (ssDNA), where s1 is the base that is about to enter the nanopore sequencer at time t = 0 (see Fig. 1). The ssDNA strand 3 will translocate through the nanopore between the electrodes, and at each time t (we measure the time in unit of a time discretization unit, Δt), the device measures the transverse current (labeled I in the figure) over a range of voltage V, thereby generating an I-V plot at each time t, denoted as the function It(V). We then compute dIt/dV, which is proportional to the electronic density of states (DOS) of the group of atoms near the electrodes at time t [16-18]. Let Dt(E) be the DOS as a function of the electron energy E at time t. For all time steps 0 t T during the measurement, we discretize Dt(E) by creating a vector , with . Namely, the continuous function Dt(E) is transformed into a discrete histogram in the energy range with B bins of width (see Fig. 1). Our measurement data is thus a time-series of B-dimensional vectors, (D(t) | 0 ≤ t ≤ T). We would like to point out that generally, n << T, to provide a sufficiently large number of measurements per nucleotides. Fig. 1. Schematic of traversal tunneling current-based sequencing of a single-stranded DNA translocating through a solid-state nanopore, where V is the applied voltage, and the arrow next to the ssDNA indicates the direction of translocation. At each time step t, the device measures the induced transverse current I (the horizontal open arrow) across the electrodes (labeled + and −) as a function of V, which is varied. We then compute dIt/dV, which is proportional to the electronic density of states of the group of atoms near the 4 electrodes at time t (denoted Dt(E) in the figure). Finally, the continuous DOS function Dt(E) is discretized into a B-dimensional vector D(t), and (D(t) | 0 ≤ t ≤ T) forms our time series. The figure shows the positions of an ssDNA molecule at two different times, t = 0 and i, and the double-shaded arrows demonstrate the transformation of data—from physical measurement of the I-V relation to the continuous DOS function Dt(E) to the discretized DOS histogram D(t), the last of which forms an input to our machine-learning algorithm. The algorithm will analyze the time series (D(t) | 0 ≤ t ≤ T) to infer the original sequence of bases. The problem is then stated as follows: Given a time sequence of DOS histograms, (D(t) | 0 ≤ t ≤ T), determine the original sequence of bases (s1,...,sn). In this paper, we break this problem into three sub-problems: 1. Learning the identifying features of the nucleotide density of states. First, we algorithmically extract the salient features of the DOS histograms from a training dataset. For this task, we use principal component analysis (PCA), which is a method of statistical data analysis that nonparametrically performs dimension reduction on complex datasets [22]. Applying PCA to the training set will yield a set of principal component (PC) vectors that serve as a basis for representing the original dataset. The PCs, however, are ordered in such a fashion that the first few basis vectors “explain” the variance in the data. That is, the projection of the original dataset on the first few basis vectors has the maximum amount of variance. 2. Classifying an unlabeled density of states. With the PC vectors, we now attempt to compute the correct label for a given DOS histogram. We use the membership formula from the fuzzy cmeans algorithm to give probabilities that the DOS histogram is a measurement of a nucleotide of type A, T, C, or G. 3. Sequencing a time series of density of states. A nanopore sequencing device provides a time series, (D(t) | 0 ≤ t ≤ T), of DOS, but each D(t) does not necessarily specify a single nucleotide. In fact, for many t, D(t) is a mixture of DOS’s of consecutive nucleotides. Therefore, simply running the classification algorithm on each D(t) will not work—the identity of D(t) might depend on the identities of D(u < t) and D(v > t). We propose to model the sequence (D(t) | 0 ≤ t ≤ T) as the output of a hidden Markov model, and use the Viterbi algorithm to determine the most likely sequence of nucleotides underlying D(t). 2.2 Learning the Salient Features of Density of States We use principal component analysis (PCA) to extract principal components (PCs) from a training set of 4m histograms (m histograms per DNA base). We refer the reader to [21], which provides an excellent tutorial for the PCA algorithm. The 4m histograms are organized into a 4m × B matrix H, where the matrix element Hij corresponds to the jth bin of the ith histogram (B is the dimension of the DOS vector defined in section 2.1). PCA is then performed in the following manner: From H construct a new matrix , where the column j of M is with the mean of column j of H. Thus, each column of X has zero mean. Perform singular value 5 decomposition on the matrix X = UΣVT, with the singular values of X in descending order along the diagonal of Σ, where V is a N × N unitary matrix such that the columns of V form an orthonormal basis for X. Let p1, p2, ..., pB be the columns of V. According to the theory of PCA, p1 is the axis along which the variance of X is maximized, p2 is an axis orthogonal to p1 along which the variance of X is maximized in the subspace orthogonal to p1, and so on. We call p1, p2, ..., pB the PCs of X. Let d be one of the 4m histograms. We project d onto p1 and p2, and then over all d, we collect the coordinate pairs (dTp1, dTp2) to form the projection space of the dataset, where dT denotes the transpose of vector d. The projections of the m histograms of type A, T, C, or G form a cluster of points with centers cA, cT, cC and cG, respectively. 2.3 Classifying Density of States To classify an unknown DOS vector d, we project it on p1 and p2 and compare the coordinate pair (dTp1, dTp2) with the clusters found with the training set. To do so, we construct a set of membership functions, derived from the fuzzy c-means (FCM) clustering algorithm [22]: , (1) where X is one of , cx is the center of the cluster corresponding to nucleotide X, and p is the m×2 matrix whose columns are p1 and p2. pX takes a 1×m input histogram d, and returns a real number in that represents the degree of membership that histogram d has in cluster X. We can interpret this as the probability that histogram d comes from a nucleotide of type X. 2.4 Sequencing a Time Series of Density of States As mentioned earlier, sequencing a time series of DOS’s requires not only identifying a DOS vector D(t) alone, but possibly D(t) in conjunction with nearby D(u < t) or D(v > t). We make the following simplifying assumptions: 1. The detection range of the electrodes is not much larger than 2-3 nucleotides (6 to 9 Å); then it is possible to have the device measure the local DOS of a single nucleotide. That is, if at time t an A nucleotide on the DNA strand were directly centered between the electrodes, then D(t) would be nearly identical to the DOS of an isolated A nucleotide. 2. The translocation speed of the DNA strand is uniform. 3. The translocation speed of the DNA strand is high enough such that after 2-3 time steps, the contribution of the nucleotide measured at time t to the DOS measurement at time t + 2 (or t + 3) is negligible. 6 These assumptions enforce the “locality” of measurement: The input to our algorithm is a time series (D(t) | 0 ≤ t ≤ T) such that the identity of D(ti) depends at most on (D(ti + k) | −2 ≤ k ≤ 2). In addition, our assumptions imply that if D(ti) is a pure DOS of a nucleotide that is directly being probed, then at most two consecutive DOS’s (i.e. D(ti + 1) and D(ti + 2)) will be mixtures of DOS’s of consecutive bases, before the next DOS (D(ti + 3)) will again be a pure measurement of a nucleotide. We compare two approaches to the time-series sequencing problem. First, we attempt a naive approach to sequence D(t) by simply computing pX(D(t)) for each X in {A, T, C, G}, at each t, and identify the measurement D(t) with the X such that where ρ is a probability threshold greater than, e.g., 0.5. If there is no such X, then we take this to mean that D(t) corresponds to a mixed DOS of more than one nucleotides, and we simply discard this measurement. We take the sequence of decoded symbols that are left as the estimated sequence of bases. The following subsections describe the second approach based on the hidden Markov model and the Viterbi algorithm. 2.4.1 Hidden Markov Model In the second approach, we model the process of measurement generation with the hidden Markov model (HMM) formalism, in which we use the Viterbi algorithm to calculate the most likely sequence of nucleotides that generated the given sequence of observations. HMMs models sequential, stochastic processes where at each time t the process is in a particular state s, and each state generates an observation symbol. However, because the output of the process is usually corrupted by noise, the states are treated as hidden. As an example, HMMs are frequently used in the domain of speech recognition. The underlying hidden states are the actual word symbols that the speaker is uttering, but the only accessible information in the output observation, which is a noisy, continuous speech signal. Furthermore, probabilities are specified for state transitions (e.g., state A has a 1/3 probability of transitioning to state B, and a 2/3 probability of transitioning to itself) and observation emissions (e.g., state A has a 1/2 probability of emitting observation X and a 1/2 probability of emitting observation Y). A critical assumption of processes modeled with HMMs is that each state only depends on the state before it, and not on any earlier states. This assumption—called the Markov property—is necessary for the operation of the Viterbi algorithm. Formally, a HMM is defined as a 5-tuple, (S, O, T, Q, I): S is a finite set of (hidden) states that the process could be in; O is the set of observables that the process can emit (of which there could be infinitely many—the observables may come from a continuous space); T: S×S → is a map, which gives the probability T(s1, s2) that the process in state s1 will transition to state s2; Q: S×O → is a map that gives the probability Q(s, o) that the process in state s will emit observation o; and I: S → is a map I(s) that gives the probability that the process will start in a state s. 7 In our setting, we treat the DNA strand as a process that is changing from state to state as it is translocating through the nanopore. The set of states S correspond to the current section of the DNA molecule that the nanopore sequencer is measuring, which might be A, T, C, or G (if the nanopore sequencer is measuring a DNA base), or the non-base E (if the nanopore sequencer is measuring the section of the molecule that is in between two nucleotides). The set of observations consists of the space of DOS histograms—essentially a B-dimensional vector space over the real numbers, where B is the number of bins in our histograms. Furthermore, the locality assumptions above justify the tenability of the Markov property in our context. The probability maps T, Q, and I can be set in a number of ways. The first way is to define them manually according to one’s understanding of the underlying process. The second way is to train the HMM on pre-labeled training data (presumably from experimentation) via an expectationmaximization (EM) algorithm (such as the Baum-Welch algorithm) [25, 26]. EM algorithms are used to estimate the parameters T, Q, and I. In our setting, however, we can tailor the HMM to reflect our knowledge of the observation generation process. 2.4.2 Viterbi Algorithm Given an observation sequence and the particular HMM defined above, we utilize the Viterbi algorithm to discover the most likely sequence of bases to have produced the observation sequence. Below, we briefly summarize the Viterbi algorithm [23]. The Viterbi algorithm uses dynamic programming to efficiently compute the most likely sequence of states to have generated the sequence of observations up to time t. Let the given observation sequence be (D(t) | 1 ≤ t ≤ T). We want to find the sequence of states (where qi can be any of is maximized, where define the quantity ) such that the conditional probability (4) represents the parameters of the HMM described above. To do so, we first , i.e., (5) represents the highest probability of any sequence of states which ends in state to have given the sequence of observations up to time t. Then by induction, we find that , (6) where T and E are defined as above. We also use an auxiliary variable that keeps track of the state that maximized . We can now specify the complete dynamic program: 1. Initialization 8 2. Recursion 3. Termination 4. State sequence backtracking: Then, the final state sequence is given by with probability P*. From this, we discard the qt*’s that equal E to obtain the most likely nucleotide sequence . 3 Results and Discussion To quantitatively evaluate the effectiveness of the proposed sequencing approach, we use simulation data of DNA, for which the ground truth is known. 3.1 Simulation Method We use molecular dynamics (MD) simulations [27] to study the dynamics of DNA molecules in water with counter ions. For selected atomic configurations from the MD simulation trajectory, the electronic density of states are calculated quantum mechanically based on the density functional theory (DFT) [27-29]. Our dataset is generated from simulations of poly(X) molecules composed of two X bases, where X is one of (see Fig. 2). All MD simulations are done with the AMBER software [30]. Each simulation begins with energy minimization followed by gradual heating to a temperature of 300 K at atmospheric pressure. Subsequently, each simulation runs for 2×106 steps with a time discretization unit of 1 femtosecond, from which 2×103 atomic configurations (or frames) of 1 picosecond apart are extracted as our working dataset. For each of the 4 systems, 10 9 equally spaced frames are extracted from the last 100 picoseconds, for a total of 40 frames. For each system, we treat these 10 frames as 10 different configurations of the same molecule, in order to imitate the variability in the poly(X) molecular structure and the noise of an actual DNA nanopore sequencer. Fig. 2. Dimer ssDNA strand consisting of two adenosine molecules, surrounded by water molecules. Next, we perform DFT calculations [31] to obtain the density of states for each of the 40 configurations. The electronic states are calculated using the projector augmented wave (PAW) method [32], and the generalized gradient approximation (GGA) [33] is used for the exchangecorrelation energy. The plane-wave cut-off energies are 30 and 250 Ry for the electronic pseudowave functions and the pseudocharge density, respectively. The energy functional is minimized using an iterative scheme [34]. The Gamma point is used for the Brillouin-zone sampling. Projector functions are generated for the 2s and 2p states of C, N and O, the 3s and 3p states of P, the 1s states of H, and the 2p, 3s, and 3d states of Na. The other electrons in the lowerenergy electronic states of each atom are treated with the frozen-core approximation [35]. Figure 3 shows the total DOS’s of the systems involving DNA and water. The total DOS largely reflects the electronic structure of surrounding water molecules, and accordingly those corresponding to different DNA bases are not easily distinguishable from each other. The total DOS consists of three peaks at about −3, −9 and −22 eV, which mostly come from the lone-pair 2p state of O, the O-H bonding state, and the s state of O, respectively. The shoulder at ~ −6 eV originates from some sp hybridization around O. In calculating the electronic structure of DNA, the contribution of water molecules to the DOS is then removed by projecting the DOS on to the subspace spanned by the pseudoatomic orbitals belonging to the DNA [13]. As shown in Fig. 4, we successfully extract the DOS associated with each DNA molecule, which represents recognizable features of the electronic state of DNA. 10 Fig. 3. Total electronic density of states of the systems with dimer ssDNA strand and water. Fig. 4. Electronic density of states of dimer ssDNA strand. To generate DOS histograms, the Kohn-Sham energy eigenvalues of the atomic configurations are partitioned into B = 30 bins that equally divide the range = −30 eV, 0 eV . We treat the DOS histograms as B dimensional vectors, where the ith element of the vector corresponds 11 to the ith bin of the histogram. We generated a total of 40 histograms, 10 per each DNA base, out of which we use 4m = 24 histograms as our training set, with m = 6 per each DNA base. To emulate the DOS time series of a translocating ssDNA strand, we use a simple interpolation scheme: Suppose that our true sequence of bases is , where each of the . For each base si in the sequence, the sequencer produces between 1 and 3 observations (DOS histograms), but only one of them corresponds to a direct measurement of the base si. We call these direct measurements “true” DOS histograms, and the others correspond to some mixed measurement of bases. The DOS histogram for the mixed measurements is computed as linear interpolations between the two true histograms corresponding to si and si+1, respectively. Let di = and di+1 = be these histograms, where aj and bj are the values of the jth bin of the ith and (i+1)th histogram, respectively. Define τ(j, p) = (1−p)aj + pbj. If the model chooses to generate 3 observations for si, for instance, then the first interpolated histogram (after the true histogram) would be , and the second interpolated histogram would be . Similarly, if the model choose to generate 2 observations for si, then the interpolated histogram would be , which is intuitively the average of the histograms di and di+1. To simulate the presence of noise, a small amount of Gaussian noise is added to each bin. Here, the noise added to di is drawn from the normal distribution, N(0,σ), with zero mean and standard deviation σ = (Var(ai)/L)1/2, where di = , Var(ai) is the variance of ai, and L is some large parameter such as 50. We call the resulting series of observations for the base sequence D(t), for 1 ≤ t ≤ T, where T ≥ n. 3.2 Identifying Single Histograms We process our sample dataset (described as H in section 2) through the PCA algorithm. Figure 5 shows the variance of the projection of H onto the principal components pi, i = 1, 2, ..., B. We observe that the first two principal components (indicated by the arrows in Fig. 5) capture the most amount of variance; from the perspective of the rest of the principal components (i > 2), H displays little variation. Intuitively, this indicates that the rest of the PCs describe the noise present in the system. The first two principal components thus “explain” the vast majority of the variance in the data, and accordingly the dimension of the dataset can be reduced to 2 while preserving its underlying structure. Figure 6 shows the projection space of H, i.e., the projection of DOS vector d onto the first two principal components. Projection on the first principal component appears to be sufficient to discriminate T and G into distinct clusters, while the second PC is needed to distinguish between A and C. We find that the maximization of variance of H along the first two PCs corresponds closely to the separation of the histograms according to their nucleotide type. Note that the PCA algorithm is essentially blind to the identities of the histograms, i.e., it “discovered” the separation algorithmically. 12 Fig. 5. The variance of the dataset H with respect to the principal components (PCs), i.e. Var(Hpi) is plotted against i, for i = 1, 2, ..., B. The variances of the first two PCs are indicated by the arrows; much of the variation in the data occurs along the axes p1 and p2, while the rest of the PCs describe very little of it. Fig. 6. The projection of H onto the first two principal components, called the projection space. The nucleotide dataset has been partitioned into disjoint clusters by type (indicated by the circles), indicating that the two principal components have captured the salient features of the density of states histograms. With any statistical modeling or learning procedure, there is the danger of overfitting, where the features learned do not necessarily describe the underlying patterns and structure of the data, but rather erroneously describe the noise [36]. Thus, the statistic model may learn the training data very well, but have poor predictive performance with new data. We test the results of PCA for its predictive performance in two phases: 1) we present a set of unlabeled histogram samples, and observe the membership probabilities computed for each sample; and then 2) analyze the stability of the clusters in the presence of noise. 13 We test the results of PCA on the training set by computing pA, pT, pC and pG on 12 unlabelled samples (3 for each A, T, C and G). Table 1 shows the results. We identify each histogram d with X such that pX(d) > 0.5. Here, 11 out of 12 histograms are correctly identified (91% accuracy), indicating that the features learned by PCA can also classify samples beyond the initial training set. Table 1. The membership probabilities for each of the unknown, sample nucleotide data, against those of randomly generated input vectors. The probabilities greater than 0.5 are bolded. Base A T C G # Samples Tested 3 3 3 3 # Correctly Identified 2 3 3 3 Avg. Avg. Avg. Avg. 0.720 0.039 .038 0.055 0.029 0.897 0.034 .011 0.052 0.051 .911 0.014 0.199 0.012 0.017 0.920 Next, we test the robustness of the clustering in the presence of noise. For this purpose, we take 36 DOS histograms (9 for each nucleotide type) and to each histogram bin add noise sampled from a normal distribution N(0,σ) with varying standard deviation σ. Let K be the average over the maximum amplitude in all DOS vectors in our dataset. A histogram with noise drawn from N(0,σ) has a probability of being correctly identified (i.e., if the original histogram is of type X, then pX(d) > 0.5). Figure 7 plots this probability against the parameter σ/K. The figure shows that an input histogram with noise level σ/K up to ~15% will still be more likely than not to be classified correctly. This stability analysis suggests that the features detected by PCA capture the underlying differences between the nucleotides well. Fig. 7. Measurement of the robustness of the clusters with respect to increasing amounts of noise in the input histograms. The vertical axis is the probability that the DOS vector d of a nucleotide with additive Gaussian noise drawn from N(0,σ) is correctly identified (i.e., if the original histogram is of type X, then pX(d) > 0.5), and the horizontal axis is the noise-level parameter σ/K , where K is the maximum amplitude over all DOS 14 vectors in our dataset. The arrow in the graph indicates that a histogram with noise level σ/K up to 15% is more likely than not to be correctly identified. 3.3 Sequencing a Histogram Time Series In section 2, we described two approaches to sequencing a given histogram time series D(t). The first method, Approach 1, is to naively project each D(t) on the first two PCs found by PCA and then identify D(t) with nucleotide X such that pX(D(t)) > τ, where τ is some threshold (e.g. 0.7). In the event none of the pX are greater than τ, then the histogram D(t) is not identified with any nucleotide, and discarded. Using the interpolation method described in section 3.1, we simulate 5 DOS time series corresponding to 5 randomly generated base sequences. We sequence each time series using the first method. We compare the predicted sequence against the true sequence by measuring the Levenshtein distance between the two strings. The Levenshtein distance between two strings (also known as the “edit distance”) measures the minimum number of single character insertions, deletions, substitutions, and transpositions needed to transform one string to another. Table 2 shows the results. Table 2. Sequencing 5 density-of-states histogram time series generated from a hidden nucleotide sequence, using the naive method. A is the true nucleotide sequence, whereas B is the nucleotide sequence estimated from the histograms. The error for each sequence is calculated as (Levenshtein distance) divided by (True Sequence Length). Sequence Number True sequence length (A) 1 2 3 4 5 123 195 178 146 120 Predicted sequence length (B) 208 348 311 249 208 Levenshtein distance between A and B 93 161 143 118 99 Error 76% 83% 80% 81% 83% With the same set of 5 generated sequences, we next use the Viterbi algorithm (Approach 2) to predict the most likely sequence of bases to generate the histograms. First, we specify the remaining parameters of the hidden Markov model described in section 2.4.1. We set T, Q, and I (the transition, observation emission, and initial probabilities, respectively) as follows: For , , , , and . One can verify that these state transition probabilities are consistent with the model of observation generation described in section 3.1. For the observation emission probabilities, we take advantage of the probability functions px that we defined above, with a slight modification: We have to 15 introduce the probability that the HMM, in state E, will emit a given DOS observation vector o. We will define it as follows: . (2) However, the emission probabilities must be normalized, so for : . Hence for a fixed o, . Finally, the initial probability is (3) . Table 3 shows the results from Approach 2. The error rate has been reduced four-fold (average 21%) compared with that of Approach 1. Table 3. Sequencing the same 5 time-series as in Table 2, but using the Viterbi algorithm. Sequence Number True sequence length (A) 1 2 3 4 5 123 195 178 146 120 Predicted sequence length (B) 117 189 176 148 119 Levenshtein distance between A and B 28 42 33 30 28 Error 23% 22% 19% 21% 23% The above results indicate that modeling the DNA sequences as Markov chains allowed for much more accurate sequencing via the Viterbi algorithm, as compared to the naive approach. With Approach 1, the predicted sequences have a huge excess of nucleotide symbols that are a byproduct of the interpolated histograms. The Viterbi algorithm is able to recognize that many of the histograms corresponded to interstitial regions. Though 21% error is quite far from acceptable error rates (reliable human genome sequencing requires an error rate of at most of 1/100,000 base pairs [37]), our results at least demonstrate the benefit of using HMM in DNA sequencing. The results of using the naive approach indicate that simply using PCA alone to identify DNA bases is unworkable, and added knowledge about the nanopore sequencing process must be utilized. Here, with an extremely simple HMM, the Viterbi algorithm was able to significantly improve the accuracy of sequencing. With a more sophisticated HMM, the Viterbi algorithm should be able to sequence DOS time series with much greater accuracy. For example, Boufounos et al. have suggested such an alternative topology for the HMM, involving not only the 4 base types but 16 additional states representing the transitions between nucleotide types (e.g. AA, AT, AC, etc.) [38]. With training data for these nucleotide transition areas, the Viterbi algorithm should be able to recognize the non-nucleotide DOS more easily. Another possibility would be to use trimer training data. This will allow for a more nuanced HMM for DNA sequencing, where the states are not simply one of , but would 16 encompass all possible codons: AAA, AAT, AAC, etc. Such expanded HMM would capture more of the subtleties involved in the input signal. 4 Conclusions In summary, we have presented theoretical results for methods of classifying both single DNA nucleotide molecules and a sequence of DNA bases from the electronic density of states of the nucleotides. Our results indicate that the density of states profiles of the DNA nucleotides may have enough information to distinguish between the base identities, and that the combination of principal component analysis and the Viterbi algorithm can extract this information to solve the nucleotide identification problem. With principal component analysis, we were able to reduce the dimensionality of the histogram space into a two-dimensional “projection space,” which partitioned the training set of histograms into distinct clusters. We demonstrated that the partitioning of the projection space predicts the identity of an unlabeled histogram very well, and that the clusters are stable with respect to moderate levels of Gaussian noise (density of states histograms are correctly identified the majority of the time even where the added noise is 15% of the maximum histogram amplitude). We then compared two approaches to sequencing a time series of histograms (as would be generated by a nanopore sequencer device). The first was a naive approach of identifying each histogram in the time series individually via the clusters found with principal component analysis. The second approach was to model the time series of histograms as the product of a hidden Markov model process and use the Viterbi algorithm to find the most likely sequence of bases that generated the histograms. Our numerical experiments demonstrated that the Viterbi algorithm performs vastly superior to the naive approach. Simply identifying each histogram D(t) with base X such that pX(D(t)) > τ for some threshold τ was producing an average 80% error rate on a test dataset, whereas the Viterbi algorithm, on the same set of data, was able to achieve an average 21% error rate (with the errors measured with the Levenshtein metric). We believe that our proposed methods are viable in experiments, and the results and ideas presented here may serve as a step closer towards the realization of the Ultra Low Cost Sequencer. Acknowledgements This work was supported by NSF-PetaApps and NSF-EMT grants. Simulations were performed on the 11,664-processor Linux cluster at USC’s High Performance Computing Facility and on the 2,048-processor Linux cluster at our Collaboratory for Advanced Computing and Simulations. 17 References 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. Venter, J. C., Adams, M. D., Myers, E. W., et al.: The sequence of the human genome. Science, 291 (2001) 1304-1351. Lander, E. S., Linton, L. M., Birren, B., et al.: Initial sequencing and analysis of the human genome. Nature, 409 (2001) 860-921. Mardis, E. R.: Next-generation DNA sequencing methods. Annual Rev. Genomics and Human Genetics, 9 (2008) 387-402. Branton, D., Deamer, D. W., Marziali, A., et al.: The potential and challenges of nanopore sequencing. Nature Biotech., 26 (2008) 1146-1153. Deamer, D. W. Akeson, M.: Nanopores and nucleic acids: prospects for ultrarapid sequencing. Trends in Biotechnology, 18 (2000) 147-151. Chen, P., Gu, J. J., Brandin, E., et al.: Probing single DNA molecule transport using fabricated nanopores. Nano Lett., 4 (2004) 2293-2298. Kasianowicz, J. J., Brandin, E., Branton, D., et al.: Characterization of individual polynucleotide molecules using a membrane channel. Proc. of Nat'l Academy of Sciences, 93 (1996) 13770-13773. Ashkenasy, N., Sanchez-Quesada, J., Bayley, H., et al.: Recognizing a Single Base in an Individual DNA Strand: A Step Towards DNA Sequencing in Nanopores. Angew. Chem., 117 (2005) 1425-1428. Clark, J., Wu, H.-C., Jayasinghe, L., et al.: Continuous base identification for singlemolecule nanopore DNA sequencing. Nature Nanotech., 4 (2009) 265-270. Li, J. L., Gershow, M., Stein, D., et al.: DNA molecules and configurations in a solidstate nanopore microscope. Nature Mater., 2003 (2003) 611-615. Storm, A. J., Chen, J. H., Ling, X. S., et al.: Fabrication of solid-state nanopores with single-nanometre precision. Nature Mater., 2 (2003) 537-540. Lagerqvist, J., Zwolak, M. Di Ventra, M.: Influence of the environment and probes on rapid DNA sequencing via transverse electronic transport. Biophys. J., 93 (2007) 23842390. Jauregui, L. A., Salazar-Salinas, K. Seminario, J. M.: Transverse electronic transport in double-stranded DNA nucleotides. J. Phys. Chem. B, 113 (2009) 6230-6239. Gracheva, M. E., Xiong, A. L., Aksimentiev, A., et al.: Simulation of the electric response of DNA translocation through a semiconductor nanopore capacitor. Nanotechnology, 17 (2006) 622-633. Lagerqvist, J., Zwolak, M. Ventra, M. D.: Fast DNA sequencing via transverse electronic transport. Nano Lett, 6 (2006) 779-782. Ohshiro, T. Umezawa, Y.: Complementary base-pair-facilitated electron tunneling for electrically pinpointing complementary nucleobases. Proc. of Nat'l Academy of Sciences, 103 (2006) 10-14. Tanaka, H. Kawai, T.: Partial sequencing of a single DNA molecule with a scanning tunnelling microscope. Nature Nanotech., 4 (2009) 518-522. Shapir, E., Cohen, H., Calzolari, A., et al.: Electronic structure of single DNA molecules resolved by transverse scanning tunnelling spectroscopy. Nature Mater., 7 (2008) 68-74. 18 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. He, Y., Shao, L., Scheicher, R., et al.: Differential conductance as a promising approach for rapid DNA sequencing with nanopore-embedded electrodes. Appl. Phys. Lett. 97 (2010) 043701. Wall, M., Rechtsteiner, A., Rocha, L.: Singular Value Decomposition and Principal Component Analysis. Springer US, (2003). Jollife, I. T..: Principal Component Analysis. 2nd ed. Springer-Verlag (2002). Bezdek, J. C., Ehrlich, R. Full, W.: FCM: The fuzzy c-means clustering algorithm. Computers & Geosciences, 10 (1984) 191-203. Rabiner, L.: A tutorial on hidden Markov models and selected applications in speech recognition. Proc. of IEEE, 77 (1989) 257-286. Viterbi, A. J.: Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Trans. on Information Theory, IT13 (1967) 260-269. Baum, L., Petrie, T., Soules, G., et al.: A maximization technique occurring in the statistical analysis of probabilistic functions of Markov chains. Annals of Math. Stat., 41 (1970) 164-171. Dempster, A. P., Laird, N. M. Rubin , D. B.: Maximum likelihood from incomplete data via the EM algorithm. J. Royal Stat. Soc., B, 39 (1977) 1-38. Nakano, A., Kalia, R. K., Nomura, K., et al.: De novo ultrascale atomistic simulations on high-end parallel supercomputers. Int'l J. High Performance Comput. Appl., 22 (2008) 113-128. Hohenberg, P. Kohn, W.: Inhomogeneous electron gas. Phys. Rev., 136 (1964) B864B871. Kohn, W. Vashishta, P.: General density functional theory. Inhomogeneous Electron Gas, eds. N.H. March and S. Lundqvist, (Plenum, 1983) 79. Wang, J. M., Wolf, R. M., Caldwell, J. W., et al.: Development and testing of a general amber force field. J. Comput. Chem., 25 (2004) 1157-1174. Shimojo, F., Ohmura, S., Kalia, R. K., et al.: Molecular dynamics simulations of rapid hydrogen production from water using aluminum clusters as catalyzers. Phys. Rev. Lett., 104 (2010) 126102. Blochl, P. E.: Projector augmented-wave method. Phys. Rev. B, 50 (1994) 17953-17979. Perdew, J. P., Burke, K. Ernzerhof, M.: Generalized gradient approximation made simple. Phys. Rev. Lett., 77 (1996) 3865-3868. Payne, M. C., Teter, M. P., Allan, D. C., et al.: Iterative minimization techniques for abinitio total-energy calculations - molecular-dynamics and conjugate gradients. Rev. Mod. Phys., 64 (1992) 1045-1097. Louie, S. G., Froyen, S. Cohen, M. L.: Non-linear ionic pseudopotentials in spin-densityfunctional calculations. Phys. Rev. B, 26 (1982) 1738-1742. Dietterich, T.: Overfitting and undercomputing in machine learning. ACM Computing Surveys, 27 (1995) 326-327. Shendure, J., Mitra, R. D., Varma, C., et al.: Advanced sequencing technologies: methods and goals. Nature Rev. Genetics, 5 (2004) 335-344. Boufounos, P., El-difrawy, S.A., Erlich, D.: Hidden Markov models for DNA sequencing. Proc. of Workshop on Genomic Signal Processing and Statistics, (2002). 19
5cs.CE
False Discovery Rate Control via Debiased Lasso Adel Javanmard∗ and Hamid Javadi† arXiv:1803.04464v1 [stat.ME] 12 Mar 2018 March 14, 2018 Abstract We consider the problem of variable selection in high-dimensional statistical models where the goal is to report a set of variables, out of many predictors X1 , . . . , Xp , that are relevant to a response of interest. For linear high-dimensional model, where the number of parameters exceeds the number of samples (p > n), we propose a procedure for variables selection and prove that it controls the directional false discovery rate (FDR) below a pre-assigned significance level q ∈ [0, 1]. We further analyze the statistical power of our framework and show that for designs with subgaussian rows and a common precision matrix Ω ∈ Rp×p , if the minimum nonzero parameter θmin satisfies s   √ 2p nθmin − σ 2(max Ωii ) log → ∞, qs0 i∈[p] then this procedure achieves asymptotic power one. √Our framework is built upon the debiasing approach and assumes the standard condition s0 = o( n/(log p)2 ), where s0 indicates the number of true positives among the p features. Notably, this framework achieves exact directional FDR control without any assumption on the amplitude of unknown regression parameters, and does not require any knowledge of the distribution of covariates or the noise level. We test our method in synthetic and real data experiments to asses its performance and to corroborate our theoretical results. 1 Introduction Living in the era of data deluge, modern datasets are often very fine-grained, including information on a large number of potential explanatory variables. For a given response of interest, we know a priori that a large portion of these variables are irrelevant and would like to select a set of predictors that influence the response. For example, in genome-wide association studies (GWAS), we collect single nucleotide polymorphism (SNP) information across a large number of loci and then aim at finding loci that are related to the trait, while being resilient to false associations. The focus of this paper is on high-dimensional regression models where the number of parameters exceeds the sample size. Such models are over-parameterized and hence are prone to overfitting. Moreover, high-dimensionality brings noise accumulation and spurious correlations between response ∗ Data Sciences and Operations Department, Marshall School of Business, University of Southern California, Email: [email protected] † Department of Electrical Engineering, Stanford University. Email: [email protected] 1 and unrelated features, which may lead to wrong statistical inference and false predictions. Model selection is therefore a crucial task in analyzing high-dimensional models. For a successful model selection, we need to assure that most of the selected predictors are indeed relevant. This not only leads to noise reduction and enhances predictions but also offers reproducibility. To be concrete in using the term “reproducibility”, we characterize it for statistical inference problem by using the false discovery rate (FDR) criterion, which is the expected fraction of discoveries that are false positives. The notion of FDR has been proposed by the groundbreaking work [BH95] and nowadays is the criterion of choice for statistical inference in large scale hypothesis testing problem. In their work, Benjamini and Hochberg developed a procedure to control FDR under a pre-assigned significance level. It has been shown theoretically that BH procedure controls FDR in some special cases such as independence or positive dependence of tests [BH95, BY01]. Since initially proposed, there have been various modifications of BH [BY01, SRC+ 15, FHG12, Wu08, XCML11] and its applications in different domains [RYB03, GLN02]. Importantly, BH procedure (and its modifications) assumes that p-values are given as input for all the hypothesis tests. The p-values are often calculated using classical formula obtained by using largesample theory which are theoretically justified only for the classical setting of fixed dimensionality p and diverging sample size n [VdV00]. However, for high-dimensional models obtaining valid pvalues is highly nontrivial. This is in part due to the fact that fitting high-dimensional model often requires the use of nonlinear and non-explicit estimation procedures and characterizing the distribution of such estimators is extremely challenging. In the past couple years, there has been a surge of interest in constructing frequentist p-values and confidence intervals for high-dimensional models. A common approach is the fundamental idea of debiasing which was proposed in a series of work [JM14b, ZZ14, JM14a, VdGBRD14]. In this approach, starting from a regularized estimator one first constructs a debiased estimator and then makes inference based on the asymptotic normality of low-dimensional functionals of the debiased estimator. This approach also provides asymptotically valid p-values for hypotheses testing each of the parameters in the model. However, these p-values are correlated and the BH procedure is not guaranteed to control FDR in this case. The modification of BH for general dependency, that scales the significance level by 1/(log p) factor [BY01], also turns out to be overly conservative and leads to a low statistical power. In this paper, we built upon the debiasing approach and propose a procedure to control FDR for high-dimensional model. Indeed, we prove that it controls a stronger criterion, namely directional FDR. We call our procedure FCD (for “FDR Control via Debiasing”) and analyze its statistical power. To address the problem of FDR control in regression model, [BC15] originally proposed the ingenious idea of knockoff filter. In a nutshell, the idea is to construct a set of “knockoff” variables that are irrelevant to response (conditional on the original covariates) but whose structure mirrors that of the original covariates. The knockoff variables then behave as the controls for original covariates. This way, they bypass the need of constructing p-values and directly select a model with the desired FDR. The focus of [BC15] was on linear regression model with n > 2p. Later, [CFJL18] extended the idea of knockoff filter to high-dimensional nonlinear models, but assumes that the joint distribution of covariates is known. Very recently, [FDLL17, BCS18] studies robustness of model free knockoff to errors in estimating the joint distribution of covariates. One advantage that our FCD framework offers over knockoff method is that other than controlling directional FDR, it also provides p-values for the model coefficients. 2 1.1 Problem Formulation Suppose we have recorded n i.i.d observational units (y1 , x1 ), . . . , (yn , xn ), with yi ∈ R representing response variables and xi ∈ Rp indicating the vector of explanatory variables on each sample, also referred to as features. We assume the classical linear regression model where the observations obey the following relation: yi = hθ0 , xi i + wi , (1) Here, θ0 ∈ Rp is the unknown vector of coefficients and noise wi is independent of xi . The symbol h·, ·i denotes the standard inner product. We assume that the noise variables wi are independent with E(wi ) = 0 , E(wi2 ) = σ 2 , E(|wi |2+a ) ≤ Cσ 2+a , (2) for some constants C > 0, a > 2. Let y = (y1 , . . . , yn )T and let X ∈ Rn×p denote the feature matrix T that have xT 1 , . . . , xn as rows. Then writing the linear regression model in matrix form, we obtain y = Xθ0 + w , (3) We let S ⊆ {1, . . . , p} denote the set of truly relevant feature variables among the many that have been recored. This set corresponds to the support to θ0 , i.e., S ≡ supp(θ0 ) = {1 ≤ i ≤ p : θ0,i 6= 0} . (4) We let s0 = |S| be the size of support or in other words the number of true positives. In this paper, we propose a framework to select a set Sb of the feature variables, while controlling the directional false discovery rate (FDR) for the selected variables. This criterion is intimately rated to type S errors (S stands for sign). Type S error (a.k.a type III error) occurs when we say, with confidence, that a comparison goes one way while it goes the other way [GT00]. For example, we claim that θ1 > θ2 , with confidence, while in fact θ1 < θ2 . In other words, we mistakenly make a claim on the sign (direction) of θ1 − θ2 . Gelman et. al. [GT00] argue that type S error is a more relevant notion in many applications. Tukey also conveys a similar message in [Tuk91] by arguing that the effects of A and B, for any A and B, are always different (in some decimal precision) and hence instead of questioning whether there is any difference in two effects, the valid question should be about the direction in which effect of A differs from that of B. Motivated by this, we formally define directional FDR, denoted by FDRdir . For a selected set Sb d j ∈ {−1, +1} of the sign of θ0,j , we define of the features along with estimates sign FDRdir = E[FDPdir ] , FDPdir = dj = |{j ∈ Sb : sign 6 sign(θ0,j )}| , b 1) max(|S|, (5) where we adopt the convention sign(0) = 0. In words, FDRdir is the expected fraction of false discoveries among the selected ones, where a false discovery is measured with respect to type S and d j = +1, while θ0,j = 0 (type I error) or θ0,j < 0 (type S error), it is type I errors. For example if sign considered as a false discovery. 3 Recall that the classical FDR is defined as   |{j ∈ Sb : θ0,j 6= 0}| , FDR = E b 1) max(|S|, (6) that defines the false discoveries only with respect to type I error. Therefore, a comparison of definitions (5) and (6) reveals that FDRdir ≥ FDR , (7) b As a result, proving that a framework controls FDRdir automatically implies for any selected set S. that it also controls FDR. Likewise, we define the statistical power of a selected set Sb as  d j = sign(θ0,j )}|  |{j ∈ Sb : sign Power = E , max(|S|, 1) (8) i.e., for a true discovery not only the corresponding variable should be in fact non-zero but we should also declare its sign correctly. The directional FDR has been also studied by [BC16] and it is shown that the knockoff filter also controls this metric as well as the FDR. 1.2 Our Contributions and Outline of the Paper Here, we provide a vignette of our contributions: Controlling directional FDR In Section 2, we propose a method for selecting relevant variables using the debiasing approach. We use the acronym FCD to call this method (standing for “FDR Control via Debiasing”). In Section 3, we show that for design matrices with subgaussian rows, √ under the standard condition s0 = o( n/(log p)2 ) and proper conditions on the population precision matrix, the FCD framework controls directional FDR. (See Theorem 3.1 for a formal statement). Characterizing the statistical power In Section 4, we characterize the statistical power of the FCD method. In particular, we show that if the minimum nonzero coefficient, θmin satisfies s   √ 2p nθmin − σ 2(max Ωii ) log → ∞, qs0 i∈[p] then FCD achieves asymptotic power one. Recently, [FDLL17] has studied the power of model p free knockoff filter and showed that it achieves asymptotic power one provided that θmin n/(log p) → ∞ and assuming a lower b ≥ cs0 , for bound on the size of the model selected by the knockoffs procedure. Namely, if |S| −1 some constant c ∈ (2(qs0 ) , 1). This condition, p however, is hard to verify and a sufficient given condition is that the size of {j : |θ0j |  s0 (log p)/n} is at least cs0 , for some constant c ∈ (2(qs0 )−1 , 1). This condition on the amplitude of nonzero coefficients is much stronger that the one we need for FCD to achieve power one. 4 Numerical validation We validate our approach on both synthetic and real data in Sections 5 and 6 and compare its performance with the model free knockoff. As the simulations suggest, FCD method compares favorably to the model free knockoff in a wide range of setups. We also compare the statistical power of FCD with the theoretical characterization and show that they are in good agreement. 1.3 Further Related Work There exists a copious theoretical literature developed on high-dimensional regression and the Lasso. Most existing studies have focused on prediction error [GR04], model selection properties [MB06, ZY06, Wai09, CP09], estimation consistency [CT05, BRT09]. For exact support recovery, it was known early on that, even in the classical setting of fixed p and diverging n, support of Lasso will be different from S (support of true signal) unless the columns of X, with index in S, are roughly orthogonal to the ones with index outside S [KF00]. This assumption is formalized under the socalled ‘irrepresentability condition’. In a seminal work, Zhao and Yu [ZY06] show that this condition also allows exact support recovery in the high-dimensional setting (p  n). Independently, [MB06] studied model selection problem for random Gaussian designs, with applications to learning Gaussian graphical models. These papers consider the setting of s0 = O(nc ), for some c < 1. Further, under √ a normalization of design such that its columns have norm at mostp n, they require the minimum nonzero amplitude of the signal θmin = mini∈S θ0,i to satisfy θmin > c s0 /n. Later, [Wai09] improved these results for the case of random Gaussian designs and showed that for a broad p range of covariance matrices, the Lasso can recover the support of a signal for which θmin > cσ (log p)/n. The model selection problem was also studied under the weaker, generalized irrepresentability condition, for the Gauss-Lasso estimator [JM13]. As an alternative to irrepresentability condition, [Lou08] proves the exact model selection under b ij = O(1/s0 ). This assumption is however stronger an incoherence assumption, namely maxi6=j Σ than irrepresentability condition [vdGB09]. As discussed in the introduction, related to the model selection is the problem of hypothesis testing for high-dimensional regression. In [ZZ11, Büh12], authors consider null hypotheses of form p H0,i : θ0,i = 0 and propose methods that achieve a given power 1 − β, if |θ0,i | > cβ σ s0 (log p)/n. Later, [JM14b] proposed a method for random Gaussian designs, with known covariance, under the setting s/p → ε and n/p → δ, for constants ε, δ ∈ (0, 1). The proposed method achieves a given power √ 1 − β, conditional on that |θ0,i | > cβ σ/ n. The debiasing approach [ZZ14, JM14a, VdGBRD14] also √ has been proposed to test H0,i in the high-dimensional setting, with s0 = o( n/(log p)). In [JM14a], it is shownp that the debiasing based framework for testing H0,i achieves a given power 1 − β, if θmin > cβ σ (log p)/n. Applicability of the debiasing approach is extended to the setting of s0 = o(n/(log p)2 ), for random Gaussian designs, using a ‘leave-one-out’ technique [JM18]. 1.4 Notations Here, we provide a summary of notations used throughout this paper. We use [p] = {1, . . . , p} to refer to the first p integers. For a vector v, we denote its coordinates by vi and let vS be the restriction of v to indices in set S. Further, the term support of a vector indicates the nonzero coordinates of that vector, i.e., supp(v) = {i ∈ [p] : vi 6= 0}. We use I to denote the identity matrix and for clarity we might also make its dimension explicit as in Id×d . For a matrix A, we denote its maximum and minimum singular values by σmax (A) and σmin (A), respectively. For a random vector x, we denote 5 √ −z 2 /2 / 2π to refer to the Gaussian density and its subgaussian norm by kxk . We use φ(z) = e ψ 2 Rz Φ(z) = −∞ φ(t)dt to denote the Gaussian cumulative distribution. For two functions f (n) and g(n), with g(n) ≥ 0, we write f (n) = o(g(n)) if g(n) grows much faster than f (n), i.e., f /g → 0. We also write f (n) = O(g(n)), if there exists a positive constant C such that for all sufficiently large values of n, |f (n)| ≤ C|g(n)|. 2 FCD Procedure: False Discovery Control via Debiasing In order to describe FCD framework, we first give an overview of debasing approach. To this end, we focus on the Lasso estimator [Tib96], given by   b X; λ) ≡ arg min 1 ky − Xθk2 + λkθk1 θ(y, (9) 2 θ∈Rp 2n In case the optimization has more than one optimizer we select one of them arbitrarily. We will often drop the arguments y, X, as they are clear from the context. Despite the great properties of Lasso in terms of point estimation and prediction, it is biased due to the `1 penalty term. Indeed, bias is unavoidable in high-dimensional setting (n < p) as one needs to produce a point estimate, in p dimension, from the observed data in lower dimension, n. Furthermore, characterizing the exact distribution of regularized estimator is in general not tractable. To deal with these challenges, the debasing approach aims at first removing the bias of Lasso and producing an estimator that is amenable to distributional characterization. 2.1 Debiasing Lasso A debiased estimator θbd takes the general simple form of 1 b . θbd = θb + M X T (y − X θ) (10) n Here, M is a ‘decorrelating’ matrix. There are various proposals for constructing M ; see e.g. [ZZ14, JM14a, VdGBRD14]. In this paper we use the construction introduced by [JM14a]. Here, we assume that the noise w is Gaussian and then discuss the non-Gaussian case in Section 2.2. To set the stage to describe construction of M , note that by plugging in for y = Xθ0 + w, we have √ d √ b + √1 M X T w , b − I)(θ0 − θ) n(θb − θ0 ) = n(M Σ (11) n b ≡ (X T X)/n is the empirical covariance of the feature vectors. The first term is the bias where Σ b − I|∞ , with | · | denoting the entrywise `∞ norm. The second term is the and is controlled by |M Σ b T . The decorrelating matrix M is unbiased Gaussian noise whose covariance works out at M ΣM constructed via a convex optimization that aims at reducing bias and variance of the coordinates of θbd at the same time. Construct M = (m1 , m2 , . . . , mp )T ∈ Rp×p by letting mi ∈ Rp be a solution to the following convex program minimize subject to b , mT Σm b − ei k∞ ≤ µ , kΣm 6 (12) with ei ∈ Rp being the i’th standard unit vector. If any of the above problems is not feasible, we let M = Ip×p . Note that M is constructed solely based on X. The choice of running parameter µ will be discussed in the sequel. The following proposition proved in [JM14a] shows that the error of the debiased estimator θbd can be decomposed as the sum of two ‘bias’ and ‘noise’ terms. Proposition 2.1. Consider the linear model (3), with gaussian noise, w ∼ N(0, σ 2 In×n ), and let θbd p be the debiased estimator given by Eq. (10), with µ = a (log p)/n. Then, we have the following decomposition: √ d √ b b T ), ∆ = n(M Σ b − I)(θ0 − θ). n(θb − θ0 ) = Z + ∆, Z|X ∼ N(0, σ 2 M ΣM (13) Consider random design matrices with i.i.d rows and let Σ = E(x1 xT 1 ) be the population level covariance. Suppose that σmin (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent subgaussian rows with p kΣ−1/2 x1 kψ2 = κ. Then, choosing λ = cσ (log p)/n, there exists constant C = C(a, κ), such that for n ≥ Cs0 log(p/s0 ), we have     16ac0 σ s0 log p √ ≤ 4e−c1 n + 4p−c2 , P k∆k∞ ≥ (14) cmin n where c1 and c2 are constants depending on κ, a, c0 , cmin , cmax . The next lemma controls the variance of the noise coordinates Zi in terms of the diagonal entries of the precision matrix. Lemma 2.2 ( [JM14a]). Let Ω ≡ Σ−1 be the precision matrix. Under the assumption of Proposition 2.1, we have b T − Ω|∞ = 0 , lim sup |M ΣM (15) n→∞ almost surely. 2.2 Extension to Non-Gaussian Noise √ In the decomposition (2.1), we have Z = M X T W/ n and given that W ∼ N(0, Σ), we have Z|X ∼ b T ). In [JM14a], it is shown that by a slight modification of optimization (12), Z admits N(0, σ 2 M ΣM the same conditional distribution even for non-Gaussian noise. For the reader’s convenience and to be self-contained we briefly explain it here. Note that for any fixed i ∈ [p], we have n 1 X Zi = √ ξj , n with ξj ≡ mT i x j wj . T b i )1/2 σ(m Σm i j=1 Pn 2 Conditional on X, the terms ξj are zero mean and independent. Moreover, j=1 E(ξj |X) = n. Therefore, if the Lindeberg’s condition holds, that is to say for every ε > 0, almost surely n √ 1X E(ξj2 I(|ξj | > ε n)|X) = 0 , n→∞ n lim j=1 7 P √ d then nj=1 ξj / n|X −→N(0, 1). The construction of M can slightly be modified to ensure the Lindeberg’s condition, namely optimization problem (12) should be modified as follows: minimize subject to b , mT Σm b − e i k∞ ≤ µ , kΣm kXmk∞ ≤ nβ (16) for arbitrary fixed 0 < β < 1/2 − a−1 , where we recall the parameter a from Eq. (2). The following lemma, from [JM14a] shows that by this modification, the marginals of Zj are asymptotically normal. Lemma 2.3 ([JM14a], Theorem 4.1). Under conditions (2) on the noise term, and using optimizad tion (12) to construct M , we have that Zi |X −→ N(0, 1). The above result can be easily generalized to fixed-dimensional marginals of Z, by using the fact that a vector has a multivariate normal distribution if every linear combination of its coordinates is normally distributed. With this overview of debiasing approach we are ready to explain the FCD procedure. 2.3 2.3.1 FCD Procedure Construction of Test Statistics In order to construct the test statistics, we first need to propose a consistent estimate of noise variance, σ 2 . There are already several proposals for this in the literature. See e.g., [FL01, FL08, SBvdG10, Zha10, SZ12, BC13, FGH12, RTF16]. To be concrete, we use the scaled Lasso [SZ12] given by   1 σ 2 b {θ, σ b} ≡ arg min ky − Xθk2 + + λ̄kθk1 (17) θ∈Rp ,σ>0 2σn 2 We state the following lemma, proved in [JM14a], that shows σ b is a consistent estimate of σ. Lemma 2.4. Let σ b be the scaled Lasso estimate of the noise level, defined by (17), with λ̄ = p b satisfies the following relation: 10 (2 log p)/n. Then σ   σ b lim sup P − 1 ≥ ε = 0. n→∞ θ ∈Rp ,kθ k ≤s σ 0 0 0 0 b T . For i ∈ [p], we define test statistic Ti as follows: Define Λ = M ΣM √ bd nθ Ti ≡ √ i . σ b Λii For a given threshold level t ≥ P 0, we reject H0,i if |Ti | ≥ t and we return sign of Ti as the estimate of sign of θ0,i . We also let R(t) = pi=1 I(|Ti | ≥ t) be the total set of rejections at threshold t. Next we discuss how to choose a data dependent threshold t to ensure that directional FDR and FDP are controlled at a pre-assigned level q ∈ [0, 1]. 8 2.3.2 A Data Dependent Threshold for the Test Statistics • Step 1: For the pre-assigned level q ∈ [0, 1], define tp = (2 log p − 2 log log p)1/2 and calculate   2p(1 − Φ(t)) ≤q . (18) t0 = inf 0 ≤ t ≤ tp : R(t) ∨ 1 √ If (18) does not exist then set t0 = 2 log p. • Step 2: For i ∈ [p], reject H0,i if |Ti | ≥ t0 . d i = sign(Ti ) as the estimate of sign(θ0,i ). • Step 3: We return sign 3 Theoretical Results Suppose that the design matrix X has i.i.d rows with Σ = E(x1 xT 1 ) being the population covari−1 b T , where M is the ance. Let Ω ≡ Σ be the precision matrix and recall the definition Λ ≡ M ΣM decorrelating matrix used in construction of the debiased estimator. We also define the normalized matrices Ω0 and Λ0 as Ωij Ω0ij = p , Ωii Ωjj Λij Λ0ij = p . Λii Λjj For a given constant γ > 0, define o n Γ(γ, c0 ) ≡ (i, j) : 1 ≤ i, j ≤ p, |Ω0ij | ≥ c(log p)−2−γ , (19) (20) for some constant c > 0. The following theorem states a guarantee on the directional false discovery rate of the FCD procedure introduced in the previous section. Theorem 3.1. Consider random design matrices with i.i.d rows and let Σ = E(x1 xT 1 ) be the population level covariance. Suppose that σmin (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent subgaussian rows with kΣ−1/2 x1 kψ2 = κ. Further, assume that: √ (i) s0 = o( n/(log p)2 ). (ii) There exist positive constants c0 , γ, such that Γ(γ, c0 ) = o(p1+ρ ), for some constant ρ ∈ [0, 1). (iii) We have |{(i, j) : |Ω0ij | > (1 − ρ)/(1 + ρ)}| = O(p). Then, for FCD procedure we get lim sup FDRdir ≤ q. (21) (n,p)→∞ Further, for any ε > 0, lim (n,p)→∞   P FDPdir ≤ q + ε = 1 . 9 (22) Remark 3.2. While directional FDR is the expected directional false discovery proportion (FDPdir ), it is idealized for a variable selection procedure to control FDPdir in any given realization. In general, controlling FDRdir does not control the variations of FDPdir . As noted by [Owe05], the variance of FDP can be large if the test statistics are correlated, which is the case here. Let us emphasize that by Eq. (22), our FCD controls FDPdir , with high probability. Examples. Here, we provide several examples of the precision matrices that satisfy conditions (ii)-(iii) of Theorem 3.1 to demonstrate its applicability. Example 1: Our first example is the circulant covariance matrices, where Σij = η |i−j| , for some constant η ∈ (0, 1). It is simple to see that the inverse of such matrices have at most three nonzero coordinates per row. Therefore, the conditions will be satisfied by choosing ρ = 1, and c > 0, γ < ∞, arbitrary. Example 2: Suppose that Σ is block diagonal with size of blocks to bounded (as p → ∞). Then, the precision matrix will also have a block diagonal structure with blocks of bounded size. It is easy to check conditions, with choosing ρ = 1 and c > 0, γ < ∞, arbitrary. Example 3: Consider the equi-correlated features, where Σ = (1 − r)I + r11T , for some constant r ∈ (0, 1), where 1 ∈ Rp denotes the all-one vector. Then, we have Ω = (a − b)I + b11T , with a= (p − 2)r + 1 , (p − 2)r − (p − 1)r2 + 1 b= −r . (p − 2)r − (p − 1)r2 + 1 (23) Note that |b| = O(1/p). Therefore, the conditions hold for arbitrary constants c > 0, 0 < ρ < 1. (1) (2) Finally, consider two matrices Ω(1) and Ω(2) , with same diagonal entries Ωii = Ωii , for i ∈ [p], (1) (2) such that Ω(1) dominates Ω(2) on off-diagonal entries, i.e., Ωij ≥ Ωij , for i 6= j ∈ [p]. Then it is easy to see that if Ω(1) satisfies Conditions (i)-(ii), so does Ω(2) . 4 Power Analysis Recall that S0 ≡ supp(θ0 ) is the set of indices of the truly significant features. Let Sb denote the set of significant parameters returned by our FCD procedure, namely Sb = {1 ≤ j ≤ p : |Tj | ≥ t0 } . (24) The power of a selected model Sb is defined as  d j = sign(θ0,j )}|  |{j ∈ Sb : sign b . Power(S) = E max(|S|, 1) (25) We are now ready to characterize the statistical power of the FCD procedure for the linear model (3). 10 Theorem 4.1. Consider a sequence of random design matrices X ∈ Rn×p , with dimension n → ∞, p×p . Suppose that σ p = p(n) → ∞ and Σ = E(x1 xT min (Σ) ≥ cmin > 0 and σmax (Σ) < cmax , 1) ∈ R for some constants cmin , cmax and maxi∈[p] Σii ≤ 1. Further, assume that XΣ−1/2 has independent √ −1/2 x k 2 subgaussian rows with kΣ 1 ψ2 = κ. Suppose that s0 = o( n/(log p) ) and for i ∈ S = supp(θ0 ), √ p we have |θ0,i | > (σ/ n) 2Ωii log(p/s0 ). Then, the following holds true: b Power(S) ≥1 n→∞ 1 − β(θ0 , n)   √ n|θ0,i | 1 X qs0 , 1 − β(θ0 , n) = F , √ s0 p σ Ωii i∈S lim inf (26) (27) where, for α ∈ [0, 1] and u ∈ R+ , the function F (α, u) is defined as follows: F (α, u) ≡ 1 − Φ(Φ−1 (1 − α ) − u) . 2 (28) We refer to Section 7.2 for the proof of Theorem 4.1. Corollary 4.2. It is easy to see that for any fixed α ∈ [0, 1], function u 7→ F (α, u) is monotone increasing. Therefore, as a result of Theorem 4.1, we have lim inf n→∞  F b Power(S)  ≥ 1. √ nθmin qs0 , √ p σ Ωii Corollary 4.3. Under the assumptions of Theorem 4.1, if b → 1, as n → ∞. ∞, then Power(S) √ nθmin −σ (29) q 2 maxi∈[p] (Ωii ) log(2p/(qs0 )) → Proof of Corollary 4.3 is given in Appendix A.4. 5 Numerical Experiments We consider linear model (3) where the design matrix X is generated by drawing its rows independently from N(0, Σ). The covariance Σ ∈ Rp×p has a circulant structure with Σij = η |i−j| , for some constant η ∈ (0, 1). We then normalize the columns of X to have unit norm. We generate the vector of coefficients θ0 ∈ Rp by choosing a subset of indices S ⊆ [p] at random, of size s0 and setting θ0,i from {±A} uniformly at random and θ0,i = 0, for i ∈ / S0 . The noise term W is drawn from N(0, In×n ). We perform three sets of simulations to compare the performance of FCD procedure with model free knockoff and to examine the effects of sparsity level, signal magnitude, and feature correlation. We also compare the empirical power of FCD with the analytical lower bound provided in Corollary 4.2. In all simulations, we set the target level FDR to q = 0.1. For FCD procedure, we use the implementation of the debiased method provided by http://web. stanford.edu/montanar/sslasso/, to construct the debiased estimator. For model free knockoff, we use the implantation provided by http://web.stanford.edu/group/candes/knockoffs/. 11 18 90 16 80 14 70 statistical power FDRdir 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 12 10 8 6 60 50 40 30 4 20 2 10 0 1 2 3 4 5 0 0 6 Amplitude (A) Knockoff (Power) FCD (Power) Analytical Lower Bound 1 2 3 4 5 6 Amplitude (A) Figure 1: Testing FCD and model free knockoff methods with varying the coefficients amplitude A. Here, n = 2000, p = 3000, k = 100, η = 0.1. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and coefficient vectors. Effect of Signal Amplitude: We choose n = 2000, p = 3000, k = 100, η = 0.1 and vary the signal amplitude in the set A ∈ {0.5, 1, 1.5, . . . , 5.5, 6}. For the FCD procedure and the model free knockoff, we compute the directional FDR and power by averaging across 100 realizations of noise and the generation of coefficient vector θ0 . The results are plotted in Figure 1. As we observe, both methods control FDRdir under the target level q = 0.1. As expected, the power of both procedures increases as the signal amplitude increases, with FCD procedure having larger power than the knockoff method over the entire range of signal amplitudes. The FCD procedure turn out to be more powerful than knockoff procedure. We also plot the analytical lower bound on the power of FCD procedure, given in Corollary 4.2. As we see the lower bound is quite close to the actual empirical power of FCD procedure in the setup tested. Effect of feature correlation: We test the effect of feature correlations on the performance of FCD procedure, comparing it with the model free knockoff. We set n = 700, p = 1000, k = 50, A = 4.5. Recall that the rows of the design matrix X are generated from a N(0, Σ) distribution, with Σij = η |i−j| , and then the columns of X are normalized to have unit norm. We vary the parameter η in the set {0.1, 0.15, 0.2, . . . , 0.75, 0.8}. For each value of η, we compute FDRdir and power for both methods, by averaging over 100 realizations of noise and design matrix X. The results are displayed in Figure 2. As observed, both methods control FDRdir over the range of correlations tested. From the power plot, we see that the power of both methods decay as the features correlations increase. This is expected because when the features are highly correlated it is harder to distinguish between them and report the truly significant ones. Indeed, for large values of η, both methods select a few variables. This way, FDRdir is still controlled but the power is low. The proposed FCD procedure has higher power than model free knockoff for η ≤ 0.65. Effect of Sparsity: Here, we set n = 2000, p = 3000, A = 4.5, η = 0.1 and vary the sparsity 12 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 18 80 statistical power 16 14 FDRdir Knockoff (Power) FCD (Power) 90 12 10 8 6 70 60 50 40 30 4 20 2 10 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 0 0.8 Feature Correlation (η) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Feature Correlation (η) Figure 2: Testing FCD and model free knockoff methods with varying the feature correlation parameter η. Here, n = 700, p = 1000, k = 50, A = 4.5. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and design matrices. level of the coefficients in the set k ∈ {10, 15, 20, . . . , 130}. For both methods, the power and FDR are computed by averaging over 100 trials of noise and the generation of coefficient vector θ0 . Both methods control FDRdir over the entire range, with FCD achieving lower FDRdir for small values of k. In terms of power, both methods have close power, and the FCD has higher power for small k. 6 Real Data Experiments In this section we evaluate the proposed method to find the mutations in the Human Immunodeficiency Virus Type 1 associated with drug resistance1 . This dataset is presented and analyzed in [RTW+ 06] and is obtained by analyzing HIV-1 subtype B sequences from persons with histories of antiretroviral treatment. The dataset contains the mutations in the protease and reverse transcriptase (RT) positions of the HIV-1 subtype B sequences which correspond to resistance to Protease Inhibitors (PI), to nucleoside reverse transcriptase inhibitors (NRTIs) and to non-nucleoside RT inhibitors (NNRTIs). In order to deal with missing measurements and preprocessing the dataset we mostly follow the steps taken in [BC15]. The design matrix X ∈ {0, 1}n×p is formed by letting Xij = 1 if the i’th sample contains the j’th mutation and Xij = 0 otherwise. Further, for a specific drug, the i’th entry of the response vector yi denotes the logarithm of the increase in the resistance to that drug in the i’th patient. We let q = 0.2 and we apply the FCD procedure described in subsection 2.3 to detect the mutations in the HIV-1 associated with resistance to each drug. In order to evaluate the performance of our method, we compare it with the knockoff filter procedure [BC15] with the test statistics based on lasso. We have used two different methods for generating the knockoff variables; in knockoff1, the knockoff variables are generated by solving a semi-definite program (SDP) and in knockoff2, equi1 The dataset is available online at https://hivdb.stanford.edu/pages/published_analysis/genophenoPNAS2006. 13 18 90 16 80 14 70 statistical power FDRdir 100 Knockoff (FDP) FCD (FDP) Nominal Level 20 12 10 8 6 60 50 40 30 4 20 2 10 0 0 20 40 60 80 100 120 0 0 140 Knockoff (Power) FCD (Power) 20 Sparsity Level (k) 40 60 80 100 120 140 Sparsity Level (k) Figure 3: Testing FCD and model free knockoff methods with varying the sparsity level k. Here, n = 2000, p = 3000, A = 4.5, η = 0.1. The target level is q = 10%. FDRdir and power are computed by averaging over 100 realizations of noise and coefficient vectors. correlated knockoff variables are created without solving an SDP at a lower computational cost2 . Since this is a real data experiment, there is no ground truth. However, we use the methodology in [BC15] to assess our results. In order to do this, we evaluate the reproducibility of the outcomes of these procedures by comparing them with treatment-selected mutation (TSM) panels provided in [RFZ+ 05]. These panels contain mutations that are observed more frequently in virus samples from patients that have been treated by each drug in compare with the patients who have never been treated with that drug. Since these panels are created independently from the dataset that we use, they can provide a good measure for validating the reproducibility of the results obtained by each procedure. A summary of the results can be seen in Figures 4, 5, 6. It can be seen that the FCD method achieves the target FDR level of q = 0.2 and the obtained power in half of the cases (8 out of 16 drugs) is larger than the power achieved by the knockoff filter. Overall, the achieved power is comparable with the power of the knockoff filter method. 7 Proof of Main Theorems 7.1 Proof of Theorem 3.1 Define G(t) = 2(1 − Φ(t)), with Φ(t) denoting the standard Gaussian cumulative distribution. We start by two lemmas about the properties of G(t). Lemma 7.1. For all t ≥ 0, we have 2 2 φ(t) < G(t) < φ(t) , t + 1/t t 2 (30) More information regarding the procedure are available at https://web.stanford.edu/groupcandes/knockoffs/ software/knockoff/index.html. 14 #HIV-1 protease positions selections Resistance to APV 25 Resistance to ATV 30 FDP=0.18, Power=0.53 In TSM list Not in TSM list 20 Resistance to IDV 20 FDP=0.26, Power=0.59 25 FDP=0.20, Power=0.47 FDP=0.11, Power=0.50 FDP=0.16, Power=0.47 FDP=0.04, Power=0.65 15 20 FDP=0.06, Power=0.44 15 FDP=0.00, Power=0.32 FDP=0.06, Power=0.50 15 10 10 10 5 5 0 5 Knockoff1 Knockoff2 FCD 0 Knockoff1 (q=0.20, Dataset size: n=767, p=201) Resistance to LPV 30 Knockoff2 0 Knockoff1 Knockoff2 Resistance to RTV 35 FDP=0.17, Power=0.71 25 FDP=0.17, Power=0.56 FDP=0.09, Power=0.59 FDP=0.31, Power=0.59 FDP=0.09, Power=0.62 25 20 FDP=0.16, Power=0.47 FDP=0.35, Power=0.65 30 25 FCD (q=0.20, Dataset size: n=825, p=206) Resistance to NFV 30 FDP=0.33, Power=0.53 20 FCD (q=0.20, Dataset size: n=328, p=147) FDP=0.19, Power=0.50 20 15 15 10 10 5 5 0 0 15 Knockoff1 Knockoff2 FCD 10 5 Knockoff1 (q=0.20, Dataset size: n=515, p=184) Knockoff2 FCD (q=0.20, Dataset size: n=842, p=207) 0 Knockoff1 Knockoff2 FCD (q=0.20, Data size: n=793, p=205) Resistance to SQV 25 FDP=0.14, Power=0.53 20 15 FDP=0.20, Power=0.35 FDP=0.07, Power=0.38 10 5 0 Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=824, p=206) Figure 4: Summary of the results of applying the knockoff filter and FCD for detecting the mutation positions in HIV-1 associated with resistance to type-PI drugs using the dataset in [RTW+ 06]. In these experiments we have used q = 0.2. In the plots, blue bars show the number of detected positions by different methods that appear in the TSM panels. On top of each bar the proportion of detected mutations that appear in the TSM panel (an estimate for FDP) and the proportion of mutations in the TSM panel that are detected by different methods (an estimate for power) are stated. 15 Resistance to x3TC 10 Resistance to ABC 30 Resistance to AZT 30 FDP=0.20, Power=0.33 9 In TSM list Not in TSM list FDP=0.52, Power=0.54 FDP=0.37, Power=0.71 25 25 #HIV-1 RT positions selections 8 FDP=0.00, Power=0.29 7 20 20 6 FDP=0.16, Power=0.67 FDP=0.18, Power=0.58 FDP=0.19, Power=0.54 5 FDP=0.00, Power=0.21 15 15 10 10 5 5 FDP=0.27, Power=0.46 4 3 2 1 0 Knockoff1 Knockoff2 FCD 0 Knockoff1 Knockoff2 (q=0.20, Dataset size: n=623, p=283) Resistance to D4T Resistance to DDI 20 25 0 FCD (q=0.20, Dataset size: n=629, p=283) Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=626, p=283) Resistance to TDF 18 FDP=0.20, Power=0.67 FDP=0.18, Power=0.58 FDP=0.22, Power=0.58 18 FDP=0.18, Power=0.75 16 20 16 14 14 12 12 FDP=0.50, Power=0.25 15 10 10 8 8 10 6 6 FDP=0.00, Power=0.21 FDP=0.17, Power=0.21 4 4 5 2 2 0 Knockoff1 Knockoff2 FCD 0 No Discovery Knockoff1 (q=0.20, Dataset size: n=625, p=281) Knockoff2 0 FCD No Discovery Knockoff1 (q=0.20, Dataset size: n=628, p=283) Knockoff2 FCD (q=0.20, Dataset size: n=351, p=215) Figure 5: Same as Figure 4 for type-NRTI drugs. Resistance to DLV 14 Resistance to EFV 25 FDP=0.36, Power=0.60 Resistance to NVP 20 FDP=0.55, Power=0.60 In TSM list Not in TSM list FDP=0.53, Power=0.60 FDP=0.23, Power=0.67 FDP=0.48, Power=0.80 18 12 20 16 FDP=0.20, Power=0.53 10 14 #HIV-1 RT positions selections FDP=0.29, Power=0.80 15 12 8 10 FDP=0.18, Power=0.60 6 10 8 FDP=0.14, Power=0.40 6 4 5 4 2 2 0 Knockoff1 Knockoff2 FCD (q=0.20, Dataset size: n=730, p=305) 0 Knockoff1 Knockoff2 FCD 0 Knockoff1 (q=0.20, Dataset size: n=732, p=312) Figure 6: Same as Figure 4 for type-NNRTI drugs. 16 Knockoff2 (q=0.20, Dataset size: n=744, p=313) FCD 2 /2 where φ(t) = e−t √ / 2π is the standard Gaussian density. Lemma 7.1 is the standard trial bound on the Gaussian distribution and its proof is omitted. Lemma 7.2. For all t > 0, ε < min(1, 1/t) and δ < min(1, 1/t2 ), the following holds true: G((1 − δ)t − ε) ≤ 1 + 8(ε + εt + δ + δt2 ) . G(t) (31) Proof of Lemma 7.2 is given in Appendix A.1. Using Proposition (2.1), we have √ nθ0,i σ e ∆i + Zi + √ Ti = √ σ b σ b Λii σ b Λii (32) ei ∼ N(0, Λ0 ). Note that since Ω = Σ−1 , we have Σii Ωii ≥ 1. Hence, maxi∈[p] Σii ≤ 1, we where Z have mini∈[p] Ωii ≥ 1. Further, by invoking Lemma 2.2, |Λ − Ω|∞ = op (1), and hence Λii are also bounded from below by an arbitrary fixed constant 0 < c < 1, for large enough n. In addition, since Λ0 − Ω0 ∞ = op (1), for (i, j) ∈ Γ(γ)c we have |Λ0ij | < C(log p)−2−γ , (33) for some constant C > 0. Further, by Condition (iii) in the theorem statement, we have n 1 − ρo (i, j) : |Ω0ij | > = O(p) . 1+ρ (34) Define S≥0 ≡ {i ∈ [p] : θ0,i ≥ 0} and S≤0 ≡ {i ∈ [p] : θ0,i ≤ 0}. √ We first consider the case that t0 , given by (18), does not exist. In this case, t0 = 2 log p and for any ε > 0 we have  X  d i 6= sign(θ0,i ) ≥ 1 P I sign i ! ≤P X !  p I Ti ≥ 2 log p ≥ 1 + P  i∈S≤0 X !  p I Ti ≤ − 2 log p ≥ 1 .  i∈S≥0 (35) We can bound the first term on the right hand side above as ! !   X σ X  p p ∆ i ei + √ I P I Ti ≥ 2 log p ≥ 1 ≤ P Z ≥ 2 log p ≥ 1 σ b σ b Λ ii i∈S≤0 i∈S≤0 !  X  p k∆k σ b ∞ ei ≥ ≤P I Z 2 log p − √ ≥1 σ σ c i∈S≤0   p  √ ≤ p max P Zei ≥ (1 − ε) 2 log p − ε + P k∆k∞ ≥ σε c i∈[p]   σ b +P −1 ≥ε σ  p  √ p  ≤ G (1 − ε) 2 log p − ε + P k∆k∞ ≥ σε c 2  σ b −1 ≥ε . +P σ 17 which goes to zero as n, p → ∞, due to Proposition 2.1 along with Condition (i), that s0 = √ o( n/(log p)2 ), and using Lemma 2.4. Similarly and by symmetry, the second term goes to zero as n, p → ∞ and the claim follows. We next focus on the event that t0 , given by (18) exists. By definition of t0 in this case, we have pG(t0 ) = q. R(t0 ) ∨ 1 (Indeed, it is clear that the left-hand side is at most q. Equality holds since t0 is the minimum t, with such property.) Define Q(t) ≡ G(t)/2 for all t ∈ R. Let P i∈S≥0 Ap ≡ sup {I (Ti ≤ −t) − Q(t)} + P i∈S≤0 {I (Ti ≥ t) − Q(t)} (36) pG(t) 0≤t≤tp Then, P FDPdir (t0 ) = I(Ti ≤ −t0 ) + i∈S≥0 P i∈S≤0 I(Ti ≥ t0 ) R(t0 ) ∨ 1 pG(t0 )Ap + s0 Q(t0 ) + 2(p − s0 )Q(t0 ) pG(t0 )(1 + Ap ) ≤ ≤ ≤ q(1 + Ap ). R(t0 ) R(t0 ) (37) Hence, we need to prove that Ap → 0, in probability. Note that ( P Ap ≤ sup i∈S≤0 {I (Ti ≥ t) − Q(t)} pG(t) 0≤t≤tp P ≤ sup i∈S≤0 {I (Ti ≥ t) − Q(t)} pG(t) 0≤t≤tp P + i∈S≥0 {I (Ti ≤ −t) − Q(t)} pG(t) P + sup ) i∈S≥0 0≤t≤tp {I (Ti ≤ −t) − Q(t)} pG(t) . (38) Note that by symmetry it is sufficient to prove that the first term in (38) goes to zero in probability. Consider a discretization 0 ≤ √ τ1 < τ2 < . . . < τb = tp such that τj − τj−1 = vp , for 1 ≤ j ≤ b − 1 and τb − τb−1 ≤ vp , where vp = 1/ log p. Hence, b ∼ tp /vp . For any t ∈ [τj−1 , τj ], we have P P P Q(τj ) i∈S≤0 I(Ti ≥ τj ) i∈S≤0 I(Ti ≥ t) i∈S≤0 I(Ti ≥ τj−1 ) Q(τj−1 ) · ≤ ≤ · pQ(τj ) Q(τj−1 ) pQ(t) pQ(τj−1 ) Q(τj ) Hence, it suffices to show that P max 0≤j≤b i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} pQ(τj ) →0 (39) in probability. In the following lemma, we provide sufficient conditions to obtain Eq. (39). Lemma 7.3. Suppose that for any δ > 0, the followings hold:  P  i∈S≤0 I(Ti ≥ t) sup P − 1 ≥ δ = o(1) pQ(t) 0≤t≤tp 18 (40) and Z  P tp P 0 i∈S≤0 I(Ti ≥ t) pQ(t)  − 1 ≥ δ dt = o(vp ) (41) where tp = (2 log p − 2 log log p)1/2 and vp = (log p)−1/2 , then (39) hold true. We refer to Appendix A.2 for the proof of Lemma 7.3. By virtue of Lemma 7.3 we only need to prove Eqs. (40) and (41). We start by analyzing the following expression P  P 2 i,j∈S≤0 {P(Ti ≥ t, Tj ≥ t) − P(Ti ≥ t)P(Tj ≥ t)} i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} ≤ E pQ(t) p20 Q(t)2 1 X P(Ti ≥ t, Tj ≥ t) −1 ≤ 2 Q(t)2 p0 i,j∈S≤0 ≤ 1 X P(Tei ≥ t, Tej ≥ t) − 1, Q(t)2 p20 (42) i,j∈[p] with p0 = |S≤0 | and ∆i σe Tei ≡ Z . i+ √ σ b σ b Λii (43) The last inequality of (42) holds because θ0,i ≤ 0 for i ∈ S≤0 and therefore Ti ≤ Tei (Recall definition of Ti , given by Eq. (32).) Further, because S c = {i ∈ [p] : θ0,i = 0} ⊆ S≤0 , we have p0 ≥ p − s0 . √ Since s0 = o( n/(log p)2 ) by Condition (i), we have p0 = Ω(p). We partition the set {(i, j) : i.j ∈ [p]} into two disjoint sets, namely Γ(γ, c0 ) (highly correlated test statistics) and Γ(γ, c0 )c (weakly correlated test statistics). (Recall the definition of set Γ(γ, c0 ) given by (20).) We analyze the contribution of each set separately. 7.1.1 Highly correlated test statistics (Γ(γ, c0 ))   1 e e We first consider the set Γ(γ, c0 ). Note that (Zi , Zj ) ∼ N 0, 0 Λij Λ0ij 1  . Using (32), we have ! ∆ ∆ σ b σ b j i P Tei ≥ t, Tej ≥ t ≤ P Zei > t − √ , Zej > t − p σ σ σ Λii σ Λjj   ei > (1 − ε1 )t − ε2 , Zej > (1 − ε1 )t − ε2 ≤P Z    √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ ( ) ((1 − ε1 )t − ε2 )2 −2 ≤ C ((1 − ε1 )t − ε2 + 1) exp − 1 + Λ0ij    √ σ b − 1 ≥ ε1 , + P k∆k∞ ≥ σε2 c + P σ   19 (44) (45) where the last inequality follows from [Liu13, Lemma 6.2]. o n Let Ψ(ρ) ≡ (i, j) : i, j ∈ [p], |Λ0ij | > (1 − ρ)/(1 + ρ) . Note that by (34) and Lemma 2.2, |Ψ(ρ)| = O(p). We can write 1 p20 X (i,j)∈Γ(γ,c0 ) P(Tei ≥ t, Tej ≥ t) 1 ≤ 2 2 Q(t) p0  X (i,j)∈Ψ(ρ) + P(Tei ≥ t, Tej ≥ t) Q(t)2 X (i,j)∈Γ(γ,c0 )\Ψ(ρ)  P(Tei ≥ t, Tej ≥ t) . Q(t)2 (46) We treat the terms on the right hand side separately. For the first term, since Λ0ij ≤ 1, by using (45), we have (   X P(Tei ≥ t, Tej ≥ t) 1 |Ψ(ρ)| −2 2 ≤ C ((1 − ε )t − ε ) exp − ((1 − ε )t − ε ) /2 1 2 1 2 Q(t)2 p20 p20 Q(t)2 (i,j)∈Ψ(ρ)  )  √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ (  G((1 − ε1 )t − ε2 ) 2 −1 exp(((1 − ε1 )t − ε2 )2 /2) ≤ Cp G(t)    )  √ 1 σ b P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 + , Q(t)2 σ where in the second inequality we used the fact that |Ψ(ρ)| = O(p) and that p0 = Ω(p). Take √ ε2 = s0 (log p)/ n. By using Lemmas 2.1, 2.4, and 7.2, we get 1 p20  2 P(Tei ≥ t, Tej ≥ t) ≤ Cp−1 1 + ε21 + ε22 + ε22 t2 + ε21 t4 et /2 2 Q(t) (i,j)∈Ψ(ρ)     √ p−1 σ b +C P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 Q(t)2 σ  2 2 2 ≤ Cp−1 (1 + ε21 + ε22 )et /2 + et /2 ε22 t2 + et /2 ε21 t4     σ b 1 −c1 n −c2 , + e +p +P − 1 ≥ ε1 Q(t)2 σ X (47) for some constant C > 0. To bound the second term on the right-hand side of Eq. (46), note that for (i, j) ∈ Γ(γ, c0 ) \ Ψ(ρ), 20 we have Λ0ij ≤ (1 − ρ)/(1 + ρ). Thus, using (45) 1 p20 (   P(Tei ≥ t, Tej ≥ t) |Γ(γ, c0 )| −2 2 C ((1 − ε )t − ε ) exp −(1 + ρ) ((1 − ε )t − ε ) /2 ≤ 1 2 1 2 Q(t)2 p20 Q(t)2 (i,j)∈Γ(γ,c0 )\Ψ(ρ)  )  √ σ b + P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 σ (    G((1 − ε1 )t − ε2 ) 2 0 ρ−1 ≤cp exp (1 − ρ) ((1 − ε1 )t − ε2 )2 /2 G(t)    )  √ σ b 1 P k∆k∞ ≥ σε2 c + P , + − 1 ≥ ε1 Q(t)2 σ X for any arbitrary constant c0 > 0. Hence, using Lemmas 2.1, 2.4, and 7.2, we get 1 p20  (1−ρ)t2 /2 P(Tei ≥ t, Tej ≥ t) 0 ρ−1 2 2 2 2 2 4 ≤ c p 1 + ε + ε + ε t + ε t e 1 2 2 1 Q(t)2 (i,j)∈Γ(γ,c0 )\Ψ(ρ)    ρ−1  √ σ b 0 p +c P k∆k∞ ≥ σε2 c + P − 1 ≥ ε1 Q(t)2 σ  2 2 2 ≤ c0 pρ−1 (1 + ε21 + ε22 )e(1−ρ)t /2 + e(1−ρ)t /2 ε22 t2 + e(1−ρ)t /2 ε21 t4     1 σ b −c1 n −c2 + e +p − 1 ≥ ε1 (48) +P Q(t)2 σ X uniformly for 0 ≤ t ≤ tp . and for any arbitrary constant c0 > 0. 21 7.1.2 Weakly correlated test statistics (Γ(γ, c0 )c ) We next consider Γ(γ, c0 )c ∩ S≤0 . Using [Liu13, Lemma 6.1] (for d = 2 in its statement) and Eq. (44), we have P(Tei ≥ t, Tej ≥ t) sup −1 Q(t)2 0≤t≤tp ! ∆ 1 ∆ σ b σ b ej > t − p j ei > t − √ i , Z ≤ sup −1 P Z 2 σ σ σ Λii σ Λjj 0≤t≤tp Q(t)   1 ei > (1 − ε1 )t − ε2 , Z ej > (1 − ε1 )t − ε2 ) − 1 ≤ sup P Z 2 0≤t≤tp Q(t)     √ 1 σ b + P k∆k ≥ σε c + P − 1 ≥ ε 2 1 ∞ Q(tp )2 σ    2 ei > (1 − ε1 )t − ε2 , Z ej > (1 − ε1 )t − ε2 ) P Z Q((1 − ε1 )t − ε2 ) −1 ≤ sup sup Q(t) Q((1 − ε1 )t − ε2 )2 0≤t≤tp 0≤t≤tp  + sup 0≤t≤tp Q((1 − ε1 )t − ε2 ) Q(t) 2 1 −1 + Q(tp )2   √ P k∆k∞ ≥ σε2 c + P  σ b − 1 ≥ ε1 σ  ≤ (1 + ε21 + ε22 + ε21 t4p + ε22 t2p )C(log p)−1−γ1 + C ε21 + ε22 + ε21 t4p + ε22 t2p +    1 σ b −c1 n −c2 e +p +P − 1 ≥ ε1 + , Q(tp )2 σ  (49) for some constant C > 0, where γ1 = min(γ, 1/2). In the last inequality above, we applied Lemma 7.1 (Note that Q(t) ≡ G(t)/2 by definition). Therefore, by employing bound (49) for all (i, j) ∈ Γ(γ, c0 )c , we get P(Tei ≥ t, Tej ≥ t) −1 Q(t)2 (i,j)∈Γ(γ,c0 )c   ≤ C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + C(log p)−1−γ1    1 |Γ(γ, c0 )c | σ b −c1 n −c2 + e + p − 1 ≥ ε + − 1, + P 1 Q(tp )2 σ p20 1 p20 X (50) uniformly for 0 ≤ t ≤ tp , and for some positive constants C, c1 , c2 . Note that this inequality is obtained by applying . Combining (42), (46) with bounds (47), (48) and (50), we obtain that  P 2 i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} E pQ(t)   2 2 2 2 ≤ C ε1 + ε2 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2    σ b 1 −c1 n −c2 e +p +P − 1 ≥ ε1 + Q(tp )2 σ p2 2 2 + c0 pρ−1 e(1−ρ)t /2 + Cp−1 et /2 + C(log p)−1−γ1 + 2 − 1 , (51) p0 22 uniformly for 0 ≤ t ≤ tp , some positive constants C, c1 , c2 and for any constant c0 > 0. We are now ready to prove the conditions of Lemma 7.3, namely Eqs. (40) and (41). Fix arbitrary constant δ > 0. By Chebyshev’s inequality, we write  P  i∈S≤0 I(Ti ≥ t) P −1 ≥δ pQ(t)  P 2 1 i∈S≤0 {I(Ti ≥ t) − P(Ti ≥ t)} ≤ 2E δ pQ(t)    1 2 2 ≤ 2 C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2 δ    1 σ b −c1 n −c2 + e + p + P − 1 ≥ ε 1 Q(tp )2 σ  p2 0 ρ−1 (1−ρ)t2 /2 −1 t2 /2 −1−γ1 +cp e + Cp e + C(log p) + 2 −1 , (52) p0 where the second step follows from (51), uniformly for 0 ≤ t ≤ tp and for some constant C > 0 and an arbitrarily small constant c0 > 0. Hence, by substituting for tp = (2 log p − 2 log log p)1/2 , we obtain  P sup P 0≤t≤tp i∈S≤0 I(Ti ≥ t) pQ(t)  −1 ≥δ    1 ≤ 2 4C ε21 + ε22 + ε21 (log p)2 + ε22 log p 1 + (log p)−1−γ1 + (log p)−1 + (log p)−(1−ρ) δ    σ b 2 −c1 n −c2 +p e +p +P − 1 ≥ ε1 σ  p2 −1 −(1−ρ) 0 −1−γ1 + C (log p) + c (log p) + C(log p) + 2 −1 . (53) p0 p √ Recall that ε2 = s0 (log p)/ n. We take ε1 = s0 (log p)/n. By [JM14a, Lemma 3.3], we have that for this choice of ε1 , P {|b σ /σ − 1| ≥ ε1 } → 0 and hence Eq.(40) holds. Likewise, (41) holds because continuing from (52) and by applying reverse Fatou Lemma, we can 23 write  Z tp  P i∈S≤0 I(Ti ≥ t) P − 1 ≥ δ dt ≤ pG(t) 0 Z tp h   2 2 C ε21 + ε22 + ε21 t4p + ε22 t2p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2 0    i σ b 2 2 −c1 n −c2 2 t2p e +p +P + tp e − 1 ≥ ε1 + c0 pρ−1 e(1−ρ)t /2 + Cp−1 et /2 + C(log p)−1−γ1 dt σ    2 2 ≤ C ε21 tp + ε22 tp + ε21 t5p + ε22 t3p 1 + (log p)−1−γ1 + p−1 et /2 + pρ−1 e(1−ρ)t /2    σ b 2 2 3 t2p −c1 n −c2 + tp e e +p +P − 1 ≥ ε1 + c0 pρ−1 tp e(1−ρ)tp /2 + Cp−1 tp etp /2 + Ctp (log p)−1−γ1 σ    ≤ 2C ε21 (log p)5/2 + ε22 (log p)3/2 1 + (log p)−1−γ1 + (log p)−1 + (log p)−(1−ρ)    σ b −c1 n −c2 2 −1/2 + c(log p)−(1/2−ρ) + C(log p)−1/2 + C(log p)−1/2−γ1 e +p +P − 1 ≥ ε1 + p (log p) σ = o((log p)−1/2 ) = o(vp ) . (54) In theplast step we used the probabilistic bound on |b σ /σ − 1|, given in [SZ12, Theorem 2.1], with  √ 2 ε1 = s0 (log p)/n, and used the assumption s0 = o n/(log p) . This shows that Eq. (41) holds and hence completes the proof. 7.2 Proof of Theorem 4.1 The threshold t0 retuned by the FCD procedure is data-dependent. To analyze the power, we first upper bound t0 by a data-independent threshold t∗ . Lemma 7.4. Under the assumptions of Theorem 4.1, we have   qs0 −1 t0 ≤ t∗ , t∗ = Φ 1− (1 − o(1)) . 2p Proof of Lemma 7.4 is given in Appendix A.3. Since t0 ≤ t∗ by Lemma 7.4, if we replace t0 by t∗ , we obtain a lower bound on the power. For fixed arbitrarily small constants c0 , δ, ε, define n o G = G(δ, c0 , ε) = max |Λii − Ωii | ≤ c0 , |b σ /σ − 1| ≤ δ, k∆k∞ ≤ ε . Define S+ ≡ {i ∈ [p] : θ0,i > 0} and S− ≡ {i ∈ [p] : θ0,i < 0}. Therefore, S = S+ ∪ S− . We have 24  d j = sign(θ0,j )}|  |{j ∈ Sb : sign Power = E max(|S|, 1) 1 X 1 X = P(Ti ≤ −t∗ ) P(Ti ≥ t∗ ) + s0 s0 + i∈S+ = 1 s0 = 1 s0 i∈S0 √   X  √nθbd 1 X  nθbid i √ P ≥ t∗ + P √ ≤ −t∗ s0 σ b Λii σ b Λii i∈S+ i∈S−     √ √ X nθ0,i + ∆i nθ0,i + ∆i 1 X σe σe √ √ ≥ t∗ + ≤ −t∗ P Zi + P Zi + σ b s0 σ b σ b Λii σ b Λii i∈S i∈S (55) − + √ √ Define ηi ≡ ( nθ0,i + ∆i )/(σ Λii ). On event G, we have √ √ nθ0,i − ε nθ0,i + ε − + ηi ≥ ηi ≡ √ , ηi ≤ ηi ≡ √ . σ Ωii + c0 σ Ωii − c0 Using Equation (55), we have h  h  1 X σ b i 1 X −b σ i Power ≥ P Zi + ηi ≥ t∗ · I(G) + P Zi + η i ≤ t∗ · I(G) − P(G c ) s0 σ s0 σ i∈S+ i∈S− h i  i  X 1 X h 1 P Zi + ηi− ≥ (1 + δ)t∗ · I(G) + P Zi + ηi+ ≤ −(1 + δ)t∗ · I(G) − P(G c ) ≥ s0 s0 i∈S+ i∈S−   1 X 1 X = P Zi + ηi− ≥ (1 + δ)t∗ P(G) + P Zi + ηi+ ≤ −(1 + δ)t∗ P(G) − P(G c ) . s0 s0 i∈S+ i∈S− √ Recall that s0 = o( n/(log p)2 ) as per Condition (i), and by using Proposition 2.1 and lemmas 2.2 √ p and 2.4, event G holds with high probability and indeed it is easy to see that for θmin > (σ/ n) 2 log(p/s0 ), we have P(G c ) lim sup = 0. n→∞ 1 − β(θ0 , n) Therefore, Power ≥ n→∞ 1 − β(θ0 , n) X   X  1 − + lim inf P Zi + ηi ≥ (1 + δ)t∗ + P Zi + ηi ≤ −(1 + δ)t∗ . n→∞ s0 (1 − β(θ0 , n)) lim inf i∈S+ i∈S− 25 (56) Since the above bound holds for all ε, δ, c0 > 0, we get Power 1 − β(θ0 , n)  X   X  √ √ nθ0,i nθ0,i 1 P Zi + √ ≥ t∗ + ≤ −t∗ ≥ lim inf P Zi + √ n→∞ s0 (1 − β(θ0 , n)) σ Ωii σ Ωii i∈S− i∈S+  o  √ nX n|θ0,i | 1 = lim inf 1 − Φ t∗ − √ n→∞ s0 (1 − β(θ0 , n)) σ Ωii i∈S   √ n1 X n|θ0,i | o 1 qs0 = lim inf = 1. F , √ n→∞ (1 − β(θ0 , n)) s0 p σ Ωii i∈S lim inf n→∞ (57) The last step holds by using the definition of function F (·, ·), given by Equation (28), and the fact that Zi |X ∼ N(0, 1). Acknowledgements A.J. was partially supported by a Google Faculty Research Award. A.J. would also like to acknowledge the financial support of the Office of the Provost at the University of Southern California through the Zumberge Fund Individual Grant Program. 26 A A.1 Proof of Technical Lemmas Proof of Lemma 7.2 For t ≥ 0, we write G ((1 − δ)t − ε) =1+ G(t) Rt (1−δ)t−ε φ(x)dx G(t) ≤1+ (ε + δt)φ((1 − δ)t − ε) , G(t) (58) where we used that φ(t) is a decreasing function. We next separate the cases of t ∈ (0, 1) and t ≥ 1. For 0 < t < 1, we use the following bound p φ(t) ≤ ( 4 + t2 − t)φ(t) ≤ G(t) , (59) where the last step is due to Birnbaum [B+ 42]. Moreover, for all t ≥ 0, n o 1 φ((1 − δ)t − ε) = exp t(δt + ε) − ((1 − δ)t + ε)2 φ(t) 2 n o ≤ exp t(δt + ε) ≤ e2 , (60) because by our assumption δ 2 t ≤ 1 and εt ≤ 1. By employing Eqs. (59) and (60) into Eq. (58), we obtain G ((1 − δ)t − ε) ≤ 1 + e2 (ε + δt) ≤ 1 + e2 (ε + δ) . G(t) (61) For t ≥ 1, using Lemma 7.1, we have that G(t) ≥ φ(t)/t and hence by using Eq. (60) into Eq. (58), we get G ((1 − δ)t − ε) ≤ 1 + e2 t(ε + δt) . G(t) The result follows by combining the bound (61) and (62). A.2 Proof of Lemma 7.3 We write P   X   P b i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} P max ≥δ ≤ P ≥δ 0≤j≤b pQ(τj ) pQ(τj ) j=1   P   P Z b X 1 tp i∈S≤0 {I(Ti ≥ τj ) − Q(τj )} i∈S≤0 I(Ti ≥ t) ≤ P − 1 ≥ δ dt + P ≥δ vp 0 pQ(t) pQ(τj ) j=b−1 Therefore, it suffices to show that  Z tp  P i∈S≤0 I(Ti ≥ t) P − 1 ≥ δ dt = o(vp ) , pQ(t) 0 and  P sup P i∈S≤0 0≤t≤tp I(Ti ≥ t) pQ(t) which are the conditions of the lemma. 27  − 1 ≥ δ dt = o(1) , (62) A.3 Proof of Lemma 7.4 p p We first show that t∗ < 2 log(p/s0 ). Assuming otherwise, we have G(t∗ ) < G( 2 log(p/s0 )) because G(t) is decreasing. By definition of t∗ , and Lemma 7.1 this results in r p s0 qs0 2 e− log(p/s0 ) p = p , (1 − o(1)) = G(t∗ ) < G( 2 log(p/s0 )) ≤ p π 2 log(p/s0 ) p π log(p/s0 ) which is a contradiction. p √ Now, given that t∗ < 2 log(p/s0 ) < 2 log p, if the claim is not true, by definition of t0 , we should have 2p(1 − Φ(t∗ )) > q. R(t∗ ) ∨ 1 (63) We next show that R(t∗ ) ≥ s0 (1 − o(1)). Define n o G = G(δ, c0 , ε) = max |Λii − Ωii | ≤ c0 , |b σ /σ − 1| ≤ δ, k∆k∞ ≤ ε b ∗ ) = {i ∈ [p] : |Ti | > t∗ }. Using Proposition (2.1), for fixed i ∈ S, we have Define S(t b ∗ )) = P(|Ti | ≤ t∗ ) P(i ∈ / S(t   √ nθ0,i σ ∆i √ + Zi + √ ≤ t∗ , =P σ b σ b Λii σ b Λii √ √ with Zi ∼ N(0, 1). Define ηi ≡ ( nθ0,i + ∆i )/(σ Λii ). On event G, we have √ n|θ0,i | − ε |ηi | ≥ ηi,∗ ≡ √ σ Ωii + c0 (64) Continuing from Equation (64), we have      σ b σ b b P(i ∈ / S(t∗ )) = P |Zi + ηi | ≤ t∗ ≤ P |Zi + ηi,∗ | ≤ t∗ · I(G) + P(G c ) σ σ    σ b ≤ P ηi,∗ − t∗ ≤ |Zi | · I(G) + P(G c ) . σ p √ p Given that θ0,i > (σ/ n) 2Ωii log(p/s0 ) and t∗ < 2 log(p/s0 ), we can choose δ, c0 , ε and ε0 small enough such that on event G = G(δ, c0 , ε), ηi,∗ − σ b t∗ ≥ t∗ , σ and therefore    σ b ηi,∗ − t∗ ≤ |Zi | · I(G) + P(G c ) σ ≤ P ((t∗ ≤ |Zi |) · I(G)) + P(G c ) b ∗ )) ≤ P P(i ∈ / S(t ≤ G(t∗ ) + P(G c )   qs0 ≤ + P(G c ) p 28 (65) √ Since P(G c ) → 0 and s0 = o( n/(log p)2 ), we can choose a deterministic sequence Ln → ∞, arbitrarily slow, as n → ∞, such that Ln P(G c ) → 0 and Ln (s0 /p) → 0. Letting An ≡ (qs0 /p) + P(G c ), we have Ln An → 0. By applying Markov inequality we obtain 1 b ∗ )c |) E(|S0 ∩ S(t s0 Ln An s0 An 1 ≤ = , s0 Ln An Ln b ∗ )c | ≥ s0 Ln An ) ≤ P(|S ∩ S(t (66) b ∗ )c | ≤ s0 Ln An , where the last inequality follows from (65). Therefore, with high probability, |S0 ∩ S(t which implies that b ∗ )| ≥ |S| − |S ∩ S(t b ∗ )c | ≥ s0 (1 − Ln An ) , R(t∗ ) = |S(t (67) as claimed. Now using Equation (67) in Equation (63), we arrive at 1 − Φ(t∗ ) > Therefore, for t∗ , given by −1 t∗ = Φ  qs0 (1 − Ln An ) . 2p qs0 1− (1 − 2Ln An ) 2p  , we reach a contradiction which proves our claim t0 ≤ t∗ is correct. The proof is complete by noting that Ln An = o(1) by choice of sequence Ln . A.4 Proof of Corollary 4.3 Define qs0 αn = , p √ un ≡ nθmin √ . σ Ωii Using Corollary 4.2, it suffices to show that F (αn , un ) = 1−Φ(Φ−1 (1−αn /2)−un ) → 1. Equivalently, we show that Φ−1 (1 − αn /2) − un → −∞. By Lemma 7.1, we have p p p 2φ( 2 log(2/αn )) G( 2 log(2/αn )) < p < 2φ( 2 log(2/αn )) = αn . (68) 2 log(2/αn ) Since G is a decreasing function, by applying G−1 on both sides, we get p Φ−1 (1 − α/2) = G−1 (αn ) ≤ 2 log(2/αn ) Using the above bound, we have un − Φ−1 (1 − αn /2) > un − p 2 log(2/αn ) (69) By the assumption on θmin , we have that the left-hand side of (69) goes to ∞, which completes the proof. 29 References [B+ 42] Z. W. Birnbaum et al. An inequality for mill’s ratio. The Annals of Mathematical Statistics, 13(2):245–246, 1942. 27 [BC13] A. Belloni and V. Chernozhukov. Least Squares after Model Selection in HighDimensional Sparse Models. Bernoulli, 19(2):521–547, 2013. 8 [BC15] R. F. Barber and E. J. Candès. Controlling the false discovery rate via knockoffs. The Annals of Statistics, 43(5):2055–2085, 2015. 2, 13, 14 [BC16] R. F. Barber and E. J. Candes. A knockoff filter for high-dimensional selective inference. arXiv:1602.03574, 2016. 4 [BCS18] R. F. Barber, E. J. Candès, and R. J. Samworth. Robust inference with knockoffs. arXiv preprint arXiv:1801.03896, 2018. 2 [BH95] Y. Benjamini and Y. Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological), pages 289–300, 1995. 2 [BRT09] P. J. Bickel, Y. Ritov, and A. B. Tsybakov. Simultaneous analysis of Lasso and Dantzig selector. Amer. J. of Mathematics, 37:1705–1732, 2009. 5 [Büh12] P. Bühlmann. Statistical significance in high-dimensional linear models. arXiv:1202.1377, 2012. 5 [BY01] Y. Benjamini and D. Yekutieli. The control of the false discovery rate in multiple testing under dependency. Annals of statistics, pages 1165–1188, 2001. 2 [CFJL18] E. Candes, Y. Fan, L. Janson, and J. Lv. Panning for gold: Model-x knockoffs for high dimensional controlled variable selection. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2018. 2 [CP09] E. Candès and Y. Plan. Near-ideal model selection by `1 minimization. The Annals of Statistics, 37(5A):2145–2177, 2009. 5 [CT05] E. J. Candés and T. Tao. Decoding by linear programming. IEEE Trans. on Inform. Theory, 51:4203–4215, 2005. 5 [FDLL17] Y. Fan, E. Demirkaya, G. Li, and J. Lv. Rank: large-scale inference with graphical nonlinear knockoffs. arXiv preprint arXiv:1709.00092, 2017. 2, 4 [FGH12] J. Fan, S. Guo, and N. Hao. Variance estimation using refitted cross-validation in ultrahigh dimensional regression. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(1):1467–9868, 2012. 8 [FHG12] J. Fan, X. Han, and W. Gu. Control of the false discovery rate under arbitrary covariance dependence (with discussion). Journal of American Statistical Association, 107:1019–1045, 2012. 2 30 [FL01] J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456):1348–1360, 2001. 8 [FL08] J. Fan and J. Lv. Sure independence screening for ultrahigh dimensional feature space. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 70(5):849–911, 2008. 8 [GLN02] C. R. Genovese, N. A. Lazar, and T. Nichols. Thresholding of statistical maps in functional neuroimaging using the false discovery rate. Neuroimage, 15(4):870–878, 2002. 2 [GR04] E. Greenshtein and Y. Ritov. Persistence in high-dimensional predictor selection and the virtue of over-parametrization. Bernoulli, 10:971–988, 2004. 5 [GT00] A. Gelman and F. Tuerlinckx. Type s error rates for classical and bayesian single and multiple comparison procedures. Computational Statistics, 15(3):373–390, 2000. 3 [JM13] A. Javanmard and A. Montanari. Model selection for high-dimensional regression under the generalized irrepresentability condition. In Advances in neural information processing systems, pages 3012–3020, 2013. 5 [JM14a] A. Javanmard and A. Montanari. Confidence intervals and hypothesis testing for highdimensional regression. The Journal of Machine Learning Research, 15(1):2869–2909, 2014. 2, 5, 6, 7, 8, 23 [JM14b] A. Javanmard and A. Montanari. Hypothesis Testing in High-Dimensional Regression under the Gaussian Random Design Model: Asymptotic Theory. IEEE Trans. on Inform. Theory, 60(10):6522–6554, 2014. 2, 5 [JM18] A. Javanmard and A. Montanari. De-biasing the lasso: Optimal sample size for gaussian designs. To appear in Annals of Statistics, 2018. 5 [KF00] K. Knight and W. Fu. Asymptotics for lasso-type estimators. Annals of Statistics, pages 1356–1378, 2000. 5 [Liu13] W. Liu. Gaussian graphical model estimation with false discovery rate control. The Annals of Statistics, pages 2948–2978, 2013. 20, 22 [Lou08] K. Lounici. Sup-norm convergence rate and sign concentration property of lasso and dantzig estimators. Electronic Journal of statistics, 2:90–102, 2008. 5 [MB06] N. Meinshausen and P. Bühlmann. High-dimensional graphs and variable selection with the lasso. Ann. Statist., 34:1436–1462, 2006. 5 [Owe05] A. B. Owen. Variance of the number of false discoveries. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(3):411–426, 2005. 10 31 [RFZ+ 05] S.-Y. Rhee, W. J. Fessel, A. R. Zolopa, L. Hurley, T. Liu, J. Taylor, D. P. Nguyen, S. Slome, D. Klein, M. Horberg, et al. Hiv-1 protease and reverse-transcriptase mutations: correlations with antiretroviral therapy in subtype b isolates and implications for drug-resistance surveillance. The Journal of infectious diseases, 192(3):456–465, 2005. 14 [RTF16] S. Reid, R. Tibshirani, and J. Friedman. A study of error variance estimation in lasso regression. Statistica Sinica, pages 35–67, 2016. 8 [RTW+ 06] S.-Y. Rhee, J. Taylor, G. Wadhera, A. Ben-Hur, D. L. Brutlag, and R. W. Shafer. Genotypic predictors of human immunodeficiency virus type 1 drug resistance. Proceedings of the National Academy of Sciences, 103(46):17355–17360, 2006. 13, 15 [RYB03] A. Reiner, D. Yekutieli, and Y. Benjamini. Identifying differentially expressed genes using false discovery rate controlling procedures. Bioinformatics, 19(3):368–375, 2003. 2 [SBvdG10] N. Städler, P. Bühlmann, and S. van de Geer. `1 -penalization for Mixture Regression Models (with discussion). Test, 19:209–285, 2010. 8 [SRC+ 15] W. Sun, B. Reich, T. Cai, M. Guindani, and A. Schwartzman. False discovery control in large-scale spatial multiple testing. Journal of the Royal Statistical Society, Series B, 77:59–83, 2015. 2 [SZ12] T. Sun and C.-H. Zhang. Scaled sparse linear regression. Biometrika, 99(4):879–898, 2012. 8, 24 [Tib96] R. Tibshirani. Regression shrinkage and selection with the Lasso. J. Royal. Statist. Soc B, 58:267–288, 1996. 6 [Tuk91] J. W. Tukey. The philosophy of multiple comparisons. Statistical science, pages 100– 116, 1991. 3 [vdGB09] S. van de Geer and P. Bühlmann. On the conditions used to prove oracle results for the lasso. Electron. J. Statist., 3:1360–1392, 2009. 5 [VdGBRD14] S. Van de Geer, P. Bühlmann, Y. Ritov, and R. Dezeure. On asymptotically optimal confidence regions and tests for high-dimensional models. The Annals of Statistics, 42(3):1166–1202, 2014. 2, 5, 6 [VdV00] A. W. Van der Vaart. Asymptotic statistics, volume 3. Cambridge university press, 2000. 2 [Wai09] M. Wainwright. Sharp thresholds for high-dimensional and noisy sparsity recovery using `1 -constrained quadratic programming. IEEE Trans. on Inform. Theory, 55:2183– 2202, 2009. 5 [Wu08] W. B. Wu. On false discovery control under dependence. Ann. Statist., 36:364–380, 2008. 2 32 [XCML11] J. Xie, T. T. Cai, J. Maris, and H. Li. Optimal false discovery rate control for dependent data. Statistics and Its Interface, 4(4):417–430, 2011. 2 [Zha10] C.-H. Zhang. Nearly unbiased variable selection under minimax concave penalty. The Annals of Statistics, 38(2):894–942, 2010. 8 [ZY06] P. Zhao and B. Yu. On model selection consistency of Lasso. The Journal of Machine Learning Research, 7:2541–2563, 2006. 5 [ZZ11] C.-H. Zhang and S. Zhang. Confidence Intervals for Low-Dimensional Parameters in High-Dimensional Linear Models. arXiv:1110.2563, 2011. 5 [ZZ14] C.-H. Zhang and S. S. Zhang. Confidence intervals for low dimensional parameters in high dimensional linear models. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 76(1):217–242, 2014. 2, 5, 6 33
7cs.IT
Algebraic Meta-Theory of Processes with Data Daniel Gebler Department of Computer Science, VU University Amsterdam (VU), De Boelelaan 1081a, NL-1081 HV Amsterdam, The Netherlands Eugen-Ioan Goriac ICE-TCS, School of Computer Science, Reykjavik University, Menntavegur 1, IS-101, Reykjavik, Iceland Mohammad Reza Mousavi Center for Research on Embedded Systems (CERES), Halmstad University Kristian IV:s väg 3, SE-302 50, Halmstad, Sweden There exists a rich literature of rule formats guaranteeing different algebraic properties for formalisms with a Structural Operational Semantics. Moreover, there exist a few approaches for automatically deriving axiomatizations characterizing strong bisimilarity of processes. To our knowledge, this literature has never been extended to the setting with data (e.g. to model storage and memory). We show how the rule formats for algebraic properties can be exploited in a generic manner in the setting with data. Moreover, we introduce a new approach for deriving sound and ground-complete axiom schemata for a notion of bisimilarity with data, called stateless bisimilarity, based on intuitive auxiliary function symbols for handling the store component. We do restrict, however, the axiomatization to the setting where the store component is only given in terms of constants. 1 Introduction Algebraic properties capture some key features of programming and specification constructs and can be used both as design principles (for the semantics of such constructs) as well as for verification of programs and specifications built using them. When given the semantics of a language, inferring properties such as commutativity, associativity and unit element, as well deriving sets of axioms for reasoning on the behavioural equivalence of two processes constitute one of the cornerstones of process algebras [7, 39] and play essential roles in several disciplines for behavioural modeling and analysis such as term rewriting [6] and model checking [9]. For formalisms with a Structural Operational Semantics (SOS), there exists a rich literature on metatheorems guaranteeing key algebraic properties (commutativity [32], associativity [17], zero and unit elements [4], idempotence [1], and distributivity [3]) by means of restrictions on the syntactic shape of the transition rules. At the same time, for GSOS [13], a restricted yet expressive form of SOS specifications, one can obtain a sound and ground-complete axiomatization modulo strong bisimilarity [2]. Supporting some form of data (memory or store) is a missing aspect of these existing meta-theorems, which bars applicability to the semantics of numerous programming languages and formalisms that do feature these aspects in different forms. In this paper we provide a natural and generic link between the meta-theory of algebraic properties and axiomatizations, and SOS with data for which we consider that one data state models the whole memory. Namely, we move the data terms in SOS with data to the labels and instantiate them to closed terms; we call this process currying. Currying allows us to apply directly the existing rule formats for algebraic properties on the curried SOS specifications (which have process terms as states and triples of J. Borgström and B. Luttik (Eds.): Combined Workshop on Expressiveness in Concurrency and Structural Operational Semantics (EXPRESS/SOS 2013) EPTCS 120, 2013, pp. 63–77, doi:10.4204/EPTCS.120.6 c Gebler, Goriac & Mousavi This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works License. Algebraic Meta-Theory of Processes with Data 64 the form (datum, label, datum) as labels). We also present a new way of automatically deriving sound and ground-complete axiomatization schemas modulo strong bisimilarity for the curried systems for the setting in which the data component is characterized by constants. It turns out that strong bisimilarity for the curried SOS specification coincides with the notion of stateless bisimilarity in the original SOS specifications with data. The latter notion is extensively studied in [31] and used, among others, in [12, 20, 10, 11]. (This notion, in fact, coincides with the notion of strong bisimilarity proposed for Modular SOS in [27, Section 4.1].) Hence, using the existing rule formats, we can obtain algebraic laws for SOS specification with data that are sound with respect to stateless bisimilarity, as well as the weaker notions of initially stateless bisimilarity and statebased bisimilarity, studied in [31]. Related work. SOS with data and store has been extensively used in specifying semantics of programming and specification languages, dating back to the original work of Plotkin [36, 37]. Since then, several pieces of work have been dedicated to providing a formalization for SOS specification frameworks allowing one to include data and store and reason over it. The current paper builds upon the approach proposed in [31] (originally published as [29]). The idea of moving data from the configurations (states) of operational semantics to labels is reminiscent of Modular SOS [26, 27], Enhanced SOS [18], the Tile Model [19], and context-dependentbehaviour framework of [16]. The idea has also been applied in instances of SOS specification, such as those reported in [8, 10, 33]. The present paper contributes to this body of knowledge by presenting a generic transformation from SOS specifications with data and store (as part of the configuration) to Transition System Specifications [13, 22]. The main purpose of this generic transformation is to enable exploiting the several existing rule formats defined on transition system specifications on the results of the transformation and then, transform the results back to the original SOS specifications (with data and store in the configuration) using a meaningful and well-studied notion of bisimilarity with data. Our transformation is also inspired by the translation of SOS specifications of programming languages into rewriting logic, see e.g., [24, 25]. Structure of the paper. The rest of this paper is organized as follows. In Section 2, we recall some basic definitions regarding SOS specifications and behavioural equivalences. In Section 3, we present the currying technique and formulate the theorem regarding the correspondence between strong and stateless bisimilarity. In Section 4 we show how to obtain sound and ground-complete axiomatizations modulo strong bisimilarity for those curried systems for which the domain of the data component is a finite set of constants. We apply the currying technique to Linda [15], a coordination language from the literature chosen as case study in Section 5, and show how key algebraic properties of the operators defined in the language semantics are derived. We conclude the paper in Section 6, by summarizing the results and presenting some directions for future work. 2 Preliminaries 2.1 Transition Systems Specifications We assume a multisorted signature Σ with designated and distinct sorts P and D for processes and data, respectively. Moreover, we assume infinite and disjoint sets of process variables VP (typical members: xP , yP , xPi , yPi . . .) and data variables VD (typical members: xD , yD , xDi , yDi . . .), ranging over their respective sorts P and D. Gebler, Goriac & Mousavi 65 Process and data signatures, denoted respectively by ΣP ⊆ Σ and ΣD ⊆ Σ, are sets of function symbols with fixed arities. We assume in the remainder that the function symbols in ΣD take only parameters of the sort ΣD , while those in ΣP can take parameters both from ΣP and ΣD , as in practical specifications of systems with data, process function symbols do take data terms as their parameters. Terms are built using variables and function symbols by respecting their domains of definition. The sets of open process and data terms are denoted by T(ΣP ) and T(ΣD ), respectively. Disjointness of process and data variables is mostly for notational convenience. Function symbols from the process signature are typically denoted by fP , gP , fPi and gPi . Process terms are typically denoted by tP , t′P , ′ and f , and data and tPi . Function symbols from the data signature are typically denoted by fD , fD Di terms are typically denoted by tD , t′D , and tDi . The sets of closed process and data terms are denoted by T (ΣP ) and T (ΣD ), respectively. Closed process and data terms are typically denoted by p, q, p′ , pi , p′i and d, e, d′ , di , d′i , respectively. We denote process and data substitutions by σ, σ ′ , and ξ, ξ ′ , respectively. We call substitutions σ : VP → T(ΣP ) process substitutions and ξ : VD → T(ΣD ) data substitutions. A substitution replaces a variable in an open term with another (possibly open) term. Notions of open and closed and the concept of substitution are lifted to formulae in the natural way. Definition 1 (Transition System Specification). Consider a signature Σ and a set of labels L (with typical members l, l′ , l0 , . . .). A positive transition formula is a triple (t, l, t′ ), where t, t′ ∈ T(Σ) and l l ∈ L, written t − → t′ , with the intended meaning: process t performs the action labeled as l and becomes ′ process t . A transition rule is defined as a tuple (H, α), where H is a set of formulae and α is a formula. The formulae from H are called premises and the formula α is called the conclusion. A transition rule is H and has the following generic shape: mostly denoted by α lij {ti −→ tij | i ∈ I, j ∈ Ji } (d) l t− → t′ , where I, Ji are sets of indexes, t, t′ , ti , tij ∈ T(Σ), and lij ∈ L. A transition system specification (abbreviated TSS) is a tuple (Σ, L, R) where Σ is a signature, L is a set of labels, and R is a set of transition rules of the provided shape. We extend the shape of a transition rule to handle process terms paired with data terms in the following manner: lij (d’) {(tPi , tDi ) −→ (tPij , tDij ) | i ∈ I, j ∈ Ji } l (tP , tD ) − → (t′P , t′D ) , where I, Ji are index sets, tP , t′P , tPi , tPij ∈ T(ΣP ), tD , t′D , tDi , tDij ∈ T(ΣD ), and lij ∈ L. A transition system specification with data is a triple T = (ΣP ∪ ΣD , L, R) where ΣP and ΣD are process and data signatures respectively, L is a set of labels, and R is a set of transition rules handling pairs of process and data terms. Definition 2. Let T be a TSS with data. A proof of a formula φ from T is an upwardly branching tree whose nodes are labelled by formulas such that 1. the root node is labelled by φ, and Algebraic Meta-Theory of Processes with Data 66 2. if ψ is the label of a node q and the set {ψi | i ∈ I} is the set of labels of the nodes directly above {χi | i ∈ I} , a process substitution σ, and a data substitution q, then there exist a deduction rule χ ξ such that the application of these substitutions to χ gives the formula ψ, and for all i ∈ I, the application of the substitutions to χi gives the formula ψi . Note that by removing the data substitution ξ from above we obtain the definition for proof of a formula from a standard TSS. The notation T ⊢ φ expresses that there exists a proof of the formula φ from the TSS (with data) T . Whenever T is known from the context, we will write φ directly instead of T ⊢ φ. 2.2 Bisimilarity In this paper we use two notions of equivalence over processes, one for standard transition system specifications and one for transition system specifications with data. Stateless bisimilarity is the natural counterpart of strong bisimilarity, used in different formalisms such as [10, 11, 12, 20]. Definition 3 (Strong Bisimilarity [34]). Consider a TSS T = (ΣP , L, R). A relation R ⊆ T (ΣP ) × l → p′ ⇒ T (ΣP ) is a strong bisimulation if and only if it is symmetric and ∀p,q (p, q) ∈ R ⇒ (∀l,p′ p − l → q ′ ∧ (q, q ′ ) ∈ R). Two closed terms p and q are strongly bisimilar, denoted by p ↔T q if there ∃q ′ q − exists a strong bisimulation relation R such that (p, q) ∈ R. Definition 4 (Stateless Bisimilarity [31]). Consider a TSS with data T = (ΣP ∪ ΣD , L, R). A relation Rsl ⊆ T (ΣP ) × T (ΣP ) is a stateless bisimulation if and only if it is symmetric and ∀p,q (p, q) ∈ Rsl ⇒ l l → (q ′ , d′ ) ∧ (p′ , q ′ ) ∈ Rsl . Two closed process terms p and q are → (p′ , d′ ) ⇒ ∃q′ (q, d) − ∀d,l,p′ ,d′ (p, d) − T stateless bisimilar, denoted by p ↔sl q, if there exists a stateless bisimulation relation Rsl such that (p, q) ∈ Rsl . 2.3 Rule Formats for Algebraic Properties As already stated, the literature on rule formats guaranteeing algebraic properties is extensive. For the purpose of this paper we show the detailed line of reasoning only for the commutativity of binary operators, while, for readability, we refer to the corresponding papers and theorems for the other results in Section 5. Definition 5 (Commutativity). Given a TSS and a binary process operator f in its process signature, f is called commutative w.r.t. ∼, if the following equation is sound w.r.t. ∼: f (x0 , x1 ) = f (x1 , x0 ). Definition 6 (Commutativity format [5]). A transition system specification over signature Σ is in commform format with respect to a set of binary function symbols COMM ⊆ Σ if all its f -defining transition rules with f ∈ COMM have the following form lij {xj −→ yij | i ∈ I} (c) l f (x0 , x1 ) − →t where j ∈ {0, 1}, I is an arbitrary index set, and variables appearing in the source of the conclusion and target of the premises are all pairwise distinct. We denote the set of premises of (c) by H and the Gebler, Goriac & Mousavi 67 conclusion by α. Moreover, for each such rule, there exist a transition rule (c’) of the following form in the transition system specification H′ (c’) l → t′ f (x′0 , x′1 ) − and a bijective mapping (substitution) h̄ on variables such that • h̄(x′0 ) = x1 and h̄(x′1 ) = x0 , • h̄(t′ ) ∼cc t and • h̄(h′ ) ∈ H, for each h′ ∈ H ′ , where ∼cc means equality up to swapping of arguments of operators in COMM in any context. Transition rule (c’) is called the commutative mirror of (c). Theorem 7 (Commutativity for comm-form [5]). If a transition system specification is in comm-form format with respect to a set of operators COMM, then all operators in COMM are commutative with respect to strong bisimilarity. 2.4 Sound and ground-complete axiomatizations In this section we recall several key aspects presented in [2], where the authors provide a procedure for converting any GSOS language definition that disjointly extends the language for synchronization trees to a finite complete equational axiom system which characterizes strong bisimilarity over a disjoint extension of the original language. It is important to note that we work with the GSOS format because it guarantees that bisimilarity is a congruence and that the transition relation is finitely branching [13]. For the sake of simplicity, we confine ourselves to the positive subset of the GSOS format; we expect the generalization to the full GSOS format to be straightforward. Definition 8 (Positive GSOS rule format). Consider a process signature ΣP . A positive GSOS rule ρ over ΣP has the shape: lij {xi −→ yij | i ∈ I, j ∈ Ji } (g) l , f (x1 , . . . , xn ) − → C[~x,~y ] where all variables are distinct, f is an operation symbol form ΣP with arity n, I ⊆ {1, . . . , n}, Ji finite for each i ∈ I, lij and l are labels standing for actions ranging over a given set denoted by L, and C[~x,~y ] is a ΣP -context with variables including at most the xi ’s and yij ’s. A finite tree term t is built according to the following grammar: t ::= 0 | l.t (∀l ∈ L) | t + t. We denote this signature by ΣBCCSP . Intuitively, 0 represents a process that does not exhibit any behaviour, s + t is the nondeterministic choice between the behaviours of s and t, while l.t is a process that first performs action l and behaves like t afterwards. The operational semantics that captures this intuition is given by the rules of BCCSP [21]: l x− → x′ l l.x − →x l x+y − → x′ l y− → y′ l x+y − → y′ . Algebraic Meta-Theory of Processes with Data 68 Definition 9 (Axiom System). An axiom (or equation) system E over a signature Σ is a set of equalities of the form t = t′ , where t, t′ ∈ T(Σ). An equality t = t′ , for some t, t′ ∈ T(Σ), is derivable from E, denoted by E ⊢ t = t′ , if and only if it is in the smallest congruence relation over Σ-terms induced by the equalities in E. We consider the axiom system EBCCSP which consists of the following axioms: x+y = y+x x+x = x (x + y) + z = x + (y + z) x+0 = x. Theorem 10 ([23]). EBCCSP is sound and ground-complete for bisimilarity on T (ΣBCCSP ). That is, it holds that EBCCSP ⊢ p = q if, and only if, p ↔BCCSP q for any two ground terms p and q ∈ T (ΣBCCSP ). Definition 11 (Disjoint extension). A GSOS system G′ is a disjoint extension of a GSOS system G, written G ⊑ G′ , if the signature and the rules of G′ include those of G, and G′ does not introduce new rules for operations in G. In [2] it is elaborated how to obtain an axiomatization for a GSOS system G that disjointly extends BCCSP. For technical reasons the procedure involves initially transforming G into a new system G′ that conforms to a restricted version of the GSOS format, named smooth and distinctive. We avoid presenting this restricted format, as the method proposed in Section 4 allows us to obtain the axiomatization without the need to transform the initial system G. 3 Currying Data We apply the process of currying [40] known from functional programming to factor out the data from the source and target of transitions and enrich the label to a triple capturing the data flow of the transition. This shows that, for specifying behaviour and data of dynamic systems, the data may be freely distributed over states (as part of the process terms) or system dynamics (action labels of the transition system), providing a natural correspondence between the notions of stateless bisimilarity and strong bisimilarity. An essential aspect of our approach is that the process of currying is a syntactic transformation defined on transition system specifications (and not a semantic transformation on transition systems); this allows us to apply meta-theorems from the meta-theory of SOS and obtain semantic results by considering the syntactic shape of (transformed) SOS rules. Definition 12 (Currying and Label Closure). Consider the TSS with data T = (ΣP ∪ ΣD , L, R) and lij transition rule ρ ∈ R of the shape ρ = {(tPi , tDi ) −→ (tPij , tDij ) | i ∈ I, j ∈ Ji } l (tP , tD ) − → (t′P , t′D ) . (tDi ,lij ,tDij ) The curried version of ρ is the rule ρc = {tPi −−−−−−−−→ tPij | i ∈ I, j ∈ Ji } . We further define (tD ,l,t′D ) ′ tP −−−−− → tP Rc = {ρc | ρ ∈ R} and Lc = {(tD , l, t′D ) | l ∈ L, tD , t′D ∈ T(ΣD )}. The curried version of T is defined as T c = (ΣP , Lc , Rc ). (ξ(tDi ),lij ,ξ(tDij )) By ρcξ = {tPi −−−−−−−−−−−→ tPij | i ∈ I, j ∈ Ji } (ξ(tD ),l,ξ(t′D )) tP −−−−−−−−−→ t′P we denote the closed label version of ρc with re- spect to the closed data substitution ξ. By cl(ρc ) we denote the set consisting of all closed label versions of ρc , i.e. cl(ρc ) = {ρcξ | ρc ∈ Rc , ξ is a closed data substitution}. We further define cl(Rc ) = {cl(ρc ) | Gebler, Goriac & Mousavi 69 ρc ∈ Rc } and cl(Lc ) = {(ξ(tD ), l, ξ(t′D )) | (tD , l, t′D ) ∈ Lc , ξ is a closed data substitution}. The closed label version of T c is cl(T c ) = (ΣP , cl(Lc ), cl(Rc )). Our goal is to reduce the notion of stateless bisimilarity between two closed process with data terms to strong bisimilarity by means of currying the TSS with data and closing its labels. The following theorem states how this goal can be achieved. Theorem 13. Given a TSS T = (Σ, L, D) with data, for each two closed process terms p, q ∈ T (ΣP ), c p ↔Tsl q if, and only if, p ↔cl(T ) q. 4 Axiomatizing GSOS with Data In this section we provide an axiomatization schema for reasoning about stateless bisimilarity. We find it easier to work directly with curried systems instead of systems with data because this allows us to adapt the method introduced in [2] by considering the set of more complex labels that integrate the data, as presented in Section 3. It is important to note that we present the schema by considering that the signature for data terms, ΣD , consists only of a finite set of constants. However, as we foresee a future extension to a setting with arbitrary data terms, we choose to use the notation for arbitrary data terms instead of the one for constants in some of the following definitions. BCCSP is extended to a setting with data, BCCSPD . This is done by adding to the signature for process terms ΣBCCSP two auxiliary operators for handling the store, named check and update, obtaining a new signature, ΣBCCSPD . Terms over ΣBCCSPD are build according to the following grammar: tP ::= 0 | l.tP ∀l∈L | check(tD , tP ) | update(tD , tP ) | tP + tP . Intuitively, operation check(tD , tP ) makes sure that, before executing an initial action from tP , the store has the value tD , and update(tD , tP ) changes the store value to tD after executing an initial action of process tP . The prefix operation does not affect the store. We directly provide the curried set of rules defining the semantics of BCCSPcD . (xD ,l,x′ ) (xD ,l,x′ ) D → x′P xP −−−−−− (xD ,l,xD ) l.xP −−−−−−→ xP (xD ,l,x′ ) D → x′P xP −−−−−− D check(xD , xP ) −−−−−− → x′P (xD ,l,x′ ) (xD ,l,x′ ) D yP −−−−−− → yP′ D xP −−−−−− → x′P (xD ,l,x′D ) xP + yP −−−−−−→ (xD ,l,yD ) update(yD , xP ) −−−−−−→ x′P x′P (xD ,l,x′D ) xP + yP −−−−−−→ . yP′ Definition 3 can easily be adapted to the setting of SOS systems with data that are curried. Definition 14. Consider a TSS T = (ΣP ∪ ΣD , L, R), which means that T c = (ΣP , Lc , Rc ). A relation R ⊆ T (ΣP ) × T (ΣP ) is a strong bisimulation if and only if it is symmetric and ∀p,q (p, q) ∈ R ⇒ (d,l,d′ ) (d,l,d′ ) ∀d,l,d′ ,p′ p −−−−→ p′ ⇒ ∃q′ q −−−−→ q ′ ∧ (q, q ′ ) ∈ R. Two closed terms p and q are strongly bisimilar, c denoted by p ↔T q if there exists a strong bisimulation relation R such that (p, q) ∈ R. Algebraic Meta-Theory of Processes with Data 70 The axiomatization EBCCSPcD of strong bisimilarity over BCCSPcD , which is to be proven sound and ground-complete in the remainder of this section, is given below: xP + y P xP + (yP + zP ) xP + xP xP + 0 check(xD , xP + yP ) update(xD , xP + yP ) check(xD , update(yD , xP )) update(xD , update(yD , xP )) check(d, check(d, xP )) check(d, check(d′ , xP )) l.xP = = = = = = = = = = = y P + xP (xP + yP ) + zP xP xP check(xD , xP ) + check(xD , yP ) update(xD , xP ) + update(xD , yP ) update(yD , check(xD , xP )) update(xD , xP ) xP (∀d ∈ ΣD ) 0 (∀d, d′ ∈ ΣD , d 6= d′ ) P d∈ΣD update(d, check(d, l.xP )) (n-comm) (n-assoc) (n-idem) (n-zero) (nc) (nu) (cu) (uu) (cc) (cc’) (lc) Recall that ΣD is a finite set of constants, and, therefore, the right hand side of axiom (lc) has a finite number of summands. The following theorem is proved in the standard fashion. Theorem 15 (Soundness). For each two terms s, t in T(ΣBCCSPcD ) it holds that if EBCCSPcD ⊢ s = t then c s ↔BCCSPD t. We now introduce the concept of terms in head normal form, which is essential for proving the completeness of axiom systems. Definition 16 (Head Normal Form). Let ΣP be a signature such that ΣBCCSPcD ⊆ ΣP . A term t in T(ΣP ) is in head normal form (for short, h.n.f.) if X t= update(t′Di , check(tDi , li .tP i )), i∈I where, for every i ∈ I, tDi , t′Di ∈ T(ΣD ), tP i ∈ T(ΣD ), li ∈ L. The empty sum (I = ∅) is denoted by the deadlock constant 0. Lemma 17 (Head Normalization). For any term p in T (ΣBCCSPcD ), there exists p′ in T (ΣBCCSPcD ) in h.n.f. such that EBCCSPcD ⊢ p = p′ . Proof. By induction on the number of symbols appearing in p. We proceed with a case distinction on the head symbol of p. Base case • p = 0; this case is vacuous, because p is already in h.n.f. Inductive step cases • p is of the shape l.p′ ; then def. p (lc) P ′ p = l.p′ = d∈T (ΣD ) update(d, check(d, l.p )), which is in h.n.f. • p is of the shape check(d′′ , p′′ ); then def. p ind. hyp. p = check(d′′ , p′′ ) = P (nc) P (cu) ′′ ′ ′ check(d′′ , i∈I update(d′i , check(di , li .p′i ))) = i∈I check(d , update(di , check(di , li .pi ))) = P (cc,cc’) P ′ ′ ′ ′′ ′ = i∈I,di =d′′ update(di , check(di , li .pi )), i∈I update(di , check(d , check(di , li .pi ))) which is in h.n.f. Gebler, Goriac & Mousavi 71 • p is of the form update(d′′ , p′′ ); then P ind. hyp. def. p (nu) p = update(d′′ , p′′ ) = update(d′′ , i∈I update(d′i , check(di , li .p′i ))) = P (uu) P ′′ ′ ′ ′′ ′ i∈I update(d , update(di , check(di , li .pi ))) = i∈I update(d , check(di , li .pi )), which is in h.n.f. • p is of the form p0 + p1 ; then ind. hyp. P def. p ′ ′′ ′ p = p + p = 0 1 i∈I check(d , update(di , check(di , li .pi ))) + P ′ ′′ ′ check(d , update(dj , check(dj , lj .pj ))) = Pj∈J ′ ′′ ′ k∈I∪J check(d , update(dk , check(dk , lk .pk ))), which is in h.n.f. Theorem 18 (Ground-completeness). For each two closed terms p, q ∈ T (ΣBCCSPcD ), it holds that if c p ↔BCCSPD q, then EBCCSPcD ⊢ p = q. Proof. We assume, by Lemma 17 that p, q are in h.n.f., define the function height as follows:   0 1 + max(height(p1 ), height(p2 )) height(p) =  1 + height(p′ ) if p = 0 if p = p1 + p2 if p = update(d′ , check(d, l.p′ )), and prove the property by induction on M = max(height(p), height(q)). Base case (M = 0) This case is vacuous, because p = q = 0, so EBCCSPcD ⊢ p = q. Inductive step case (M > 0) We prove EBCCSPcD ⊢ p = q + p by arguing that every summand of q is provably equal to a summand of p. Let update(d′ , check(d, l.q ′ )) be a summand of q. By applying the rules (d,l,d′ ) c (d,l,d′ ) defining BCCSPcD , we derive q −−−−→ q ′ . As q ↔BCCSPD p holds, it has to be the case that p −−−−→ p′ and c q ′ ↔BCCSPD p′ hold. As max(height(q ′ ), height(p′ )) < M , from the inductive hypothesis it results that EBCCSPcD ⊢ q ′ = p′ , hence update(d′ , check(d, l.q ′ )) is provably equal to update(d′ , check(d, l.p′ )), which is a summand of p. It follows, by symmetry, that EBCCSPcD ⊢ q = p + q holds, which ultimately leads to the fact that EBCCSPcD ⊢ p = q holds. Consider a TSS with data T = (ΣP ∪ ΣD , L, R). For an operation f ∈ ΣP , we denote by Rf the set of all rules defining f . All the rules in Rf are in the GSOS format extended with the data component. For the simplicity of presenting the axiomatization schema, we assume that f only has process terms as arguments, baring in mind that adding data terms is trivial. When given a signature ΣP that includes ΣBCCSPcD , the purpose of an axiomatization for a term c p ∈ T (ΣP ) is to derive another term p′ such that p ↔T p′ and p′ ∈ T (ΣBCCSPcD ). Definition 19 (Axiomatization schema). Consider a TSS T c = (ΣP , Lc , Rc ) such that BCCSPcD ⊑ T c . By ET c we denote the axiom system that extends EBCCSPcD with the following axiom schema for every operation f in T , parameterized over the vector of closed process terms p~ in h.n.f.: ) ( P H p, ρ) , ∈ cl(Rcf ) and X(~ update(d′ , check(d, l.C[~ p, y~P ])) ρ = f (~ p) = (d,l,d′ ) f (~ p) −−−−→ C[~ p, ~q] Algebraic Meta-Theory of Processes with Data 72 V where X is defined as X(~ p, ρ) = pk ∈~p X′ (pk , k, ρ),   (di ,lij ,d′ij ) − − − − − − → y | i ∈ I, j ∈ J } {x Pij i  Pi and X′ pk , k, = (d,l,d′ ) f (~ p) −−−−→ C[~ p, ~q] if k ∈ I then ∀j∈Jk ∃p′ ,p′′ EBCCSPcD ⊢ pk = update(d′kj , check(dk , lkj .p′ )) + p′′ . Intuitively, the axiom transforms f (~ p) into a sum of closed terms covering all its execution possibilities. We iterate, in order to obtain them, through the set of f -defining rules and check if ~p satisfies their hypotheses by using the meta-operation X. X makes sure that, for a given rule, every component of p~ is a term with enough action prefixed summands satisfying the hypotheses associated to that component. Note that the axiomatization is built in such a way that it always derives terms in head normal form. Also note that the sum on the right hand side is finite because of our initial assumption that the signature for data is a finite set of constants. The reason why we conceived the axiomatization in this manner is of practical nature. Our past experience shows that this type of schemas may bring terms to their normal form faster than finite axiomatizations. Aside this, we do not need to transform the initial system, as presented in [2]. Theorem 20. Consider a TSS T c = (ΣP , Lc , Rc ) such that BCCSPcD ⊑ T c . ET c is sound and groundcomplete for strong bisimilarity on T (ΣP ). Proof. It is easy to see that, because of the head normal form of the right hand side of every axiom, the completeness of the axiom schema reduces to the completeness proof for bisimilarity on T (ΣBCCSPcD ). In order to prove the soundness, we denote, for brevity, the right hand side of the schema in Definition 19 by RHS. Let us first prove that if f (~ p) performs a transition then it can be matched by RHS. Consider a rule ρ ∈ (di ,lij ,dij ) p): ρ = cl(Rcf ) that can be applied for f (~ {xi −−−−−−→ yij | i ∈ I, j ∈ Ji } (d,l,d′ ) (d,lij ,d′ ) . Then f (~ p) −−−−−→ C[~ p, ~ q] f (~x) −−−−→ C[~x,~y ] holds and, at the same time, all of the rule’s premises are met. This means that pi is of the form P ′ ′ j∈Ji update(dij , check(di , lij .pij )) + p for some p and pij ’s. It is easy to see that all the conditions for (di ,lij ,dij ) X are met, so (d, l, d′ ).C[~ p, ~ q ] is a summand of RHS, and therefore it holds that RHS −−−−−−→ C[~ p, ~ q ], witch matches the transition from f (~ p). The proof for the fact that f (~ p) can match any of the transitions of RHS is similar. We end this section with the remark that the problem of extending the axiomatization schema to the setting with arbitrary data terms is still open. The most promising solution we have thought of involves using the infinite alternative quantification operation from [38]. This operation would us to define and express head normal forms as (potentially) infinite sums, parameterized over data variables. 5 Case Study: The Coordination Language Linda In what follows we present the semantics and properties of a core prototypical language. The provided specification defines a structural operational semantics for the coordination language Linda; the specification is taken from [31] and is a slight adaptation of the original semantics presented in [14] (by removing structural congruences and introducing a terminating process ǫ). Process constants (atomic process terms) in this language are ǫ (for terminating process), ask(u) and nask(u) (for checking existence and absence of tuple u in the shared data space, respectively), tell(u) (for adding tuple u to the Gebler, Goriac & Mousavi 73 space) and get(u) (for taking tuple u from the space). Process composition operators in this language include nondeterministic choice (+), sequential composition (;) and parallel composition (k). The data signature of this language consists of a constant {} for the empty multiset and a class of unary function symbols ∪{u}, for all tuples u, denoting the union of a multiset with a singleton multiset containing tuple u. The operational state of a Linda program is denoted by (p, xD ) where p is a process term in the above syntax and xD is a multiset modeling the shared data space. The transition system specification defines one relation − → and one predicate ↓. Note that → − is unlabeled, unlike the other relations considered so far. Without making it explicit, we tacitly consider ↓ the termination predicate ↓ as a binary transition relation − → with the pair (xP , xD ), where xP and xD are fresh yet arbitrary process and data variables, respectively. Below we provide a table consisting of both the original and the curried and closed label versions of the semantics of Linda on the left and, respectively, on the right. (1) (2) (ask(u), xD ∪ {u}) − → (ǫ, xD ∪ {u}) (3) (4) (5) (6) (1c ) (ǫ, xD ) ↓ (tell(u), xD ) → (ǫ, xD ∪ {u}) (get(u), xD ∪ {u}) → (ǫ, xD ) (nask(u), xD ) → (ǫ, xD ) (xP , xD ) ↓ (xP + yP , xD ) ↓ (8) (9) (7) [u ∈ / xD ] (yP , xD ) ↓ (xP + yP , xD ) ↓ (xP , xD ) → (x′P , xD ′ ) (xP + yP , xD ) → (x′P , xD ′ ) (yP , xD ) → (yP′ , xD ′ ) (xP + yP , xD ) → (yP′ , xD ′ ) (xP , xD ) → (x′P , xD ′ ) (10) (xP ; yP , xD ) → (x′P ; yP , xD ′ ) (11) (xP , xD ) ↓ (yP , xD ) → (yP′ , xD ′ ) (xP ; yP , xD ) → (yP′ , xD ′ ) (12) (2c ) (d∪{u},−,d∪{u}) ask(u) −−−−−−−−−−→ ǫ (3c ) (d,−,d∪{u}) tell(u) −−−−−−−→ ǫ (4c ) (d∪{u},−,d) get(u) −−−−−−−→ ǫ [u ∈ / d] (d,−,d) nask(u) −−−−→ ǫ xP ↓ y↓ (6c ) (7c ) xP + y P ↓ xP + y P ↓ (5c ) (d,−,d′ ) xP −−−−−→ x′P (8c ) (d,−,d′ ) xP + yP −−−−−→ x′P (d,−,d′ ) (9c ) yP −−−−−→ yP′ (d,−,d′ ) xP + yP −−−−−→ yP′ (d,−,d′ ) xP −−−−−→ x′P (10c ) (d,−,d′ ) xP ; yP −−−−−→ x′P ; yP (11c ) (xP , xD ) ↓ (yP , xD ) ↓ (xP ; yP , xD ) ↓ (xP , xD ) → (x′P , xD ′ ) (13) (xP k yP , xD ) → (x′ k y, xD ′ ) ǫ↓ xP ↓ (d,−,d′ ) yP −−−−−→ yP′ (d,−,d′ ) xP ; yP −−−−−→ yP′ xP ↓ y P ↓ (12c ) xP ; y P ↓ (d,−,d′ ) (13c ) xP −−−−−→ x′P (d,−,d′ ) xP || yP −−−−−→ x′P || yP Algebraic Meta-Theory of Processes with Data 74 (14) (yP , xD ) → (yP′ , xD ′ ) (xP k yP , xD ) → (xP k yP′ , xD ′ ) (15) (xP , xD ) ↓ (yP , xD ) ↓ (xP k yP , xD ) ↓ (d,−,d′ ) (14c ) yP −−−−−→ yP′ (d,−,d′ ) xP || yP −−−−−→ xP || yP′ xP ↓ y P ↓ (15c ) xP k y P ↓ In the curried SOS rules, d and d′ are arbitrary closed data terms, i.e., each transition rule given in the curried semantics represents a (possibly infinite) number of rules for each and every particular d, d′ ∈ T (ΣD ). It is worth noting that by using the I-MSOS framework [28] we can present the curried system without explicit labels at all as they are propagated implicitly between the premises and conclusion. Consider transition rules (6c ), (7c ), (8c ), and (9c ); they are the only + - defining rules and they fit in the commutativity format of Definition 6. It follows from Theorem 7 that the equation x + y = y + x is sound with respect to strong bisimilarity in the curried semantics. Subsequently, following Theorem 13, we have that the previously given equation is sound with respect to stateless bisimilarity in the original semantics. (Moreover, we have that (x0 + x1 , d) = (x1 + x2 , d) is sound with respect to statebased bisimilarity for all d ∈ T (ΣD ).) Following a similar line of reasoning, we get that x || y = y || x is sound with respect to stateless bisimilarity in the original semantics. In addition, we derived the following axioms for the semantics of Linda, using the meta-theorems stated in the third column of the table. The semantics of sequential composition in Linda is identical to the sequential composition (without data) studied in Example 9 of [17]; there, it is shown that this semantics conforms to the A SSOC -D E S IMONE format introduced in [17] and hence, associativity of sequential composition follows immediately. Also semantics of nondeterministic choice falls within the scope of the A SSOC -D E S IMONE format (with the proposed coding of predicates), and hence, associativity of nondeterministic choice follows (note that in [17] nondeterministic choice without termination rules is treated in Example 1; moreover, termination rules in the semantics of parallel composition are discussed in Section 4.3 and shown to be safe for associativity). Following a similar line of reasoning associativity of parallel composition follows from the conformance of its rules to the A SSOC -D E S IMONE format of [17]. Idempotence for + can be obtained, because rules (6c ), (7c ) and (8c ), (9c ) are choice rules [1, Definition 40] and the family of rules (6c ) to (9c ) for all data terms d and d′ ensure that the curried specification is in idempotence format with respect to the binary operator +. The fact that ǫ is unit element for ; is proved similarly as in [4], Example 10. Property Axiom Meta-Theorem Associativity for ; x ; (y ; z) = (x ; y) ; z Theorem 1 of [17] x + (y + z) = (x + y) + z Theorem 1 of [17] Associativity for + Associativity for || x || (y || z) = (x || y) || z Theorem 1 of [17] x+x = x Theorem 42 of [1] Idempotence for + ǫ;x=x Theorem 3 of [4] Unit element for ; Distributivity of + over ; (x + y) ; z = (x ; y) + (x ; z) Theorem 3 of [3] We currently cannot derive an axiomatization for Linda because its semantics involves arbitrary data terms, as opposed to a finite number of constants. Gebler, Goriac & Mousavi 6 75 Conclusions In this paper, we have proposed a generic technique for extending the meta-theory of algebraic properties to SOS with data, memory or store. In a nutshell, the presented technique allows for focusing on the structure of the process (program) part in SOS rules and ignoring the data terms in order to obtain algebraic properties, as well as, a sound and ground complete set of equations w.r.t. stateless bisimilarity. We have demonstrated the applicability of our method by means of the well known coordination language Linda. It is also worth noting that one can check whether a system is in the process-tyft format presented in [30] in order to infer that stateless bisimilarity is a congruence, and if this is the case, then strong bisimilarity over the curried system is also a congruence. Our results are applicable to a large body of existing operators in the literature and make it possible to dispense with several lengthy and laborious soundness proofs in the future. Our approach can be used to derive algebraic properties that are sound with respect to weaker notions of bisimilarity with data, such as initially stateless and statebased bisimilarity [31]. We do expect to obtain stronger results, e.g., for zero element with respect to statebased bisimilarities, by scrutinizing data dependencies particular to these weaker notions. We would like to study coalgebraic definitions of the notions of bisimilarity with data (following the approach of [41]) and develop a framework for SOS with data using the bialgebraic approach. Furthermore, it is of interest to check how our technique can be applied to quantitative systems where non-functional aspects like probabilistic choice or stochastic timing is encapsulated as data. We also plan to investigate the possibility of automatically deriving axiom schemas for systems whose data component is given as arbitrary terms, instead of just constants. Acknowledgements. We thank Luca Aceto, Peter Mosses, and Michel Reniers for their valuable comments on earlier versions of the paper. Eugen-Ioan Goriac is funded by the project ‘Extending and Axiomatizing Structural Operational Semantics: Theory and Tools’ (nr. 1102940061) of the Icelandic Research Fund. References [1] Luca Aceto, Arnar Birgisson, Anna Ingólfsdóttir, Mohammad Reza Mousavi & Michel A. Reniers (2012): Rule formats for determinism and idempotence. Science of Computer Programming 77(7–8), pp. 889–907, doi:10.1016/j.scico.2010.04.002. [2] Luca Aceto, Bard Bloom & Frits W. Vaandrager (1994): Turning SOS rules into equations. Information and Computation 111, pp. 1–52, doi:10.1006/inco.1994.1040. [3] Luca Aceto, Matteo Cimini, Anna Ingólfsdóttir, Mohammad Reza Mousavi & Michel A. Reniers (2011): Rule Formats for Distributivity. In Adrian Horia Dediu, Shunsuke Inenaga & Carlos Martı́n-Vide, editors: Language and Automata Theory and Applications - 5th International Conference, LATA 2011, Tarragona, Spain, May 26–31, 2011. Proceedings, Lecture Notes in Computer Science 6638, Springer, pp. 80–91, doi:10.1007/978-3-642-21254-3 5. [4] Luca Aceto, Matteo Cimini, Anna Ingólfsdóttir, Mohammad Reza Mousavi & Michel A. Reniers (2011): SOS rule formats for zero and unit elements. Theoretical Computer Science 412(28), pp. 3045–3071, doi:10.1016/j.tcs.2011.01.024. [5] Luca Aceto, Anna Ingolfsdottir, MohammadReza Mousavi & Michel A. Reniers (2009): Algebraic Properties for Free! Bulletin of the European Association for Theoretical Computer Science (BEATCS) 99, pp. 81–104. 76 Algebraic Meta-Theory of Processes with Data [6] Franz Baader & Tobias Nipkow (1999): Term Rewriting and All That. Cambridge University Press. [7] J.C.M. (Jos) Baeten, Twan Basten & Michel A. Reniers (2010): Process Algebra: Equational Theories of Communicating Processes. Cambridge Tracts in Theoretical Computer Science, Cambrdige University Press. [8] Jos C. M. Baeten & Jan A. Bergstra (1997): Process Algebra with Propositional Signals. Theoretical Computer Science (TCS) 177(2), pp. 381–405, doi:10.1016/S0304-3975(96)00253-8. [9] Christel Baier & Joost-Pieter Katoen (2008): Principles of Model Checking. MIT Press. [10] D. A. van Beek, Ka Lok Man, Michel A. Reniers, J. E. Rooda & Ramon R. H. Schiffelers (2006): Syntax and consistent equation semantics of hybrid Chi. J. Log. Algebr. Program. 68(1-2), pp. 129–210, doi:10.1016/j.jlap.2005.10.005. [11] D. A. van Beek, Michel A. Reniers, Ramon R. H. Schiffelers & J. E. Rooda (2007): Foundations of a Compositional Interchange Format for Hybrid Systems. In Alberto Bemporad, Antonio Bicchi & Giorgio C. Buttazzo, editors: Proceedings of the 10th International Workshop on Hybrid Systems: Computation and Control (HSCC’07), Lecture Notes in Computer Science 4416, Springer, pp. 587–600, doi:10.1007/978-3-540-71493-4 45. [12] Jan A Bergstra & A. (Kees) Middelburg (2007): Synchronous cooperation for explicit multi-threading. Acta Informatica 44, pp. 525–569, doi:10.1007/s00236-007-0057-9. [13] Bard Bloom, Sorin Istrail & Albert R. Meyer (1995): Bisimulation can’t be traced. J. ACM 42, pp. 232–268, doi:10.1145/200836.200876. [14] Antonio Brogi & Jean-Marie Jacquet (1998): On the Expressiveness of Linda-like Concurrent Languages. Electr. Notes Theor. Comput. Sci. 16(2), pp. 75–96, doi:10.1016/S1571-0661(04)00118-5. [15] Nicholas Carriero & David Gelernter (1989): Linda in Context. Communications of the ACM 32(4), pp. 444–459, doi:10.1145/63334.63337. [16] Robert J. Colvin & Ian J. Hayes (2011): Structural Operational Semantics through Context-Dependent Behaviour. Journal of Logic and Algebraic Programming 80(7), pp. 392–426, doi:10.1016/j.jlap.2011.05.001. [17] Sjoerd Cranen, Mohammad Reza Mousavi & Michel A. Reniers (2008): A Rule Format for Associativity. In Franck van Breugel & Marsha Chechik, editors: Proceedings of the 19th International Conference on Concurrency Theory (CONCUR’08), Lecture Notes in Computer Science 5201, Springer-Verlag, pp. 447– 461, doi:10.1007/978-3-540-85361-9 35. [18] Pierpaolo Degano & Corrado Priami (2001): Enhanced operational semantics. ACM Computing Surveys 33(2), pp. 135–176, doi:10.1145/384192.384194. [19] Fabio Gadducci & Ugo Montanari (2000): The Tile Model. In Gordon D. Plotkin, Colin Stirling & Mads Tofte, editors: Proof, Language and Interaction: Essays in Honour of Robin Milner, MIT Press, Boston, MA, USA, 2000, pp. 133–166. [20] Vashti Galpin, Luca Bortolussi & Jane Hillston (2013): HYPE: Hybrid modelling by composition of flows. Formal Asp. Comput. 25(4), pp. 503–541, doi:10.1007/s00165-011-0189-0. [21] R.J. van Glabbeek (2001): The Linear Time - Branching Time Spectrum I. The Semantics of Concrete, Sequential Processes. In A. Ponse S.A. Smolka J.A. Bergstra, editor: Handbook of Process Algebra, Elsevier, pp. 3–99, doi:10.1007/3-540-57208-2 6. [22] Jan Friso Groote & Frits W. Vaandrager (1992): Structured Operational Semantics and Bisimulation As a Congruence. Information and Computation 100(2), pp. 202–260, doi:10.1016/0890-5401(92)90013-6. [23] Matthew Hennessy & Robin Milner (1985): Algebraic laws for nondeterminism and concurrency. J. ACM 32(1), pp. 137–161, doi:10.1145/2455.2460. [24] Narciso Martı́-Oliet & José Meseguer (2002): Rewriting Logic as a Logical and Semantic Framework. In Dov M. Gabbay & Franz Guenthner, editors: Handbook of Philosophical Logic, 9, Kluwer Academic Publishers, 2002, pp. 1–87, doi:10.1007/978-94-017-0464-9 1. Gebler, Goriac & Mousavi 77 [25] José Meseguer & Christiano Braga (2004): Modular Rewriting Semantics of Programming Languages. In Charles Rattray, Savi Maharaj & Carron Shankland, editors: Proceedings of the 10th International Conference on Algebraic Methodology and Software Technology (AMAST’04), Lecture Notes in Computer Science 3116, Springer-Verlag, Berlin, Germany, 2004, pp. 364–378, doi:10.1007/978-3-540-27815-3 29. [26] Peter D. Mosses (2004): Exploiting Labels in Structural Operational Semantics. Fundam. Inform. 60(1-4), pp. 17–31. [27] Peter D. Mosses (2004): Modular structural operational semantics. J. Log. Algebr. Program. 60-61, pp. 195–228, doi:10.1016/j.jlap.2004.03.008. [28] Peter D. Mosses & Mark J. New (2009): Implicit Propagation in Structural Operational Semantics. Electr. Notes Theor. Comput. Sci. 229(4), pp. 49–66, doi:10.1016/j.entcs.2009.07.073. [29] Mohammad Reza Mousavi, Michel Reniers & Jan Friso Groote (2004): Congruence for SOS with Data. In: Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science (LICS’04), IEEE Computer Society Press, Los Alamitos, CA, USA, 2004, pp. 302–313, doi:10.1109/LICS.2004.1319625. [30] Mohammad Reza Mousavi, Michel A. Reniers & Jan Friso Groote (2004): Congruence for SOS with Data. In: LICS, pp. 303–312, doi:10.1109/LICS.2004.1319625. [31] Mohammad Reza Mousavi, Michel A. Reniers & Jan Friso Groote (2005): Notions of Bisimulation and Congruence Formats for SOS with Data. Information and Computation 200(1), pp. 107–147, doi:10.1016/j.ic.2005.03.002. [32] Mohammad Reza Mousavi, Michel A. Reniers & Jan Friso Groote (2005): A syntactic commutativity format for SOS. Inf. Process. Lett. 93(5), pp. 217–223, doi:10.1016/j.ipl.2004.11.007. [33] Scott Owens (2008): A Sound Semantics for OCamllight. In Sophia Drossopoulou, editor: ESOP, Lecture Notes in Computer Science 4960, Springer, pp. 1–15, doi:10.1007/978-3-540-78739-6 1. [34] David Michael Ritchie Park (1981): Concurrency and Automata on Infinite Sequences. In Peter Deussen, editor: Theoretical Computer Science, Lecture Notes in Computer Science 104, Springer, pp. 167–183, doi:10.1007/BFb0017309. [35] Gordon D. Plotkin (1981): A structural approach to operational semantics. Technical Report DAIMI FN-19, Computer Science Department, Aarhus University, Aarhus, Denmark. [36] Gordon D. Plotkin (2004): The origins of structural operational semantics. Journal of Logic and Algebraic Programming (JLAP) 60, pp. 3–15, doi:10.1016/j.jlap.2004.03.009. [37] Gordon D. Plotkin (2004): A structural approach to operational semantics. Journal of Logic and Algebraic Progamming (JLAP) 60, pp. 17–139. This article first appeared as [35]. [38] Michel A. Reniers, Jan Friso Groote, Mark B. van der Zwaag & Jos van Wamel (2002): Completeness of Timed µCRL. Fundamenta Informaticae 50(3-4), pp. 361–402. [39] A. W. (Bill) Roscoe (2010): Understanding Concurrent Systems. Springer, doi:10.1007/978-1-84882-258-0. [40] Christopher Strachey (2000): Fundamental Concepts in Programming Languages. Higher-Order and Symbolic Computation 13, pp. 11–49, doi:10.1023/A:1010000313106. [41] Daniele Turi & Gordon D. Plotkin (1997): Towards a Mathematical Operational Semantics. In: LICS, IEEE Computer Society, pp. 280–291, doi:10.1109/LICS.1997.614955.
6cs.PL
The Rapidly Changing Landscape of Conversational Agents arXiv:1803.08419v1 [cs.AI] 22 Mar 2018 Vinayak Mathur and Arpit Singh College of Information and Computer Sciences University of Massachusetts Amherst {vinayak, arpitsingh}@cs.umass.edu Abstract Conversational agents have become ubiquitous, ranging from goal-oriented systems for helping with reservations to chit-chat models found in modern virtual assistants. In this survey paper, we explore this fascinating field. We look at some of the pioneering work that defined the field and gradually move to the current state-of-the-art models. We look at statistical, neural, generative adversarial network based and reinforcement learning based approaches and how they evolved. Along the way we discuss various challenges that the field faces, lack of context in utterances, not having a good quantitative metric to compare models, lack of trust in agents because they do not have a consistent persona etc. We structure this paper in a way that answers these pertinent questions and discusses competing approaches to solve them. 1. Introduction One of the earliest goals of Artificial Intelligence (AI) has been to build machines that can converse with us. Whether in early AI literature or the current popular culture, conversational agents have captured our imagination like no other technology has. In-fact the ultimate test of whether true artificial intelligence has been achieved, the Turing test [1] proposed by Alan Turing the father of artificial intelligence in 1950, revolves around the concept of a good conversational agent. The test is deemed to have been passed if a conversational agent is able to fool human judges into believing that it is in fact a human being. Starting with pattern matching programs like ELIZA developed at MIT in 1964 to the current commercial conversational agents and personal assistants (Siri, Allo, Alexa, Cortana et al) that all of us carry in our pockets, conversational agents have come a long way. In this paper we look at this incredible journey. We start by looking at early rule-based methods which consisted of hand engineered features, most of which were domain specific. However, in our view, the advent of neural networks that were capable of capturing long term dependencies in text and the creation of the sequence to sequence learning model [2] that was capable of handling utterances of varying length is what truly revolutionized the field. Since the sequence to sequence model was first used to build a neural conversational agent [3] in 2016 the field has exploded. With a multitude of new approaches being proposed in the last two years which significantly impact the quality of these conversational agents, we skew our paper towards the post 2016 era. Indeed one of the key features of this paper is that it surveys the exciting new developments in the domain of conversational agents. Dialogue systems, also known as interactive conversational agents, virtual agents and sometimes chatterbots, are 1 used in a wide set of applications ranging from technical support services to language learning tools and entertainment. Dialogue systems can be divided into goal-driven systems, such as technical support services, booking systems, and querying systems. On the other hand we have non-goal-driven systems which are also referred to as chit-chat models. There is no explicit purpose for interacting with these agents other than entertainment. Compared to goal oriented dialog systems where the universe is limited to an application, building open-ended chit-chat models is more challenging. Non-goal oriented agents are a good indication of the state of the art of artificial intelligence according to the Turing test. Though it may sound like something right out of science fiction, Alan Black, who is widely regarded as the Father of conversational agents, mostly because of his pioneering work in the field focused on building an end-to-end system for bus reservations at CMU, maintains that people are ready for these agents it is the technology that is lacking. This is supported by anaonymized logs of people trying to hold deep conversations with their virtual assistants. With no grounding in common sense and no sense of context these agents have to fall back on canned responses and resort to internet searches now. But as we discuss in section 5 , new techniques are emerging to provide this much needed context to these agents. The recent successes in the domain of Reinforcement Learning (RL) has also opened new avenues of applications in the conversational agent setting. We explore some of these approaches in section 6 Another feature that has been traditionally lacking in conversation agents is a personality. O Vinayal et al [3] hypothesis that not having a consistent personality is one of the main reasons that is stopping us from passing the turing test. Conversational agents also lack emotional consistency in their responses. These features are vital if we want humans to trust conversational agents. In section 7 we discuss state of the art approaches to overcome these problems. Despite such huge advancements in the field, the way these models are evaluated is something that needs to be dramatically altered. Currently there exists no perfect quantitative method to compare two conversational agents. The field has to rely on qualitative measures or measures like BLeU and perplexity borrowed from machine translation. In section 8 we discuss this problem in detail. 2. Early Techniques Initially, the interactive dialogue systems were based on and limited to speaker independent recognition of isolated words and phrases or limited continuous speech such as digit strings. In August 1993, there came the ESPRIT SUNDIAL project (Peckham et al, 1993 [4]) which was aimed at allowing spontaneous conversational inquiries over the telephone for the train timetable and flight enquiries. The linguistic processing component in it was based on natural language parsing. The parser made use of alternative word hypotheses represented in a lattice or graph in constructing a parse tree and allowance was made for gaps and partially parsable strings. It made use of both syntactic and semantic knowledge for the task domain. It was able to achieve a 96% success rate for the flight inquiry application in English. However, the issue was that the given conversational agent was heavily limited to the types of applications it can perform and its high success rate was more due to that instead of great natural language techniques (relative to recent times). In 1995, two researchers (Ball et al, 1995 [5]) at Microsoft developed a conversational assistant called Persona which was one of the first true personal assistant similar to what we have in recent times (like Siri, etc). It allowed users the maximum flexibility to express their requests in whatever syntax they found most natural and the interface was based on a broad-coverage NLP system unlike the system discussed in the previous paragraph. In this, a labelled semantic graph is generated from the speech input which encodes case frames or thematic roles. After this, a sequence of graph transformations is applied on it using the knowledge of interaction scenario and application domain. This results into a normalized application specific structure called as task graph which is then 2 matched against the templates (in the application) which represent the normalized task graphs corresponding to all the possible user statements that the assistant understands and the action is then executed. The accuracy was not that good and they did not bother to calculate it. Also, due to the integrated nature of conversational interaction in Persona, the necessary knowledge must be provided to each component of the system. Although it had limitations, it provided a very usable linguistic foundation for conversational interaction. The researchers thought that if they can create assistant models specific to the corresponding models, they can achieve better accuracy for those applications instead of creating a common unified personal assistant which at that time performed quite poorly. There was a surge in application-specific assistants like in-car intelligent personal assistant (Schillo et al, 1996 [6]), spoken-language interface to execute military exercises (Stent et al, 1999 [7]), etc. Since it was difficult to develop systems with high domain extensibility, the researchers came up with a distributed architecture for cooperative spoken dialogue agents (Lin et al, 1999 [8]). Under this architecture, different spoken dialogue agents handling different domains can be developed independently and cooperate with one another to respond to the users requests. While a user interface agent can access the correct spoken dialogue agent through a domain switching protocol, and carry over the dialogue state and history so as to keep the knowledge processed persistently and consistently across different domains. Figure 1 shows the agent society for spoken dialogue for tour information service. Figure 1. Agent society for spoken dialogue for tour information service [8] If we define the false alarm rate by counting the utterances in which unnecessary domain-switching occurred and the detection rate by counting the utterances in which the desired domain-switching were accurately detected, then in this model, high detection rate was achieved at very low false alarm rate. For instance, for around a false alarm rate of 0.2, the model was able to achieve a detection rate of around 0.9 for the case of tag sequence search with language model search scheme. 3. Machine Learning Methods Next came the era of using machine learning methods in the area of conversation agents which totally revolutionized this field. Alan Black, professor at CMU, and his team initially wanted to build spoken dialog system for the less general sections of the population, such as the elderly and non-native speakers of English. They came up with Lets Go project (Raux et al, 2003 [9]) that was designed to provide Pittsburgh area bus information. Later, this was opened to the general public (Raux et al, 2005 [10]). Their work is important in terms of the techniques they used. 3 The speech recognition was done using n-gram statistical model which is then passed to a robust parser based on an extended Context Free Grammar allowing the system to skip unknown words and perform partial parsing. They wrote the grammar based on a combination of their own intuition and a small scale Wizard-of-Oz experiment they ran. The grammar rules used to identify bus stops were generated automatically from the schedule database. After this, they trained a statistical language model on the artificial corpus. In order to make the parsing grammar robust enough to parse fairly ungrammatical, yet understandable sentences, it was kept as general as possible. On making it public, they initially achieved a task success rate of 43.3% for the whole corpus and 43.6 when excluding sessions that did not contain any system-directed speech. After this they tried to increase the performance of the system (Raux et al, 2006 [11]). They retrained their acoustic models by performing Baum-Welch optimization on the transcribed data (starting from their original models). Unfortunately, this only brought marginal improvement because the models (semi-continuous HMMs) and algorithms they were using were too simplistic for this task. They improved the turn-taking management abilities of the system by closely analysing the feedback they received. They added more specific strategies, aiming at dealing with problems like noisy environments, too loud or too long utterances, etc. They found that they were able to get a success rate of 79% for the complete dialogues (which was great). The previous papers (like the ones which we discussed in the above paragraph) did not attempt to use data-driven techniques for the dialog agents because such data was not available in large amount at that time. But then there was a high increase in the collection of spoken dialog corpora which made it possible to use data-driven techniques to build and use models of task-oriented dialogs and possibly get good results. In the paper by Srinivas et al,2008 [12], the authors proposed using data-driven techniques to build task structures for individual dialogs and use the dialog task structures for dialog act classification, task/subtask classification, task/subtask prediction and dialog act prediction. For each utterance, they calculated features like n-grams of the words and their POS tags, dialog act and task/subtask label. Then they put those features in the binary MaxEnt classifier. For this, their model was able to achieve an error rate of 25.1% for the dialog act classification which was better than the best performing models at that time. Although, according to the modern standards, the results are not that great but the approach they suggested (of using data to build machine learning models) forms the basis of the techniques that are currently used in this area. 4. Neural Models 4.1. Sequence to Sequence approaches for dialogue modelling The problem with rule-based models was that they were often domain dependent and could not be easily ported to a new domain. They also depended on hand crafted rules which was both expensive and required domain expertise. Two factors which when combined spell doom for scalbility. All of this changed in 2015 when Vinyals et al proposed an approach [3] inspired from the recent progress in machine translation [2]. Vinyals et al used the sequence to sequence learning architecture for conversation agents. Their model was the first model which could be trained end-to-end, and could generate a new output utterance based on just the input sentence and no other hand crafted features. They achieved this by casting the conversation modelling task, as a task of predicting the next sequence given the previous sequence using recurrent networks. This simple approach truly changed the conversation agent landscape. Most of the state-of-the-art today is built on their success. In a nutshell the input utterance is input to an encoder network, which is a recurrent neural network (RNN) in this case, but as we will see Long Short Term Memory (LSTMs) [13] have since replaced RNNs as the standard for this task. The encoder summarizes the input 4 utterance into a fixed length vector representation which is input to the decoder, which itself is again a RNN. The paper looks at this fixed vector as the thought vector - which hold the most important information of the input utterance. The Decoder netwroks takes this as input and output’s an output utterance word-by-word until it generates an end-of-speech < eos > token. This approach allows for variable length inputs and outputs. The network is jointly trained on two turn conversations. Figure 2 shows the sequence to sequence neural conversation model. Even though most of the modern work in the field is built on this approach there is a significant drawback to this idea. This model can theoretically never solve the problem of modelling dialogues due to various simplifications, the most important of them being the objective function that is being optimized does not capture the actual objective achieved through human communication, which is typically longer term and based on exchange of information rather than next step prediction. It is important to see that optimizing an agent to generate text based on what it sees in the two-turn conversation dataset that it is trained on does not mean that the agent would be able to generalize to human level conversation across contexts. Nevertheless in absence of a better way to capture human communication this approach laid the foundation of most of the modern advances in the field. Another problem that plagues this paper and the field in general is Evaluation. As there can be multiple correct output utterances for a given input utterance there is no quantitative way to evaluate how well a model is performing. In this paper to show the efficacy of their model the authors publish snippets of conversations across different datasets. We discuss this general problem in evaluation later. Figure 2. sequence to sequence framework for modelling conversation [3] Iulian et al. build on this sequence-to-sequence based approach in their paper presented in AAAI 2016 [14]. Their work is inspired by the hierarchical recurrent encoder-decoder architecture (HRED) proposed by Sordoni et al. [15]. Their premise is that a dialogue can be seen as a sequence of utterances which, in turn, are sequences of tokens. Taking advantage of this built in hierarchy they model their system in the following fashion. The encoder RNN maps each utterance to an utterance vector. The utterance vector is the hidden state obtained after the last token of the utterance has been processed. The higher-level context RNN keeps track of past utterances by processing iteratively each utterance vector. After processing utterance Um , the hidden state of the context RNN represents a summary of the dialogue up to and including turn m, which is used to predict the next utterance Um+1 . The next utterance prediction is performed by means of a decoder RNN, which takes the hidden state of the context RNN and produces a probability distribution over the tokens in the next utterance. As seen in figure 3 The advantages of using a hierarchical representation are two-fold. First, the context RNN allows the model to represent a form of common ground between speakers, e.g. to represent topics and concepts shared between the speakers using a distributed vector representation. Second, because the number of computational steps between utterances is reduced. This makes the objective function more stable w.r.t. the model parameters, and helps propagate the training signal for first-order optimization methods. 5 Figure 3. Hierarchical approach to dialogue modelling. A context RNN summarizes the utterances until that point from the encoder. The decoder produces output utterances based on the hidden state of the context RNN instead of the encoder RNN [14] Models like sequence-to-sequence and the hierarchical approaches have proven to be good baseline models. In the last couple of years there has been a major effort to build on top of these baselines to make conversational agents more robust [16] [17]. Due to their large parameter space, the estimation of neural conversation models requires considerable amounts of dialogue data. Large online corpora are helpful for this. However several dialogue corpora, most notably those extracted from subtitles, do not include any explicit turn segmentation or speaker identification.The neural conversation model may therefore inadvertently learn responses that remain within the same dialogue turn instead of starting a new turn. Lison et al [18] overcome these limitations by introduce a weighting model into the neural architecture. The weighting model, which is itself estimated from dialogue data, associates each training example to a numerical weight that reflects its intrinsic quality for dialogue modelling. At training time, these sample weights are included into the empirical loss to be minimized. The purpose of this model is to associate each context, response example pair to a numerical weight that reflects the intrinsic quality of each example. The instance weights are then included in the empirical loss to minimize when learning the parameters of the neural conversation model. The weights are themselves computed via a neural model learned from dialogue data. Approaches like [18] are helpful but data to train these neural conversational agents remains scarce especially in academia, we talk more about the scarcity of data in a future section. 4.2. Language Model based approaches for dialogue modelling Though sequence-to-sequence based models have achieved a lot of success, another push in the field has been to instead train a language model over the entire dialogue as one single sequence [19]. These works argue that a language model is better suited to dialogue modeling, as it learns how the conversation evolves as information progresses. Mei et al. [20] improve the coherence of such neural dialogue language models by developing a generative dynamic attention mechanism that allows each generated word to choose which related words it wants to align to in the increasing conversation history (including the previous words in the response being generated). They introduce a dynamic attention mechanism to a RNN language model in which the scope of attention increases as the recurrence operation progresses from the start through the end of the conversation. The dynamic attention model 6 promotes coherence of the generated dialogue responses (continuations) by favoring the generation of words that have syntactic or semantic associations with salient words in the conversation history. 5. Knowledge augmented models Although these neural models are really powerful, so much so that they power most of the commercially available smart assistants and conversational agents. However these agents lack a sense of context and a grounding in common sense that their human interlocutors possess. This is especially evident when interacting with a commercial conversation agent, when more often that not the agent has to fall back to canned responses or resort to displaying Internet search results in response to an input utterance. One of the main goals of the research community, over the last year or so, has been to overcome this fundamental problem with conversation agents. A lot of different approaches have been proposed ranging from using knowledge graphs [21] to augment the agent’s knowledge to using latest advancements in the field of online learning [22]. In this section we discuss some of these approaches. The first approach we discuss is the Dynamic Knowledge Graph Network (DynoNet) proposed by He et al [21], in which the dialogue state is modeled as a knowledge graph with an embedding for each node. To model both structured and open-ended context they model two agents, each with a private list of items with attributes, that must communicate to identify the unique shared item. They structure entities as a knowledge graph; as the dialogue proceeds, new nodes are added and new context is propagated on the graph. An attention-based mechanism over the node embeddings drives generation of new utterances. The model is best explained by the example used in the paper which is as follows: The knowledge graph represents entities and relations in the agents private KB, e.g., item-1s company is google. As the conversation unfolds, utterances are embedded and incorporated into node embeddings of mentioned entities. For instance, in Figure 4, anyone went to columbia updates the embedding of columbia. Next, each node recursively passes its embedding to neighboring nodes so that related entities (e.g., those in the same row or column) also receive information from the most recent utterance. In this example, jessica and josh both receive new context when columbia is mentioned. Finally, the utterance generator, an LSTM, produces the next utterance by attending to the node embeddings. Figure 4. Example demonstrating how DynoNet augments the conversation [21] However Lee et al in [22] take a different approach to add knowledge to conversational agents. They proposes using a continuous learning based approach. They introduce a task-independent conversation model and an adaptive online algorithm for continual learning which together allow them to sequentially train a conversation model 7 over multiple tasks without forgetting earlier tasks. In a different approach, Ghazvininejad et al [23] propose a knowledge grounded approach which infuses the output utterance with factual information relevant to the conversational context. Their architecture is shown in figure 5. They use an external collection of world facts which is a large collection of raw text entries (e.g., Foursquare, Wikipedia, or Amazon reviews) indexed by named entities as keys. Then, given a conversational history or source sequence S, they identify the focus in S, which is the text span (one or more entities) based on which they form a query to link to the facts. The query is then used to retrieve all contextually relevant facts. Finally, both conversation history and relevant facts are fed into a neural architecture that features distinct encoders for conversation history and facts. Another interesting facet of such a model is that new facts can be added and old facts updated by just updating the world facts dictionary without retraining the model from scratch, thus making the model more adaptive and robust. Figure 5. The neural architecture of the knowledge grounded model which uses a set of external world facts to augment the output utterance generated bt the model [23] Instead of just having a set of facts to augment the conversation, a richer way could be to use knowledge graphs or commonsense knowledge bases which consist of [entity-relation-entity] triples. Young et al explore this idea in [24]. For a given input utterance, they find the relevant assertions in the common sense knowledge base using simple n-gram matching. They then perform chunking on the relevant assertions and feed the individual token to a tri-LSTM encoder. The output of this encoder is weighted along with the input utterance and the output utterance is generated. They claim that such common sense conversation agents outperform a naive conversation agent. Another interesting way to add knowledge to the conversation agents is to capture external knowledge for a given dialog using a search engine. In the paper by Long et al, 2017 [25], the authors built a model to generate natural and informative responses for customer service oriented dialog incorporating external knowledge. They get the external knowledge using a search engine. Then a knowledge enhanced sequence-to-sequence framework is designed to model multi-turn dialogs on external knowledge conditionally. For this purpose, their model extends the simple sequence-to-sequence model by augmenting the input with the knowledge vector so as to take account of the knowledge in the procedure of response generation into the decoder of the sequence-to-sequence model. Both the encoder and the decoder are composed of LSTM. Their model scores an average human rating of 3.3919 out of 5 in comparison to the baseline which is 3.3638 out of 5. Hence, their model generates more informative responses. However, they found the external knowledge plays a negative role in the procedure of response generation when there is more noise in the information. Exploring how to obtain credible knowledge of a given dialog history can be a future generation of their model. 8 6. Reinforcement Learning based models After exploring the neural methods in a lot of detail, the researchers have also begun exploring, in the current decade, how to use the reinforcement learning methods in the dialogue and personal agents. 6.1. Initial reinforcement methods One of the first main papers that thought of using reinforcement learning for this came in 2005 by English et al [26]. They used an on-policy Monte Carlo method and the objective function they used was a linear combination of the solution quality (S) and the dialog length (L), taking the form: o(S,I) = w1 S - w2 L. At the end of each dialog the interaction was given a score based on the evaluation function and that score was used to update the dialog policy of both agents (that is, the conversants). The state-action history for each agent was iterated over separately and the score from the recent dialog was averaged in with the expected return from the existing policy. They chose not to include any discounting factor to the dialog score as they progressed back through the dialog history. The decision to equally weight each state-action pair in the dialog history was made because an actions contribution to the dialog score is not dependent upon its proximity to the end of the task. In order to combat the problem of converging to an effective policy they divided up the agent training process into multiple epochs. The average objective function score for the case of learned policies was 44.90. One of the main reasons for the low accuracy (which is also a limitation of this paper) was that there were a number of aspects of dialog that they had not modeled such as non-understandings, misunderstandings, and even parsing sentences into the action specification and generating sentences from the action specification. But the paper set the pavement of the reinforcement learning methods into the area of dialog and personal agents. 6.2. End-to-End Reinforcement Learning of Dialogue Agents for Information Access Lets have a look at KB-InfoBot (by Dhingra et al, 2017 [27]): a multi-turn dialogue agent which helps users search Knowledge Bases (KBs) without composing complicated queries. In this paper, they replace the symbolic queries (which break the differentiability of the system and prevent end-to-end training of neural dialogue agents) with an induced soft posterior distribution over the KB that indicates which entities the user is interested in. Integrating the soft retrieval process with a reinforcement learner leads to higher task success rate and reward in both simulations and against real users. In this, the authors used an RNN to allow the network to maintain an internal state of dialogue history. Specifically, they used a Gated Recurrent Unit followed by a fully-connected layer and softmax non-linearity to model the policy over the actions. During training, the agent samples its actions from this policy to encourage exploration. Parameters of the neural components were trained using the REINFORCE algorithm. For end-to-end training they updated both the dialogue policy and the belief trackers using the reinforcement signal. While testing, the dialogue is regarded as a success if the user target is in top five results returned by the agent and the reward is accordingly calculated that helps the agent take the next action. Their system returns a success rate of 0.66 for small knowledge bases and a great success rate of 0.83 for medium and large knowledge bases. As the user interacts with the agent, the collected data can be used to train the endto-end agent which we see has a strong learning capability. Gradually, as more experience is collected, the system can switch from Reinforcement Learning-Soft to the personalized end-to-end agent. Effective implementation of this requires such personalized end-to-end agents to learn quickly which should be explored in the future. However, the system has a few limitations. The accuracy is not enough for using for the practical applications. 9 The agent suffers from the cold start issue. In the case of end-to-end learning, they found that for a moderately sized knowledge base, the agent almost always fails if starting from random initialization. 6.3. Actor-Critic Algorithm Deep reinforcement learning (RL) methods have significant potential for dialogue policy optimisation. However, they suffer from a poor performance in the early stages of learning as we saw in the paper in the above section. This is especially problematic for on-line learning with real users. In the paper by Su et al, 2017 [28], they proposed a sample-efficient actor-critic reinforcement learning with supervised data for dialogue management. Just for a heads up, actor-critic algorithms are the algorithms that have an actor stores the policy according to which the action is taken by the agent and a critic that critiques the actions chosen by the actor (that is, the rewards obtained after the action are sent to the critic using which it calculates value functions). To speed up the learning process, they presented two sample-efficient neural networks algorithms: trust region actor-critic with experience replay (TRACER) and episodic natural actor-critic with experience replay (eNACER). Both models employ off-policy learning with experience replay to improve sample-efficiency. For TRACER, the trust region helps to control the learning step size and avoid catastrophic model changes. For eNACER, the natural gradient identifies the steepest ascent direction in policy space to speed up the convergence. To mitigate the cold start issue, a corpus of demonstration data was utilised to pre-train the models prior to online reinforcement learning. Combining these two approaches, they demonstrated a practical approach to learn deep RL-based dialogue policies and also demonstrated their effectiveness in a task-oriented information seeking domain. Figure 6. The success rate of TRACER for a random policy, policy trained with corpus data (NN:SL) and further improved via RL (NN:SL+RL) respectively in user simulation under various semantic error rates [8] We can see in the figure 6 that the success rate reaches at around 95% for the case of policy trained with corpus data and using reinforcement learning which is impressive. Also, they train very quickly. For instance, for training just around 500-1000 dialogues, eNACER has a success rate of around 95% and TRACER has a success rate of around 92%. However, the authors noted that performance falls off rather rapidly in noise as the uncertainty estimates are not handled well by neural networks architectures. This can also be a topic for future research. 6.4. Using Generative Adversarial Network Recently, generative adversarial networks are being explored and how they can be used in the dialog agents. Although generative adversarial networks are a topic in itself to explore. However, the paper mentioned below 10 used uses reinforcement learning along with generative adversarial network so we cover it here inside the reinforcement learning methods. They can be used by the applications to generate dialogues similar to humans. In the paper by Li et al, 2017 [29], the authors proposed using adversarial training for open-domain dialogue generation such that the system is trained to produce sequences that are indistinguishable from human-generated dialogue utterances. The task is considered as a reinforcement learning problem where two systems get jointly trained: a generative model to produce response sequences, and a discriminator (similar to the human evaluator in the Turing test) that distinguishes between the human-generated dialogues and the machine-generated ones. The generative model defines the policy that generates a response given the dialog history and the discriminative model is a binary classifier that takes a sequence of dialog utterances as inputs and outputs whether the input is generated by the humans or machines. The outputs from the discriminator are then used as rewards for the generative model pushing the system to generate dialogues that mostly resemble human dialogues. The key idea of the system is to encourage the generator to generate utterances that are indistinguishable from human generated dialogues. The policy gradient methods are used to achieve such a goal, in which the score of current utterances being human-generated ones assigned by the discriminator is used as a reward for the generator, which is trained to maximize the expected reward of generated utterances using the REINFORCE algorithm. Their model achieved a machine vs random accuracy score of 0.952 out of 1. However, on applying the same training paradigm to machine translation in preliminary experiments, the authors did not find a clear performance boost. They thought that it may be because the adversarial training strategy is more beneficial to tasks in which there is a big discrepancy between the distributions of the generated sequences and the reference target sequences (that is, the adversarial approach may be more beneficial on tasks in which entropy of the targets is high). In the future, this relationship can be further explored. 7. Approaches to Human-ize agents A lack of a coherent personality in conversational agents that most of these models propose has been identified as one of the primary reasons that these agents have not been able to pass the Turing test [1] [3]. Aside from such academic motivations, making conversational agents more like their human interlocutors which posses both a persona and are capable of parsing emotions is of great practical and commercial use. Consequently in the last couple of years different approaches have been tried to achieve this goal. Li et al [30] address the challenge of consistency and how to endow data-driven systems with the coherent persona needed to model human-like behavior. They consider a persona to be composite of elements of identity (background facts or user profile), language behavior, and interaction style. They also account for a persona to be adaptive since an agent may need to present different facets to different human interlocutors depending on the interaction. Ultimately these personas are incorporated into the model as embeddings. Adding a persona not only improves the human interaction but also improves BLeU score and perplexity over the baseline sequence to sequence models. The model represents each individual speaker as a vector or embedding, which encodes speaker-specific information (e.g.dialect, register, age, gender, personal information) that influences the content and style of her responses. Most importantly these traits do not need to be explicitly annotated, which would be really tedious and limit the applications of the model. Instead the model manages to cluster users along some of these traits (e.g. age, country of residence) based on the responses alone. The model first encodes message S into a vector representation hS using the source LSTM. Then for each step in the target side, hidden units are obtained by combining the representation produced by the target LSTM at the previous time step, the word representations at the current time step, and the speaker embedding vi . In this way, speaker information is encoded and injected into the hidden layer at each time step and thus helps predict personalized responses throughout the generation 11 process. The process described here is visualizes in figure 7 below. Figure 7. Visualization of how the persona is integrated in a sequence to sequence style conversational agent [30] Building on works like this the Emotional Chatting Machine model proposed by Zhou et al [31] is a model which generates responses that are not only grammatically consistent but also emotionally consistent. To achieve this their approach models the high-level abstraction of emotion expressions by embedding emotion categories. They also capture the change of implicit internal emotion states and use explicit emotion expressions with an external emotion vocabulary. Although they did not evaluate their model on some standard metric, they showed that their model can generate responses appropriate not only in content but also in emotion. In the future, instead of specifying an emotion class, the model should decide the most appropriate emotion category for the response. However, this may be challenging since such a task depends on the topic, context or the mood of the user. The goal of capturing emotions and having consistent personalities for a conversational agent is an important one. The field is still nascent but advances in the domain will have far reaching consequences for conversational models in general. People tend to trust agents that are emotionally consistent, and in the long term trust is what will decide the fate of large scale adoption of conversational agents. 8. Evaluation methods Evaluating conversational agents is an open research problem in the field. With the inclusion of emotion component in the modern conversation agents, evaluating such models has become even more complex.The current evaluation methods like perplexity and BLEU score are not good enough and correlate very weakly with human judgments. In the paper by Liu et al, 2016 [32], the authors discuss about how not to evaluate the dialogue system. They provide quantitative and qualitative results highlighting specific weaknesses in existing metrics and provide recommendations for the future development of better automatic evaluation metrics for dialogue systems. According to them, the metrics (like Kiros et al, 2015 [33]) that are based on distributed sentence representations hold the most promise for the future. It is because word-overlap metrics like BLEU simply require too many ground-truth responses to find a significant match for a reasonable response due to the high diversity of dialogue responses. Similarly, the metrics that are embedding-based consist of basic averages of vectors obtained through distributional semantics and so they are also insufficiently complex for modeling sentence-level compositionality in dialogue. 12 The metrics that take into account the context can also be considered. Such metrics can come in the form of an evaluation model that is learned from data. This model can be either a discriminative model that attempts to distinguish between model and human responses or a model that uses data collected from the human survey in order to provide human-like scores to proposed responses. 9. Conclusion In this survey paper we explored the exciting and rapidly changing field of conversational agents. We talked about the early rule-based methods that depended on hand-engineered features. These methods laid the ground work for the current models. However these models were expensive to create and the features depended on the domain that the conversational agent was created for. It was hard to modify these models for a new domain. As computation power increased, and we developed neural networks that were able to capture long range dependencies (RNNs,GRUs,LSTMs) the field moved towards neural models for building these agents. Sequence to sequence model created in 2015 was capable of handling utterances of variable lengths, the application of sequence to sequence to conversation agents truly revolutionized the domain. After this advancement the field has literally exploded with numerous application in the last couple of years. The results have been impressive enough to find their way into commercial applications such that these agents have become truly ubiquitous. We attempt to present a broad view of these advancements with a focus on the main challenges encountered by the conversational agents and how these new approaches are trying to mitigate them. References [1] A. M. Turing, “Intelligent machinery, a heretical theory,” The Turing test: Verbal behavior as the hallmark of intelligence, vol. 105, 1948. [2] I. Sutskever, O. Vinyals, and Q. V. Le, “Sequence to sequence learning with neural networks,” in Advances in neural information processing systems, pp. 3104–3112, 2014. [3] O. Vinyals and Q. Le, “A neural conversational model,” arXiv preprint arXiv:1506.05869, 2015. [4] J. Peckham, “A new generation of spoken sundial systems: Results and lessons from the sundial project,” 1993. [5] J. E. Ball and D. T. Ling, “Spoken language processing in the persona conversational assistant,” 1995. [6] M. Schillo, E. Atwell, C. Souter, and T. Denson, “Language modelling for the in-car intelligent personal assistant,” 1996. [7] A. Stent, J. Dowding, J. M. Gawron, E. O. Bratt, and R. Moore, “A new generation of spoken sundial systems: Results and lessons from the sundial project,” 1999. [8] B. shen Lin, H. min Wang, and L.-S. Lee, “A distributed architecture for cooperative spoken dialogue agents with coherent dialogue state and history,” 1993. [9] A. Raux, B. Langner, A. W. Black, and M. Eskenazi, “Lets go: Improving spoken dialog systems for the elderly and non-natives,” 2003. [10] A. Raux, B. Langner, D. Bohus, A. W. Black, and M. Eskenazi, “Lets go public! taking a spoken dialog system to the real world,” 2005. [11] A. Raux, D. Bohus, B. Langner, A. W. Black, and M. Eskenazi, “Doing research on a deployed spoken dialogue system: One year of lets go! experience,” 2006. [12] S. Bangalore and A. Stent, “Learning the structure of task-driven humanhuman dialogs,” 2008. [13] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735–1780, 1997. [14] I. V. Serban, A. Sordoni, Y. Bengio, A. C. Courville, and J. Pineau, “Building end-to-end dialogue systems using generative hierarchical neural network models.,” in AAAI, vol. 16, pp. 3776–3784, 2016. 13 [15] A. Sordoni, Y. Bengio, H. Vahabi, C. Lioma, J. Grue Simonsen, and J.-Y. Nie, “A hierarchical recurrent encoderdecoder for generative context-aware query suggestion,” in Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 553–562, ACM, 2015. [16] A. Bordes, Y.-L. Boureau, and J. Weston, “Learning end-to-end goal-oriented dialog,” arXiv preprint arXiv:1605.07683, 2016. [17] R. C. Gunasekara, D. Nahamoo, L. C. Polymenakos, J. Ganhotra, and K. P. Fadnis, “Quantized-dialog language model for goal-oriented conversational systems,” [18] P. Lison and S. Bibauw, “Not all dialogues are created equal: Instance weighting for neural conversational models,” arXiv preprint arXiv:1704.08966, 2017. [19] Y. Luan, Y. Ji, and M. Ostendorf, “Lstm based conversation models,” arXiv preprint arXiv:1603.09457, 2016. [20] H. Mei, M. Bansal, and M. R. Walter, “Coherent dialogue with attention-based language models.,” in AAAI, pp. 3252– 3258, 2017. [21] H. He, A. Balakrishnan, M. Eric, and P. Liang, “Learning symmetric collaborative dialogue agents with dynamic knowledge graph embeddings,” arXiv preprint arXiv:1704.07130, 2017. [22] S. Lee, “Toward continual learning for conversational agents,” arXiv preprint arXiv:1712.09943, 2017. [23] M. Ghazvininejad, C. Brockett, M.-W. Chang, B. Dolan, J. Gao, W.-t. Yih, and M. Galley, “A knowledge-grounded neural conversation model,” arXiv preprint arXiv:1702.01932, 2017. [24] T. Young, E. Cambria, I. Chaturvedi, M. Huang, H. Zhou, and S. Biswas, “Augmenting end-to-end dialog systems with commonsense knowledge,” arXiv preprint arXiv:1709.05453, 2017. [25] Y. Long, J. Wang, Z. Xu, Z. Wang, B. Wang, and Z. Wang, “A knowledge enhanced generative conversational service agent,” 2017. [26] M. S. English and P. A. Heeman, “Learning mixed initiative dialog strategies by using reinforcement learning on both conversants,” 2005. [27] B. Dhingra, L. Li, X. Li, J. Gao, Y.-N. Chen, F. Ahmed, and L. Deng, “Towards end-to-end reinforcement learning of dialogue agents for information access,” 2017. [28] P.-H. Su, P. Budzianowski, S. Ultes, M. Gasic, and S. Young, “Sample-efficient actor-critic reinforcement learning with supervised data for dialogue management,” 2017. [29] J. Li, W. Monroe, T. Shi, S. Jean, A. Ritter, and D. Jurafsky, “Adversarial learning for neural dialogue generation,” 2017. [30] J. Li, M. Galley, C. Brockett, G. P. Spithourakis, J. Gao, and B. Dolan, “A persona-based neural conversation model,” arXiv preprint arXiv:1603.06155, 2016. [31] H. Zhou, M. Huang, T. Zhang, X. Zhu, and B. Liu, “Emotional chatting machine: emotional conversation generation with internal and external memory,” arXiv preprint arXiv:1704.01074, 2017. [32] C. Liu, R. Lowe, I. V. Serban, M. Noseworthy, L. Charlin, and J. Pineau, “How NOT to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation,” 2016. [33] R. Kiros, Y. Zhu, R. Salakhutdinov, R. S. Zemel, A. Torralba, R. Urtasun, and S. Fidler, “Skip-thought vectors,” 2015. 14
2cs.AI
arXiv:1712.00988v1 [cs.AI] 4 Dec 2017 End-to-End Relation Extraction using Markov Logic Networks Sachin Pawar1,2 , Pushpak Bhattacharya2,3 , and Girish K. Palshikar1 [email protected], [email protected], [email protected] 1 TCS Research, Tata Consultancy Services, Pune-411013, India 2 Dept. of CSE, Indian Institute of Technology Bombay, Mumbai-400076, India 3 Indian Institute of Technology Patna, Patna-801103, India Abstract. The task of end-to-end relation extraction consists of two sub-tasks: i) identifying entity mentions along with their types and ii) recognizing semantic relations among the entity mention pairs. It has been shown that for better performance, it is necessary to address these two sub-tasks jointly [22,13]. We propose an approach for simultaneous extraction of entity mentions and relations in a sentence, by using inference in Markov Logic Networks (MLN) [21]. We learn three different classifiers : i) local entity classifier, ii) local relation classifier and iii) “pipeline” relation classifier which uses predictions of the local entity classifier. Predictions of these classifiers may be inconsistent with each other. We represent these predictions along with some domain knowledge using weighted first-order logic rules in an MLN and perform joint inference over the MLN to obtain a global output with minimum inconsistencies. Experiments on the ACE (Automatic Content Extraction) 2004 dataset demonstrate that our approach of joint extraction using MLNs outperforms the baselines of individual classifiers. Our end-to-end relation extraction performance is better than 2 out of 3 previous results reported on the ACE 2004 dataset. 1 Introduction Real world entities are referred in natural language sentences through entity mentions and these are often linked through meaningful relations. The task of end-to-end relation extraction consists of two sub-tasks: entity extraction and relation extraction. The sub-task of entity extraction deals with identifying entity mentions and determining their entity types. The other task of relation extraction deals with identifying whether any semantic relation exists between any two mentions in a sentence and also determining the relation type if it exists. In this paper, we refer to entity extraction and relation extraction tasks as defined by the Automatic Content Extraction (ACE) program [3] under the EDT (Entity Detection and Tracking) and RDC (Relation Detection and Characterization) tasks, respectively. ACE standard defined 7 entity types 1 : PER (person), ORG 1 https://www.ldc.upenn.edu/sites/www.ldc.upenn.edu/files/english-edt-v4.2.6.pdf (organization), LOC (location), GPE (geo-political entity), FAC (facility), VEH (vehicle) and WEA (weapon). It also defined 7 coarse level relation types 2 : EMPORG (employment), PER-SOC (personal/social), PHYS (physical), GPE-AFF (GPE affiliation), OTHER-AFF (PER/ORG affiliation), ART (agent-artifact) and DISC (discourse). Compared to the work (refer the surveys [18,19]) in Named Entity Recognition (NER), there are relatively few attempts [4,5,13,15] to address the more general entity extraction problem. NER extracts only named mentions (e.g. John Smith, Walmart) whereas entity extraction is expected to also identify common noun and pronoun mentions (e.g. company, leader, it, they) and their entity types. This task is more challenging than NER because entity type of mentions like leader or they may vary from sentence to sentence depending on which real life entity they are referring to in that sentence. For example, entity type of leader would be PER in the sentence John Smith was elected as the leader of the Socialist Party whereas its entity type would be ORG in the sentence Pepsi is a market leader in its segment. There has been a lot of work for relation extraction like Zhou et al. [6], Jiang and Zhai [10], Bunescu and Mooney [1] and Qian et al. [20]. All of these approaches assume that the boundaries and the types of entity mentions are already known. Several features based on this information are used for relation prediction. In order to use such relation extraction systems, there should be separate entity extraction system whose output acts as an input for relation extraction. In such a “pipeline” method, the errors are propagated from first phase (entity extraction) to second phase (relation extraction) affecting the overall relation extraction performance. Another major disadvantage of the “pipeline” method is that it facilitates only one-way information flow, i.e. the knowledge about entities is used for relation extraction but not vice versa. However, the knowledge about relations can help in correcting some entity extraction errors. In order to overcome these problems, we propose an approach which uses inference in Markov Logic Networks (MLN) for simultaneous extraction of entities and relations in a sentence. This approach facilitates two-way information flow. MLNs combine first-order logic and probabilistic graphical models in a single representation. An MLN contains a set of first-order logic rules, and each rule is associated with a weight. The fewer rules a world violates, the more probable it is. Also, higher the weight of a rule, greater is the probability of a world that satisfies the rule compared to the one that does not. In our approach, three separate classifiers are learned: a local entity classifier, a local relation classifier and a “pipeline” relation classifier which uses predictions of the local entity classifier. Predictions of these classifiers along with other domain knowledge are represented using weighted first-order logic rules in an MLN. Joint inference over this MLN is then performed to get a final output with least possible contradictions or inconsistencies among the individual classifiers. The specific contributions of this work are : i) a novel approach for joint extraction of entity mentions and relations using inference in MLNs and ii) easy 2 https://www.ldc.upenn.edu/sites/www.ldc.upenn.edu/files/english-rdc-v4.3.2.PDF and compact representation of the domain knowledge using first-order logic rules in MLNs. The rest of the paper is organized as follows. Section 2 describes some background and necessary building blocks for our approach. Section 3 describes our approach in detail and Section 4 describes the working of our approach through an example. Experimental results are presented in Section 5. Related work is then described briefly in Section 6. Finally we conclude in Section 7 with brief discussion about the future work. 2 Building Blocks for Our Approach 2.1 Markov Logic Networks Markov Logic Networks (MLN) which were proposed by Richardson and Domingos [21], combine first-order logic and probabilistic graphical models in a single representation. Formally, a Markov Logic Network L is defined as a set of pairs (Fi , wi ), where each Fi is a formula in first-order logic with a real weight wi . Along with a finite set of constants C = {C1 , C2 , · · · , C|C| }, it defines a Markov Network ML,C as follows: 1. ML,C contains one binary node for each possible grounding of each predicate appearing in L. The value of the node is 1 if the ground atom is true, and 0 otherwise. 2. ML,C contains one feature for each possible grounding of each formula Fi in L. The value of this feature is 1 if the ground formula is true, and 0 otherwise. The weight of the feature is the wi associated with Fi in L. The probability distribution of random variable X over possible worlds x specified by Markov Network ML,C is given by, X 1 P (X = x) = exp wi ni (x) Z i ! (1) where ni (x) is the number of true groundings of Fi in x and Z is the partition function. MLN can be used to find probability of a formula (say F1 ) being true, given some other formula (say F2 ) is true. P (F1 ∧ F2 |ML,C ) = P (F1 |F2 , ML,C ) = P (F2 |ML,C ) P x∈XF1 ∩XF2 P x∈XF1 P (X = x|ML,C ) P (X = x|ML,C ) where XFi represents the set of worlds where Fi holds and P (X = x|ML,C ) is computed using the equation 1. 2.2 Identifying Entity Mention Candidates It is necessary to first identify the span (or boundaries) of each entity mention 3 in a given sentence. We model this as a sequence labelling problem. A sentence 3 We consider the “head” extent of a mention defined by ACE standard as the entity mention so that all the valid entity mentions are always non-overlapping. is a sequence of words and each word in a sentence is assigned a label indicating whether that word belongs to any entity mention or not. We use BIO encoding for this purpose. – O: Label for the words which are not part of any entity mention – B: Label for the first word of entity mentions – I: Label for the subsequent words (except the first word) of entity mentions We employ the Conditional Random Field (CRF) model [12], which is trained in a supervised manner. Given any new sentence, we use the trained CRF model to predict the 2 most probable label sequences as follows: S1 :A/O Palestinian/B Council/B member/B says/O anger/O is/O growing/O ./O S2 :A/O Palestinian/B Council/I member/B says/O anger/O is/O growing/O ./O In this sentence, entity mention candidates from the topmost sequence are Palestinian, Council and member. Entity mention candidate Palestinian Council is generated from the second sequence. Generally, the candidates generated from the most probable sequence are more likely to be valid entity mentions. The candidates generated from the second most probable sequence are considered valid entity mentions only if they satisfy certain constraints. These constraints are applied in the form of first-order logic rules in MLNs and will be explained later. A special entity type N ON E is assigned to a candidate entity mention if it is an invalid entity mention. 2.3 Local Entity Classifier The local entity classifier is used to predict the most probable entity type for each candidate entity mention in a given sentence. This classifier is referred to as “local” as it takes an independent decision for each entity mention irrespective of its relation with other mentions. A Maximum Entropy Classifier is trained in a supervised manner which captures the characteristics of each entity mention E using following features: 1. Lexical Features: Head word and other words in E, words preceding and succeeding E in the sentence 2. Syntactic Features: POS tags of the head word and other words in E, POS tags of the words preceding and succeeding E, parent of head word of E in the dependency tree and also the dependency relation with the parent 3. Semantic Features: WordNet category (if any) of the head word of E. Some specific synsets in the WordNet (e.g. person, location, vehicle) are marked as possible “categories” and if any word is direct or indirect hypernym of such synsets, it is said to be falling in the corresponding “category”. As this classifier is trained using only the valid entity mentions in the training data, it always predicts one of the 7 ACE entity types and never predicts the N ON E type. 2.4 Local Relation Classifier The local relation classifier is used to predict the most probable relation type for each pair of candidate entity mentions in a given sentence. This classifier is referred to as “local” as it takes an independent decision for each pair of entity mentions irrespective of their entity types. In addition to ACE 2004 relation types, it considers two special relation types “NULL” (indicating that no semantic relation holds) and “IDN” (representing intra-sentence co-references). In the sentence Pepsi is a market leader, the entity mentions leader and Pepsi are co-references and hence we add the IDN relation between these mentions. With the help of IDN (identity) relation type, information about intra-sentence co-references can be incorporated in a principled way without using an external co-reference resolution system. Also, more number of entity mentions get involved in at least one relation, resulting in better entity extraction performance. For example, in the ACE 2004 dataset, there are 22718 entity mentions and 4328 relation instances resulting in only 7604 entity mentions involved in at least one relation. Considering the IDN relation, number of relation instances increases to 12060 covering 14930 entity mentions. A Maximum Entropy Classifier is used which captures the characteristics of each entity mention pair (E1 , E2 ) with the help of following features: 1. Lexical Features: Head words and other words of E1 & E2 , words preceding and succeeding E1 & E2 in the sentence 2. Syntactic Features: POS tags of the head word and other words in E1 & E2 , POS tags of the words preceding and succeeding E1 & E2 , parents of head words of E1 & E2 in the dependency tree and also the dependency relations with the parents, path connecting E1 & E2 in the dependency tree, their common ancestor in the dependency tree 3. Semantic Features: WordNet categories (if any) of the head words of E1 & E2 , the common ancestor and other words on the path connecting E1 & E2 in the dependency tree of the sentence, syntactico-semantic structures identified in Chan and Roth [2]. 2.5 Pipeline Relation Classifier Unlike the local relation classifier, the “pipeline” relation classifier is dependent on the output of the local entity classifier. It uses following features in addition to the features used by the local relation classifier. 1. Entity types of E1 and E2 as predicted by the local entity classifier 2. Concatenation of entity types of E1 and E2 3. A binary feature indicating whether the types of E1 and E2 are same or not. This classifier is referred to as a “pipeline” classifier because of unidirectional information flow. In other words, the knowledge about types of entity mentions is used by the relation classifier but not vice versa. 3 Joint Extraction using Inference in MLNs 3.1 Motivation As described in the previous section, we have 3 classifiers producing various predictions about entity types and relation types. These decisions may be inconsistent, i.e. relation type predicted by the local relation classifier may not be compatible with the entity types predicted by the local entity classifiers. Also, there may be contradiction in predictions of local relation classifier and “pipeline” relation classifier. Our aim is to take predictions of these classifiers as input and make a global prediction which minimizes such inconsistencies. MLN provides a perfect framework for this, where we can represent predictions of individual classifiers as first-order logic rules where weights of these rules are proportional to the prediction probabilities (soft constraints). Also, the consistency constraints among the relation types and entity types can be represented in the form of first-order logic rules with infinite weights (hard constraints). Now, the inference in such an MLN will provide a globally consistent output with maximum weighted satisfiability of the rules. The detailed explanation is provided in subsequent sections about how the first-order logic rules are created and how the corresponding weights are set. 3.2 Domains and Predicates We specify one MLN for a sentence, i.e. for all candidate entity mentions and possible relation instances in a sentence. The software package used for inference in MLN is Alchemy 4 . We define 3 domains : entity, etype and rtype. The entity domain represents entity mentions where an unique ID is assigned to each entity mention. It is specified as follows in Alchemy for a sentence with n entity mentions having IDs from 1 to n: entity = {1, 2, · · · , n} The next domain etype represents the set of all possible entity types and another domain rtype represents the set of all possible relation types. These domains are specified in Alchemy as follows: etype = {P ER, ORG, LOC, GP E, W EA, F AC, V EH, N ON E} rtype = {EM P ORG, GP EAF F, OT HERAF F, P ERSOC, P HY S, ART, N U LL, IDN } We define following predicates which are used for writing various first-order logic rules. The arguments for these predicates come from the above domains. 1. ET (entity, etype): ET (i, E) is true only when entity type of the entity mention i is equal to E. It is true for one and only one entity type. It represents the entity type prediction of the local entity classifier and used as an evidence during inference. 4 http://alchemy.cs.washington.edu/ 2. RT P (entity, entity, rtype): RT P (i, j, R) is true only when type of relation between entity mentions i and j is equal to R. It is true for one and only one relation type. It represents relation type prediction of “pipeline” relation classifier. It is also used as an evidence. 3. RT L(entity, entity, rtype) : Similar to RT P but represents relation type prediction of local relation classifier. 4. ET F inal(entity, etype) : Similar to ET but represents global entity type prediction and is used as a query predicate during inference. 5. RT F inal(entity, entity, rtype) : Similar to RT P but represents global relation type prediction and is used as a query predicate. During the inference in MLN, the probabilities of all possible groundings of query predicates are computed, conditioned on the specific groundings of the evidence predicates. 3.3 Generic Rules Although one MLN is created for each sentence, some first-order rules are common and they are added to MLNs of all the sentences. We refer to these rules as Generic Rules. These rules represent some universal truths about the domain and hence the weight associated with each of these rules is set to infinity. In other words, any world that violates any of these rules, is practically impossible. These rules provide an easy and effective way of incorporating the domain knowledge about entity types and relation types. For each valid combination of relation type and entity type of one of its argument, we write rules to constrain the possible entity types for the other argument. Such rules can be easily devised by going through the ACE 2004 labelling guidelines. Following are some representative examples 5 . Note that the variables x, y are universally quantified at the outermost level. 1. If there is an EM P ORG relation between two entity mentions and entity type of any mention is P ER, then entity type of other mention can only be one of : ORG or GP E. RT F inal(x, y, EM P ORG) ∧ ET F inal(x, P ER) ⇒ (ET F inal(y, ORG) ∨ ET F inal(y, GP E)). RT F inal(x, y, EM P ORG) ∧ ET F inal(y, P ER) ⇒ (ET F inal(x, ORG) ∨ ET F inal(x, GP E)). 2. For the “identity” relation type IDN , the constraint is that the entity types of both the mentions should be same. RT F inal(x, y, IDN ) ∧ ET F inal(x, z) ⇒ ET F inal(y, z). RT F inal(x, y, IDN ) ∧ ET F inal(y, z) ⇒ ET F inal(x, z). 5 All the rules can’t be listed because of the space constraints. 3.4 Sentence-specific Rules These rules are specific to each sentence and represent the predictions by the individual baseline classifiers. Unlike the Generic Rules, these rules are added with finite weights. Weight Assignment Strategies: In order to learn the weights of various firstorder logic rules, historical examples of predictions of 3 base classifiers along with gold-standard predictions would be required. Instead we chose to compute these weights by using some functions of the corresponding prediction probabilities. The work by Jain [9] discussed various ways of weight assignments to represent knowledge in MLNs. In another work, Heckmann et al. [8] adjusted the rule weights experimentally for citation segmentation using MLNs. On the similar lines, following two strategies are adopted for weight assignments. 1. Log of Odds Ratio (LOR): Richardson and Domingos [21] states that the weight of a formula F is log odds between a world where F is true and a world where F is false. For a prediction   with probability p, we set the weight p of corresponding formula as log 1−p . Here, the penalty for violating any formula will increase logarithmically with its probability. 2. Constant Multiplier (CM): As per this strategy, for a prediction with probability p, we set the weight of corresponding formula as K · p. Here, the penalty for violating any formula will increase linearly with its probability. We have used K = 10 in all our experiments. Rules induced by the Local Entity Classifier: For each candidate entity mention, the entity type predicted by the local entity classifier acts as an evidence for the MLN inference. The classifier also assigns some probability to each possible entity type. For each entity mention id i, for each possible entity type E, following rule is added with the weight proportional to the probability of prediction. ET (i, Emax ) ⇔ ET F inal(i, E) Here, Emax is the entity type predicted by the local entity classifier. The  weights  Pe (E|i) and K · assigned to this rule as per above strategies would be log 1−P e (E|i) Pe (E|i), where Pe (E|i) is the probability assigned to entity type E for the entity mention id i by the local entity classifier. Rules induced by the Pipeline Relation Classifier: For each pair of entity mentions, the relation type predicted by the “pipeline” classifier acts as an evidence for the MLN inference. For each pair of candidate entity mentions (i, j), for each possible relation type R, following rule is added with the weight proportional to the probability of prediction. RT P (i, j, Rmax ) ⇔ RT F inal(i, j, R) Here, Rmax is the relation type predicted bythe “pipeline”relation classifier.The wtp ·PrP (R|i,j) weights assigned to this rule would be log 1−P and K · PrP (R|i, j) · P (R|i,j) r wtp , where PrP (R|i, j) is the probability assigned to the relation type R for the pair (i, j) by the “pipeline” relation classifier. And wtp is the reliability of prediction of “pipeline” classifier, which indicates how confident the local entity classifier was in predicting entity types for entity mentions i and j. We set i j wtp = Pe (Emax |i) · Pe (Emax |j). Rules induced by the Local Relation Classifier: For each pair of candidate entity mentions, the relation type predicted by the local classifier acts as an evidence for the MLN inference. For each pair entity mentions (i, j), for each possible relation type R, following rule is added with the weight proportional to the probability of prediction. L RT L(i, j, Rmax ) ⇔ RT F inal(i, j, R) L Here, Rmax is the relation type predicted by local relation classifier.The  the PrL (R|i,j) weights assigned to this rule would be log 1−P L (R|i,j) and K · PrL (R|i, j), r where PrL (R|i, j) is the probability assigned to the relation type R for the pair (i, j) by the local relation classifier. Rules for identifying valid/invalid entity mentions: We generate candidate entity mentions using top 2 most probable BIO sequences. In general, we have a high confidence that candidate mentions from the topmost sequence are valid and have a lower confidence for candidates from the second sequence. This intuition is captured by addition of following rules. For each candidate  i from  p the topmost sequence, we add !ET F inal(i, N ON E) with the weight log 1−p or K ·p, based on the weighing strategy employed. Also for each candidate   i from or the second sequence, we add ET F inal(i, N ON E) with the weight log 1−p p K · (1 − p). In both the cases, p is the highest probability for any entity type predicted for that mention by the local entity classifier. As we are generating candidate entity mentions by using top 2 most probable BIO sequences, there may be some overlapping entity mentions. For each pair of such overlapping candidate entity mentions (say i and j), following rules are added so that at most one of them is a valid entity mention. !ET F inal(i, N ON E) ⇒ ET F inal(j, N ON E). !ET F inal(j, N ON E) ⇒ ET F inal(i, N ON E). We assume candidate mentions generated from the second BIO sequence to be valid, only if they are involved in some valid relation other than N U LL. Also, an invalid entity mention should not be involved is any non N U LL relation with any other mention. To ensure this desired consistency, following rules are added for each pair of candidate mentions (i, j) where one of them (say i) is generated from second BIO sequence. !RT F inal(i, j, N U LL) ⇒!ET F inal(i, N ON E). ET F inal(i, N ON E) ⇒ RT F inal(i, j, N U LL). After the inference, if the probability of ET F inal(i, N ON E) is the highest for any candidate mention i, then it is identified as an invalid mention. And because of above rules ensuring consistency, such mentions are never involved in any non N U LL relation. 3.5 Additional Semantic Rules We explored the possibility of incorporating some domain knowledge by exploiting the easy and effective representability of the first-order logic. In order to incorporate the additional rules, we define following new predicates: 1. CON S(entity, entity) : CON S(i, j) is true only when there is no other entity mention occurring in between the mentions i and j in a sentence. 2. CON J(entity, entity) : CON J(i, j) is true only when there is a conjunction (i.e. connected through the dependency relations “conj:and” or “conj:or” in the dependency tree) between the two mentions i and j. Using the knowledge of conjunctions: When two entity mentions are connected through a conjunction (like and, or) and one of them is connected to a third entity mention with PHYS (i.e. located at) relation, then the other entity mention is also very likely to be connected to the third mention with PHYS relation. E.g. in the sentence fragment troops in Israel and Syria, a PHYS relation between troops and Israel implies another PHYS relation between troops and Syria. To incorporate this knowledge, following generic rules are added in MLNs of all sentences. RT F inal(x, y, P HY S) ∧ ((CON J(y, z) ∧ CON S(y, z)) ∨ (CON J(z, y) ∧ CON S(z, y))) ∧ET (y, t) ∧ ET (z, t) ⇒ RT F inal(x, z, P HY S). RT F inal(x, y, P HY S) ∧ ((CON J(w, x) ∧ CON S(w, x)) ∨ (CON J(x, w) ∧ CON S(x, w))) ∧ET (w, t) ∧ ET (x, t) ⇒ RT F inal(w, y, P HY S). Linking entity mentions with same types: The entity mentions linked through certain dependency relations tend to share the same entity type. E.g. in the sentence fragment companies such as Nielsen, the mentions companies and Nielsen are very likely to have the same entity type. This is one of the Hearst patterns [7] to automatically identify hyponyms from text. If entity mentions i and j follow such a pattern, we add following rule to their sentence’s MLN : ET F inal(i, x) ⇔ ET F inal(j, x). Using knowledge about relation types: If an entity mention of type P ER is involved in a EM P ORG relation, then it is highly unlikely that the same person will be connected to any other mention with the EM P ORG relation. This is because any person can have at most one employer mentioned in a single sentence. To impose this constraint, we add following rule. RT F inal(x, y, EM P ORG) ∧ (y 6= z)∧!RT F inal(y, z, IDN )∧!RT F inal(z, y, IDN ) ∧ET F inal(x, P ER) ⇒!RT F inal(x, z, EM P ORG)∧!RT F inal(z, x, EM P ORG). 3.6 Joint Inference As described above, an MLN is created for a sentence using some Generic Rules with infinite weights and some sentence-specific rules. Given such an MLN, we are interested to know the most probable groundings of the query predicates given some specific groundings of evidence predicates. In our case, ET F inal and RT F inal are the query predicates and ET , RT P , RT L, CON S and CON J are the evidence predicates. Inference over this MLN gives the probability of each possible grounding of the query predicates, conditioned on the given values of the evidence predicates. We used the default inference algorithm in Alchemy named “Lifted Belief Propagation” [26]. For each candidate entity mention i, grounding of the predicate ET F inal(i, E) with the highest probability is chosen and corresponding value of E is its final entity type except the case when E = N ON E. In that case, we do not identify the corresponding candidate mentions as a valid entity mention. Similarly, for each entity mention pair (i, j), grounding of the predicate RT F inal(i, j, R) with the highest probability is chosen and corresponding R value is its final relation type. 4 Example In this section, we describe an example sentence where the joint inference helps in correcting the prediction errors by the individual classifiers. Consider the sentence from the ACE 2004 dataset: she is the new chair of the black caucus. In order to identify the candidate entity mentions, top 2 label sequences predicted by the CRF model are considered. 1. she/B is/O the/O new/O chair/O of/O the/O black/O caucus/B ./O 2. she/B is/O the/O new/O chair/B of/O the/O black/O caucus/B ./O Table 1 shows all the candidate entity mentions identified along with their IDs and predictions of the local entity classifier. It can be observed that mention ID Table 1. Candidate entity mentions identified in the example sentence ID Entity Mention From First BIO Sequence? Predicted Type Actual Type 1 she Yes PER PER 2 chair No PER PER 3 caucus Yes PER ORG 2 is generated from the second best BIO sequence and hence will be considered a valid mention only if it is involved in a relation with some other mention. Moreover, the entity type predicted for the mention ID 3 (caucus) is incorrect. This error propagates to the relation classification with “pipeline” classifier predicting relation between chair and caucus to be IDN instead of EMP-ORG. But the local classifier predicts the correct relation type EMP-ORG for this pair as it is not using the entity type features. The first-order logic rules for this sentence’s MLN are shown in the Table 2. The LOR (log of odds ratio) weights assignment strategy is used. In case of soft constraints, the number preceding each rule indicates its weight. No weight is explicitly specified for the hard constraints and they always end with a period. Table 2. First-order logic rules for the MLN of example sentence Rules induced by the local entity Rules for identifying valid/invalid entity classifier mentions 6.13 ET (1,P ER) ⇔ ET F inal(1,P ER) 6.13 !ET F inal(1,N ON E) −0.93 ET (2,P ER) ⇔ ET F inal(2,LOC) 0.71 ET F inal(2,N ON E) −0.89 ET (2,P ER) ⇔ ET F inal(2,ORG) 0.15 !ET F inal(3,N ON E) −0.71 ET (2,P ER) ⇔ ET F inal(2,P ER) ET F inal(2,N ON E) ⇒ RT F inal(1,2,N U LL). −0.53 ET (3,P ER) ⇔ ET F inal(3,ORG) !RT F inal(1,2,N U LL) ⇒!ET F inal(2,N ON E). 0.15 ET (3,P ER) ⇔ ET F inal(3,P ER) ET F inal(2,N ON E) ⇒ RT F inal(2,3,N U LL). !RT F inal(2,3,N U LL) ⇒!ET F inal(2,N ON E). Rules induced by the local and pipeline relation classifiers 3.37 RT L(1, 2, IDN ) ⇔ RT F inal(1, 2, IDN ) 2.99 RT P (1, 2, IDN ) ⇔ RT F inal(1, 2, IDN ) 1.52 RT L(1, 3, N U LL) ⇔ RT F inal(1, 3, N U LL) −1.66 RT L(1, 3, N U LL) ⇔ RT F inal(1, 3, IDN ) 0.35 RT P (1, 3, N U LL) ⇔ RT F inal(1, 3, N U LL) −1.63 RT P (1, 3, N U LL) ⇔ RT F inal(1, 3, IDN ) −1.80 RT L(2, 3, EM P ORG) ⇔ RT F inal(2, 3, P HY S) −1.09 RT L(2, 3, EM P ORG) ⇔ RT F inal(2, 3, IDN ) 0.24 RT L(2, 3, EM P ORG) ⇔ RT F inal(2, 3, EM P ORG) −0.46 RT P (2, 3, IDN ) ⇔ RT F inal(2, 3, IDN ) Table 3. MLN inference output for entity types she (ID 1) chair (ID 2) ET F inal(1, P ER) =0.99 ET F inal(2, P ER) =0.92 ET F inal(1, GP E) =0.01 ET F inal(3, GP E) =0.03 ET F inal(2, GP E) =0.02 ET F inal(2, N ON E) =0.01 caucus (ID 3) ET F inal(3, P ER) =0.35 ET F inal(3, ORG) =0.39 ET F inal(3, N ON E) =0.14 ET F inal(3, F AC) =0.03 The joint inference combines the evidence from the above three classifiers and generates a globally consistent output. The outputs for the query predicates ET F inal and RT F inal are shown in the Tables 3 and 4, respectively. The predicate groundings which have negligible probability are not shown. Here, it can be observed that the entity mention chair (ID 2) has been correctly identified as a valid mention and the type of entity mention caucus has been correctly predicted as ORG. Also the correct relation type of EMP-ORG between chair and caucus has been chosen as the global prediction. Table 4. MLN inference output for relation types (she,chair) (she, caucus) RT F inal(1, 2, IDN ) =0.92 RT F inal(1, 3, EM P ORG) =0.02 RT F inal(1, 2, P HY S) =0.01 RT F inal(1, 3, P ERSOC) =0.02 RT F inal(1, 2, ART ) =0.01 RT F inal(1, 3, OT HERAF F ) =0.02 RT F inal(1, 2, OT HERAF F ) =0.02 RT F inal(1, 3, N U LL) =0.90 RT F inal(1, 2, N U LL) =0.01 RT F inal(1, 3, IDN ) =0.02 (chair,caucus) RT F inal(2, 3, EM P ORG) =0.33 RT F inal(2, 3, P HY S) =0.10 RT F inal(2, 3, GP EAF F ) =0.10 RT F inal(2, 3, OT HERAF F ) =0.09 RT F inal(2, 3, IDN ) =0.20 5 Experimental Analysis In order to demonstrate the effectiveness of our approach, we compare its performance with other approaches which have reported their results for end-to-end relation extraction on ACE 2004 dataset 6 . For fair comparison, we follow the same assumptions made by Chan and Roth [2] and Li and Ji [13], i.e. ignoring the DISC relation, not treating implicit relations as false positives and using coarse entity and relation types. All the results are obtained by 5-fold cross-validation on ACE-2004 data. Note that the actual folds used by each algorithm may differ. Table 5. Results on the ACE 2004 dataset (Micro-averaged, 5-fold cross-validation) Approach Entity Extraction Relation Extraction Entity+Relation P R F P R F P R F Local Classifiers 80.9 77.6 79.2 53.2 43.9 48.1 46.2 38.1 41.8 Pipeline Classifier 53.3 46.4 49.6 48.7 42.5 45.4 Chan and Roth [2] 42.9 38.9 40.8 Li and Ji [13] 83.5 76.2 79.7 64.7 38.5 48.3 60.8 36.1 45.3 Miwa and Bansal [16] 83.3 79.2 81.2 56.1 40.8 47.2 MLN (LOR) 79.3 79.9 79.6 56.2 45.2 50.1 50.6 40.8 45.2 MLN (LOR)+Rules 79.3 80.0 79.6 56.6 45.1 50.2 51.0 40.6 45.2 MLN (CM) 78.9 80.1 79.5 57.2 45.2 50.5 51.6 40.8 45.6 MLN (CM)+Rules 79.0 80.1 79.5 57.9 45.6 51.0 52.4 41.3 46.2 Comparative performances of all the approaches are shown in the table 5. A true positive for the task of entity extraction means that an entity mention has been correctly identified as the valid mention and also its type has been identified correctly. A true positive for the task of relation extraction means that for a pair of valid entity mentions, its relation type (except for special relation types 6 We have not yet acquired a more recent ACE 2005 dataset N U LL and IDN ) has been identified correctly. For entity+relation extraction, a stricter criteria is used where a true positive means that for a pair of valid entity mentions, not only its relation type is identified correctly but types of both the mentions are also identified correctly. Even if any one of these predictions is incorrect, we consider it as a false positive for the predicted combination of entity types and relation type and also as a false negative for the true combination of entity types and relation type. It can be observed that MLN inference with CM (Constant Multiplier) weights assignment strategy performs better that the LOR (Log of Odds Ratio) in case of relation extraction whereas for entity extraction LOR strategy is better. Addition of semantic rules (discussed in the Section 3.5) results in better performance for both the strategies. Also, we can observe that MLN (CM) with semantic rules comfortably outperforms the individual classifiers: local entity classifier, local relation classifier and “pipeline” relation classifier. In case of end-to-end relation extraction, our approach outperforms the approaches of Chan and Roth [2] and Li and Ji [13] on the ACE 2004 dataset and also achieves a comparable performance as compared to Miwa and Bansal [16]. We also achieve comparable performance in case of entity extraction as compared to Li and Ji [13] but underperform in comparison with Miwa and Bansal [16]. 6 Related Work Previous work on joint extraction of entities and relations can be broadly classified into 5 categories : i) Integer Linear Programming (ILP) based approaches [22,24], ii) Probabilistic Graphical Models [23,25], iii) Card-pyramid parsing [11], iv) Structured Prediction [13,14,17] and v) Recurrent Neural Network (RNN) based model [16]. Our approach is similar to ILP based approaches, but we use MLNs for joint inference which provide much better representation to incorporate complex domain knowledge as compared to ILP. For example, the rules defined in the section 3.5 are quite easy to incorporate using first-order logic but the same would be cumbersome in ILP. The approaches by Singh et al. [25] and Li and Ji [13] not only carry out joint “inference” but also create a joint “model” where the parameters for both the tasks are learned jointly. Zhang et al. [27] used Markov Logic rules to perform Ontological Smoothing. The concept of Ontological Smoothing is to find a mapping from a user-specified target relation to a background knowledge base. This mapping is then used to generate extra training data for distant supervision. Similar to our approach, they also use Markov logic rules to ensure consistency between relation types and entity types. One major difference is that the relation types used by them were quite specific and not as general as ACE 2004 relation types. Zhu et al. [28] also used MLNs but they addressed a relation extraction problem which is bit different from the ACE 2004 RDC task. It requires the explicit mention of relation in the form of words other than the words inside entity mentions. This is not always true for ACE 2004 relations. For example, EMP-ORG relation holds be- tween Indian and soldiers in the sentence Indian soldiers attacked the terrorists. 7 Conclusion and Future Work We described the problem of end-to-end relation extraction and the need to jointly address its sub-tasks of entity and relation extraction. We proposed a new approach for joint extraction of entity mentions and relations at the sentence level, which uses joint inference in Markov Logic Networks (MLN). We described in detail about the domains, predicates and first-order logic rules used to create an MLN for a sentence. We also explored how the effective representability of first-order logic can be used to incorporate various semantic rules and domain knowledge. Finally, we demonstrated better than the state-of-the-art end-to-end relation extraction performance on the standard dataset of ACE 2004. In future, we plan to analyze the two weights assignment strategies (CM and LOR) in detail and develop deeper understanding of pros and cons of each one. Also, we have tried only a small number of additional semantic rules. In future, we wish to take advantage of the first-order logic framework to incorporate deeper semantic knowledge. Another important direction to explore is about learning the weights of first-order logic rules automatically. References 1. Bunescu, R.C., Mooney, R.J.: A shortest path dependency kernel for relation extraction. In: Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing. pp. 724–731. ACL (2005) 2. Chan, Y.S., Roth, D.: Exploiting syntactico-semantic structures for relation extraction. In: Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies-Volume 1. pp. 551–560. ACL (2011) 3. Doddington, G.R., Mitchell, A., Przybocki, M.A., Ramshaw, L.A., Strassel, S., Weischedel, R.M.: The Automatic Content Extraction (ACE) Program-Tasks, Data, and Evaluation. In: LREC. vol. 2, p. 1 (2004) 4. Florian, R., Jing, H., Kambhatla, N., Zitouni, I.: Factorizing complex models: A case study in mention detection. In: Proceedings of the 21st International Conference on Computational Linguistics and the 44th annual meeting of the Association for Computational Linguistics. pp. 473–480. ACL (2006) 5. Florian, R., Pitrelli, J.F., Roukos, S., Zitouni, I.: Improving mention detection robustness to noisy input. In: Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing. pp. 335–345. ACL (2010) 6. GuoDong, Z., Jian, S., Jie, Z., Min, Z.: Exploring various knowledge in relation extraction. In: Proceedings of the 43rd annual meeting on association for computational linguistics. pp. 427–434. Association for Computational Linguistics (2005) 7. Hearst, M.A.: Automatic acquisition of hyponyms from large text corpora. In: Proceedings of the 14th conference on Computational linguistics-Volume 2. pp. 539–545. ACL (1992) 8. Heckmann, D., Frank, A., Arnold, M., Gietz, P., Roth, C.: Citation segmentation from sparse & noisy data: An unsupervised joint inference approach with markov logic networks (2013) 9. Jain, D.: Knowledge engineering with Markov Logic Networks: A review. Evolving Knowledge in Theory and Applications 16 (2011) 10. Jiang, J., Zhai, C.: A Systematic Exploration of the Feature Space for Relation Extraction. In: HLT-NAACL. pp. 113–120 (2007) 11. Kate, R.J., Mooney, R.J.: Joint entity and relation extraction using card-pyramid parsing. In: Proceedings of the Fourteenth Conference on Computational Natural Language Learning. pp. 203–212. ACL (2010) 12. Lafferty, J., McCallum, A., Pereira, F.C.: Conditional Random Fields: Probabilistic models for segmenting and labeling sequence data (2001) 13. Li, Q., Ji, H.: Incremental joint extraction of entity mentions and relations. In: ACL (2014) 14. Li, Q., Ji, H., Hong, Y., Li, S.: Constructing information networks using one single model. In: EMNLP (2014) 15. Lu, W., Roth, D.: Joint mention extraction and classification with mention hypergraphs. In: Proc. Conference on Empirical Methods in Natural Language Processing (EMNLP2015) (2015) 16. Miwa, M., Bansal, M.: End-to-end Relation Extraction using LSTMs on Sequences and Tree Structures. arXiv preprint arXiv:1601.00770 (2016) 17. Miwa, M., Sasaki, Y.: Modeling Joint Entity and Relation Extraction with Table Representation. In: EMNLP. pp. 1858–1869 (2014) 18. Nadeau, D., Sekine, S.: A survey of named entity recognition and classification. Lingvisticae Investigationes 30(1), 3–26 (2007) 19. Palshikar, G.K.: Techniques for Named Entity Recognition. Bioinformatics: Concepts, Methodologies, Tools, and Applications p. 400 (2013) 20. Qian, L., Zhou, G., Kong, F., Zhu, Q., Qian, P.: Exploiting constituent dependencies for tree kernel-based semantic relation extraction. In: Proceedings of the 22nd International Conference on Computational Linguistics-Volume 1. pp. 697–704. ACL (2008) 21. Richardson, M., Domingos, P.: Markov Logic Networks. Machine learning 62(1-2), 107–136 (2006) 22. Roth, D., Yih, W.: A linear programming formulation for global inference in natural language tasks. In: CoNLL. pp. 1–8 (2004) 23. Roth, D., Yih, W.t.: Probabilistic reasoning for entity & relation recognition. In: Proceedings of the 19th international conference on Computational linguisticsVolume 1. pp. 1–7. ACL (2002) 24. Roth, D., Yih, W.t.: Global inference for entity and relation identification via a linear programming formulation. Introduction to statistical relational learning pp. 553–580 (2007) 25. Singh, S., Riedel, S., Martin, B., Zheng, J., McCallum, A.: Joint inference of entities, relations, and coreference. In: Proceedings of the 2013 workshop on Automated knowledge base construction. pp. 1–6. ACM (2013) 26. Singla, P., Domingos, P.: Lifted first-order belief propagation. In: AAAI. vol. 8, pp. 1094–1099 (2008) 27. Zhang, C., Hoffmann, R., Weld, D.S.: Ontological Smoothing for Relation Extraction with Minimal Supervision. In: AAAI (2012) 28. Zhu, J., Nie, Z., Liu, X., Zhang, B., Wen, J.R.: StatSnowball: a statistical approach to extracting entity relationships. In: Proceedings of the 18th international conference on World wide web. pp. 101–110. ACM (2009)
2cs.AI
SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 1 Self-Controlled Jamming Resilient Design Using Physical Layer Secret Keys arXiv:1803.07358v1 [cs.IT] 20 Mar 2018 Jay Prakash, Student Member, IEEE, Chenxi Liu, Member, IEEE, Jemin Lee, Member, IEEE, and Tony Q. S. Quek, Fellow, IEEE Abstract Direct-sequence spread spectrum (DSSS) has been recognized as an effective jamming resilient technique. However, the effectiveness of DSSS relies on the use of either pre-shared unique secret keys or a bank of public codes, which can be prohibitively expensive in future large-scale decentralized wireless networks, e.g., the Internet of Things. To tackle this problem, in this work we develop a new framework for self-controlled physical-layer-security-based spreading sequence generation. Specifically, we exploit the shared randomness inherent in wireless channels to generate and refresh secret seeds at each communicating node using shared randomness extraction, entropy pooling and random seed generation. The generated secret seeds are then utilized to perform DSSS. To evaluate the performance, we implement our framework on software defined radio platform and examine the successful transmission probability of the system under various models of broadband jamming along with an special case wherein adversary is assumed to have leaked information on key rate. Both our analysis and real-world measurements confirm that communication systems based on our framework can achieve jamming-resilient communications without requiring pre-shared sequences. J. Prakash, C. Liu, and T. Q. S. Quek are with the Information Systems Technology and Design Pillar, Singapore University of Technology and Design, Singapore 487372 (email: jay [email protected], chenxi [email protected], [email protected]). J. Lee is with the Department of Information and Communication Engineering, Daegu Gyeongbuk Insitute of Science and Technology (DGIST), Daegu, Korea (email: [email protected]). The corresponding author is C. Liu. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 2 Index Terms IoT, security, Anti-Jamming, physical layer key, randomness extraction, DSSS I. I NTRODUCTION The Internet of Things (IoT) is a promising aspect of wireless communications, which is envisioned to interconnect ultra-large number of devices from various environments. However, the inherent decentralized structure of the IoT makes devices increasingly vulnerable to potential attacks, as well as making it extremely difficult for traditional centralized security methods to protect devices of the IoT from such attacks. Consequently, developing novel secure transmission schemes that are suitable for large-scale decentralized wireless networks has been receiving more and more research attention. On the other hand, jamming attacks, among all potential attacks, have been considered as a significant threat to wireless communications in the past few decades, since it can lead to new signal creation, annihilation and/or symbol flipping [1]. In addition, jamming attacks decrease the signal-to-interference-plus-noise-ratio (SINR) of the legitimate system, thereby directly degrading the bit error rate (BER) and throughput of the legitimate system. Effect of jamming attack on state of art cyber-physical-system (CPS) testbed, SWAT, was studied in [2] which shows aberrations in physical water cleaning processes, among other effects, in response to jamming of network at different levels in link hierarchy. These detrimental effects of jamming and advancement in narrow-band jamming, as introduced in optimal attack strategy for given modulation in [3], and real-time reactive jammer, as presented in [4], make it imperative to explore jamming resilient protocol. Traditionally, jamming resilient communications in wireless networks are achieved through spread spectrum techniques such as frequency hopping spread spectrum (FHSS) and direct sequence spread spectrum (DSSS), relying on the assumption that the frequency band used in FHSS and codes used to spread data in DSSS are not known at the jammer. This assumption, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 3 however, is less likely to be valid with the low computational complexity of breaking the preshared codes in DSSS as well as the rapid increase in the adversary’s computational capability. To tackle this problem, significant research efforts have been devoted to design jamming resilient communications systems without requiring pre-shared keys [5]–[11]. Specifically, in [5] and in [6], an uncoordinated key agreement protocol was proposed to combat jamming attacks. The network secrecy was examined in [7] considering the use of the uncoordinated hopping. Relaxing the requirement on pre-shared secret sequences, the uncoordinated FHSS was proposed in [8]. Instead of having the same spreading codes for each transmission, in [9] the randomized DSSS, which uses a set of codes and randomly choose one of these codes for each transmission, was proposed for peer-to-peer communication systems. As such, an extra processing delay is introduced at the jammer since it needs to decipher the sequence used in each transmission, and thereby improving the jamming resilience of the legitimate system. An improved version of randomized DSSS in [9] was later generalized to broadcast communication systems [10]. In [11], it was proposed to use encryption on spread sequence. The aforementioned works [5]–[11] focus on the jamming resilient design in centralized communication systems, but the jamming resilient design in decentralized communication systems particularly for the IoT network, where many peer-to-peer communications can occur simultaneously, has not been studied extensively. In such system, significant challenges are introduced for the generation, distribution, and management of spread sequences. In this work, we exploit the potential benefits of physical layer key in enhancing the jamming resilience of decentralized wireless networks. Inspired by the physical layer secret key extraction (e.g., [12], [13]), we exploit the shared randomness inherent in wireless channels to perform pseudo-random seed generation. The generated pseudo-random seeds are then used to simultaneously generate spreading codes at all participating nodes of the considered system. We note that physical layer key based secure spectrum spread has recently been presented in [14] and [15]. A fault tolerant key extraction was proposed in [14] and the extracted keys were then used directly to perform spectrum spread. A detailed theoretical analysis SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 4 for physical layer secret key based FHSS was performed in [15]. These works do not consider two important aspects: functionality assurance in low key rate conditions and orthogonality of spreading sequences thus generated. Compared to [14] and [15], we adopt a cross-layer strategy to use the generated secret keys as the seeds of random sequence generation, and adopt the bit error probability and successful transmission probability as performance metrics. Our contributions are summarized as follows: • We extract secret keys from orthogonal frequency-division multiplexing (OFDM) subcarriers. In addition, we show how secret key agreement can be achieved in the legitimate system. • We propose to utilize cross-layer security techniques for random seed generation. We highlight that our proposed method can support the system requirements even when the key rate is relatively low. • To evaluate the performance, we analyze the successful transmission probability of the legitimate system, under active attacks from the jammer. Moreover, we implement our proposed design on software defined radios platform using USRP-2952 and Labview Communication Suite, confirming that our analysis accurately match with real-world measurements. The rest of the paper is organized as follows. In Section II, we describe the system model. In Section III, we detail the shared randomness extraction of the proposed design. In Section IV, we present the components of proposed jamming resilient design and show how the extracted secret keys can be used for secure spectrum spread. We also analyze the performance achieved by the proposed scheme. Numerical results and related discussions are presented in Section V. Finally, Section VI draws conclusions. Notations: Column vectors (matrices) are denoted by boldface lower (upper) case letters. Conjugate transpose is denoted by (·)H . Complex Gaussian distribution is denoted by CN . Statistical expectation is denoted by E. The absolute value of a scalar is denoted by | · |. The Frobenius norm of a vector or a matrix is denoted by k · k. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 5 (a) Channel probing and trasmission. (b) TDD frame structure. Fig. 1. Illustration of the channel probing and the frame structure of TDD. II. S YSTEM M ODEL We consider a wiretap channel, as depicted in Fig.1(a), where a transmitter (Alice) communicates with a legitimate receiver (Bob) in the presence of an active attacker who can perform malicious jamming attack when legitimate communications occur. We assume that all the nodes are equipped with a single antenna and works in a half-duplex mode. In the considered system, the transmission between Alice and Bob follows a time division duplex (TDD) protocol with the frame slotted structure, as shown in Fig. 1(b). Specifically, TP 1 and TP 2 denote the channel probing slots when Alice and Bob send each other OFDM based probing symbols. The mth sample in OFDM symbol transmitted in TP 1 and TP 2 can be expressed as x [m] = √ M M −1 X X[k] exp (j2πkm/M) , (1) k=0 where M denotes the total number of subcarriers and X[k] denotes the pilot symbol modulated to k th subcarrier. We assume that the total time length of TP 1 and TP 2 is less than the channel SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 6 coherence time such that the channel reciprocity is guaranteed. In R, Alice and Bob generate secret bits independently and establish the common key. In D, Alice uses the secret bits to spread the symbols using DSSS. A. Channel Model In this work, we consider the frequency-selective broadband channel model. We denote hij , i, j ∈ {a, b, e} as the channel between node i and j, where a, b, and e stand for Alice, Bob, and attacker, respectively. As such, the impulse response of the channel between node i and j is expressed as hij (τ, t) = L−1 X hij [l] = l=0 L−1 X l=0 hij (τl , t)δ(τ − τl ), (2) where L denotes the total number of channel taps, τl = lT and hij (τl , t) denote the delay and attenuation of the lth channel tap, respectively, T denotes the sampling period, and δ(·) denotes the Dirac delta function [16]. Based on (2), the frequency response of hij (τ, t) corresponding to the k th subcarrier can be expressed as Hij [k] = L−1 X hij [l] exp (−j2πkl/M) . (3) l=0 Without loss of generality, in the following, we omit the subcarrier index k. We then express the 1 × M channel vector observed at Bob in the frequency domain as Hba = Hab + ∆b , (4) where ∆b denotes channel probing errors between Alice and Bob. We also express the 1 × M channel vector observed at attacker in the frequency domain as Hea = Hab + ∆e1 , (5) where ∆e denotes the difference between Hab and Hae . We note that the variance of ∆e is much larger than that of ∆b due to different locations of Bob and attacker. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 7 B. Adversary Model We consider that attacker is of the capability of fast spectrum sensing and RF chain switching. As such, attacker transmits malicious jamming signals only when it senses that the legitimate communication occurs. As previously described, Alice transmits the signal using DSSS. As such, we express the signal received at Bob in the time domain as q q −α yb = Pa dab hab xCab + Pe d−α eb heb xe + nb , (6) where Pa and Pe denote the transmit power at Alice and attacker, respectively, dab and deb denote the distance between Alice and Bob and the distance between attacker and Bob, respectively, α denotes the path-loss exponent, Cab denotes the spreading code, of length L bits, used by Alice, x and xe denotes the transmitted symbol from Alice and the jamming signal from attacker, respectively, and nb denotes the thermal noise at Bob, which is assumed to be an independent and identically distributed (i.i.d) complex Gaussian random variable with zero mean and variance σb2 , i.e., nb ∼ CN (0, σb2 ). In (6), we have E (|x|2 ) = 1 and E (|xe |2 ) = 1. As per the rule of DSSS, for Cab of length L, the signal-to-interference-plus-noise ratio (SINR) at Bob is expressed as [17] γb = γab L|hab |2 , γeb |heb |2 + 1 (7) −α 2 2 where γab = Pa d−α ab /σb and γeb = Pe deb /σb . III. S HARED R ANDOMNESS E XTRACTION In this section, we describe in detail how the shared randomness extraction (SRE) (i.e., the physical layer secret key generation) is achieved, which will be used in our proposed scheme. We note that secret key generation is performed by using channel measurements, including the channel impulse response (CIR), the channel frequency response (CFR), and the received signal strength (RSS), as the source of randomness. The key benefits of using channel measurements as the source of randomness are: SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY • 8 Shared randomness: Due to the reciprocity of wireless channels, channel measurements are almost same at the transmitter and the receiver. • Time variant: Channel measurements are independent of each other across time. • Position independence: Channel measurements at two different locations are independent [18]. These benefits also stand for primary requirements on the part of source for designing a shared key based secure system. We note that secret key generation based on different channel measurements has its own suitable scenarios. For example, the RSS-based secret key generation can be cost-effective in systems with low-capability devices, while CIR-based secret key generation is more suitable for the system requiring a higher secret generation rate since CIR-based scheme can generate more keys from multi-path rich environments. The process of SRE can be divided into three steps (see Fig. 4 for the block diagram of SRE): 1) randomness observation, 2) fuzzy extraction, and 3) privacy amplification, which are described in the following subsections. A. Randomness Observation: Channel Estimation For the channel estimation at Alice and Bob, as described in Section II, Alice and Bob exchange OFDM-based pilot probes to estimate channel between them. In order to observe highly correlated estimates at both nodes, the following constraint needs to be satisfied: TP 1 + TP 2 + Ts ≤ Tc , (8) where Ts denotes the time spent in switching RF chain at transceivers, and Tc denotes the coherence time. We have Tc = 9 16πfd [18], where fd denotes the Doppler frequency. After channel probing, two highly correlated random matrices Hab and Hba are obtained at Alice and Bob, respectively. We note that both Hab and Hba are arrays of channel measurements across N probing slots and M subcarriers, i.e., Hba = [Hba (f1 ), · · · , Hba (fM )] and Hab = SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 9 [Hab (f1 ), · · · , Hab (fM )]. We also note that N probing slots (TP 1 and TP 2 ) are needed in order to make sure that both nodes have sufficient entropy to support the proposed PHY-DSSS. The value of N is determined by system requirements such as the secret key rate. We also note that the duration between probing slots plays a vital role in generating secret keys with enough entropy. This is because a high probing rate leads to a decreased entropy of generated secret keys, due to high bits correlation across time. As such, we choose the probing rate to be 1/Tc as in [19] and [20]. B. Fuzzy Extraction After obtaining these channel estimates at Alice and Bob, the next step is to obtain the same secret keys at Alice and Bob. This can be achieved by the shared randomness extractor [21], defined as: Definition 1. A function fsre (·) is a shared randomness extractor if (1) fsre (·) is a mapping {Re}n → {0, 1}m, and fsre (H), H ∈ {Hab , Hba } is ǫ-close to Um , i.e., k < fsre (H, φ), φ > − < Um , φ > k ≤ ǫ, where Um is the uniform distribution over {0, 1}m and φ is a random variable uniformly distributed over R; (2) fsre (Hab ) and fsre (Hba ) return same outputs with at least 1 − ǫc probability. One such promising extractor is the fuzzy extractor, which can generate sufficiently random bits using two similar and noisy data as inputs [22]. Specifically, we define m as the length of the channel estimates Hab at Alice and the channel estimates Hba at Bob, l as the length of output random string R, and t as the maximum distance (e.g., hamming distance or set-difference) between channel estimates at Alice and Bob. How the fuzzy extractor works can be explained as follows: fuzzy extractor f (Hab , Hba , m, l, t), as shown in Fig. 2, consists of two components: a probability difference function Gene(·) and a recovery process Rec(·). First, Alice generates a random string R ∈ {0, 1}l and a helper string P ∈ {0, 1}∗ by using Gene(Hab ). In order to obtain the same random string R at Bob, Alice shares the helper string P with Bob. Then, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 10 Fig. 2. Fuzzy extraction in the presence of attacker. Bob performs the recovery process Rec (Hba , P ). If the distance between Hab and Hba is within a certain range, i.e., dis (Hab , Hba ) ≤ t, Bob can perfectly recover the random string R. The Fuzzy Extractor also insures that R is ǫ close to Ul , indicating that the generated secret keys are random enough. We highlight that attacker cannot recover the random string R even if it knows Rec(·), due to the fact that Hba and Hea are independent. We note that there are two types of fuzzy extractors, namely, set-difference based fuzzy extractor and hamming distance based fuzzy extractor. Fig. 3 shows the block diagram of these two type of fuzzy extractors. We can see that set-difference based fuzzy extractor uses Pin-sketch based constructor to design the helper string, while hamming distance based fuzzy extractor utilizes Secure-sketch based constructor [22]. In this work, we focus on the use of hamming distance based extractor. We will show in Section V-C why the set-difference based fuzzy extractor is not suitable for our considered system. The process of hamming distance based fuzzy extractor can be explained as follows: a) Quantization: We note that Hamming distance based constructor needs binary inputs hence channel observations need to be quantized. Specifically, Alice and Bob use an adaptive quantizer, Qu (·), to quantize Hab and Hba , respectively. The lower and upper thresholds of Qu (·) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 11 Fig. 3. Notions of fuzzy-extraction. are given by 2 Q+ u = µHab + α ∗ σHab , (9) 2 Q− u = µHab − α ∗ σHab , (10) and respectively, where µHab is the mean of channel estimates vector, σ is the corresponding variance vector, and α denotes a tuning factor. We note that incorporating this tuning factor α in Qu (·) can decrease secret bit mismatches per block. We drop channel estimates whose amplitudes are − + between Q+ u and Qu , while setting values of channel estimates whose amplitudes are above Qu and below Q− u to be 1 and 0, respectively. b) Information Reconciliation: We note that bit mismatches after the quantization are inevitable due to noise, interference, hardware impairments, automatic gain control issues, synchronization issues at Alice and bob, and other issues associated with half-duplex transceivers. Therefore, the next step of SRE is to insure both nodes agree on the exact same bit sequence with sufficient randomness. We denote the quantized channel estimates at Alice and Bob as Qu (Hab ) and Qu (Hba ), SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 12 respectively. Using Qu (Hab ), Alice first broadcasts to Bob a Secure-sketch, which is given by SS(Qu (Hab )) = Qu (Hab ) − C = Qu (Hab ) ⊕ C, (11) where C is a set of M Bose-Chaudhuri-Hocquenghem (BCH)-codes [23] of (N ′ , k, 2t+1) family with N ′ denoting the number of rows of Qu (Hab ). We use the (BCH) family of codes as it can correct multiple errors simultaneously. Note that ⊕ in (11) is used because the subtraction and the addition in binary fields are the same. Bob then recovers C using the recovery process C ′ ← Rec(Qu (Hba ), SS(Qu (Hab ))). From C ′ , Bob decodes C and retrieves Qu (Hab ) from SS(Qu (Hab )). We note that hashed value of Qu (Hab ) is also broadcasted with SS(Qu (Hab )) such that Bob can confirm whether the correct sequence was recovered. We highlight that this method can guarantee almost zero mismatch, and it is resource and time efficient. After the information reconciliation, both Alice and Bob obtain the same sequence K, i.e., K = Qu (Hab ) . C. Privacy Amplification We note that attacker can exploit the short-term correlation between adjacent quantized bits in case of high channel sampling or RF switching rate. Messages exchanged during reconciliation can also lead to the information leakage. To address this problem, the privacy amplification is needed to generate a high-entropy key from a longer low-entropy secret bit stream. In this work, we utilizes leftover hash lemma function to realize the process of privacy amplification. IV. P ROPOSED PHY-DSSS In this section, we present the proposed self-controlled jamming resilient scheme, which is the physical layer secret key-assisted DSSS (PHY-DSSS). The proposed PHY-DSSS utilizes secret keys generated from the physical layer and DSSS as core elements to enhance the jamming resilience of the adopted system. The block diagram of the proposed scheme is provided in Fig. 4. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 13 Fig. 4. Block diagram of the proposed physical layer secret key-assisted DSSS (PHY-DSSS). In the proposed scheme, Alice and Bob first perform channel probing alternatively and then extract shared secret bits using shared randomness extraction (SRE), which is described in Section III. Instead of using the shared secret bit sequence K directly for spreading symbols, we use K to initiate random seeds generation (RSG), which are then used to perform spreading sequence generation (SSG). This is because RSG can further remove the spatial-temporal correlation between secret bits generated from consecutive channel estimates. In addition, RSG can generate random seeds based on keys from multiple entropy sources. As such, once RSG is initialized, it can continuously generate random seeds, and consequently reduce the waiting time. Furthermore, RSG can protect the generated random sequences from being compromised even if the adversary knows the algorithm of RSG [24]. We highlight that our proposed scheme not only strengthens conventional DSSS, but also relaxes the need for pre-shared sequences, thereby making it more suitable for massive connected network (e.g., IoT). In DSSS, data signal is spread in the frequency domain using a chipping sequence (spreading sequence). As such, the narrow band jamming noise becomes less effective since its power is distributed over the whole band. We denote the ratio by which interference is suppressed as the processing gain, given by G = Tds /Tcs , where Tds and Tcs are data and chipping sequence period, respectively. In the following subsections, we detail the processes of RSG and SSG of PHY-DSSS, and analyze the jamming resilience performance of PHY-DSSS SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 14 Fig. 5. Entropy pooling. against the broadband jamming attack. A. Random Seed Generation (RSG) Our RSG is inspired by the random number generator, Fortuna [24], [25]. In particular, we adopt entropy pooling from multiple entropy sources. As such, the internal state of our system is secured. We define input state of RSG as G ← (K, Cp ) , where K and Cp are the random string generated from SRE and a universal counter, respectively. Both are initialized to 0 at first, which means it has not been fed yet. The details of RSG are as follows: • Entropy Pooling: Entropy pooling is designed based on the entropy accumulator in Fortuna using multi-source model. We use OFDM sub-carriers as independent sources of entropy. Each channel estimate matrix is independent from the others and varies with time, location, and frequency [13]. The idea is to increases robustness of the design such that even if any particular spatial location or time slot (due to periodic or random nature of secret bit SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 15 manipulation by attacker as performed in [26]) is compromised, RSG will remain secure until all of observations are compromised. As shown in Fig. 5, channel estimates across different sub-carriers are uniformly distributed over pools, P0 , P1 , · · · , PU , due to the fact that channel estimates are time variant and location independent. Since secret bits keeps refreshing, secrets need to be compressed using SHA-256 hash function to maintain constant pool size of 32 bytes in each pool. When pool P0 has accumulated enough randomness, the pool can feed next module, i.e generator can be reseeded. • Generator: The generator, Gen, takes a random fixed size string, h, from the entropy pool as the input and produces arbitrarily long pseudo-random sequences by using AES-256 as the block cipher [24]. As can be seen in Algorithm 1, a counter, Cp , keeps track of number of times the generator has been reseeded from the pools and is used to determine which pool is used to reseed. As is evident from line 6-8, pool Pi will be included in the reseed if 2i divides Cp . This insures that pool P0 is used in every reseed, P1 in every second reseed, etc. This means higher numbered pools contribute less frequently but collect a large amount of entropy between reseeding. Reseeding is performed by hashing the specified entropy pools together, using two iterations of SHA − 256, henceforth denoted SHAd − 256. Once a pool has been reseeded, it is then reset to zero. Provided there is at least one source of entropy, OFDM sub-carrier, over which an attacker has no control, it will be unable to predict the contents of at least one pool, and therefore will be unable to break the RSG in this way. The generator operates block cipher on input, R, in counter encryption mode. In this implementation, AES − 256 is chosen as the block cipher [24]. The plain-text input to the block cipher is simply a counter, j, and the 256-bit keys come from the compressed entropy across multiple pools. Since AES is a 128-bit block cipher, it generates 16 bytes of data, random seed Rs using Rs ← Rs ||E(R, |). Based on Algorithm 1, we find that, along with generating Rs , two more seeds, Rp and R, SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 16 Algorithm 1: Random Seed Generation Input: G ← (K, Cp) : Generator state, sl : Seed length Output: Rs , Rp : Random seed and Poly-select num 1 2 function RSG if Update=true then 3 Rs ← ∅ 4 h←∅ 5 for i ∈ 0, ..., U do 6 if 2i |Cp then 7 h ← h||SHAd − 256(Pi ) 8 Pi ← ∅ 9 R ← SHAd−256 (R||h) 10 11 12 Cp = Cp + 1 sl ) do for j ∈ 1 : round( 128 Rs ← Gen(R, j) 13 Rp ← Gen(G, 1) 14 R ← Gen(G, 2) are generated as well. We note that R will be used as the supplementary input for RSG the next time it is required to generate seed. As such, the adversary is not able to estimate the future and past generated seeds even if it has the knowledge of current seed. B. Spreading Sequence Generation (SSG) We note that Rs and Rp are used as the input for SSG. Specifically, Rp is a 128-bit random binary string, which is used for choosing polynomial from a primitive polynomial bank. The polynomial bank basically consists of lookup table corresponding to possible totatives, [27], SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 17 and combinations of LFSRs. We note that totatives helps define tap location of LFSRs based spreading code generators and randomness in its selection increases complexity of the system, [28]. Then using the selected polynomial and Rs , LFSR engines generates 2sl − 1 bits for each (Rs , Rp ) at rate fs × rs chips per second, where fs denotes the spreading factor and rs denotes the symbol rate at the source. C. Jamming Resilience Performance Analysis In this subsection, we analyze the performance of the proposed scheme against the broadband jamming attack. Specifically, we consider the rate-aware code selection (RACS) attack by assuming attacker knows the secret key generation rate, kr . As such, attacker can generate all the possible codes for the RSG. For example, if attacker knows that Alice and Bob agree on the secret key of 5 bits and use this secret key for the RSG, it can then generate all 31 possible codes. Since attacker does not know the exact code that Alice uses, the best strategy for attacker would be to uniformly allocate its transit power among possible codes and transmit the summation of these codes. As such, the received signal at Bob under RACS attack can be re-expressed as r S q X Pe d−α −α eb heb xe Cab,i + nb , (12) yb = Pa dab hab xCab + S i=1 where S = 2kr − 1 denotes the number of all possible codes and Cab,i denotes a possible code that attacker generates. Based on (12), we re-express the SINR at Bob under RACS attack as γb = where ϕ = PS i=1 γab |hab |2 γeb |heb |2 ϕ + S 1 L , (13) ϕi , and ϕi denotes the correlation between Cab,i and Cab . We note that ϕi = 1 if Cab,i = Cab . In order to evaluate the performance of our proposed scheme under RACS attack, we adopt the successful transmission probability as the performance metric, which is defined as the probability that the received SINR at Bob is larger than a certain threshold. Mathematically, it is given by Ps (kr , γth ) = Pr (γb > γth ) . (14) SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 18 According to (14), we now examine the successful transmission probability of our proposed scheme in the following theorem. Theorem 1. The successful transmission probability of our system under RACS attack is expressed as Ps (kr , γth ) =   γth exp − γab L γth γeb ϕ Sγab +1 . (15) Proof. Based on (13), we derive the successful transmission probability as Ps (kr , γth )   γab |hab |2 = Pr γeb > γth |heb |2 ϕ + L1 S    γth γeb 1 2 2 = Pr |hab | < |heb | ϕ + γab S L    Z ∞ 1 γth γeb (a) exp (−x) dx xϕ + = exp − γab S L 0   exp − γγabthL = γth γeb ϕ , +1 Sγab (16) where (a) holds due to the fact that hab ∼ exp (1) and heb ∼ exp (1). The proof is completed. We find that Theorem 1 provides us an efficient tool for evaluating the successful transmission probability of our proposed scheme under RACS attack. The correctness of our analysis in Theorem 1 will be validated by both simulation and experimental results in Section V. We also kr find that in (15) the value of ϕ can be approximated by 1+ 2 3L−2 using nultiple access interference (MAI) [29] and [30]. As such, we obtain an approximation of the successful transmission probability, given by   γth Sγab exp − γab L   P̃s (kr , γth ) = . kr γth γeb 1 + 2 3L−2 + Sγab (17) D. Resilience Against Replay Attack Apart from the RACs attack, we note that our proposed protocol is also applicable for denying the effect of another dominant jamming attack on DSSS systems, i.e., the replay attack. In order SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 19 to perform the replay attack, attacker first captures signals transmitted by Alice and then retransmits the captured signals after multiplying them with random symbols. In terms of when the retransmission happens, there can be two attacking strategies for attacker: a) attacking in the same symbol period of Alice transmitting, b) attacking the consecutive symbols. We note that the former attacking strategy is difficult to conduct for attacker, due to the fact that it requires attacker to be located within an ellipse, with focal points at Alice and Bob and the major diameter dab + cTcs , where c denotes the speed of light. However, this requirement is unlikely to be met given the practical limitations such as the processing speed and the precise location awareness [9]. The latter attack, on the other hand, does not have such stringent requirements on the processing speed and the location awareness of attacker, and therefore is easier to conduct. Our proposed PHY-DSSS avoids such replay attacks by refreshing codes using RSG and SSG. As such, the cross-correlation between the transmitted signals from Alice and the transmitted signals from attacker is very low. V. S IMULATION AND E XPERIMENT R ESULTS The proposed randomness extraction and jamming resilient scheme are verified in this section. Specifically, we present simulation results as well as experimental results to validate the performance of our proposed scheme. Since our experimental results are obtained from the testbed in an ideal office environment, we highlight that our proposed scheme is suitable for real-world environments. A. Simulation Configuration We use Monte Carlo simulations to show how our proposed scheme can improve the jamming resilience of the considered system. The configurations for Monte Carlo simulations are as follows: √ √ 1) Alice, Bob, and attacker are located at (0, 0), (0, 20) and (10 2, 10 2) respectively.The transmit power at Alice, Bob, and attacker is 45 dBm. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 20 2) We use OFDM subcarriers to generate secret keys. Following the IEEE 802.11 protocol [31], every 64 subcarriers corresponding to a common pilot OFDM symbol are collected and quantized by using the fuzzy extraction detailed in III-B. In addition, we check the correlation between secret keys from adjacent subcarriers. If it exceeds 0.25, we drop one of the secret keys such that the randomness of generated secret keys are guaranteed. 3) For entropy pooling, we use 12 entropy pools. We assume that each time only the channel estimates generated from one subcarrier is fed to entropy pools, thus mimicking the worst-case scenario where other channel estimates are all compromised due to adversarial interference. B. Experiment Configurations We also use a SDR-based testbed to examine the performance of our proposed scheme in realistic environments. We note that our experiments are conducted in the indoor environment. In order to avoid possible interference from existing WiFi links, we adopt the frequency as 2.484 GHz. 1) Hardware: We conduct the experiments in our laboratory with the size of 15 m × 20 m. As shown in Fig. 6, we use Universal Software Radio Peripheral (USRP) 2952 series of National Instruments [32]. It has 2 full-duplex transmit and receive channels with 40 MHz/channel of realtime bandwidth and a large DSP-oriented Kintex 7 FPGA. The analog RF front end interfaces with the large Kintex 7 410T FPGA through dual ADCs and DACs clocked at 120MS/s. Each RF channel includes a switch, allowing for TDD operation on a single antenna using the TX1/RX1 port. In order to realize strict adversary assumptions, all three USPRs, representing Alice, Bob, and attacker, are interfaced to one PXIe-8135 controller through high speed (800 MB/s) PCI Express x4 cables and PXIe-8384 MXI-Express modules. In addition, we use PXIe-66747T synchronization module to insure transceivers and attacker are tightly synchronized. All modules are stacked in a dedicated chassis, PXIe-1085, as shown in Fig. 7. We note that, using the 10 SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 21 Fig. 6. Lab setup and equipments. Fig. 7. Synchronized USRP. MHz reference signal and the pulse-per-second singal provided by PXIe-66747T, CDA-2990 clock distribution device can simultaneously drive three USRPs. 2) Software and Design: We program the USRPs using Labview Communication Design Suite (LCDS) [32], which facilitates splitting of the signal processing code blocks between host processor and FPGA. As such, we make sure most intensive and latency sensitive calculations are conducted on FPGA, while the processor only handles control signal and data fetching. We implement OFDM symbol based channel estimation FPGA based on LCDS LTE framework [33]. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 22 To guarantee the channel reciprocity, Alice and Bob are required to estimate channels within the coherence time, i.e., 25-30 ms for indoor environments at around 2.484 GHz. Hence, Alice and Bob switch between the transmission mode and the receiving mode fast enough so that they can probe channels within a slotted time. In addition, we consider the scenario where attacker is also capable of fast switching between the transmission mode and the receiving mode in order to inject jamming signals. We use automatic transmit/receive (ATRs) on SDR daughter board to achieve the fast switching between the transmission mode and the the receiving mode. The channel probing is operated in 20 MHz bandwidth mode, which consists of 2048 frequency-domain subcarriers per OFDM symbol. We organize 1200 usable subcarriers in sets of 12 contiguous subcarriers [32] and take measurements across each one of them in each TDD slot. The entropy pooling and random seed generation are handled by the host controller. Specifically, it first uses seeds to generate spreading sequences, and then sends generated sequences to Alice and Bob for spreading and despreading messages, respectively. Meanwhile, attacker sends broadband jamming signal to interfere with the legitimate transmission. C. Results In Fig. 8, we first examine the impact of the number of secret key bits used per transmission, kt , on keys generation time when secret keys from different types of channel measurements, including RSS, CIR, and CFR, are generated. kt is used as input to RSG which further drives SSG to generate new codes every symbol. We note from our experiment that the secret key generation rates of these three types of channel measurements are different. On average, 4, 15 and 16 bits/s can be generated from RSS, CIR and CFR, respectively. We define the key generation time as the time for generating kt secret key bits from each type of channel measurements. As such, we can see that the key generation time increases as kt increases. We also see that RSS requires the longest time to generate kt secret key bits, indicating that RSS can only be employed at system without stringent delay requirements. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 23 4.5 CIR CFR RSSI Key Generation Time [s] 4 3.5 3 2.5 2 1.5 1 0.5 0 1 2 3 4 5 kt 6 7 8 [bits] Fig. 8. Key generation time versus kt for different channel measurements. 1 Analysis Experiment 0.95 Ps ( kr , γ th ) 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 1 2 3 4 kt 5 6 7 8 [bits] Fig. 9. Ps (kr , γth ) versus kt in experimental setup and simulation with γth = 1 under RACS attack. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 24 12 CIR CFR RSSI 10 6 Ts [bits] 8 4 2 0 1 2 3 4 kt 5 6 7 8 [bits] Fig. 10. Ts versus kt for different channel measurements. In Fig. 9, we plot the successful transmission probability versus the number of secret key bits used per transmission, kt , for γth = 1. In this figure, we assume that Alice only uses the secret key bits generated from the current block to perform our proposed PHY-DSSS, and drops those secret key bits when the next block comes. The analytical curves and experimental results are marked by black solid lines and red dotted lines, respectively. We first see that our analytical curve, generated from Theorem 1 with L = 1024, predicts the experimental results, which shows the correctness of our analysis on the successful transmission probability. It also shows that our proposed scheme can improve jamming resilience of systems in real-world environments. In addition, we see that the successful transmission probability first monotonically increases in the regime where kt in relatively small, i.e., kt ≤ 5 bits, and then saturates when kt becomes large. For example, when L = 1024, the successful transmission probability saturates when kt = 7 bits. This indicates that, even with limited number of secret key bits, the jamming resilience of the system can be supported by using our proposed scheme. To further understand how well our proposed scheme can improve the jamming resilience SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 25 of the considered system, we adopt another performance metric, the successful transmission throughput, which is defined as Ts = kr Ps (kt , γth ) . kt (18) Recall that kr denotes the secret key generation rate, we note that the successful transmission throughput quantifies how many transmission can be successful achieved with a given number of secret key bits. In Fig. 10, we plot Ts versus kt for different lengths of Cab and different types of channel measurements. We first see that Ts decreases as kt increases. We then see that Ts increases as L increases. Moreover, we see that RSS achieves the lowest Ts in three types of channel measurements. VI. C ONCLUSIONS We proposed a jamming resilient transmission scheme for three-node communication systems, where Alice transmits to Bob in the presence of an attacker. In our proposed scheme, random secret keys were first generated from wireless fading channels. Utilizing generated secret keys to drive cross-layer security design, we show how the jamming resilience of the considered system can be boosted with the aid of DSSS. Using the successful transmission probability as the performance metric, we analytically and experimentally confirm that our proposed scheme can achieve successful transmission in real-world environments even when attacker has the knowledge of the secret key generation rate. ACKNOWLEDGMENT The authors would like to thank Dr. Richard Hsu, Dr. Nils Ole Tippenhauer, Ravi Kumar and Dr. Leonid Reyzin for valuable insights during discussions. We are also very thankful to Archit Goyal for sharing java-version codes of Fuzzy extractor. R EFERENCES [1] C. Pöpper, N. O. Tippenhauer, B. Danev, and S. Capkun, “Investigation of signal and message manipulations on the wireless channel,” in Proc. Computer Security–ESORICS, Sep. 2011, pp. 40–59. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 26 [2] S. Adepu, J. Prakash, and A. Mathur, “Waterjam: An experimental case study of jamming attacks on a water treatment system,” in Proc. IEEE QRS-C, Jul. 2017, pp. 341–347. [3] S. Amuru and R. M. Buehrer, “Optimal jamming against digital modulation,” IEEE Trans. Inf. Forensics Security, vol. 10, no. 10, pp. 2212–2224, Oct. 2015. [4] D. Nguyen, C. Sahin, B. Shishkin, N. Kandasamy, and K. R. Dandekar, “A real-time and protocol-aware reactive jamming framework built on software-defined radios,” in Proc. ACM SIRF, Aug. 2014, pp. 15–22. [5] L. C. Baird, W. L. Bahn, M. D. Collins, M. C. Carlisle, and S. C. Butler, “Keyless jam resistance,” in Proc. IEEE SMC, Jun. 2007, pp. 143–150. [6] M. Strasser, C. Pöpper, S. Capkun, and M. Cagalj, “Jamming-resistant key establishment using uncoordinated frequency hopping,” in Proc. IEEE Symp. Security Privacy, May 2008, pp. 64–78. [7] J. S. Sousa and J. P. Vilela, “A characterization of uncoordinated frequency hopping for wireless secrecy,” in Proc. IFIP WMNC, May 2014, pp. 1–4. [8] M. Strasser, C. Popper, and S. Capkun, “Efficient uncoordinated FHSS anti- jamming communication,” in Proc. ACM MobiHoc, May 2009, pp. 207–218. [9] C. Popper, M. Strasser, and S. Capkun, “Jamming- resistant broadcast communication without shared keys,” in Proc. USENIX Security Symposium, Aug. 2009, pp. 231–248. [10] Y. Liu, P. Ning, H. Dai, and A. Liu, “Randomized differential DSSS: Jamming-resistant wireless broadcast communication,” in Proc. IEEE INFOCOM, Mar. 2010, pp. 1–9. [11] T. Song, K. Zhou, and T. Li, “CDMA system design and capacity analysis under disguised jamming,” IEEE Trans. Inf. Forensics Security, vol. 11, no. 11, pp. 2487–2498, 2016. [12] S. N. Premnath, S. Jana, J. Croft, P. L. Gowda, M. Clark, S. K. Kasera, N. Patwari, and S. V. Krishnamurthy, “Secret key extraction from wireless signal strength in real environments,” IEEE Trans. Mobile Comput., vol. 12, no. 5, pp. 917–930, May 2013. [13] N. Patwari, J. Croft, S. Jana, and S. K. Kasera, “High-rate uncorrelated bit extraction for shared secret key generation from channel measurements,” IEEE Trans. Mobile Comput., vol. 9, no. 1, pp. 17–30, Jan. 2010. [14] A. J. Majid, H. Moradi, and B. Farhang-Boroujeny, “Fault tolerant key generation and secure spread spectrum communication,” IEEE Trans. Wireless Commun., vol. 16, no. 8, pp. 5467–5480, Aug. 2017. [15] C.-Y. Liu, Y. W. P. Hong, P.-H. Lin, and E. A. Jorswieck, “Jamming-resistant frequency hopping system with secret key generation from channel observations,” in Proc. IEEE ITW, Sep. 2016, pp. 46–50. [16] A. Goldsmith, Wireless Communications. Cambridge, U.K, Cambridge Univ. Press, 2005. [17] A. J. Viterbi, CDMA: Principles of Spread Spectrum Communication. Addison-Wesley Reading, MA, 1995, vol. 122. [18] Q. Wang, H. Su, K. Ren, and K. Kim, “Fast and scalable secret key generation exploiting channel phase randomness in wireless networks,” in Proc. IEEE INFOCOM, Apr. 2011, pp. 1422–1430. [19] J. Zhang, A. Marshall, R. Woods, and T. Q. Duong, “Secure key generation from ofdm subcarriers’ channel responses,” in Proc. IEEE Globecom Workshops, Dec. 2014, pp. 1302–1307. SUBMITTED TO IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 27 [20] ——, “Efficient key generation by exploiting randomness from channel responses of individual ofdm subcarriers,” IEEE Trans. Commun, vol. 64, no. 6, pp. 2578–2588, Jun. 2016. [21] B. Azimi-Sadjadi, A. Kiayias, A. Mercado, and B. Yener, “Robust key generation from signal envelopes in wireless networks,” in Proc. ACM CCS, Oct. 2007, pp. 401–410. [22] Y. Dodis, R. Ostrovsky, L. Reyzin, and A. Smith, “Fuzzy extractors: How to generate strong keys from biometrics and other noisy data,” SIAM J. Comput., vol. 38, no. 1, pp. 97–139, May 2008. [23] G. Balakrishnan, M. Yang, Y. Jiang, and Y. Kim, “Performance analysis of error control codes for wireless sensor networks,” in Proc. ITNG, Apr. 2007, pp. 876–879. [24] N. Ferguson and B. Schneier, Practical Cryptography, 1st ed. New York, NY, USA: John Wiley & Sons, Inc., 2003. [25] Y. Dodis, A. Shamir, N. Stephens-Davidowitz, and D. Wichs, How to Eat Your Entropy and Have It Too – Optimal Recovery Strategies for Compromised RNGs. Springer Berlin Heidelberg, 2014, pp. 37–54. [26] S. Eberz, M. Strohmeier, M. Wilhelm, and I. Martinovic, “A practical man-in-the-middle attack on signal-based key generation protocols,” in Proc. Computer Security–ESORICS, Sep. 2012, pp. 235–252. [27] P. Loomis, M. Plytage, and J. Polhill, “Summing up the euler ϕ function,” The College Mathematics J., vol. 39, no. 1, pp. 34–42, Jan. 2008. [28] O. Acevedo and D. Kagaris, “Using the berlekamp-massey algorithm to obtain lfsr characteristic polynomials for tpg,” in Proc. IEEE DFT, Oct. 2012, pp. 233–238. [29] D. V. Sarwate and M. B. Pursley, “Crosscorrelation properties of pseudorandom and related sequences,” Proc. IEEE, vol. 68, no. 5, pp. 593–619, May 1980. [30] M. Pursley, “Performance evaluation for phase-coded spread-spectrum multiple-access communication - part i: System analysis,” IEEE Trans. Commun., vol. 25, no. 8, pp. 795–799, Aug. 1977. [31] D. Halperin, W. Hu, A. Sheth, and D. Wetherall, “Predictable 802.11 packet delivery from wireless channel measurements,” in Proc. ACM SIGCOMM, vol. 40, no. 4, Aug. 2010, pp. 159–170. [32] “Hands-on rapid prototyping real-time wireless systems with labview communications,” National Instruments manual, http://www.ni.com/white-paper/52147/en/, 2016. [33] “Labview communications lte application framework 2.0 and 2.0.1,” http://www.ni.com/white-paper/53286/en/.
7cs.IT
Testing bounded arboricity arXiv:1707.04864v1 [cs.DS] 16 Jul 2017 Talya Eden ∗ Reut Levi † Dana Ron ‡ Abstract In this paper we consider the problem of testing whether a graph has bounded arboricity. The family of graphs with bounded arboricity includes, among others, bounded-degree graphs, all minor-closed graph classes (e.g. planar graphs, graphs with bounded treewidth) and randomly generated preferential attachment graphs. Graphs with bounded arboricity have been studied extensively in the past, in particular since for many problems they allow for much more efficient algorithms and/or better approximation ratios. We present a tolerant tester in the sparse-graphs model. The sparse-graphs model allows access to degree queries and neighbor queries, and the distance is defined with respect to the actual number of edges. More specifically, our algorithm distinguishes between graphs that are ǫ-close to having arboricity α and graphs that c · ǫ-far from having arboricity 3α, where c is an absolute small constant. The query complexity and running time of the algorithm are1   O(log(1/ǫ)) 1 where n denotes the number of vertices and m denotes Õ √nm · log(1/ǫ) + n·α ǫ m · ǫ the number of edges. In terms of √ the dependence on n and m this bound√ is optimal up to poly-logarithmic factors since Ω(n/ m) queries are necessary (and α = O( m)). We leave it as an open question whether the dependence on 1/ǫ can be improved from quasi-polynomial to polynomial. Our techniques include an efficient local simulation for approximating the outcome of a global (almost) forest-decomposition algorithm as well as a tailored procedure of edge sampling. ∗ School of Computer Science, Tel Aviv University, [email protected]. This research was partially supported by a grant from the Blavatnik fund. The author is grateful to the Azrieli Foundation for the award of an Azrieli Fellowship. † MPI for Informatics, Saarbrücken 66123, Germany, [email protected] ‡ School of Electrical Engineering, Tel Aviv University, [email protected]. This research was partially supported by the Israel Science Foundation grant No. 671/13 and by a grant from the Blavatnik fund. 1 We use the notation Õ to hide poly-logarithmic factors in n. 1 Introduction The arboricity of a graph is defined as the minimum number of forests into which its edges can be partitioned. This measure is equivalent (up to a factor of 2) to the maximum average degree in any subgraph [20, 25, 21] and to the degeneracy of the graph2 . Hence, the arboricity of a graph can be viewed as a measure of its density “everywhere”. The family of graphs with bounded arboricity includes many important families of graphs, e.g., all minor-closed graph classes such as planar graphs, graphs of bounded treewidth and graphs of bounded genus. However, graphs with bounded arboricity do not necessarily exclude a fixed minor, in fact, graphs over n vertices of arboricity 2 may have a K√n -minor. In the context of social networks, it includes graphs that are generated according to evolving graph models such as the Barabási-Albert Preferential Attachment model [3]. For various graph optimization problems, it is known that better approximation ratios and faster algorithms exist for graphs with bounded arboricity3 (e.g., [7, 15, 12, 2] and [4, 18] in the distributed setting), and several NP-hard problems such as Clique, Independent-Set and Dominating-Set become fixed-parameter tractable[1, 11]. In this work we address the problem of testing whether a graph has bounded arboricity. That is, we are interested in an algorithm that with high constant probability accepts graphs that have arboricity bounded by a given α, and rejects graphs that are relatively far from having slightly larger arboricity (in the sense that relatively many edges should be removed so that the graph will have such arboricity). In fact, as explained precisely next, we solve a tolerant [24] version of this problem in which we accept graphs that are only close to having arboricity α. Furthermore, our result is in what is known as the sparse-graphs model [23], where there is no upper bound on the maximum degree in the graph, and distance to having a property is measured with respect to the number of edges in the graph. As we discuss in more detail in Subsection 1.4, almost all previous results on testing related bounded graph measures assumed the graph had a bounded degree. 1.1 Our result Let G = (V, E) be a graph with n vertices and m edges. We assume that for any given vertex v ∈ V , it is possible to query for its degree, d(v), as well as query for its ith neighbor for any 1 ≤ i ≤ d(v).4 We say that G is ǫ-close to having arboricity α if at most ǫ · m edges should be removed from G so that the resulting graph will have arboricity at most α. Otherwise, G is ǫ-far from having arboricity α. We present an algorithm that, given query access to G together with parameters n, α and ǫ distinguishes with high constant probability between the case that G is ǫ-close to having arboricity at most α, and the case in which G is c · ǫ-far from having arboricity 3α for an absolute constant5 c. The query complexity and running time of the algorithm are  O(log(1/ǫ)) ! 1 log(1/ǫ) n · α n + · Õ √ · m ǫ m ǫ in expectation. 2 A k-degenerate graph is an undirected graph in which every subgraph has a vertex of degree at most k. The arboricity of G is upper bounded by its degeneracy and the degeneracy is less than twice the arboricity. 3 Some of these algorithms are fixed-parameter tractable for degenerate graphs. 4 We note that the ordering of the neighbors of vertices is arbitrary and that a neighbor query to vertex v with i > d(v) is answered by a special symbol. Observe that a degree query to v can be replaced by O(log d(v)) neighbor queries. 5 The constant we achieve is 20. For the sake of simplicity and clarity of the algorithm and its analysis, we did not make an effort to minimize this constant. 1 1.2 Discussion of the result The tightness of the complexity bound. Since the arboricity of every graph with m edges √ √ is O( m), we have that nα/m = O(n/ m). Therefore, if we consider the complexity of the √ algorithm as a function of n and m (ignoring the dependence on ǫ), we get that it is O(n/ m) √ (up to polylog(n) factors). We observe that this complexity is tight. To be precise, Ω(n/ m) queries are necessary for any algorithm that is not provided with any information regarding m, or even when it is provided with a constant factor estimate of m (e.g., a factor-2 estimate). If the algorithm is provided with m (or a very precise estimate, i.e., within (1 ± ǫ/c) for c > 1), then the lower bound does not hold. However, in such a case Ω(nα/m) queries are necessary (and we also show that they are sufficient). Bounded-degree graphs. Suppose first that we are given an upper bound d on the maximum √ degree in G, and let d = 2m/n denote the average degree. Then we can replace the term Õ(n/ m) in the complexity of the algorithm by d/d. Note that we may assume that d ≥ α/2 (or else the graph necessarily has arboricity at most α), so that the term nα/m is upper bounded by O(d/d). The above statement was for the case that distance to having the property is measured (as defined in the sparse-graphs model), with respect to m (and we only assume that the algorithm is provided with additional information regarding the maximum degree in the graph). If we consider the bounded-degree model [13], in which not only do we get d as input, but in addition distance is measured with respect to d · n (which is an upper bound on m), then our algorithm can be slightly modified so that its complexity depends only on 1/ǫ (and the dependence is quasi-polynomial). Expected complexity. The reason that the query complexity and running time are in expectation is due to our need to obtain an estimate for the number of edges. If such a (constant factor) estimate is provided to the algorithm, then the bound on the complexity of the algorithm is with probability 1. α vs. 3α. Our algorithm distinguishes between the case that the graph is close to having arboricity at most α and the case that it is far from having arboricity at most 3α. The constant 3 can be reduced to 2 + η at a cost that depends (exponentially) on 1/η, but we do not know how to avoid this cost and possibly go below a factor of 2. However, in some cases this constant may not be significant. For example, suppose we want to know whether, after removing a small fraction of the edges, we can obtain a graph G′ with bounded arboricity so that we can run an optimization algorithm on G′ (or possible on G itself), whose complexity depends polynomially on the arboricity of G′ . In such a case, the difference between α and 3α is inconsequential. Two-sided error vs. one-sided error. Our algorithm has two-sided error, and we observe that every one-sided error algorithm must perform Ω(n) queries. Dependence on ǫ. In the second term of the complexity of our algorithm there is a quasipolynomial dependence on 1/ǫ. It is an open problem whether this dependence can be reduced to polynomial. 1.3 Techniques Our starting point is a simple (non-sublinear and deterministic) algorithm that is similar to the distributed forest decomposition algorithm of Barenboim and Elkin [4]. This algorithm works in ℓ = O(log(1/ǫ)) iterations, where in each iteration it assigns edges to a subset of the vertices, and the vertices that are assigned edges become “inactive”. We show that if the graph has arboricity at most α, then, when the algorithm terminates, the number of edges between remaining active 2 vertices, whose set we denote here by Aℓ , is relatively small. On the other hand, if the graph is sufficiently far from having arboricity at most 3α, then the number of edges between vertices in Aℓ is relatively large. Given this statement regarding the number of remaining edges between vertices in Aℓ , our algorithm estimates the number of such remaining edges. To this end we devise a procedure for deciding whether a given vertex v belongs to Aℓ . This can be done by emulating the deterministic algorithm on the distance-ℓ neighborhood of v. However, such an emulation may require a very large number of queries (as the maximum degree in the graph is not necessarily bounded). Instead, we perform a certain approximate randomized emulation of the deterministic algorithm, which is much more query efficient. While this emulation does not exactly answer whether or not v ∈ Aℓ , it gives an approximate answer that suffices for our purposes (see Lemma 4 for the precise statement). Armed with this approximate decision procedure for membership in Aℓ , we sample edges and apply the procedure on their endpoints. To be precise, for the sake of efficiency, we start by estimating the number of edges with two high-degree endpoints (i.e., with degree above α/ǫ), referred to as high edges. We exploit the fact that if the graph is close to having arboricity α, then the number of high edges is small. Hence, we first verify that indeed there are relatively few high edges by using the algorithm of Eden and Rosenbaum [10] for sampling edges almost uniformly, and querying for the degree of the endpoints of each returned edge. It remains to estimate the number of edges between vertices in Aℓ for which at least one endpoint has low degree. To this end we employ a more efficient edge-sampling procedure whose complexity depends on α, and run the approximate procedure for membership in Aℓ on the endpoints of each returned edge. 1.4 Related Work Most of the related property testing results are in the bounded-degree model [13]. Recall that in this model the algorithm has the same query access to the graph as we consider, but it is also given an upper bound, d, on the maximum degree in the graph, and distance is measured with respect to d · n (rather than the actual number of edges, m), so that it is less stringent. As noted in Subsection 1.2, an adaptation of our algorithm to the (“easier”) bounded-degree model achieves complexity that is quasi-polynomial in 1/ǫ (and independent of n). In the bounded-degree model there are several results on testing whether a graph excludes specific fixed minors as well as results on testing minor-closed properties in general. In what follows we assume that d is a constant, since in some of these works this assumption is made (so that no explicit dependence on d is stated). Goldreich and Ron [13] provide an algorithm for testing if a graph is cycle-free, namely, excludes C3 -minors, where the complexity of the algorithm is O(1/ǫ3 ). Yoshida and Ito [26] test outerplanarity (excluding K4 -minors and K2,3 -minors) and if a graph is a cactus (excluding a diamond-minor) in time that is polynomial in 1/ǫ. Benjamini, Schramm, and Shapira [5] showed that any minor-closed property can be tested in time that depends only on 1/ǫ (where the dependence may be triply-exponential). Hassidim et al. [16] introduced a general tool, a partition oracle, for locally partitioning graphs that belong to certain families of graphs, into small parts with relatively few edges between the parts. A partition oracle for a family of graphs implies a corresponding (two-sided error) tester for membership in this family. Hassidim et al. [16] designed partition oracles for hyperfinite classes of graphs and minor-closed classes of graphs. One of the implications of their work is improving the running time of testing minor-closed properties from triply-exponential in poly(1/ǫ) to singly exponential in poly(1/ǫ). Levi and Ron later improved the running time of the partition oracle for minor-closed classes of graphs to quasi-polynomial in 1/ǫ [19]. Edelman et al. designed a partition oracle for graphs with bounded treewidth [9] whose query and time complexity are polynomial in 1/ǫ. Newman and Sohler [22] extended the result 3 of [16] and showed that every hyperfinite property (i.e., property of hyperfinite graphs) is testable in time that is independent of the size of the graph. All the aforementioned testing algorithms have two-sided error (and this is also true of our algorithm). Czumaj et al. [8] study the problem of one-sided error testing of Ck -minor freeness and tree-minor freeness. For cycle-freeness (C3 -minor freeness) they give a one-sided error testing √ algorithm whose complexity is Õ( n · poly(1/ǫ)) (for k > 3 there is an exponential dependence on √ k). They show that the dependence on n is tight for any minor that contains a cycle. On the other hand, for tree-minors they give an algorithm whose complexity is exp((1/ǫ)O(k) ), where k is the size of the tree (so that the complexity is independent of n). Finally we discuss related results in the sparse-graphs model studied in this paper. Czumaj et al. [8] show that their result for cycle-freeness extends to the sparse-graphs model, where the √ complexity of the algorithm is Õ( n · poly(1/ǫ)). Iwama and Yoshida consider an augmented model that allows random edge sampling. In this augmented model they provide several testers for parameterized properties including k-path freeness whose complexity is independent in the size of the graph. 1.5 Organization Following some basic preliminaries in Section 2, we give the aforementioned “edge-assignment algorithm” in Section 3. In Section 4 we present our testing algorithm. The lower bounds mentioned in Subsection 1.2 are provided in Section 5 and the variants of our algorithm (e.g., in the bounded-degree model) appear in Section 6. Some missing technical claims and proofs appear in the appendix. 2 Preliminaries For an integer k, let [k] , {1, . . . , k}. For an undirected simple graph G = (V, E) let n = |V | and m = |E|. For each vertex v ∈ V , let d(v) denote its degree. We assume there is query access to the graph in the form of degree queries and neighbor queries. That is, for any vertex v ∈ V , it is possible to perform a query to obtain d(v), and for any v and i ∈ [d(v)], it is possible to perform a query to obtain the ith neighbor of v (where the order over neighbors is arbitrary), or a special symbol if such neighbor does not exist, i.e., when d(v) < i. Definition 1 (Distance). For a property P of graphs, and a parameter ǫ ∈ [0, 1], we say that a graph G is ǫ-far from (having) the property P, if more than ǫ · m edge modifications on G are required so as to obtain a graph that has the property P. Definition 2 (Arboricity). The arboricity of a graph G = (V, E) is the minimum number of forests into which its edges can be partitioned. We denote the arboricity of G by α(G). By the work of Nash-Williams [20, 21], for every graph G = (V, E),   |E(S)| α(G) ≤ max , S⊆V |S| − 1 (1) where E(S) denotes the set of edges in the subgraph induced by S. We make use of Hoeffding’s inequality [17], stated next. For i = 1, . . . , s, let χi be a 0/1 values random variable, such that Pr[χi = 1] = µ. Then for any γ ∈ (0, 1], " s #  1X Pr χi > µ + γ < exp −2γ 2 s s i=1 4 and # s  1X χi < µ − γ < exp −2γ 2 s , Pr s " i=1 We also apply the following version of the multiplicative Chernoff bound [6]. For i = 1, . . . , s, let χi be a random variables taking values in [0, B], such that Ex[χi ] = µ. Then for any γ ∈ (0, 1], # " m  2  γ µs 1X χi > (1 + γ)µ < exp − Pr s 3B i=1 and 3 " #  2  m 1X γ µs Pr χi < (1 − γ)µ < exp − . s 2B i=1 A Deterministic Edge-Assignment Algorithm In this section we describe a deterministic algorithm that, given a graph G = (V, E), assigns edges to vertices. The algorithm works iteratively, where in each iteration it assigns edges to a new subset of vertices. The algorithm is provided with parameters that determine an upper bound on the number of edges that are assigned to each vertex (where an edge may be assigned to both of its endpoints). When the algorithm terminates, some edges may remain unassigned (and some vertices may not have been assigned any edges). This algorithm (when viewed as a distributed algorithm) is a variant of the algorithm by Barenboim and Elkin [4] for finding a forest decomposition in graphs with bounded arboricity. The algorithm, which is described next (and named Assign-Edges), is provided with 3 parameters: α, ǫ and γ. It might be useful to first consider its execution with γ = 0. The role of γ will become clear subsequently (when we describe our testing algorithm and its relation to Assign-Edges). In the case of γ = 0, in every iteration, each vertex with degree at most 3α in the current graph is assigned all its incident edges in this graph. The initial graph is G, and at the end of each iteration, the vertices that are assigned edges, together with the edges assigned to them, are removed from the graph. Assign-Edges(G, α, ǫ, γ) 1. G0 (γ) = G, A0 (γ) = V . 2. For i = 1 to ℓ , ⌈log6/5 log(1/ǫ)⌉ do: (a) Let Bi (γ) be the set of vertices v ∈ V whose degree in Gi−1 (γ) is at most 3α + γ · d(v). (b) Assign each vertex v ∈ Bi (γ) the edges incident to it in Gi−1 (γ). (c) Let Ai (γ) = Ai−1 (γ) \ Bi (γ), and let Gi (γ) be the graph induced by Ai (γ). In each iteration i of the algorithm Assign-Edges, the set of vertices that are assigned edges in the iteration, is denoted Bi (γ).6 Once vertices are assigned edges, we view them as becoming inactive. We use the notation Ai (γ) for the vertices that are still active at the end of iteration i. Observe that by the definition of the algorithm, for γ1 ≤ γ2 , we have that Ai (γ2 ) ⊆ Ai (γ1 ) for every iteration i, and hence Gi (γ2 ) is a subgraph of Gi (γ1 ). 6 While Bi (γ) depends also on α, we shall want to refer to these sets when the algorithm is invoked with the same value of α but with different values of γ. Hence, only γ appears explicitly in the notation. 5 In the next lemma we upper bound the number of edges in Gℓ (0) when G is close to having arboricity α, and we lower bound the number of edges in Gℓ (γ) (which is a subgraph of Gℓ (0)), when G is far from having arboricity 3α.7 Lemma 3. If G is ǫ-close to having arboricity at most α, then |E(Gℓ (0))| ≤ 5ǫm. If G is ǫ′ -far from having arboricity 3α, then |E(Gℓ (γ))| > (ǫ′ − 2γ)m. Proof. Let G be a graph that is ǫ-close to having arboricity at most α. Since each of its subgraphs has arboricity at most α, in particular this is true for the subgraphs Gi (0) defined by the algorithm, for i = 1, . . . , ℓ. Denoting by mi the number of edges in Gi (0), we have that mi ≤ α · |Ai (0)| + ǫm. By the definition of Ai (0), each vertex v ∈ Ai (0) has degree greater than 3α in Gi−1 (0). It follows that mi−1 ≥ 3α|Ai (0)|/2. Therefore, if |Ai (0)| > 4ǫm/α, then mi ≤ 5α|Ai (0)|/4, implying i ≤ 5/6. Hence, in every iteration of Assign-Edges in which |Ai (0)| > 4ǫm/α, the that mmi−1 number of edges in the graph decreases by a multiplicative factor of 5/6. On the other hand, if |Ai (0)| ≤ 4ǫm/α, then, since G is ǫ-close to having arboricity at most α, mi ≤ |Ai (0)|·α+ǫm ≤ 5ǫm. Hence, after at most ⌈log6/5 (1/ǫ)⌉ iterations, there are at most 5ǫm edges between active vertices. We now turn to the case that G is ǫ′ -far from having arboricity 3α. Assume, contrary to the claim, that |E(Gℓ (γ)| ≤ (ǫ′ − 2γ)m. We shall show that by removing at most ǫ′ · m edges from G we can obtain a graph that has arboricity at most 3α, thus reaching a contradiction. First we remove all edges in Gℓ (γ), that is, all edges in which both endpoints belong to Aℓ (γ). We are left with edges that are incident to vertices in the set V \ Aℓ (γ). For each vertex v ∈ V \ Aℓ (γ), let a(v) be the number of edges it is assigned, and recall that a(v) ≤ 3α + γd(v). For each such vertex v, we remove max{a(v) − 3α, 0} of the edges it is assigned (these edges can be selected arbitrarily), thus leaving it with at most 3α assigned edges. Similarly to what was shown in [4], the edges that were not removed can be decomposed into at most 3α forests. To verify this observe that we can orient the edges so that we obtain an acyclic orientation as follows. Consider an edge (u, v) such that u ∈ Bi and v ∈ Bi′ . If i 6= i′ , then we orient (u, v) from the vertex that became inactive first to the vertex that became inactive second. That is, if (without loss of generality) i < i′ , then (u, v) is oriented from u to v. If both vertices became inactive at the same iteration, that is i = i′ , then we orient (u, v) from the vertex with the smaller id to the vertex with the larger degree. Since the total number of edges removed is at most X X |E(Gℓ (γ))| + max{a(v) − 3α, 0} ≤ (ǫ′ − 2γ)m + γd(v) = ǫ′ · m , v∈V v∈V we have obtained the desired contradiction. 4 The testing algorithm In this section we describe our algorithm. The algorithm uses three subroutines: A subroutine that locally emulates the outcome of Assign-Edges for a single vertex (Subsection 4.1) and a pair of subroutines that estimate the number of edges that remain in the graph after the execution of Assign-Edges. More precisely, the first subroutine estimates the total number of edges between high-degree vertices (Subsection 4.2) and the other estimates the number of remaining edges that are incident to at least one low-degree vertex (Subsection 4.3). In Subsection 4.4 we put everything together and describe the testing algorithm. In what follows we assume that the distance parameter, ǫ, is at most 1/20 (since otherwise the algorithm can simply accept, as it is required to reject graphs that are 20ǫ-far from having arboricity at most 3α). 7 The term 3α can be improved to (2 + η)α for any η > 0 by increasing the number of iterations by a factor of 1/η. 6 4.1 Deciding whether a vertex is active In this subsection we present a procedure that, roughly speaking, decides whether a given vertex v belongs to the set of active vertices Ai (0) (as defined in the algorithm Assign-Edges from Section 3). This procedure is then used to estimate the number of edges remaining in Gℓ (0) (the subgraph induced by Aℓ (0)). Observe that by the description of the algorithm Assign-Edges, for any vertex v, the decision whether v ∈ Ai (0) can be made by considering the distance-i neighborhood of v. However, the size of this neighborhood may be very large, as the maximum degree in the graph is not bounded. Hence, rather than querying for the entire distance-i neighborhood, we query (in a randomized manner), for only a small part of the neighborhood, as detailed in the procedure IsActive. As stated in Lemma 4, the procedure ensures (with high probability), that its output is correct on v ∈ Aℓ (2γ) ⊆ Aℓ (0) and on v ∈ / Aℓ (0). If v ∈ Aℓ (0) \ Aℓ (2γ), then the procedure may return any output, and as we shall see subsequently, this suffices for our purposes. IsActive(α, γ, δ, v, i) 1. 2. 3. 4. If d(v) ≤ 3α then return No. If i = 1 and d(v) > 3α then return Yes. Sample a random multiset, Sv,i , of t = log(1/δ)/γ 2 neighbors of v. For every u ∈ Sv,i , invoke IsActive(α, γ, δ′ , u, i − 1), where δ′ = δ/(2t) and let η(v, i) be the fraction of vertices in Sv,i that returned Yes. 5. If η(v, i) · d(v) > 3α + γ · d(v), then return Yes, otherwise return No. Lemma 4. For ℓ = ⌈log6/5 (1/ǫ)⌉, the procedure IsActive(α, γ, δ, v, ℓ) returns a value in {Yes, No} such that the following holds. 1. If v ∈ / Aℓ (0), then the procedure returns No with probability at least 1 − δ. 2. If v ∈ Aℓ (2γ), then the procedure returns Yes with probability at least 1 − δ.  ℓ  cℓ log(ℓ/(γδ)) for a The query complexity and running time of IsActive(α, γ, δ, v, ℓ) are O γ2 constant c > 1. Proof. For a vertex v ∈ V , consider the execution of IsActive(α, γ, δ, v, ℓ). For 2 ≤ i ≤ ℓ let δi denote the value of δ for the invocations of IsActive with parameter i, and let ti denote the size of the corresponding sampled multiset selected in Step 3, when IsActive is invoked with i. Note that i decreases as the depth of the recursion increases, and observe that δℓ = δ, δi = δi+1 /2ti+1 , and ti = log(1/δi )/γ 2 . For 1 ≤ i ≤ ℓ, define Si to be the multiset of vertices on which IsActive is invoked with the parameter i. In particular, Sℓ = {v}, and for i < ℓ, the vertices in Si were selected in invocations of IsActive with i + 1. For a vertex u, let ηe(u, i) be the fraction of vertices in Su,i that are in Ai−2 (2γ), and let ηb(u, i) be the fraction of vertices in Su,i that are in Ai−2 (0) (which is a superset of Ai−2 (2γ)). Recall that A0 (0) = A0 (2γ) = V . For 2 ≤ i ≤ ℓ we say that a vertex u ∈ Si is i-successful if one of the following holds: 1. u ∈ Ai−1 (2γ) and ηe(u, i) · d(u) > 3α + γd(u). 2. u ∈ / Ai−1 (0) and ηb(u, i) · d(u) ≤ 3α + γd(u). 7 3. u ∈ Ai−1 (0) \ Ai−1 (2γ). Otherwise, it is i-unsuccessful. For i = 1, every vertex is 1-successful. Consider a recursive call to IsActive(α, γ, δi , u, i) on a vertex u ∈ Ai−1 (2γ) for 2 ≤ i ≤ ℓ. Since u ∈ Ai−1 (2γ), we have that Ex[e η (u, i) · d(u)] > 3α + 2γd(u). By Hoeffding’s inequality, the probability that u is i-unsuccessful is upper bounded by h i Pr ηe(u, i) ≤ Ex[e η (u, i)] − γ < exp(−2γ 2 · ti ) < δi /2 . S Now consider a vertex u ∈ / Ai−1 (0). That is, u ∈ i′ <i Bi′ (0) (where Bi′ (·) is as defined in the algorithm Assign-Edges). In this case we claim that Ex[b η (u, i) · d(u)] ≤ 3α. To verify this claim observe that since u ∈ Bi′ (0) (for some i′ ≤ i − 1), the number of neighbors that u has in Ai′ −1 (0) is at most 3α. The claim follows since Ai−2 (0) ⊆ Ai′ −1 (0) (for i′ ≤ i − 1), and by the definition of ηb(u, i). By Hoeffding’s inequality, the probability that u is i-unsuccessful is upper bounded by h i Pr ηb(u, i) > Ex[b η (u, i)] + γ < exp(−2γ 2 · ti ) < δi /2 . For 2 ≤ i ≤ ℓ we say that a vertex u ∈ Si is recursively i-successful if u is i-successful and all the vertices in Su,i are recursively (i − 1)-successful. Every vertex is recursively 1-successful. By an inductive argument and the union bound, the probability that u is recursively i-successful is at least 1 − δi . We claim that if u ∈ Si is recursively i-successful, then the following holds: if u ∈ Ai−1 (2γ), then IsActive(α, γ, δi , u, i) returns Yes and if u ∈ / Ai−1 (0), then IsActive(α, γ, δi , u, i) returns No. We establish this claim by induction on i. For i = 1 (the leaves of the recursion tree), the claim follows by Steps 1 and 2 of the algorithm. For the induction step, assume the claim holds for i − 1 ≥ 1, and we prove it for i. If u ∈ Ai−1 (2γ), then by definition, ηe(u, i)·d(u) > 3α+ γd(u), and since all the vertices in Su,i are recursively (i− 1)/ Ai−1 (0), then by definition, successful, then by induction, the algorithm returns Yes in Step 5. If u ∈ ηb(u, j) · d(u) ≤ 3α + γd(u), and since all the vertices in Su,i are recursively (i − 1)-successful, by induction the algorithm returns No in Step 5. It remains to bound the complexity of the algorithm. Consider the recursion tree corresponding to the complete execution of IsActive(α, γ, δ, v, ℓ) for any vertex v. Let δi and ti be as defined above. Since the recursion depth j increases as i decreases, it will be convenient to make a change of variables, and define δ̃j , δℓ−j+1 and t̃j , tℓ−j+1 . Hence, δ̃1 = δℓ = δ, and δ̃j = δ̃j−1 /(2t̃j−1 ) = δ̃j−1 γ 2 /(2 log(1/δ̃j−1 )). By applying Claim 15 (that appears in Appendix A) to this recursive  4 j , so that t̃j = O(j log(δγ/j)/γ 2 ). Since the query complexity expression, we get that δ̃j ≥ δ·γ 4j 2 Q  ℓ ℓ and running time of the procedure are O i=2 ti = O((t̃ℓ ) ), the upper bound on the complexity of the procedure follows. 4.2 Estimating the number of edges between high-degree vertices In this subsection we provide a procedure for distinguishing between the case that the number of edges between vertices whose degree is above a certain threshold is relatively small, and the case in which the number of such edges is relatively large. Definition 5. We say that a vertex v is a high-degree vertex if d(v) > 2α/ǫ. We let H denote the set of high-degree vertices in the graph. If both endpoints of an edge are high-degree vertices, then we say that the edge is a high edge. Otherwise, if either endpoint of the edge is low, we say that the edge is a low edge. 8 Claim 6. If G is ǫ-close to having arboricity at most α, then the number of high edges in G is at most 2ǫm. Proof. Let E(H) denote the set of high edges. By the definition of high-degree vertices, |H| < ǫm/α. Since G is ǫ-close to having arboricity at most α, |E(H)| ≤ α|H| + ǫm, implying that |E(H)| ≤ 2ǫm. Our procedure for estimating the number of high edges makes use of the following theorem. Theorem 7 (Eden & Rosenbaum [10], rephrased). Let G = (V, E) be a graph with n vertices and m edges. There exists an algorithm named Sample-edge-almost-uniformly, that is given query access to G and parameters n, ǫ and δ. The algorithm returns an edge eh ∈ E with iprobability at (1+ǫ) least 1 − δ, where each edge in the graph is returned with probability in (1−ǫ) . The query m , m   complexity and running time of the algorithm are Õ √nǫm · poly(log(1/δ)). Estimate-high-edges(n, α, ǫ, δ, m) 1. Set r = 200 ln(2/δ) and δ′ = δ/(2r). ǫ 2. For i = 1 to r do: (a) Invoke Sample-edge-almost-uniformly(n, 0.1, δ′ ) and let (ui , vi ) be the returned edge. If no edge was returned then return Few. (b) Set χP i = 1 if both ui and vi are high-degree vertices, and set χi = 0 otherwise. 3. Set χ = 1r i∈Y χi . 4. If χ > 2.6ǫ, then return Many. Otherwise, return Few. Lemma 8. The procedure Estimate-high-edges returns a value in {Many,Few} and satisfies the following. 1. If the graph G has more than 4ǫm high edges, then the procedure returns Many with probability at least 1 − δ. 2. If the graph G has at most 2ǫm high edges, then the procedure returns Few with probability at least 1 − δ.   · The expected query complexity and running time of the procedure are Õ √nm · log(1/ǫ) ǫ poly(log(1/δ)). Proof. By Theorem 7, the invocation of Sample-edge-almost-uniformly(n, 0.1, δ′ ) returns an edge (ui , vi ) with probability at least 1 − δ′ . Therefore, by the setting of δ′ and by the union bound, with probability at least δ/2 all invocations will return an edge. We henceforth condition on this event. Also by Theorem 7, for  every edge in the graph G, the probability that it will be the returned 1 1 edge is in 0.9 · m , 1.1 · m . Hence, if G has more than 4ǫm high edges, then Ex[χ] ≥ 0.9 · 4ǫ > 3ǫ. By the multiplicative Chernoff bound, and by the setting of r, " r #   1X 0.12 · 3ǫ · r δ Pr χi ≤ 2.6ǫ < exp − < . r 3 2 i It follows that in this case the procedure will return Many with probability at least 1 − δ. 9 We now turn to the case that that G has at most 2ǫm high edges, so that Ex[χ] ≤ 2.2ǫ. By the multiplicative Chernoff bound, and by the setting of r, # " r   0.12 · 2.2ǫ · r δ 1X χi > 2.6ǫ < exp − < . Pr r 2 2 i Therefore, the procedure will return Few with probability at least 1 − δ. It remains to prove the third item of the lemma. By Theorem 7, the expected query complexity and running of Sample-edge-almost-uniformly with parameters 0.1 and   time of each invocation n ′ ′ √ · poly log(1/δ ) . Therefore, by the setting of r and δ′ , the expected query complexity δ are Õ m   and running time are Õ √nm · log(1/ǫ) · poly(log(1/δ)). ǫ 4.3 Estimating the number of remaining low edges Recall that a low edge (as defined in Definition 5) is an edge such that at most one of its endpoints is a high-degree vertex. In this subsection we describe a procedure for distinguishing between the case that the number of low edges in Gℓ (0) is relatively small, and the case in which the number of low edges in Gℓ (2ǫ) (which is a subgraph of Gℓ (0)), is relatively large. We define ≺ to be a total order on the graph vertices such that v ≺ u if d(v) < d(u) or if d(v) = d(u) and id(v) < id(u) (where id(v) denotes the unique id of vertex v). In the following procedure and analysis we consider an orientation of the edges such that each edge (v, u) is oriented from its lower endpoint according to ≺. Estimate-remaining-low-edges(α, ǫ, δ, ℓ, m) · (800 ln(1/δ)). 1. Set t = ǫ2αn ·m 2. For i = 1 to t do: (a) Sample a uniform vertex vi ∈ V . (b) If vi is a high-degree vertex, then set χi = 0 and continue to iteration i + 1. (c) Choose a random index ji ∈ [1, 2α/ǫ] and query for the jith neighbor of vi . If no neighbor was returned, then set χi = 0 and continue to iteration i + 1. Otherwise let ui denote the returned neighbor. (d) Invoke IsActive(α, ǫ, ǫ/2, vi , ℓ) and IsActive(α, ǫ, ǫ/2, ui , ℓ). If the procedure returned Yes on both invocations and d(vi ) ≺ d(ui ) then set χi = 1. Otherwise, set χiP = 0. 1 · χ. 3. Set χ = t ti=1 χi and set µ = n·(2α/ǫ) m 4. If µ ≤ 14ǫ, then return Few. Otherwise, return Many. Lemma 9. Assume that m ∈ [m/2, m]. If the number of low edges in Gℓ (0) is at most 5ǫ, then Estimate-remaining-low-edges returns Few with probability at least 1 − δ. If the number of low edges in Gℓ (2ǫ) is at least 18ǫ, then Estimate-remaining-low-edges returns Many with probability at least 1 − δ. complexity and running time of Estimate-remaining-low-edges(α, ǫ, δ, ℓ, m) are The query ℓ+1   cℓ log(ℓ/ǫ) for a constant c > 1. O αn m · ǫ2 Proof. We say that the procedure IsActive is correct when invoked with a vertex v if v ∈ Aℓ (2ǫ) and IsActive returns Yes or if v ∈ / Aℓ (0) and IsActive returns No. For a subgraph G′ of G we let m(G′ ) denote the number of edges in G′ . 10 We define the following sets of pairs. Let R be the set of all pairs (v, j) such that v ∈ V and j ∈ [1, 2α/ǫ]. For every γ ≥ 0, let R(γ) ⊂ R be the set of all pairs (v, j) such that (i) v ∈ Gℓ (γ) \ H, (ii) j ≤ d(v), (iii) u is the j th neighbor of v and u ∈ Gℓ (γ), and (iv) d(v) ≺ d(u). We first consider the case that Gℓ (0) has at most 5ǫm edges. Observe that by the definition of R(γ), there exists a one-to-one correspondence between the pairs in R(0) and the oriented low edges of Gℓ (0). For every i such that (vi , ji ) ∈ / R(0), it holds that either vi or ui (where ui th is the ji neighbor of vi ) is not in Aℓ (0). Hence, by Lemma 4, IsActive returns Yes on both vertices with probability at most ǫ/2. For every pair (vi , ji ) ∈ R(0), we bound the probability that m(Gℓ (0))+ǫm m IsActive returns Yes on both vertices by 1. Hence, Ex[χi ] ≤ |R(0)| , and if |R| + ǫ · |R| ≤ |R| 6ǫm m(Gℓ (0)) ≤ 5ǫm, then Ex[χ] ≤ n·(2α/ǫ) . By the multiplicative Chernoff bound and by the setting of t = ǫαn 2 ·m · (800 ln(1/δ)), if m ≤ m, " t # !   6ǫm (1/20)2 · n·(2α/ǫ) ·t 1X 1 6ǫm Pr < exp − < δ. χi > 1 + · t 20 n · (2α/ǫ) 3 i=1 It follows that if m ∈ [m/2, m] and m(Gℓ (0)) ≤ 5ǫm then with probability at least 1 − δ, µ≤ n · (2α/ǫ) 7ǫm · ≤ 14ǫ, n · (2α/ǫ) m and the procedure returns Few. Now consider the case that Gℓ (2ǫ) has at least 18ǫm low edges. Similarly to the above, there exists a one-to-one correspondence between the pairs in R(2ǫ) and the oriented low edges of Gℓ (2ǫ). For every i such that the pair (vi , ji ) is in R(2ǫ), χi = 1 if the invocations of IsActive on vi and ui (where ui is the jith neighbor of vi ) return Yes. Since for every such pair ui and vi are in Aℓ (2ǫ), by Lemma 4 and by the union bound, IsActive returns Yes on both vertices with probability at least 1 − ǫ. Hence, Ex[χi ] ≥ (m(Gℓ (2ǫ)) − m(H))(1 − ǫ) |R(2ǫ)|(1 − ǫ) ≥ , |R| n · (2α/ǫ) where m(H) denotes the number of high edges in the graph. Therefore, if the number of low edges 16ǫm in Gℓ (2ǫ) is at least 18ǫm, then Ex[χ] ≥ 18ǫ(1−ǫ)m ≥ n·(2α/ǫ) . By the multiplicative Chernoff bound |R| αn and by the setting of t = ǫ2 ·m · (800 ln(1/δ)), if m ≤ m, # ! " t   16ǫm (1/20)2 · n·(2α/ǫ) ·t 1 16ǫm 1X χi < 1 − · < exp − < δ. Pr t 20 n · (2α/ǫ) 2 i=1 Therefore, if m ∈ [m/2, m] and the number of low edges in Gℓ (2ǫ) is at least 18ǫm, then with probability at least 1 − δ, 15ǫm n · (2α/ǫ) µ≥ · ≥ 15ǫ, n · (2α/ǫ) m and Estimate-remaining-low-edges returns Many. In each step of the for loop there are at most two invocations of the procedure IsActive with 4, the query complexity and running time resulting from parameters γ = ǫ and δ = ǫ/2. By Lemma ℓ  cℓ log(ℓ/ǫ) these invocations are O . The rest of the steps inside and outside the for loop take ǫ2 constant queries and running time, and therefore the total query complexity and running time are   ℓ+1  cℓ log(ℓ/ǫ) αn . O m · ǫ2 11 4.4 The algorithm for testing bounded arboricity We are now ready to present our algorithm for testing bounded arboricity. The algorithm makes use of the following theorem. Theorem 10 ([14]). Let G = (V, E) be a graph with n vertices and m edges. There exists an algorithm named Estimate-number-of-edges, that is given query access to G and parameters n, ǫ and δ. The algorithm outputs an estimate m of m such that with probability at least 1 − δ satisfies  m/2 ≤ m ≤ m. The query complexity and running time of the algorithm are Õ √nm · log(1/δ) in expectation (for a constant c). Is-bounded-arboricity(G, α, ǫ) 1. Let δ = 2/3. 2. Invoke Estimate-number-of-edges(1/2, δ/3) and let m denote the returned value. 3. Invoke Estimate-high-edges(α, ǫ, δ/3), and if the procedure returned Many then return No. 4. Set ℓ = ⌈log6/5 (1/ǫ)⌉. 5. Invoke Estimate-remaining-low-edges(α, ǫ, δ/3, ℓ, m) and if the procedure returned Few then return Yes and otherwise return No. Theorem 11. If G is ǫ-close to having arboricity at most α, then Is-bounded-arboricity returns Yes with probability at least 1 − δ, and if G is 20ǫ-far from having arboricity at most 3α, then Isbounded-arboricity returns No with probability at least 1 − δ. The query complexity and running time of Is-bounded-arboricity are  O(log(1/ǫ) ! 1 log(1/ǫ) n · α n + · Õ √ · ǫ m ǫ m in expectation. Proof. By Theorem 10, the invocation of Estimate-number-of-edges(ǫ, δ/3) returns a value m such that m ∈ [m/2, m] with probability at least 1 − δ/3. We henceforth condition on this event. Consider first the case that G is ǫ-close to having arboricity at most α. By Claim 6, G has at most 2ǫm high edges, and by Lemma 8, the procedure Estimate-high-edges returns Many with probability at most δ/3. Therefore, the algorithm continues to the following step with probability at least 1 − 2δ/3. We condition on this event as well. By Lemma 3, if G is ǫ-close to having arboricity at most α then m(Gℓ (0)) ≤ 5ǫm, and therefore by Lemma 9, Estimate-remaining-low-edges will return Few with probability at least 1 − δ/3. By taking a union bound over all “bad” events and by the setting of δ = 2/3, it holds that with probability at least 2/3 Is-bounded-arboricity will return Yes. Now consider the case that G is at least 20ǫ-far from having arboricity at most 3α. If G has at least 2ǫm high edges, then by Lemma 8, Estimate-high-edges returns Many with probability at least 1 − δ/3 and therefore Is-bounded-arboricity returns No with probability at least 1 − 2δ/2 > 2/3. Therefore, assume that G has at most 2ǫm high edges. By Lemma 3, m(Gℓ (2ǫ)) > (20ǫ − 2ǫ)m and it follows that Gℓ (2ǫ) has at most 18ǫm low edges. Hence, by Lemma 9, Estimate-remaining-low-edges returns Many with probability at least 1 − δ/3. By taking a union bound over all “bad” events and by the setting of δ = 2/3, it holds that with probability at least 2/3 Is-bounded-arboricity will return No. 12 By Theorem 10, the expected query complexity and running time of the  invocation of n Estimate-number-of-edges with parameters ǫ = 1/2 and δ = 2/9 are Õ √m . By Lemma 8, the expected query complexity and running timeof the invocation of Estimate-high-edges with  n·log(1/ǫ) √ parameters ǫ and δ/3 = 2/9 are Õ . By Lemma 9, the running time and query ǫ m complexity of Estimate-remaining-low-edges when invoked with m and ℓ = ⌈log6/5 (1/ǫ)⌉  O(log(1/ǫ)) . are O ǫnα Therefore, the expected query complexity and running time of 2 m · (1/ǫ) Is-bounded-arboricity are  O(log(1/ǫ)) ! 1 log(1/ǫ) n · α n + · . Õ √ · m ǫ m ǫ 5 Lower bounds The following lower bounds are quite simple and are brought here for the sake of completeness. Claim 12. For a graph G let n denote the number of vertices in G and let m be a constant factor approximation of the number of edges, m in G. Let A be an algorithm that is given query access to a graph G as well as parameters n, m, α and ǫ < 12 and is required to distinguish with high constant probability between the case that G has arboricityat most  α and the case that G is ǫ-far from having n arboricity at most 3α. Then A must perform Ω √m queries. Proof. Consider the following two families of graphs. Every graph in the first family consists of a two subgraphs. The first is a bipartite subgraph with m/α vertices in each sides, and there are α perfect matchings between the two sides. The second subgraph is an independent set of size n − 2m/α. The different graphs within the family differ from one another only by their labeling. The graph in √ two additional subgraphs. A √ the second family have the same bipartite subgraph, but clique over m vertices and an independent set of size n − 2m/α − m. As in the first family, the graphs within the second family differ only by their labeling. Clearly in the first family all graphs have arboricity α, while in the second family all graphs are Ω(1)-far from having arboricity at most 3α. Also, for both families m is a constant factor approximation of their of edges. Since   number √ the probability of witnessing a vertex in the clique is nm , at least Ω √nm queries are required in order to distinguish between a graph drawn from the first family and a graph drawn from the second family with high constant probability. The above lower bound does not hold in the case that the algorithm is also given the exact number of vertices in the graph. In this case we prove a lower bound of nα m. Claim 13. For a graph G let n denote the number of vertices in G and let m denote the number of edges. Let A be an algorithm that is given query access to a graph G as well as parameters n, m, α and ǫ < 12 and is required to distinguish with high constant probability between the case that G has arboricity at most  α and the case that G is ǫ-far from having arboricity at most 3α. Then A must perform Ω nα m queries. Proof. Consider the following two families of graphs. Every graph in the first family consists of two subgraphs. The first subgraph is a bipartite graph with m/α vertices in each side, and there are α perfect matchings between the two sides. The second subgraph is an independent set of 13 n − 2m/α vertices. The graphs in the second family are similar and the difference is in the setting of parameters. They also consist of two subgraphs, but here the first subgraph is a bipartite graph with m/(3α(1 + 2ǫ)) vertices in each side, and 3α(1 + 2ǫ) perfect matchings between the two sides. The second subgraph is now an independent set over n − 2m/(3α(1 + 2ǫ)) vertices. Within the two families the graphs differ only by their labeling. Clearly all graphs in the first family have arboricity α, and all graphs in the second family are 2ǫ-far from having arboricity 3α. In order to distinguish between the two families with high constant probability any algorithm must at least witness a vertex in the graph. Since the probability  m/α of hitting a vertex in the bipartite subgraphs is O n , it follows that any high constant success probability algorithm must perform Ω( nα m ) queries. Finally we establish that there is no one-sided error algorithm for bounded arboricity that performs a number of queries that is sublinear in n. Claim 14. For a graph G let n denote the number of vertices in G and let m denote the number of edges. Let A be an algorithm that is given query access to a graph G as well as parameters n, m, α and ǫ < 12 and is required to accept G with probability 1 if it has arboricity at most α and reject G with probability at least 2/3 if it is ǫ-far from having arboricity at most 3α. Then A must perform Ω(n) queries. Proof. Consider the second family of graphs in the proof of Claim 12. Recall that every graph in this family is Ω(1)-far from having arboricity at most 3α. However, if a one-sided error algorithm performs at most n/c queries for a sufficiently large constant c and observes only vertices from the bipartite subgraph and the independent set, then it must accept. This is true since for every such set of queries, there exists a graph with arboricity at most α that is consistent with the answers to these queries (and has the same number of edges as the queried graph). This graph is the same as the queried graph except that the clique, together with part of the independent set, are replaced by a subgraph with the same number of edges and arboricity at most α. 6 Variations and adaptations of the algorithm In the case that the number of edges m is given to the algorithm, we can modify the algorithm as follows in order to improve the query complexity and running time. First, we do not need to estimate the number of edges, as it is already given as input. Now, we can change the procedure for estimating the number of high edges as follows. We consider an orientation of the graph edges according to degrees so that each edge is only considered from its lower degree endpoint (and ties are broken arbitrarily). Now we can estimate the number of low edges by sampling random vertices, and if they are of low-degree querying for their ith neighbor where i is a uniformly at random chosen index in [1, 2α/ǫ]. Denoting by mℓ the number of low edges in the graph, it holds that the success mℓ . Hence, if at least an ǫ-fraction of the graph edges probability of the described procedure is n·(2α/ǫ)  are low, we can obtain a (1 ± ǫ) approximation of mℓ , denoted m e ℓ , using O ǫnα queries. Since we 2m know m exactly, this also yields a (1 ± ǫ) approximation of the number of high edges in the graph. 1 O(log(1/ǫ) testing algorithm. From this point we can continue as before to get an O ǫnα 2m · ( ǫ ) If the algorithm is not given the number of edges, but is given information on the maximal degree d in the graph, we can similarly change the algorithm to improve the first term in the √ running time to O(d/d) where d is the average degree of the graph (if d > m then it is better to use the original algorithm.) The approximations of m and mℓ can be obtained similarly to the above, by sampling random vertices and querying for their ith neighbor where i is chosen uniformly 14 mℓ m and in [1, d]. The success probabilities for hitting an edge and a low edge are n·d n·d , respectively,   and therefore a (1 ± ǫ) approximations can be obtained in time O (n · d/(ǫ2 m) = O d/(ǫ2 d) . Finally if an upper bound d on the maximal degree is known, and the distance measure is with respect to n · d then the algorithm can be altered to run in time ( 1ǫ )O(log(1/ǫ) . This is true, since testing if there are more than ǫ · n · d high edges can be done in time O( 1ǫ ), and similarly testing if the number of remaining low edges is higher than ǫ · n · d requires sampling O( 1ǫ ) edges and testing if their endpoints are active, which takes a total of ( 1ǫ )O(log(1/ǫ) time. References [1] Noga Alon and Shai Gutner. Linear time algorithms for finding a dominating set of fixed size in degenerated graphs. Algorithmica, 54(4):544–556, 2009. [2] Nikhil Bansal and Seeun William Umboh. Tight approximation bounds for dominating set on graphs of bounded arboricity. Inf. Process. Lett., 122:21–24, 2017. [3] Albert-László Barabási and Reka Albert. Emergence of scaling in random networks. Science, 286(5439):509–512, 1999. [4] Leonid Barenboim and Michael Elkin. Sublogarithmic distributed MIS algorithm for sparse graphs using nash-williams decomposition. Distributed Computing, 22(5-6):363–379, 2010. [5] Itai Benjamini, Oded Schramm, and Asaf Shapira. Every minor-closed property of sparse graphs is testable. In Proceedings of the 40th Annual ACM Symposium on Theory of Computing, Victoria, British Columbia, Canada, May 17-20, 2008, pages 393–402, 2008. [6] Herman Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, pages 493–507, 1952. [7] Norishige Chiba and Takao Nishizeki. Arboricity and subgraph listing algorithms. SIAM Journal on Computing, 14(1):210–223, 1985. [8] Artur Czumaj, Oded Goldreich, Dana Ron, C. Seshadhri, Asaf Shapira, and Christian Sohler. Finding cycles and trees in sublinear time. Random Structures and Algorithms, 45(2):139–184, 2014. [9] Alan Edelman, Avinatan Hassidim, Huy N. Nguyen, and Krzysztof Onak. An efficient partitioning oracle for bounded-treewidth graphs. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques - 14th International Workshop, APPROX 2011, and 15th International Workshop, RANDOM 2011, Princeton, NJ, USA, August 17-19, 2011. Proceedings, pages 530–541, 2011. [10] T. Eden and W. Rosenbaum. arXiv:1706.09748, 2017. On sampling edges almost uniformly. arXiv preprint [11] David Eppstein, Maarten Löffler, and Darren Strash. Listing all maximal cliques in sparse graphs in near-optimal time. Algorithms and computation, pages 403–414, 2010. [12] David Eppstein, Maarten Löffler, and Darren Strash. Listing all maximal cliques in large sparse real-world graphs. ACM Journal of Experimental Algorithmics, 18, 2013. 15 [13] Oded Goldreich and Dana Ron. Property testing in bounded degree graphs. Algorithmica, 32(2):302–343, 2002. [14] Oded Goldreich and Dana Ron. Approximating average parameters of graphs. Random Structures & Algorithms, 32(4):473–493, 2008. [15] Petr A. Golovach and Yngve Villanger. Parameterized complexity for domination problems on degenerate graphs. In Graph-Theoretic Concepts in Computer Science, 34th International Workshop, WG 2008, Durham, UK, June 30 - July 2, 2008. Revised Papers, pages 195–205, 2008. [16] Avinatan Hassidim, Jonathan A. Kelner, Huy N. Nguyen, and Krzysztof Onak. Local graph partitions for approximation and testing. In 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2009, October 25-27, 2009, Atlanta, Georgia, USA, pages 22–31, 2009. [17] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [18] Christoph Lenzen and Roger Wattenhofer. Minimum dominating set approximation in graphs of bounded arboricity. In Distributed Computing, 24th International Symposium, DISC 2010, Cambridge, MA, USA, September 13-15, 2010. Proceedings, pages 510–524, 2010. [19] Reut Levi and Dana Ron. A quasi-polynomial time partition oracle for graphs with an excluded minor. ACM Trans. Algorithms, 11(3):24:1–24:13, 2015. [20] C. St. JA. Nash-Williams. Edge-disjoint spanning trees of finite graphs. Journal of the London Mathematical Society, 1(1):445–450, 1961. [21] C. St. JA. Nash-Williams. Decomposition of finite graphs into forests. Journal of the London Mathematical Society, 1(1):12–12, 1964. [22] Ilan Newman and Christian Sohler. Every property of hyperfinite graphs is testable. SIAM J. Comput., 42(3):1095–1112, 2013. [23] M. Parnas and D. Ron. Testing the diameter of graphs. Random Structures and Algorithms, 20(2):165–183, 2002. [24] M. Parnas, D. Ron, and R. Rubinfeld. Tolerant property testing and distance approximation. Journal of Computer and System Sciences, 72(6):1012–1042, 2006. [25] W. T. Tutte. On the problem of decomposing a graph into n connected factors. Journal of the London Mathematical Society, 36(1):221–230, 1961. [26] Yuichi Yoshida and Hiro Ito. Testing outerplanarity of bounded degree graphs. Algorithmica, 73(1):1–20, 2015. A Missing technical claims Claim 15. Consider the following recursive formula: Xj = Xj−1 · α log(1/Xj−1 ) 16 where α < 1 and X1 < 1. Then for any j ≥ 1, Xj ≥  X1 · α2 j2 j . Proof. We prove the claim by induction. For the base of the induction, j = 1, we have that X1 ≥ X1 · α2 , since α < 1. To prove the induction step for j + 1 > 1, we use the induction hypothesis by which  j X1 · α2 Xj ≥ . j2 This implies that log(1/Xj ) ≤ j · log  j2 X1 · α2  . By combining this with the definition of the recursive formula we get that Xj · α log(1/Xj )  j X1 · α2 1  2  ≥ ·α· 2 j j · log X1j·α2  j+1   j2 j+1 X1 · α2 · · log . ≥ (j + 1)2 X1 · α X1 · α2 Xj+1 = The claim follows since log  j2 X1 · α2  ≤ 2 · log which holds since j + 1 ≥ 2 and X1 α < 1. 17  j X1 · α  ≤ j , X1 · α (2) (3) (4)
8cs.DS
Integration of Absolute Orientation Measurements in the KinectFusion Reconstruction pipeline arXiv:1802.03980v1 [cs.CV] 12 Feb 2018 Silvio Giancola, Jens Schneider, Peter Wonka and Bernard S. Ghanem Abstract— In this paper, we show how absolute orientation measurements provided by low-cost but high-fidelity IMU sensors can be integrated into the KinectFusion pipeline. We show that integration improves both runtime, robustness and quality of the 3D reconstruction. In particular, we use this orientation data to seed and regularize the ICP registration technique. We also present a technique to filter the pairs of 3D matched points based on the distribution of their distances. This filter is implemented efficiently on the GPU. Estimating the distribution of the distances helps control the number of iterations necessary for the convergence of the ICP algorithm. Finally, we show experimental results that highlight improvements in robustness, a speed-up of almost 12%, and a gain in tracking quality of 53% for the ATE metric on the Freiburg benchmark. I. I NTRODUCTION Automated 3D reconstruction of geometry from images is a highly versatile field of research with applications in archeology [1], topography [2], urban planning [3], robotics [4] and entertainment [5]. The ubiquity of this core vision task stems primarily from decades of advances in reconstruction algorithms [6]–[9] and acquisition devices [10]–[15]. With the latest advent of low-cost consumer-class RGB-D cameras, 3D scene understanding and reconstruction has become a pervasive mass market technology. Simultaneous Localization and Mapping (SLAM) techniques are based on a registration step, i.e., they seek to properly align pairs of images or point clouds. This registration step consists of finding a 6-DoF rigid body transformation M ∈ SE(3) composed of a rotation matrix R ∈ SO(3) and a translation vector t ∈ R3 such that overlapping parts of a scene can be superimposed, thereby minimizing the distances between pairs of matched points. It is clear that the process of finding the best-possible rigid transformation M = (R,t) is affected by noise, occlusion, matching quality, and outliers. Therefore, it remains intrinsically ambiguous and complex to solve (R,t) in a robust and computationally efficient fashion. The main reason is that solving for both R and t simultaneously is a non-convex problem. We believe that non-convexity is principally introduced by the orientation component. The problem can be linearized, however, if a rough estimate of the orientation is available. Point cloud registration, be it frame-by-frame or frame-tomodel, is the foundation for 3D reconstruction, since separate acquisitions have to be aligned. The original KinectFusion algorithm [16] makes use of a coarse-to-fine ICP method [17] The authors are Abdullah University with the Visual Computing of Science and Technology, [email protected] Center, King Saudi Arabia Fig. 1: Reconstruction of a Kitchen environment using an absolute orientation prior to seed the ICP algorithm. Top Left: Photo of the Kitchen environment. Top Right: Original KinectFusion reconstruction. Bottom: IMU-seeded KinectFusion reconstruction. with a fixed number of iterations, using a linear approximation [18] that minimizes for the point-to-plane metric [19]. In this work, we present a modified KinectFusion framework that integrates an absolute orientation measurement provided by an off-the-shelf IMU. The orientation prior is leveraged in the ICP method and the original problem is solved by adding a regularization for the orientation component. Also, correspondences between closest points are filtered based on an efficient estimate of the median distance between pairs of points implemented on a GPU. As such, we observe improvements in quality, runtime, and robustness in the 3D reconstruction process. We characterize the uncertainty model for the orientation measurement according to the ISO JCGM 100:2008 [20], and we apply such model to the Freiburg dataset [21] in order to evaluate the quality of our reconstruction pipeline. II. R ELATED WORK Visual-Inertial SLAM is a hot topic with direct applications to robotics, for which the setup usually includes cameras and IMUs. Here, we review works focusing on Navigation and Mapping, dual topics applied to robotics. Navigation focuses on estimating the system’s egomotion, i.e., its own trajectory in space and time. Many important navigation methods use extended Kalman filter (EKF) techniques [22]–[25]. They define and update a system state based on visual and inertial measurements using advanced and complex Kalman filtering techniques [26]–[28]. Paul et al. [22] recently conducted a comparative study between monocular and stereo visual-inertial EKF-based techniques, but do not mention any RGB-D devices. Other methods such as [29]–[31] focus on solving a global optimization problem minimizing for a combined cost function. In those techniques, the translation is estimated by integrating the IMU acceleration measurements twice. However, since integration may amplify noise, such double integration generally produces significant drifts. Leutenegger et al. [29] modeled the noise in a probabilistic way, but residual drift inevitably affects the method’s stability negatively. In contrast, we show that orientation measurements can be estimated robustly and consistently using a 9-DoF IMU. In Visual-Inertial Navigation techniques, the IMU data can be loosely-coupled, i.e., an independent measurement in the problem [32], [33] or tightly-coupled, optimizing over all sensor measurements in the optimization [29] and EKF pipelines [23], [26]. Finally, it is worth noting that navigation techniques mostly make use of monocular or stereo cameras, but do not rely on direct depth measurements. The reason is that the quality of the 3D reconstruction is typically out-ofscope for navigation tasks. Mapping. While Navigation tries to solve for ego-motion, Mapping focuses attention on high quality 3D reconstruction using depth-capable devices. Zhang et al. [34] recently presented a pipeline that estimates ego-motion while building an accurate representation of the surrounding environment. Similar to Navigation, it is common practice to rely on EKF [35] or global optimization [36] techniques. Ma et al. [36] presented a solution for large-scale Visual-Inertial reconstruction using a volumetric representation similar to KinectFusion. Concha et al. [37] created a real-time, fully dense reconstruction based on an RGB camera and an IMU. Visual Inertial KinectFusion. Nießner et al. [38] followed similar considerations by using an IMU from a smartphone to initialize both (R,t) in the ICP step of KinectFusion. While achieving some improvement in runtime, reliable position information cannot be extracted from an IMU alone, since the accelerometer’s noise leads to significant drift. Smartphones therefore use a fusion of multiple triangulation techniques based on measurements including GSM, WiFi, and GPS (outdoors). Nevertheless, the position information is of very low fidelity, especially indoors. We argue that since ICP is generally sensitive to its initialization, providing it with such noisy measurements can only lead to limited improvement (or even degradation) in many acquisition scenarios. In contrast to requiring an expensive, full sensor array as found in smartphones, our method only relies on a cheap and modular IMU that produces high-fidelity absolute orientation measurements in real-time. Datasets. Pfrommer et al. [39] recently released a dataset for visual-inertial benchmarking. However, this dataset strictly focuses on odometry along long distances, but not on small range reconstructions as KinectFusion-based algorithms do. Sturm et al. [21] released multiple versions of their well-known Freiburg benchmark, albeit without orientation measurements. We will present a way to generate such measurements using the ground truth orientation and an empirical uncertainty model of our sensor. Contributions. While the existing literature focuses on solving the problem for both position and orientation from the IMU raw measurements, we argue that orientation alone is sufficient to improve overall performance. Our contributions are: 1) We overcome the non-convexity of the joint problem induced by the unknown rotation R by seeding the ICP algorithm with an orientation estimate from the IMU. 2) We present a regularized point-to-plane metric in the coarse-to-fine ICP alignment. 3) We use a novel filter that estimates the median distance between closest points efficiently on the GPU in order to reject outliers and control ICP convergence. 4) We provide an uncertainty model of the IMU measurements and apply our model to the Freiburg dataset. III. P ROPOSED METHOD The original KinectFusion algorithm is based on a coarseto-fine ICP between a newly acquired frame and the reconstructed model. The current frame is aligned by solving a non-linear least squares minimization problem (1) using the point-to-plane metric to find the optimal transformation matrix M ∈ SE(3), composed of an orientation R ∈ SO(3) and a translation t ∈ R3 , Mopt = arg min M X > (Mpi − qi ) ni 2 , (1) i where pi and qi are pairs of matched points belonging to the current frame and the model respectively. In our method, we use the orientation measurement from the IMU to pre-orient the point pi beforehand. Inspired by Low et al. [18], who proposed a linear solution to this problem by assuming small angles (α ' 0, β ' 0, c γ ' 0), transformation M is approximated by M   1 −γ β tx  γ 1 −α ty  c  := M. M' (2) −β α 1 tz  0 0 0 1 In this specific case, the optimization of equation (1) can be reformulated into a linear least square problem: minx 21 kAx−bk22 , where x = (α, β, γ, tx , ty , tz )> . To solve this problem, A> A and A> b are efficiently computed on the GPU using a parallel reduction [40]. The resulting 6×6 linear system A> Ax = A> b is efficiently solved using a Singular Value Decomposition (SVD) performed on the CPU. A. Regularized formulation of the problem In order to leverage the orientation prior, we propose a regularized formulation for the linear least squares problem, 1 kAx − bk22 + λkPxk22 . (3) 2n   We set P = I3 |03 to regularize only the 3 angles α, β and γ to be close to zero. Such a constraint enforces the small angle hypothesis presented in the original formulation (2), but also allows for small rotations to compensate for the noise in the IMU orientation measurement. The regularized linear system that we solve is presented in Eq. (4). min x (A> A + 2λnP> P)x = A> b (4) The regularized term 2λnP> P is efficiently computed on the GPU. λ is a hyper-parameter that leverages the use of the IMU prior; it can be fixed (constant) or a function of n. The regularized formulation of the linearized problem is solved using an SVD on the CPU. The process is repeated in an ICP framework. B. Distribution of closest-point distances In the original problem, the number of good matches n in Eq. (3) is unknown. To both estimate n and identify inconsistent correspondences, we exploit the probability density function (PDF) of closest point pairs, which gathers the point-to-point distances into a histogram. The PDF and its cumulative (CDF) are efficiently computed on the GPU and are used in the next steps. Figure 2 shows a PDF extracted from a single iteration in the ICP framework. Fig. 2: Median Filtering performed on a distance distribution. In this specific case, we are keeping around 75% of the pairs. D. Convergence verification The median distance used for the filtering is subsequently used to control the convergence of the ICP. Since we seed the ICP with the orientation, we observe that the coarse-tofine ICP requires less iterations for convergence than before. To assess the proper alignment, we loop until the median converges instead of performing a fixed number of iterations. The convergence of a given level of the coarse-to-fine ICP is achieved when the median no longer changes within its resolution for 3 successive iterations. IV. E XPERIMENTS We use the state-of-the-art IMU BNO055 manufactured by Bosch, which is typically designed for embedded applications, such as flight control and motion capture. It has a small footprint of a few mm2 and comes on a 1cm-sized board. We mounted the IMU on a Kinect V1 (Figure 3 right) and its pose has been calibrated with the reference system of the 3D camera using the hand-to-eye calibration method proposed by Tsai et al. [42]. The Kinect V1 grabber has been modified to include the IMU orientation in the point cloud. We used the KinectFusion implementation available in the Point Cloud Library [43]. C. Median-based filtering We also propose a filtering method for the closest-point correspondences based on the median distance. This median is estimated from the CDF of the distances obtained up to the resolution of the used histogram. We argue that, by correcting the orientation, the distribution of the closest point distances should be clustered around the distance corresponding to the translation between the two point clouds. Inqother words, the distances should be gathered around d¯ = t2x + t2y + t2z after orientation correction. The closest point estimation is performed using a normal shooting technique, with normals estimated using an integral image method [41]. Such a normal estimation is prone to error especially on the border of the depth frame and on the edges of objects in the scene. The algorithm may look for the closest point along a wrong direction. We thus filter out pairs of points that do not gather around the median distance, identifying them as erroneous. Figure 2 illustrates such median-based filtering. Here, the PDF of the distances is plotted with the good pair distances in green and the filtered out ones in red. Fig. 3: BNO055 board on a Kinect V1 RGB-D Camera. A. Evaluation of ICP Variants We tested different versions of ICP using an illustrative Desktop example for the registration, shown in Figure 4. Here, we consider two consecutive frames in the Desktop sequence and evaluate how well each ICP variant registers the input point cloud to the target point cloud. From Figure 4c, it is evident that ICP may converge to an undesirable local minimum if the IMU is not used, especially if the initial guess of the matched point correspondences is unreliable. Here, even though the IMU-Based metrics have a worse initial value, it lies in a more linear and more convex neighbourhood of the global optimal solution, hence it converges faster and more robustly to the desired solution. (a) Input point cloud. (b) Target point cloud. (c) ICP convergence over iterations Fig. 4: Input (a) and target (b) point clouds with IMU measurements, the convergence (c) of ICP metric (median) without IMU vs. IMU-Based methods. Fig. 6: Original ICP (left) and our implementation (right) convergence over time (top) and iteration (bottom) for different intra-frame angles. TABLE I: Failure rate across intra-frame acquisition angles. Desktop 5◦ 10◦ 15◦ 20◦ 25◦ 30◦ 40◦ 50◦ 60◦ Original Ours 0% 10% 25% 55% 75% 90% 100% 100% 100% 0% 0% 10% 0% 10% 0% 5% 10% 100% (a) Original ICP B. Angular convergence (b) IMU-Based ICP (strongly regularized λ  0) (c) IMU-Based ICP (not regularized λ = 0) Fig. 5: ICP alignment and distance distribution over iteration. Figure 5 compares the results of the alignment of two point clouds, as well as, the distribution of the closest point distance over iterations, using a plain ICP and our IMUBased ICP both with and without regularization. In this example, the original ICP gets stuck in a local minimum and does not align the two point clouds properly (Figure 5a); the distribution of distances does not converge after 50 iterations. In Figures 5b and 5c we show how our system converges when initialized with the orientation measurement. Using a strong regularization (b), the orientation is not optimized, the distribution does converge, but, in this case, the translation t is computed without taking into account the eventual noise in the orientation. Without regularization (c), the robustness is decreased, i.e. the ICP can converge to a local minimum, but an eventual error in the orientation measurement is corrected, which produces a narrower PDF. In order to show the sensitivity of KinectFusion to angular motion, we considered 20 consecutive frames from the Desktop environment. Between pairs of frames, we rotate the 3D camera by a specific angle θ ∈ {5◦ , 10◦ , . . . , 60◦ }. The rationale is to simulates angular shifts in acquisition. We then feed the data to KinectFusion and inspect the resulting 3D reconstruction for obvious errors such as duplication of scene geometry. Figure 6 plots the median of the residual error over iterations, for a predefined set of intra-frame angles. Clearly, KinectFusion’s original ICP cannot cope with orientation changes of more than 20◦ between consecutive frames and shows an increasing degradation. In contrast, our IMU-based approach maintains the same convergence quality over angle. Table I summarizes the failure rate (averaged across 20 pairs of frames) for each angular shift during the acquisition. Clearly, our IMU-based version of KinectFusion is more robust, since it has a much lower failure rate for most rotations. Our method degrades more gracefully than classical KinectFusion and total failure only occurs at θ = 60◦ , when the point clouds do not overlap anymore. C. Improvements in reconstruction For the same reason we have mentioned above, the reconstruction deteriorates with the scanning pace; a fast scanning at a fixed frame rate creates larger gaps between consecutive frames than a slow scanning. Figure 8 shows the ICP convergence for a slow and fast pace reconstruction. Clearly, for slow motion (small angles between consecutive frames), both versions of ICP tend to converge to similar results, with the IMU-based version being faster to converge (refer to Figure 8a). However, for fast motion (large angles between consecutive frames), ICP tends not to converge in the 19 (a) People (∼150 frames) (b) Showcase (∼300 frames) (c) Desktop (∼200 frames) Fig. 7: KinectFusion reconstruction of multiple scenes, each with (green background) and without IMU (red background). iterations at its disposal (refer to Figure 8b). Because error rampantly propagates, a single instance where acquisition is too fast can lead to a completely erroneous model (refer to Fig. 1 (red background)). In comparison, KinectFusion with IMU-based ICP converges to a much better solution and in a shorter time for the same acquisition (refer to Fig. 1 (green background)). (a) ICP convergence for slow motion (b) ICP convergence for fast motion Fig. 8: ICP convergence plot representative for more than 95% of our data, for slow (a) and fast (b) camera motion. Adding an IMU substantially improves both cases. In order to assess our hypothesis, we asked different users to perform several reconstructions on multiple scenes with our setup. To prevent bias, the users were not given intricate instructions about the acquisition strategy they should use. Note that the users were visualizing the reconstruction as it was being incrementally created. As a result, they scanned the scene at a speed that they considered suitable for reconstruction. Figure 1 shows some qualitative results for the Kitchen dataset, while Figure 7 shows results for the People, Showcase and Desktop environments. A red background indicates an erroneous reconstruction performed by the original KinectFusion algorithm and a green background shows the reconstruction performed by our implementation. In these particular examples, we only used the IMU as a seed to the ICP without any regularization, median filtering nor convergence check. We can already see an improvement in the reconstruction quality. We notice for the People model in Figure 7a that a fast rotation along the camera principal axis (model on the middle) or an horizontal axis (model on the right) creates an inconsistent reconstruction. At a certain point, the coarse-tofine ICP is not able to align the newly acquired point cloud with the model within the 19 iterations at its disposal. As a result, it duplicates the scene and overwrites the weight of the TSDF cube that stores the reconstruction. For the Showcase scene in Figure 7b, a fast motion aligned a frame on the wrong seat, creating a shift in the overall reconstruction, duplicating the objects. Using the orientation provided by the IMU helped in keeping track of the reconstruction. For the Desktop scene shown in Figure 7c, a bad alignment has created a duplication of the desktop in two different levels. The first part of the point cloud streaming reconstructed a model of the desk, but after a bad alignment occurred, a second model was built. For all the previous examples, our implementation (green background) was able to cope with the difficulties of the different datasets, showing improved robustness in the presence of fast motion. D. Considerations on convergence timings The original KinectFusion method uses a fixed cadence (4, 5, 10) of coarse-to-fine ICP iterations, since computing the residual error on a GPU is an expensive log-reduce operation. By feeding the ICP with an initial orientation from the IMU, we can reduce the number of iteration to (2, 2, 3) without reducing the performance. Table II shows the improvement in time, which corresponds to 61%–69% of the time used for the ICP alone and 35%–43% of the overall KinectFusion pipeline. TABLE II: KinectFusion runtime with custum number of iterations on NVIDIA K6000 and GTX850M GPUs. ICP K6000 KinFu GTX850M ICP KinFu Original (4,5,10) Ours (2,2,3) 10.58 ms 4.07 ms 15.74 ms 10.22 ms 27.17 ms 8.22 ms 43.41 ms 24.72 ms Improvement 61.53 % 35.07 % 69.75 % 43.05 % Since less ICP iterations result in improved speed, we can use this saved time to estimate the PDF of the closestpoint distances. Such an operation can be time consuming if performed on the CPU, so we take advantage of the multiple GPU cores available to build the distance PDF on the GPU as well. Figure 9 shows the timing for different versions of KinectFusion, while reconstructing the Freiburg scenes (a total of 15,793 alignments). In blue, we show the distribution of the time required by the original KinectFusion, with an average of 15.55ms. Adding the estimation of the PDF at each ICP iteration (red distribution), the average time increases to 25.62ms. However, once we use the PDF to estimate its median value and stop the alignment after a convergence is detected, our method requires only 11.54 iterations on average to converge, whereas the original KinectFusion requires 19 iterations. Since our method converges in less iterations, it only requires an overall average of 13.71ms for alignment, which corresponds to an improvement of 11.8% on the original time. Furthermore, Table III shows the timing details for different datasets. V. P ERFORMANCE ON THE F REIBURG B ENCHMARK We evaluate our implementation on the Freiburg dataset [21], which is commonly used to benchmark largescale SLAM techniques. Since this dataset does not provide any measured orientation, we first characterize the uncertainty model of our IMU in order to apply such a model to the ground truth orientation. Fig. 9: Computational time for the original KinectFusion (blue), KinectFusion with PDF estimation for distant point removal (red) and KinectFusion with PDF estimation and median value convergence check (yellow). TABLE III: KinectFusion runtime for the original KinectFusion, our version using a fixed number of iteration (4,5,10) and our version with a control of the convergence. Dataset nPC Original KinFu Fixed iteration Until Converg. fr1/desk fr1/desk2 fr1/plant fr1/room fr1/rpy fr1/teddy fr1/xyz fr2/desk fr2/dishes fr2/ms2 fr3/teddy 571 609 1117 1351 689 1398 789 2173 2940 1834 2322 16.0 16.1 15.4 15.8 15.4 15.4 15.8 15.7 15.3 15.6 15.6 26.6 25.8 25.4 25.7 25.8 25.1 26.4 25.8 25.1 25.5 25.3 12.8 14.1 14.9 13.8 12.9 13.1 13.1 14.4 14.2 13.1 12.7 AVG 15793 ms ms ms ms ms ms ms ms ms ms ms 15.6 ms ms ms ms ms ms ms ms ms ms ms ms 25.6 ms ms ms ms ms ms ms ms ms ms ms ms 13.7 ms Improvements −19.6 −12.6 −3.1 −12.3 −16.3 −15.1 −17.0 −7.9 −6.8 −15.8 −18.0 % % % % % % % % % % % −11.8 % anthropomorphic robot ABB IRB 1200 to stress the IMU in rotation along the three main axes, within a ±180◦ range and a 5◦ angular step. The reference orientation is set to 0.01◦ resolution on each axis, which is several orders of magnitude better in resolution than the expected IMU uncertainty. For the static characterization, the IMU was positioned in space with a controlled orientation with respect to its reference system (Earth). The Z-axis vertical was aligned to top, and the X- and Y- axes orthogonal and horizontal. In particular, the X- axis was aligned with the north direction. After a stabilization time of 5 seconds, 1000 orientation measurements are performed at the IMU frequence of 100Hz. Uncertainty was measured as a combination of a random error represented by the standard deviation of the 1000 measurements and a systematic error measured by comparison to the ground truth orientation provided by the robotic arm. A. Metrological Characterization of the IMU Orientation We characterize the uncertainty of the IMU under static conditions according the Guide to the Expression of Uncertainty in Measurement (GUM) [20]. We used a 6-DoF Fig. 10: Uncertainty characterization of the BNO055 IMU along X-, Y- and Z- axes for the systematic (top) and random (bottom) errors. Note the different scales. Results presented in Figure 10 show that the uncertainty has an important systematic error, but no random error. The absence of a random component in the uncertainty is due to a strong low pass filter occurring on the IMU for the orientation estimation. The systematic error is mainly due to the internal calibration between the sensors. For reference, the IMU orientation around the horizontal X- and Y- axes are extracted using the combination of a magnetometer, an accelerometer, and a gyroscope, which provide accuracy around ±3◦ . Orientation around the vertical Z-axis is extracted using the magnetometer only, which provides lower quality measurement with uncertainty measured to be about ±10◦ . The test was repeated several times with different initial orientations for the IMU leading to similar trends. B. Methods and Results We used multiple datasets from the Freiburg benchmark [21], focusing on 3D object reconstructions rather than large environments. The list of datasets we used is shown in Table V. We adapted the parameters of the KinectFusion such that the reconstructions can fit inside a 512×512×512 TSDF cube, with a maximum side length of 6m. We chose identical parameters to run instances of the original KinectFusion and our pipeline using the ground truth orientation, with and without the systematic error that we characterized in the uncertainty model. We tested our model over different values of λ to figure out the best regularization. Table IV shows the average improvement for Absolute Trajectory Error (ATE) metrics (in %) with respect to the original KinectFusion algorithm, over all the datasets used. Our results clearly indicate that larger regularization results in better accuracy. TABLE V: ATE and RPE metrics for our method compared to the original KinectFusion. Here we used regularization (λ = 5), median filtering and convergence control dataset ATE (RMSE) (m) Ours Orig. IMU +noise RPE (RMSE) (m) Ours Orig. IMU +noise fr1/desk fr1/desk2 fr1/plant fr1/room fr1/rpy fr1/teddy fr1/xyz fr2/desk fr2/dishes fr2/ms2 fr3/teddy 0.073 1.162 0.569 0.533 0.144 0.772 0.022 1.399 1.118 1.126 0.396 0.030 0.293 0.134 0.292 0.026 0.033 0.018 1.087 0.268 0.141 0.097 0.044 0.444 0.176 0.370 0.039 0.136 0.032 1.107 0.619 0.142 0.292 0.738 1.288 0.707 0.573 0.190 1.107 0.471 0.513 0.394 0.426 0.430 0.745 0.838 0.655 0.568 0.147 0.562 0.455 0.325 0.239 0.321 0.392 0.739 0.870 0.632 0.576 0.155 0.552 0.443 0.411 0.323 0.329 0.397 AVG Improv. 0.665 - 0.220 −67% 0.309 −53% 0.622 - 0.477 −23% 0.494 −21% TABLE IV: Comparison of the average RMSE Absolute Trajectory Error (ATE) of our method respect to the original KinectFusion one using different regularizations. Value are given in percentage of improvement over all the datasets. c= 0.05 0.20 1.00 2.00 5.00 AVG √c c/ n c/n c/n2 -c ln(n) −30% −26% −6% 20% 72% 5% −31% −11% −2% −32% −29% −33% −51% −45% −16% −33% −46% −41% −34% −34% −44% −46% −29% −41% −41% −26% −36% −28% −20% −10% AVG 6% −14% −35% −38% −40% −24% Table V details the ATE and the Relative Pose Estimation (RPE) metrics for the different datasets. We only show the improvement on the translational part, since the rotational part is directly measured. We can see that the average ATE error is reduced by 53% on the selected dataset and the RPE is reduced by 21%. Figure 11 plots the trajectories resulting from our method. They are consistent with the ground truth. When using the original KinectFusion method, part of the trajectory is not reconstructed due to tracking loss. VI. C ONCLUSION In this work, we have demonstrated the benefits of integrating a cheap and modular IMU into the popular Fig. 11: From left to right: Trajectories for some Freiburg datasets. (black: ground truth, blue: estimated, red: difference) From top to bottom: Original KinectFusion / our method without regularization (λ = 0) / adding regularization (λ = 5) and convergence check / using noisy orientation. KinectFusion reconstruction pipeline. We used the IMU orientation to seed the ICP algorithm, which allows us to linearize/convexify the original problem more faithfully. We used a regularized point-to-plane metric that constrains the orientation within boundaries. We made sure the chosen correspondences are consistent and free of outliers by exploiting their median distance as a basis for outlier removal. We showed qualitative and quantitative improvements in the robustness of our modified KinectFusion pipeline over the original KinectFusion. In addition to improved reconstruction quality, speed is also improved by almost 12%. This is due to a significant reduction in the number of ICP iterations needed for convergence. Finally, results on the Freiburg benchmark show that the overall quality of the tracking/reconstruction is improved by a factor of 2. R EFERENCES [1] S. Giancola, D. Piron, P. Poppa, and R. Sala, “A Solution for Crime Scene Reconstruction using Time-of-Flight Cameras,” ArXiv e-prints, Aug. 2017. [2] H. Giberti, M. Tarabini, F. Cheli, and M. Garozzo, “Accuracy enhancement of a device for automated underbridge inspections,” in Structural Health Monitoring, Damage Detection & Mechatronics, Volume 7. Springer, Cham, 2016, pp. 59–66. [3] P. Musialski, P. Wonka, D. G. Aliaga, M. Wimmer, L. v. Gool, and W. Purgathofer, “A survey of urban reconstruction,” in Computer graphics forum, vol. 32, no. 6. Wiley Online Library, 2013, pp. 146–177. [4] K. Konolige, E. Rublee, S. Hinterstoisser, T. Straszheim, G. Bradski, and H. M. Strasdat, “Detection and reconstruction of an environment to facilitate robotic interaction with the environment,” Apr. 25 2017, US Patent 9,630,320. [5] D. Pagliari, F. Menna, R. Roncella, F. Remondino, and L. Pinto, “Kinect fusion improvement using depth camera calibration,” The International Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences, vol. 40, no. 5, p. 479, 2014. [6] D. Nistér, “Preemptive ransac for live structure and motion estimation,” Machine Vision and Applications, vol. 16, no. 5, pp. 321–329, 2005. [7] S. Thrun et al., “Robotic mapping: A survey,” Exploring artificial intelligence in the new millennium, vol. 1, pp. 1–35, 2002. [8] H. Durrant-Whyte and T. Bailey, “Simultaneous localization and mapping: part i,” Robotics & Automation Magazine, IEEE, vol. 13, no. 2, pp. 99–110, 2006. [9] S. Izadi, D. Kim, O. Hilliges, D. Molyneaux, R. Newcombe, P. Kohli, J. Shotton, S. Hodges, D. Freeman, A. Davison et al., “Kinectfusion: real-time 3d reconstruction and interaction using a moving depth camera,” in Proceedings of the 24th annual ACM symposium on User interface software and technology. ACM, 2011, pp. 559–568. [10] P. Axelsson, “Processing of laser scanner data-algorithms and applications,” ISPRS Journal of Photogrammetry and Remote Sensing, vol. 54, no. 2, pp. 138–147, 1999. [11] J. Geng, “Structured-light 3d surface imaging: a tutorial,” Advances in Optics and Photonics, vol. 3, no. 2, pp. 128–160, 2011. [12] S. Foix, G. Alenya, and C. Torras, “Lock-in time-of-flight (tof) cameras: a survey,” Sensors Journal, IEEE, vol. 11, no. 9, pp. 1917– 1926, 2011. [13] K. Khoshelham and S. O. Elberink, “Accuracy and resolution of kinect depth data for indoor mapping applications,” Sensors, vol. 12, no. 2, pp. 1437–1454, 2012. [14] J. Smisek, M. Jancosek, and T. Pajdla, “3d with kinect,” in Consumer Depth Cameras for Computer Vision. Springer, 2013, pp. 3–25. [15] A. Corti, S. Giancola, G. Mainetti, and R. Sala, “A metrological characterization of the kinect v2 time-of-flight camera,” Robotics and Autonomous Systems, vol. 75, pp. 584–594, 2016. [16] R. A. Newcombe, S. Izadi, O. Hilliges, D. Molyneaux, D. Kim, A. J. Davison, P. Kohi, J. Shotton, S. Hodges, and A. Fitzgibbon, “Kinectfusion: Real-time dense surface mapping and tracking,” in Mixed and augmented reality (ISMAR), 2011 10th IEEE international symposium on. IEEE, 2011, pp. 127–136. [17] P. J. Besl and N. D. McKay, “Method for registration of 3-d shapes,” in Robotics-DL tentative. International Society for Optics and Photonics, 1992, pp. 586–606. [18] K.-L. Low, “Linear least-squares optimization for point-to-plane icp surface registration,” Chapel Hill, University of North Carolina, vol. 4, 2004. [19] S. Rusinkiewicz and M. Levoy, “Efficient variants of the icp algorithm,” in 3-D Digital Imaging and Modeling, 2001. Proceedings. Third International Conference on. IEEE, 2001, pp. 145–152. [20] B. I. des Poids et Mesures, “Evaluation of measurement data guide for the expression of uncertainty in measurement. JCGM 100: 2008.” [21] J. Sturm, N. Engelhard, F. Endres, W. Burgard, and D. Cremers, “A benchmark for the evaluation of rgb-d slam systems,” in Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on. IEEE, 2012, pp. 573–580. [22] M. K. Paul, K. Wu, J. A. Hesch, E. D. Nerurkar, and S. I. Roumeliotis, “A comparative analysis of tightly-coupled monocular, binocular, and stereo vins,” in Robotics and Automation (ICRA), 2017 IEEE International Conference on. IEEE, 2017, pp. 165–172. [23] K. Wu, A. Ahmed, G. A. Georgiou, and S. I. Roumeliotis, “A square root inverse filter for efficient vision-aided inertial navigation on mobile devices.” in Robotics: Science and Systems, 2015. [24] G. Huang, M. Kaess, and J. J. Leonard, “Towards consistent visualinertial navigation,” in Robotics and Automation (ICRA), 2014 IEEE International Conference on. IEEE, 2014, pp. 4926–4933. [25] M. Li and A. I. Mourikis, “High-precision, consistent ekf-based visualinertial odometry,” The International Journal of Robotics Research, vol. 32, no. 6, pp. 690–711, 2013. [26] A. I. Mourikis and S. I. Roumeliotis, “A multi-state constraint kalman filter for vision-aided inertial navigation,” in Robotics and automation, 2007 IEEE international conference on. IEEE, 2007, pp. 3565–3572. [27] A. Martinelli, “Vision and imu data fusion: Closed-form solutions for attitude, speed, absolute scale, and bias determination,” IEEE Transactions on Robotics, vol. 28, no. 1, pp. 44–60, 2012. [28] G. Ligorio and A. M. Sabatini, “Extended kalman filter-based methods for pose estimation using visual, inertial and magnetic sensors: Comparative analysis and performance evaluation,” Sensors, vol. 13, no. 2, pp. 1919–1941, 2013. [29] S. Leutenegger, S. Lynen, M. Bosse, R. Siegwart, and P. Furgale, “Keyframe-based visual–inertial odometry using nonlinear optimization,” The International Journal of Robotics Research, vol. 34, no. 3, pp. 314–334, 2015. [30] C. Forster, L. Carlone, F. Dellaert, and D. Scaramuzza, “Imu preintegration on manifold for efficient visual-inertial maximum-a-posteriori estimation.” Georgia Institute of Technology, 2015. [31] U. Qayyum, J. Kim et al., “Inertial-kinect fusion for outdoor 3d navigation,” in Australasian Conference on Robotics and Automation (ACRA), 2013. [32] K. Konolige, M. Agrawal, and J. Sola, “Large-scale visual odometry for rough terrain,” in Robotics research. Springer, 2010, pp. 201–212. [33] S. Weiss, M. W. Achtelik, S. Lynen, M. Chli, and R. Siegwart, “Realtime onboard visual-inertial state estimation and self-calibration of mavs in unknown environments,” in Robotics and Automation (ICRA), 2012 IEEE International Conference on. IEEE, 2012, pp. 957–964. [34] J. Zhang and S. Singh, “Enabling aggressive motion estimation at lowdrift and accurate mapping in real-time,” in Robotics and Automation (ICRA), 2017 IEEE International Conference on. IEEE, 2017, pp. 5051–5058. [35] N. Brunetto, S. Salti, N. Fioraio, T. Cavallari, and L. Stefano, “Fusion of inertial and visual measurements for rgb-d slam on mobile devices,” in Proceedings of the IEEE International Conference on Computer Vision Workshops, 2015, pp. 1–9. [36] L. Ma, J. M. Falquez, S. McGuire, and G. Sibley, “Large scale dense visual inertial slam,” in Field and Service Robotics. Springer, 2016, pp. 141–155. [37] A. Concha, G. Loianno, V. Kumar, and J. Civera, “Visual-inertial direct slam,” in Robotics and Automation (ICRA), 2016 IEEE International Conference on. IEEE, 2016, pp. 1331–1338. [38] M. Nießner, A. Dai, and M. Fisher, “Combining inertial navigation and icp for real-time 3d surface reconstruction.” in Eurographics (Short Papers), 2014, pp. 13–16. [39] B. Pfrommer, N. Sanket, K. Daniilidis, and J. Cleveland, “Penncosyvio: A challenging visual inertial odometry benchmark,” in Robotics and Automation (ICRA), 2017 IEEE International Conference on. IEEE, 2017, pp. 3847–3854. [40] M. Harris, S. Sengupta, and J. D. Owens, “Parallel prefix sum (scan) with cuda,” GPU gems, vol. 3, no. 39, pp. 851–876, 2007. [41] S. Holzer, R. B. Rusu, M. Dixon, S. Gedikli, and N. Navab, “Adaptive neighborhood selection for real-time surface normal estimation from organized point cloud data using integral images,” in Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on. IEEE, 2012, pp. 2684–2689. [42] R. Y. Tsai and R. K. Lenz, “A new technique for fully autonomous and efficient 3d robotics hand/eye calibration,” IEEE Transactions on robotics and automation, vol. 5, no. 3, pp. 345–358, 1989. [43] R. B. Rusu and S. Cousins, “3D is here: Point Cloud Library (PCL),” in IEEE International Conference on Robotics and Automation (ICRA), Shanghai, China, May 9-13 2011.
1cs.CV
Hi, how can I help you?: Automating enterprise IT support help desks Senthil Mani1 , Neelamadhav Gantayat1 , Rahul Aralikatte1 , Monika Gupta1 {sentmani, neelamadhav, rahul.a.r, monikgup}@in.ibm.com Sampath Dechu1 , Anush Sankaran1 , Shreya Khare1 {sampath.dechu, anussank, shkahre4}@in.ibm.com Barry Mitchell2 , Hemamalini Subramanian2 , Hema Venkatarangan2 arXiv:1711.02012v1 [cs.CL] 2 Nov 2017 [email protected], {hesubram, hema.sudarshan}@in.ibm.com 1 2 IBM Reseach IBM Global Business Services Abstract Question answering is one of the primary challenges of natural language understanding. In realizing such a system, providing complex long answers to questions is a challenging task as opposed to factoid answering as the former needs context disambiguation. The different methods explored in the literature can be broadly classified into three categories namely: 1) classification based, 2) knowledge graph based and 3) retrieval based. Individually, none of them address the need of an enterprise wide assistance system for an IT support and maintenance domain. In this domain the variance of answers is large ranging from factoid to structured operating procedures; the knowledge is present across heterogeneous data sources like application specific documentation, ticket management systems and any single technique for a general purpose assistance is unable to scale for such a landscape. To address this, we have built a cognitive platform with capabilities adopted for this domain. Further, we have built a general purpose question answering system leveraging the platform that can be instantiated for multiple products, technologies in the support domain. The system uses a novel hybrid answering model that orchestrates across a deep learning classifier, a knowledge graph based context disambiguation module and a sophisticated bag-of-words search system. This orchestration performs context switching for a provided question and also does a smooth hand-off of the question to a human expert if none of the automated techniques can provide a confident answer. This system has been deployed across 675 internal enterprise IT support and maintenance projects. 1 Introduction One of the long-term goals of AI is to have a system answering complex questions asked in natural language. The term question answering (QA) has a very broad interpretation enabling almost any problem to be formulated as one. The problem of QA originated decades ago with research focused on retrieving answers from structured databases. AI has aided the growth of QA systems in more challenging settings with better natural data understanding. QA systems have undergone a revolution in inferring from various information sources such as unstructured web content, Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. large-scale document corpus and provide more cognitive responses (Fang et al. 2016). Based on the response provided, QA systems can be broadly classified into two groups: i) factoid based systems, which generally answer ‘wh’ questions. The answer is typically an entity with one or few words (Xu et al. 2015) (Oh et al. 2016), ii) non-factoid based systems providing complex long answers or a procedural explanation to the question. Research in factoid QA systems is very mature (Kolomiyets and Moens 2011) with lots of open domain systems available such as AskHermes (Cao et al. 2011), AnswerBus (Zheng 2002), QANUS (Ng and Kan 2015), YodaQA (Baudiš and Šedivỳ 2015), Sirius (Hauswald et al. 2015), and DEQA (Lehmann et al. 2012). Publicly available large-scale knowledge bases, such as FreeBase, are manually curated to learn and benchmark factoid based QA systems (Yao and Van Durme 2014) (Bordes et al. 2015). However, going beyond factoid QA systems, i.e. retrieving long answers is extremely challenging both in defining what constitutes an answer chunk and in evaluating the retrieval performance (Yang et al. 2016). In such nonfactoid systems, generating syntactically correct long procedural answers is challenging, compelling the use of classification or search based approaches for such tasks (Clark et al. 2016) (Mitra and Baral 2015). In enterprise IT, one of the main sources of income is providing support to clients. In 2012, the IT support industry revenue in the U.S. alone was estimated to be $212 billion (Shapiro 2014). This is an area where even simple automations can bring about a huge financial impact. (Chen, Chiang, and Storey 2012) studied how intelligent systems can make this sector more profitable. In this work, we present a platform which is developed and deployed inside IBM to share the load of IT support agents. This system is a classical case of a QA system where the answers are not factoid but are long explanatory answers which often contain multiple steps describing the solution to a problem. The success of such a system in enterprise depends on many factors like: i) accuracy of the answers ii) speed of answer generation/retrieval iii) ability to rapidly ingest new data. Consider this example from the banking domain: “How can I get a card?”. It is the responsibility of a system to respond incomplete/generic questions. To do this, we need a robust technique which will just not try to answer the question right away but asks for more information to build a clear context. Any single technique will not be able to accomplish this and therefore an ensemble of different techniques are required to work together to understand the question, identify the gaps in the information given by the user and then answer the question in a meaningful manner. To cater to such situations, we have built a platform which can do the following with no assistance from a human. 1. Knowledge ingestion: The system has the ability to assimilate knowledge from multiple sources. The sources currently supported are unstructured documents (.docx, .pptx, .pdf, .html), images, audio and video recordings. 2. Dynamic Disambiguation: If the input question is incomplete and/or extra information is required for answering the question with high confidence, the system asks a counter question to the user rather than provide a generic answer 3. Orchestration: There are multiple components in the system which can provide the answer in different situations. Therefore, we have built a separate orchestrator which decides which component to call under what circumstances to maximize the likelihood of getting a correct answer 4. Effective addition of human-in-the-loop: Even with all our efforts, there will always be questions that a machine can never answer. To handle such cases, the orchestration mechanism is built with the ability to automatically handoff a question to a human agent who can then carry forward the conversation started by the system 5. Continuous learning: The system never stops learning. It monitors i) the user’s feedback after every dialog turn and ii) the conversations between the user and the system/agent to improve its knowledge store Further, once the answer has been identified, if there is a back-end fix which needs to be performed to completely resolve the problem, the platform automatically executes an appropriate automaton with the user’s permission. For example, if the user’s problem was that he is not able to log into a system, the platform, after narrowing down to a high confidence solution, asks the consumer whether it should reset his password. On receiving an affirmative response, the reset process is performed, hence automating the end-to-end IT technical support process. This platform is currently being used by close to 1300 internal enterprise IT support and maintenance projects. 2 System architecture This platform consists of three major components: (i) an ingestion component which converts raw data in various formats into structured knowledge, (ii) cognitive component which learns and indexes the answer for a question through multiple techniques, and (iii) the assistant component which interacts with the end user and orchestrates across the cognitive component to fetch the answer. In this section, we discuss these components in detail 2.1 Knowledge Curation Enterprise knowledge is dispersed across multiple system (incident management systems, document management systems etc.) and formats (html, pdf, ppt, doc etc.). In some cases, the knowledge resides only with the SMEs. To build a question answering system, ingestion of this knowledge is fundamental. The knowledge curation component addresses this heterogeneity by enabling a crowd-sourced platform for curating QA pairs manually, mining incident logs to extract QA pairs, and understanding and extracting content from various structured and unstructured documents. Incident Analysis The success of a question answering system largely depends on understanding what are the frequently asked questions by the users and being able to address these questions. Past incidents in incident management systems can be mined to understand this insight. However, incidents contain this data (the problem reported and resolution provided) in an unstructured format. Further the quality of this data is human dependant and also prone to human error. We implemented a clustering approach to mine frequently occurring problem categories by grouping individual incidents to sets of clusters. We then extracted the most frequent problem in the cluster as the question and the corresponding resolution (if available) as the relevant answer. However, in some cases, we had to rely on manual curation of the content to create a relevant QA pair from an identified problem cluster. Crowd Sourced Curation Much of the knowledge in resolving commonly occurring user issues, is present with the SMEs who have been working in this domain. To bootstrap the system quickly with clean, noise-free QA pairs, we enabled a crowd sourced QA authoring component in our platform. SMEs could use this component to author the answers for the commonly occurring user issues. Document Ingestion The purpose of document ingestion is to break content into atomic chunks such that each chunk explains about one concept. The document ingestion pipeline handles .doc, .docx, .ppt, .pptx, and .pdf files in two major steps. In the first step, Apache POI1 is used to check if the document has good formatting i.e. the content is structured with headings and sub-headings. If they are not formatted in this way, we use some structural heuristics and Latent Semantic Indexing (Hofmann 1999) to induce formatting into the documents. The structured document in then converted into HTML using Apache TIKA2 . Post processing is performed on the HTML chunks to fix any discrepancies or incorrect chunking. The processed chunks are then indexed using Apache Lucene3 to enable fast retrieval. This 1 https://poi.apache.org/ https://tika.apache.org/ 3 http://lucene.apache.org/ 2 SME Support agent End user Ingestion Raw Data Media management system Documentum Document management system Sharepoint Ticket management system Service Now Automatic annotation Knowledge Language & Acoustic modelling Conversion and chunking module Apache Tika, Poi QA generation image Search index Crowd sourced curation Lucene text Dialog iSight Entity & Intent extraction Tesseract LOTJ Automatic curation Database Orchestrator DB2, Mongo Assistant Heuristics SRL, NLG Incident analysis Ensemble KG builder Dependency parsing Dynamic disambiguation Heuristics X` Resolution automation Custom automata Question classifiers CNN, SVM Cognition Figure 1: Overall architecture diagram of our platform pipeline maintains the styles, formatting, tables, images, etc in the documents so that they can be displayed in an aesthetically pleasing manner to the user. Multi-Media Ingestor In an enterprise, there exist typically knowledge transfer sessions about applications in recorded video formats. These are sessions conducted by an outgoing vendor to the service provider receiving the maintenance contract of the client IT systems. However, knowledge contained in such videos remain inaccessible because it is laborious for the support agent to get the relevant information, as these videos stretch over couple of hours of knowledge transfer sessions. Further, these videos generally show a screen capture of a running application or programs and the related audio contains the relevant correlated information. Our ingestor component is an ensemble of audio processing techniques which enables support agent to retrieve relevant video snippets based on a query. The main aim of this component is to convert the information contained in the video to a richly annotated text format so that it can be indexed in the same way as documents. The implementation details are listed below. 1. Noise Removal: Adaptive filtering (Sambur 1978) is used to remove the noise present in the audio channel which may have seeped in due to the recording environment, microphone processing algorithms, etc. 2. Speech To Text: The filtered audio is then converted into time stamped text using Automatic Speech Recognition (ASR). With the application of deep learning techniques, ASR performance has improved dramatically with word error rate dropping to about 6% from 14% a few years ago (Deng, Hinton, and Kingsbury 2013). We use our proprietary speech to text service which has been shown to have a state-of-the-art word-error rate of 5.5% (Saon et al. 2017). We use WaveNet (Oord et al. 2016) and a custom LSTM for language modelling, and an ensemble of three neural networks for acoustic modelling viz., i) an LSTM with multiple feature inputs, ii) an LSTM trained with speaker-adversarial multi-task learning and iii) a residual net (ResNet) with 25 convolutional layers and timedilated convolutions. This process produces word-level time stamped text without punctuations from the audio content. 3. Transcript Enrichment: The transcripts obtained from the previous step lack punctuation, and sentence level time-stamps. Lack of punctuations limits the use of these transcripts for subsequent machine processing like machine translation, question answering etc. It is impossible to perform phrase level (contiguous and non-contiguous words) or topic based searches if we cannot identify or segment the obtained transcript into sentences. Therefore, we trained a bi-directional recurrent neural network (BRNN) model with attention similar to (Tilk and Alumäe 2016). It takes in a sequence of words with no punctuation and outputs punctuated text. 4. Indexing and Search Finally, the transcripts are indexed with Lucene. This allows us to indirectly search the content of videos using its transcripts. We use Lucene’s highlights and Extended Dismax Query Parser (edismax) to retrieve contiguous and non-contiguous text (and hence video) fragments respectively. This allows the user to have a seamless experience of playing the video from the exact moment where a topic of interest starts. Question & Answer Generation One of the important goals of our system is to reduce the effort of manual curation. Hence, it is essential to identify QA pairs directly from the documents and videos that are ingested for a project. Figure 2a shows the various sub-components of a QA pair generation pipeline. Currently, we create questions from ‘factual’ sentences and ‘mention’ sentences. Factual sentences are those which contain one or more atomic facts. For eg: “A credit card is a standalone lending instrument.”. Mention sentences are those which talk about a location such as “the following table...”, “the above figure...”, etc. We briefly ex- Sentence Processing plain each subcomponent of this pipeline below. 1. Sentence filtering: We identify important sentences from a chunk of text which are candidates for QA pair generation. We achieve this by first creating an extractive summary using TextRank algorithm (Mihalcea and Tarau 2004) retaining 10% of the sentences. Further, we filter the sentence using a domain specific glossary constructed automatically by using tf-idf scores from the domain corpus. 2. Sentence simplification: The candidate sentences can sometime be complex in nature. Such sentences are broken into simpler ones using (Heilman and Smith 2010), such that the truth value of the simpler sentences are always true. 3. Sentence parsing: The candidate set of sentences are parsed using Semantic Role Labeling (SRL) (Pradhan et al. 2004) to get the constituents. For each predicate in a sentence, further identified constituents which are either a semantic role (agent, patient, instrument, etc.) or an adjunct (location, manner, temporal etc.). We implemented the SRL using a SVM (Cortes and Vapnik 1995) trained on the WSJ corpora from the PTB dataset (Marcus et al. 1994). These semantic labels are used to form grammatically correct questions following the rules described next. 4. Question formation rules: We identify the question type (Who, What, How, When etc.) to be generated for each constituent of a predicate based on the combination of semantic role and the named entity class . For e.g if the word is a constituent, the role is an agent and named entity class is a person, then we generate a Who question. We constructed 42 such static rules (similar to (Mannem, Prasad, and Joshi 2010)) based on the combination of constituent, role and named entity class. 5. Question Generation: For each candidate sentence, we use SimpleNLG4 an open-source library for generating natural language question based on thier SRL annotations and the type of question identified in the previous steps. 6. Question Filtering: The questions generated can sometimes be grammatically incorrect or too generic and not relevant to the domain. We use some heuristics such as length of the question, presence of a noun phrase, etc. to retain high quality questions and discard others. 2.2 Cognitive Component In this section, we talk about the core cognitive component of the platform. This layer uses the knowledge ingested in the previous stages to answer questions from the users. There are three components in this layer, each of which takes a different approach to tackle the user’s questions. • QA classifiers: We can look at QA as a question classification problem. One or more questions in the ingested QA pairs can have the same answer. The first question for which a new answer is written/ingested becomes a ‘primary question‘ and all other questions which have the 4 https://github.com/simplenlg Sentence Filtering Sentence Simplification Question Rules Sentence Parsing (SRL) Question Filtering SimpleNLG QA Pairs Question Generation a) Debit Card Credit Card 1 New Duplicate 3 2 Get 4 b) Figure 2: a) Question generation pipeline. b) Knowledge graph created on the resultant questions. same answer become it’s ‘alternate questions’. Each primary question and it’s corresponding alternate questions form a class. The purpose of these classifiers is to classify incoming questions into one of these classes. A simple SVM and an advanced CNN classifier are built to suit the needs of different users • Dynamic Disambiguation: Sometimes the users’ questions are not complete. Additional information/context is required before the classifiers can classify the question correctly with a high confidence score. A sophisticated disambiguation module is built to deal with such cases of incomplete data. A knowledge graph is built using the ingested data and is used by the disambiguation module to identify the gaps in the user’s question and ask for relevant information • Search: If a question cannot be classified with confidence even after getting missing information from the user, a simple tf-idf and bag of words based language model is used to search for similar sentences and retrieve them QA Classifiers There are two types of classifiers in our platform which can be configured for a project based on users’ specific needs: i) Dependency based CNN classifier (DCNN) and ii) Support Vector Classifier (SVC). There is a trade off between time taken to train and accuracy between these two classifiers. If there is need at the project level, to have an incoming question/answer pair to be available immediately as part of the classifier (especially when the new answer is introducing a new class), then SVC is preferred as it can be trained in a couple of minutes. However, if the project is comfortable with a delay in the incoming question/answer pair’s availability in the classifier, then DCNN is preferred. The details of the classifiers are explained below. 1. Dependency based CNN Classifier We used CNNs because (Ruder, Ghaffari, and Breslin 2016) showed that CNNs give better classification accuracy on short pieces of text when compared to RNNs. The DCNN classifier is similar to the model proposed in (Kim 2014), but it also considers the ancestor and sibling words in a sentence’s dependency tree. Here, we consider two types of convolutions: Convolutions of ancestor paths and Convolutions on Siblings. For a detailed explanation of these convolutions, please see (Ma et al. 2015). We use max-over-time pooling (Kim 2014) to get the maximum activation over the feature maps. In DCNNs, we want the maximum activation from the feature map across the whole dependency tree (whole sentence). This is also called ‘max-over-tree’ pooling (Ma et al. 2015). Thus, each filter outputs only one feature vector after pooling. The final representation of a sentence will be many such features, one from each of the filters in the network. These feature vectors are finally passed on to a fully connected layer for classification. The model we built is similar to what is done in (Ma et al. 2015). We concatenated the feature maps obtained from ancestor path and sibling convolutions with the sequential n-gram representation. The concatenation with the sequential n-gram representation was required since the questions that the model is being trained on may contain grammatical flaws which will result in parsing errors during dependency tree construction, but these parsing errors do not affect the sequential representation. 2. Support Vector Classifier A standard Support Vector Classifier with a linear kernel is used with a one-vs-rest scheme for multi-class support. We trained it with L2 penalty and hinge loss. We built it using the liblinear library (Chang and Lin 2011) written in C. This makes it extremely fast to train and deploy. Dynamic Disambiguation Consider an example from the banking support domain, where a customer asks a question like ‘How do I get a card?’. This is a very generic question and the QA classifier classifies it into multiple semantically related classes such as: 1. How can I get a new debit card? 2. What is the process to get a new credit card? 3. I want a duplicate debit card 4. How do I get a duplicate credit card? The confidence scores of these classifications are not high as all these questions are similar to each other. Therefore, when the highest confidence from the classifiers go below a configurable threshold, the dynamic disambiguation module is invoked. The user is asked to clarify the intent with a question like ‘Do you need a Debit Card or Credit Card?’. Based on the response, further disambiguating question like ‘Do you want to apply for a new card or a duplicate card?’ is posted. Once these relevant information are obtained, the context becomes clear and the classifier can easily identify the relevant QA pair and display the correct answer. To perform such disambiguations, we constructed a knowledge graph (KG) on the fly using the top-k QA pair returned by the classifiers. The KG is a bipartite graph where all the concepts like noun phrases, verb phrases, etc. form one group and the references to the questions form another group as shown in 2b. These concepts are extracted using dependency parsing (De Marneffe and Manning 2008b) (De Marneffe and Manning 2008a). Similar concept buckets are identified from the first group and one question is asked for each bucket. The questions are usually very simple and hence are template based. Once the user clarifies the concept(s) she is interested in, the answer which is connected to those concept(s) is shown. Search A tf-idf based search system is built on top of Apache Lucene. Lucene offers an O(n) search time, where the text chunks (from the document and AV ingestion pipelines) are indexed using a simple bag-of-words scheme. For an input question, the ten most similar documents/videos along with the closely related chunks are extracted by checking for maximum cosine similarities on their tf-idf representations. Resolution Automation Sometimes it is not enough to just provide a solution to a user’s problem. For eg., if the user is facing an issue during login, it would be a great user experience if the password is reset by the system directly, rather than giving out the instructions for the user to do the same. Therefore our platform supports an automaton to be attached to an answer. When displaying such an answer, the user is alerted to the possibility of the system taking some corrective action on their behalf. If the user agrees, the automaton is executed by the system and the problem is resolved. 2.3 Assistant The main purpose of the Assistance layer is to hide the complexities of the system from the users and provide them with an easy to use interface. The user can interact with our platform in two ways: text and images. The user can ask a question or can upload a screenshot of the error he is facing. The output of the system is always rich text. This layer contains five components, namely: 1. iSight: If the user chooses to upload an error screenshot, this component extracts information about the error and certain UI artifacts which may help in resolving the error 2. Dialog: This is a standard dialog module which takes in user’s natural language inputs and converts it into a structured and annotated format understandable by the orchestrator. It also takes in output from the orchestrator and generates natural language text for the user to read 3. Orchestractor: As the name suggests, this component orchestrates among all the components of the brain to get a single answer and show it to the user 4. LOTJ: This Learning On The Job component constantly listens to the interactions between the user, the orchestrator and the support agent to identify new tidbits of information which is ingested into the system as new knowledge usable in future conversations Figure 3: An example screenshot image of a SAP system having an error message displayed. The user query input to find a solution for the error was, “How to fix error in CO object?”. Figure 4: The resulting image of the proposed image preprocessing and enhancement pipeline on which the Tesseract OCR is performed. iSight Sometimes it is easier for the users to upload the screenshot of an error they are facing rather than describing it in text. Consider Figure 3 which shows an error in an SAP system UI (the red fields). It may be difficult for a novice user to describe this error and hence might end up asking a generic question like “How to fix error in CO object?”. This will result in a unnecessary disambiguation process in this context, which can be avoided if the system accepts the error screen shot directly and parses them to identify the errors accurately. We used the Tesseract OCR (Smith 2007) library to extract text from an image. Upon initial testing, we found out that the performance of Tesseract’s text extraction is influenced by, (i) font size, (ii) font color, (iii) background color, and (iv) font type. Hence, we built the following image preprocessing pipeline to enhance the text in screenshot images: i) Converted RGB color to grayscale for withering the effect of font and background colors ii) Removed the effect of font types such as bold and italics, by sharpening the text using two levels of Difference of Gaussians iii) Normalized the font size by enhancing the resolution of the images (superresolution) using bicubic interpolation iv) converted the image into a binary format by performing adaptive threshold- ing using Otsu’s algorithm and v) completed the binarization loss through one level of dialation using a square structuring element. The resulting enhanced screenshot image is shown in Figure 4 from which text is extracted using Tesseract. A general purpose English dictionary along with a domain specific vocabulary built using ingested documents is used to correct spellings in the OCR extracted text. Further, a simple classifier is used to recognize the application to which this UI screenshot belongs to and heuristics are applied to extract the error message and meta information. This is then restructured appropriately and fed into the orchestrator for further processing. Dialog This component does a two way conversion between natural language and a structured data format understandable by the system. It extracts the intent in the user’s question and the relevant entities the question is talking about. These intents are entities are then processed and enriched using a fuzy matching algorithm (Baeza-Yates and G. Navarro 1999) before being sent to the orchestrator. Orchestrator The orchestrator component acts as a middleman between the user and the platform. It communicates with all the components in the cognitive component to get relevant answers and decides what to show to the user. It also gathers feedback from the user at every step to identify it’s own shortcomings. The major steps taken by the orchestrator when a new conversation starts with a user is as follows: i) The user either uploads a screenshot or enters a question which is then pre-processed to a structured format and given to the orchestrator ii) The orchestrator initially contacts the classifiers to get top-k answers for the question asked and their confidence scores iii) If the confidence of an answer is greater than a threshold, the answer is shown. Else, the dynamic disambiguation module is called and the orchestrator asks counter questions to the user to clarify the context iv) After clarification, if the confidence of the classifiers increase above the threshold, the answer is shown to the user. Else, the search module is invoked vi) If the high confidence answer shown to the user has a automaton attached to it, the orchestrator takes the user’s permission and executes the automaton vii) At any time, if the user is not happy with the answer provided, the orchestrator does a smooth hand-off to a human agent Learning on the job The purpose of this module is to identify new QA pairs which can be harvested from interactions with the system. It does so in two ways: i) whenever the search module is invoked and the user provides a positive feedback on a document/AV chunk, the LOTJ module associates the question asked by the user to this chunk and forms a new QA pair and updates the associated weight based on the frequency. If this weight becomes greater than a pre-defined threshold, the QA pair is ingested into the system ii) when the user is dissatisfied with the answers given by the system and a hand-off is made to the human agent, the LOTJ component listens to the conversation between the user and the agent to identify potential QA pairs, updates the associated weights and the same process is followed as Metric Value Projects 675 Users 5800 Avg. users / project 86 Total QA Pairs 306930 Avg. QA pairs / project 454.7 Queries per day 453 Avg. time saved / user 455 Minutes Questions answered by a) Classifiers 106033 b) Dynamic Disambiguation 12590 c) Search 113351 Table 1: Usage summary of the solutions in production before. At any point in time, the support agents can see the potential QA pairs created by the LOTJ module. They can then edit them if required and approve/reject them for immediate ingestion. Thus, this module provides a non-intrusive way of accumulating new knowledge. 3 Business Impact Our platform has enabled the deployment of multiple general purpose assistance solutions to reduce the time taken to resolve incidents, automate the resolution of incidents and reduce incident volumes resulting in support agent productivity improvement. Some of the solutions built on our platform are: 1. Employee Assist: Assistance to business users; helping them tackle day-to-day issues they face while interacting with various applications (like HR portal, Travel portal, etc) and there by reducing the overall volume of incidents raised 2. Agent Assist: Assistance to support agents (L1/L2) in helping them resolve incidents faster 3. Coding Assist: Assistance to SAP ABAP programmers to help improve their productivity in development of custom ABAP modules 4. Dynamic Automation: Automating the execution of typical service requests orchestrating across robotic process automatons, thereby reducing the need for a human in the loop. These solutions have been deployed across multiple accounts and helped significantly in revenue generation and savings. Table 1 summarizes current usage of these solutions in a production environment. Here are some actual quotes from the user community who have actively adopted our solutions: 1. “Using Agent Assist we are able to resolve tickets faster. This one implementation has given a lot of mindshare with the client and is a key ingredient in our contract renewal proposal with the client” 2. “Over 30+ support agents were able to use the solution to resolve 30% of the tickets. Saving time on ticket resolution means helping end users quicker, and reducing the effort and cost required to support the application in question. Win-win!’ 3. “We are thrilled to have a successful commercial deployment of the automation solution. This kind of automation is becoming a fundamental way GBS delivers services, a definite stepping stone towards self healing applications and wider process integration” We have a dedicated development team of around 30 people including testers as part our services business units who manage this product following an agile development methodology. There are monthly releases consisting of new enhancements and bug fixes, following our own devops pipeline to build, test and deploy the solutions to production. 4 Conclusion We have developed a cognitive QA platform aimed at automating enterprise help desks for IT support and maintenance. A generic orchestration framework is designed that integrates diverse QA methods and performs context switching in real-time to combine the advantages of the individual methods. We also discuss knowledge ingestion, training & configuration, the user experience and the continuous learning & adaptation aspects of this system. We also emphasize on how including a human expert in the loop guarantees a high-quality user experience. Currently, the QA system provides support to 675 enterprise projects, thereby improving support agent productivity while reducing the turnaround time for incident resolution and also attracting a huge revenue. References [Baeza-Yates and G. Navarro 1999] Baeza-Yates, and G. Navarro, R. 1999. Faster approximate string matching. Algorithmica 23(2):127–158. [Baudiš and Šedivỳ 2015] Baudiš, P., and Šedivỳ, J. 2015. Modeling of the question answering task in the yodaqa system. In International Conference of the Cross-Language Evaluation Forum for European Languages, 222–228. [Bordes et al. 2015] Bordes, A.; Usunier, N.; Chopra, S.; and Weston, J. 2015. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075. [Cao et al. 2011] Cao, Y.; Liu, F.; Simpson, P.; Antieau, L.; Bennett, A.; Cimino, J. J.; Ely, J.; and Yu, H. 2011. Askhermes: An online question answering system for complex clinical questions. Journal of biomedical informatics 44(2):277–288. [Chang and Lin 2011] Chang, C.-C., and Lin, C.-J. 2011. Libsvm: A library for support vector machines. ACM Trans. Intell. Syst. Technol. 2(3):27:1–27:27. [Chen, Chiang, and Storey 2012] Chen, H.; Chiang, R. H.; and Storey, V. C. 2012. Business intelligence and analytics: From big data to big impact. MIS quarterly 36(4):1165– 1188. [Clark et al. 2016] Clark, P.; Etzioni, O.; Khot, T.; Sabharwal, A.; Tafjord, O.; Turney, P.; and Khashabi, D. 2016. Combining retrieval, statistics, and inference to answer elementary science questions. AAAI Conference on Artificial Intelligence. [Cortes and Vapnik 1995] Cortes, C., and Vapnik, V. 1995. Support-vector networks. Machine learning 20(3):273–297. [De Marneffe and Manning 2008a] De Marneffe, M.-C., and Manning, C. D. 2008a. Stanford typed dependencies manual. Technical report, Technical report, Stanford University. [De Marneffe and Manning 2008b] De Marneffe, M.-C., and Manning, C. D. 2008b. The stanford typed dependencies representation. In Coling 2008: Proceedings of the workshop on Cross-Framework and Cross-Domain Parser Evaluation, 1–8. [Deng, Hinton, and Kingsbury 2013] Deng, L.; Hinton, G.; and Kingsbury, B. 2013. New types of deep neural network learning for speech recognition and related applications: An overview. In Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, 8599–8603. IEEE. [Fang et al. 2016] Fang, H.; Wu, F.; Zhao, Z.; Duan, X.; Zhuang, Y.; and Ester, M. 2016. Community-based question answering via heterogeneous social network learning. In AAAI Conference on Artificial Intelligence. [Hauswald et al. 2015] Hauswald, J.; Laurenzano, M. A.; Zhang, Y.; Li, C.; Rovinski, A.; Khurana, A.; Dreslinski, R. G.; Mudge, T.; Petrucci, V.; Tang, L.; et al. 2015. Sirius: An open end-to-end voice and vision personal assistant and its implications for future warehouse scale computers. In ACM SIGPLAN Notices, volume 50, 223–238. [Heilman and Smith 2010] Heilman, M., and Smith, N. A. 2010. Extracting simplified statements for factual question generation. In Proceedings of QG2010: The Third Workshop on Ques-tion Generation, 11. [Hofmann 1999] Hofmann, T. 1999. Probabilistic latent semantic indexing. In Proceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval, 50–57. ACM. [Kim 2014] Kim, Y. 2014. Convolutional neural networks for sentence classification. CoRR abs/1408.5882. [Kolomiyets and Moens 2011] Kolomiyets, O., and Moens, M.-F. 2011. A survey on question answering technology from an information retrieval perspective. Information Sciences 181(24):5412–5434. [Lehmann et al. 2012] Lehmann, J.; Furche, T.; Grasso, G.; Ngomo, A.-C. N.; Schallhart, C.; Sellers, A.; Unger, C.; Bühmann, L.; Gerber, D.; Höffner, K.; et al. 2012. Deqa: deep web extraction for question answering. In International Semantic Web Conference, 131–147. [Ma et al. 2015] Ma, M.; Huang, L.; Zhou, B.; and Xiang, B. 2015. Tree-based convolution for sentence modeling. CoRR abs/1507.01839. [Mannem, Prasad, and Joshi 2010] Mannem, P.; Prasad, R.; and Joshi, A. 2010. Question generation from paragraphs at upenn: Qgstec system description. In Proceedings of QG2010: The Third Workshop on Question Generation, 84– 91. [Marcus et al. 1994] Marcus, M.; Kim, G.; Marcinkiewicz, M. A.; MacIntyre, R.; Bies, A.; Ferguson, M.; Katz, K.; and Schasberger, B. 1994. The penn treebank: annotating predicate argument structure. In Proceedings of the workshop on Human Language Technology, 114–119. Association for Computational Linguistics. [Mihalcea and Tarau 2004] Mihalcea, R., and Tarau, P. 2004. Textrank: Bringing order into texts. In Lin, D., and Wu, D., eds., Proceedings of EMNLP 2004, 404–411. Barcelona, Spain: Association for Computational Linguistics. [Mitra and Baral 2015] Mitra, A., and Baral, C. 2015. Addressing a question answering challenge by combining statistical methods with inductive rule learning and reasoning. AAAI Conference on Artificial Intelligence. [Ng and Kan 2015] Ng, J.-P., and Kan, M.-Y. 2015. Qanus: An open-source question-answering platform. arXiv preprint arXiv:1501.00311. [Oh et al. 2016] Oh, J.-H.; Torisawa, K.; Hashimoto, C.; Iida, R.; Tanaka, M.; and Kloetzer, J. 2016. A semi-supervised learning approach to why-question answering. In AAAI Conference on Artificial Intelligence. [Oord et al. 2016] Oord, A. v. d.; Dieleman, S.; Zen, H.; Simonyan, K.; Vinyals, O.; Graves, A.; Kalchbrenner, N.; Senior, A.; and Kavukcuoglu, K. 2016. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499. [Pradhan et al. 2004] Pradhan, S. S.; Ward, W. H.; Hacioglu, K.; Martin, J. H.; and Jurafsky, D. 2004. Shallow semantic parsing using support vector machines. In HLT-NAACL, 233–240. [Ruder, Ghaffari, and Breslin 2016] Ruder, S.; Ghaffari, P.; and Breslin, J. G. 2016. Character-level and multi-channel convolutional neural networks for large-scale authorship attribution. ArXiv e-prints. [Sambur 1978] Sambur, M. 1978. Adaptive noise canceling for speech signals. IEEE Transactions on Acoustics, Speech, and Signal Processing 26(5):419–423. [Saon et al. 2017] Saon, G.; Kurata, G.; Sercu, T.; Audhkhasi, K.; Thomas, S.; Dimitriadis, D.; Cui, X.; Ramabhadran, B.; Picheny, M.; Lim, L.; Roomi, B.; and Hall, P. 2017. English conversational telephone speech recognition by humans and machines. CoRR abs/1703.02136. [Shapiro 2014] Shapiro, R. J. 2014. The us software industry as an engine for economic growth and employment. Georgetown McDonough School of Business Research Paper (2541673). [Smith 2007] Smith, R. 2007. An overview of the tesseract ocr engine. In International Conference on Document Analysis and Recognition, volume 2, 629–633. IEEE. [Tilk and Alumäe 2016] Tilk, O., and Alumäe, T. 2016. Bidirectional recurrent neural network with attention mechanism for punctuation restoration. In INTERSPEECH, 3047–3051. [Xu et al. 2015] Xu, K.; Zhang, S.; Feng, Y.; Huang, S.; and Zhao, D. 2015. What is the longest river in the usa? semantic parsing for aggregation questions. In AAAI Conference on Artificial Intelligence, 4222–4223. [Yang et al. 2016] Yang, L.; Ai, Q.; Spina, D.; Chen, R.-C.; Pang, L.; Croft, W. B.; Guo, J.; and Scholer, F. 2016. Beyond factoid qa: Effective methods for non-factoid answer sentence retrieval. In European Conference on Information Retrieval, 115–128. [Yao and Van Durme 2014] Yao, X., and Van Durme, B. 2014. Information extraction over structured data: Question answering with freebase. In ACL (1), 956–966. [Zheng 2002] Zheng, Z. 2002. Answerbus question answering system. In international conference on Human Language Technology Research, 399–404.
2cs.AI
DISTRIBUTED CONVERGENCE VERIFICATION FOR GAUSSIAN BELIEF PROPAGATION Jian Du, Soummya Kar and José M. F. Moura Electrical and Computer Engineering, Carnegie Mellon University† , Pittsburgh, PA arXiv:1711.09888v1 [cs.IT] 26 Nov 2017 ABSTRACT Gaussian belief propagation (BP) is a computationally efficient method to approximate the marginal distribution and has been widely used for inference with high dimensional data as well as distributed estimation in large-scale networks. However, the convergence of Gaussian BP is still an open issue. Though sufficient convergence conditions have been studied in the literature, verifying these conditions requires gathering all the information over the whole network, which defeats the main advantage of distributed computing by using Gaussian BP. In this paper, we propose a novel sufficient convergence condition for Gaussian BP that applies to both the pairwise linear Gaussian model and to Gaussian Markov random fields. We show analytically that this sufficient convergence condition can be easily verified in a distributed way that satisfies the network topology constraint. Index Terms— graphical model, belief propagation, large-scale networks, distributed inference, Markov random field. 1. INTRODUCTION Gaussian belief propagation (BP) [1,2] provides an efficiently distributed way to compute the marginal distribution of unknown variables with a joint Gaussian distribution, and Gaussian BP has been adopted in a variety of topics including image denosing [3], distributed power state estimation [4] in smart grid, data detection for massive MIMO systems [5], distributed beamforming [6] and synchronization [7–10] in distributed networks, fast solver for system of linear equations [11], distributed rate control in ad-hoc networks [12], factor analyzer networks [13], sparse Bayesian learning [14], inter-cell interference mitigation [15], and peer-to-peer rating in social networks [16]. It has been shown that Gaussian BP computes the optimal centralized estimator if it converges [1, 2]. The challenge of deploying Gaussian BP for large-scale networks is determining if it will converge. In particular, it is generally known that, if the factor graph, which represents the joint distribution, contains cycles, the Gaussian BP algorithm may diverge. Thus, determining convergence conditions for the Gaussian BP algorithm is very important. Further, in practical applications for large-scale networks, having an easily verified sufficient convergence condi- tion is of great importance. Sufficient convergence conditions for Gaussian BP have been developed in [2, 17, 18] when the underlying Gaussian distribution is expressed in terms of Gaussian Markov random fields (GMRFs) with scalar variables. These works focus on the convergence analysis of Gaussian BP for computing the marginal distribution of a joint distribution with pairwise factors. However, as demonstrated in [1], the iterative equations for Gaussian BP on GMRFs are different from those for distributed estimation problems such as in [4,6–8,11–15], where linear Gaussian measurements are involved. Recently, the convergence properties of Gaussian BP for the linear Gaussian measurement model with vector variables have been studied in [1]. It is analytically shown that the marginal covariance for each unknown vector variable converges to a unique positive definite matrix with double exponential rate with arbitrary positive-semidefinite initial message information matrix. Further, a sufficient convergence condition that guarantees the belief mean to converge to the exact marginal mean is also given. It is also shown that this sufficient convergence condition subsumes all the previous sufficient convergence conditions in [2, 17, 18]. Though sufficient convergence conditions have been studied for both the GMRFs and linear Gaussian models, verifying these conditions all require to gather all the information together to perform centralized computation. For example, in [1], the convergence condition requires computation with complexity of O(N 3 ) of the spectrum radius of a dimensionN matrix, where N is the dimension of a vector constructed by stacking together all the mean vectors exchanged in the network at each iteration. This defeats the main advantage of low computation complexity of a distributed inference algorithm. In this paper, we present a sufficient convergence condition for Gaussian BP on both GMRFs and linear Gaussian models and demonstrate that it can be easily verified in a distributed way that respects the network topology constraints. 2. COMPUTATION MODEL 2.1. Belief Propagation The BP algorithm computes the marginal distribution/function given a factorization of the distribution/function. The factorization can be represented by a graphical model known as factor graph [19], and the BP algorithm can be expressed as message passing on the factor graph. In the factor graph, every vector variable xi is represented by a circle (called variable node) and the probability distribution of a vector variable or a group of vector variables is represented by a square (called factor node). A variable node is connected to a factor node if the variable is involved in that particular factor. For example, Fig. 1 shows the factor graph representation of a joint Gaussian distribution. The explicit functions of fi,j and fi for the linear Gaussian model and the GMRF will be given later. We next derive the BP algorithm over the corresponding factor graph. It involves two types of messages: one is the message from a variable node xj to its neighboring factor node fi,j , defined as Y (`) (`−1) mj→fi,j (xj ) = p (xj ) mfk,j →j (xj ) , (1) fk,j ∈B(j)\fi,j where B (j) denotes the set of neighbouring factor nodes of (`−1) xj , and mfk,j →j (xj ) is the message from fk,j to xj at iteration ` − 1. The second type of message is from a factor node fi,j to a neighboring variable node xi , defined as Z Z Y (`) (`) mfi,j →i (xi ) = · · · fi,j × mj→fi,j (xj )d {xj }j∈B(fi,j )\i , j∈B(fi,j )\i (2) where B (fi,j ) denotes the set of neighboring variable nodes of fi,j . The process iterates between equations (1) and (2). At each iteration `, the approximate marginal distribution, also referred to as belief, on xi is computed locally at xi as Y (`) (`) mfn →i (xi ) . (3) bBP (xi ) = p (xi ) fn ∈B(i) In the following subsections, we show the updating equations of Gaussian BP for the linear Gaussian model and the GMRF. Fig. 1. An example of factor graph representing a joint Gaussian distribution. p(xi )p(xj ) and p(zi,j , zs,t ) = p(zi,j )p(zs,t ) for {i, j} 6= {s, t}. The goal is to estimate xi , based on yi,j , p(xi ) and p(zi,j ) for all xi ∈ V. Note that in (4), yi,j = yj,i . The joint distribution p (x) p (y|x) is first written as the product of the prior distribution and the likelihood function as Y Y p(yi,j |xi , xj , {i, j} ∈ ENet ) . p (x) p (y|x) = p (xi ) | {z } | {z } i∈V i∈V ,gi (5) Following the computation rule of (2), it can be easily shown that the message from a factor that denotes prior in(`) formation is a constant, i.e., mfi →i (xi ) = p(xi ), ∀` = (`) 0, 1, . . . . Further, from (2) and (1), message mi→fi (xi ) will never be used for message updating. Therefore, we next focus on the message exchange between the factor denoting the likelihood function and its neighboring variables. It can be shown that the message from a factor node to a variable node is given by [1]  1 (`) (`) mfi,j →i (xi ) ∝ exp − ||xi − vfi,j →i ||C(`) , fi,j →i 2 2.2. Linear Gaussian Model (`−1) Consider a general connected network of M nodes, with V = {1, . . . , M } denoting the set of nodes, and ENet ⊂ V × V the set of all undirect communication links in the network, i.e., if i and j are within the communication range, (i, j) ∈ ENet . The local observations, yi,j , between node i and j are modeled by the pairwise linear Gaussian model [20, 21]: yi,j = Aj,i xi + Ai,j xj + zi,j , (4) where Aj,i and Ai,j are known coefficient matrices with full column rank, xi and xj are local unknown vector parameters at node i and j with dimension Ni × 1 and Nj × 1, and with prior distribution p(xi ) ∼ N (xi |0, Wi ) and p(xj ) ∼ N (xj |0, Wj ), and zi,j is additive noise with distribution zi,j ∼ N (zi,j |0, Ri,j ). It is assumed that p(xi , xj ) = ,gi,j (6) (`−1) where Cfi,j →i and vfi,j →i are the message covariance matrix and mean vector received at variable node i at the ` − 1 iteration with h i−1 h i−1 (`) (`) Cf →i = ATj,i Ri,j + Ai,j Cj→f ATi,j Aj,i . (7) i,j i,j and h i−1 (`) (`) vfi,j →i =ATj,i Ri,j + Ai,j Cj→fi,j ATi,j   (`) × yi,j − Ai,j vj→fi,j . (8) Furthermore, the general expression for the message from a variable node to a factor node is   1 (`) (`) , (9) mj→fi,j (xj ) ∝ exp − ||xj − vj→fi,j ||C(`) j→fi,j 2 (`) (`) where Cj→fi,j and vj→fi,j are the message covariance matrix and mean vector received at variable node j at the `-th iteration, where the inverse of the covariance matrix updating equation is given by X  (`−1) −1  (`) −1 , (10) = W−1 Cfk,j →j Cj→fi,j j + fk,j ∈B(j)\fi,j and the mean vector is  (`) (`) vj→fi,j = Cj→fi,j to a unique positive definite matrix with arbitrary positive semidefinite initial value. Thus, it is reasonable to assume (0) (`) that, for arbitrary initial value vfk,j →j , the evolution of vj→fn in (11) can be written in terms of the limit message information matrices, i.e., C∗j→fi,j and C∗fk,j →j , as (`) vj→fi,j = C∗j→fi,j  X   ∗ −1 (`−1) Cfk,j →j vfk,j →j . fk,j ∈B(j)\fi,j   (`−1) −1 (`−1) vfk,j →j . Cfk,j →j X fk,j ∈B(j)\fi,j (15) Using (8), and replacing indices j, i with k, j respectively, (`−1) vfk,j →j is given by (11) Following Lemma 2 in [1], we know that setting the initial message covariances inverse (also known as the message (0) information matrix) [Cfk,j →i ]−1  0 for all k ∈ V and i−1 h (`) vfk,j →j =ATk,j Rk,j + Aj,k C∗k→fk,j ATj,k   (`) × yk,j − Aj,k vk→fk,j . (`) j ∈ B(k) guarantees [Cj→fi,j ]−1  0 for l ≥ 1. Therefore, let the initial messages at factor node fk,j be in Gaus(0) sian function forms with covariance [Cfk,j →j ]−1  0 for all k ∈ V and j ∈ B(fk,j ). Then all the messages (`) mj→fi,j (xj ) (`) and mfi,j →i (xi ) exist and are in Gaussian form. Furthermore, during each round of message updating, each variable node can compute the belief for xi using (3), which can be easily shown to be (16) Substituting (16) into (15), we have (`) vj→fi,j = bj→fi,j −C∗j→fi,j X (`) C∗fkj →j Mk,j Aj,k vk→fk,j , fk,j ∈B(j)\fi,j (17) P where bj→fi,j = C∗j→fi,j fk,j ∈B(j)\fi,j Mk,j yk and Mk,j = i−1 h . The above equation for ATk,j Rk,j + Aj,k C∗k→fk,j ATj,k all j ∈ N (i) cases can be further written in compact form as (l) (l) (l) bi (xi ) ∼ N (xi |µi , Pi ), with the inverse of the covariance matrix h i−1 h i−1 X (l) (l) Pi = Cfi,j →i , (12) (`) vj = bj − Qj v(`−1) , (`) (13) fi,j ∈B(fi,j ) and mean vector  −1 X X   −1 (l) (l)  Cfi,j →i µi =  j∈B(fi,j ) (0) (`) with the column vector vj containing all {vj→fi,j }i∈N (j) as subvectors with ascending index on i. Similarly, bj containing all {bj→fi,j }i∈N (j) as subvectors with ascending index (`−1) h (l) Cfi,j →i i−1 (l) vfi,j →i . j∈B(fi,j ) (14) The iterative algorithm based on BP is summarized as follows. The algorithm is started by setting the mes(0) sage from factor node to variable node as mfi,j →i (xi ) = (0) (18) (0) N (xi ; vfi,j →i , Cfi,j →i ) with a random initial vector vfi,j →i on i, and v(`−1) containing vk→fk,j for all fk,j ∈ B (j) \ fi,j as subvectors with ascending index first on z and then on k. The matrix Qj is a row block matrix with component blocks 0 and C∗j→fi,j where fk,j ∈ B (j) \ fi,j . In the next subsection, we show that the convergence of Gaussian BP for GMRF also depends on an iterative equation similar to (18), and a distributed convergence condition for such iterative updating is given in the next section. 2.3. Gaussian Markov Random Field (0) and [Cfi,j →i )]−1  0. At each round of message exchange, every variable node computes the outgoing messages to factor nodes according to (10) and (11). After receiving the messages from its neighboring variable nodes, each factor node computes its outgoing messages according to (7) and (8). Such iteration is terminated when (14) converges (e.g., (`) (`−1) when kµi − µi k < η, where η is a threshold) or the maximum number of iterations is reached. Then the estimate of xi of each node is obtained as in (14). In recent work [1, 22], it is shown that the message information matrix converges with double exponential rate In the domain of physics and probability, a Markov random field (often abbreviated as MRF), Markov network, or undirected graphical model is a set of random variables having a Markov property described by an undirected graph. A multivariate normal distribution forms a GMRF with respect to a graph if the missing edges correspond to zeros on the information matrix J. We denote the normalized joint Gaussian distribution as   1 T T (19) p (x) ∝ exp − x Jx + h x 2 ∗ where Ji,i = 1 for all i. Function p(x) can always be factor∆Jj→f denote the converged fixed point, then (22) can be i,j ized as written as   Y   P Y (`−1) 1 2 J h + ∆h j,i i p(x) ∝ exp − Ji,i xi + hi xi exp (−xi Ji,j xj ). k∈N (i)\j k→fk,i (`) 2 P . (24) ∆hj→gi,j = − ∗ i∈V (i,j)∈EMRF Ji,i + k∈N (i)\j ∆Jk→f k,i We denote the the factor containing a single variable as   1 2 fi (xi ) = exp − Ji,i xi + hn xi . 2 Then similar to the analysis before (18), we have The other factor represents local correlations and contains a pair of unknown variables with ebj = − Ji,i +P (`) e j h(`−1) , {hj→fi,j }i∈N (j) = ebj − Q fi,j (xi , xj ) = exp (−xi Ji,j xj ), with Ji,j 6= 0. Following the BP message computation rule in (1) and (2), we can compute the message updating equations for messages from factor node to variable (`) node mfk,j →j (xi ) and also message from variable node to (`) mj→fi,j (xj ). factor node We omit these equations due to space limitations. Similar to the message computation of Gaussian BP for the linear Gaussian model, the computa(`) (`) tion of mj→fi,j (xj ) depends on mfk,j →j (xi ). We substitute (`) (`) mfk,j →j (xi ) into mj→fi,j (xj ) and obtain the message updating expression   1 (`) (`) (`) mj→fi,j (xj ) ∝ exp − ∆Jj→fi,j x2j + ∆hj→fi,j xj , 2 (20) with the updating parameters 2 Jj,i (`) ∆Jj→fi,j = − Ji,i + P (`−1) , (21) k∈N (i)\j ∆Jk→fk,i and (`) ∆hj→gi,j   P (`−1) Jj,i hi + k∈N (i)\j ∆hk→gk,i =− . P (`−1) Ji,i + k∈N (i)\j ∆Jk→gk,i (22)  −1In [2, Proposition 1], based on the interpretation that J i,j is the sum of the weights of all the walks from variable j to variable i on the corresponding GMRF, a sufficient Gaussian BP convergence condition known as walksummability is provided, which is equivalent to I − |R|  0, (23) together with the initial message variance inverse being set to 0, where R = I−J and |R| is the matrix of entrywise absolute values of R. However, to verify the walk-summability, one needs to compute I − J in a centralized way, which defeats the main advantage of distributed computing of Gaussian BP. Following the convergence analysis of message informa(`) tion matrix in [1], it can be shown that ∆Jj→fi,j is conver(0) gence guaranteed if the initial value is ∆Jj→fi,j = 0. Let Jj,i hi k∈N (i)\j ∗ ∆Jk→f (25) , and h(`−1) containk,i (`−1) ing hk→fk,j for all fk,j ∈ B (j) \ fi,j as components. e j is a row matrix with component 0 and The matrix Q Jj,i (`−1) P k∈N (i)\j − Ji,i +P ∆hk→f k∈N (i)\j k,i ∗ ∆Jk→f . k,i 3. DISTRIBUTED CONVERGENCE CONDITION The challenge of deploying the Gaussian BP algorithm is determining whether it will converge. In particular, it is generally known that, if the factor graph contains cycles, the BP algorithm may diverge. Thus, determining convergence conditions for the BP algorithm is very important. In loopy graphs, sufficient conditions for the convergence of Gaussian BP with vector variables for the linear Gaussian model are available in [1], and sufficient conditions for the convergence of Gaussian BP with scalar variables for GMRF are available in [2, 17]. However, checking these conditions requires centralized computation, which conflicts with the low computation complexity purpose of distributed computation. In this section, we present a sufficient convergence condition for Gaussian BP and demonstrate a distributed way to verify this condition for both the linear Gaussian model and the GMRF model. In the following, we perform the convergence analysis for the linear Gaussian model as an example, and all the analysis and results apply to the GMRF case. For arbitrary pairwise linear Gaussian model, we define the block matrix Q as   Q1  Q2    Q =  . ,  ..  QM (`) and let v(`) and b be the vector containing vj and bj respectively with the same stacking order as Qj in Q. Following (18), we have v(`) = −Qv(`−1) + b. (26) For this linear updating equation, it is known that, for arbitrary initial value v(0) , v(`) converges if and only if the spectral radius ρ (Q) < 1. In [1], the convergence condition of Gaussian BP for the linear Gaussian model is given as following.  Theorem 1. The vector sequence v(`) defined by  (26) converges to a unique value for any initial value v(0) h i−1 (0) and initial covariance matrix inverse Cfi,j →i  0 if and l=0,1,... only if ρ (Q) < 1. The above condition subsumes the walk-summability condition as shown in [1]. However, checking this condition requires computation of the spectral radius of Q with a comP|V| putational complexity of O(( i=1 Ni )3 ), which conflicts with the low computation complexity purpose for distributed inference. We next present a sufficient convergence condition and demonstrate a distributed way to verifyqthis condition. Since Q is a square matrix, we have ρ (Q) ≤ ρ(QQ ), and there- fore ρ(QQ ) < 1 is a sufficient condition for the convergence of v(`) . According to the construction of Qj , which is a row block matrix with block components 0 and C∗j→fi,j where fk,j ∈ B (j) \ fi,j , we have ∀i 6= j. Therefore, QQT is a block diagonal matrix with block diagonal elements Qj QTj , j = 1, . . . , M . Following the analysis above (18), Qj is a matrix with entries C∗j→fi,j or 0, therefore ρ(Qj QTj ) can be computed locally at node j. (0) 5. ACKNOWLEDGMENT We would like to acknowledge support for this project from the National Science Foundation (NSF grant CCF-1513936). 6. REFERENCES T T Qj QTi = 0, Gaussian model and Gaussian Markov random fields. Compared with existing convergence conditions for Gaussion belief propagation that need to gather information for centralized computation, the proposed distributed sufficient condition only involves local computation at each node, which fits well distributed computation. (l) From Theorem 1, by setting [Cfi,j →i ]−1  0, [Cfi,j →i ]−1 converges to a unique positive definite matrix. Then, accord(`) ing to (10), Cj→fi,j converges to a unique positive definite (`) matrix. Once ρ(QQT ) < 1 for all i 6= j, we know vj→fi,j , which is an entry in v(`) , converges. Then, we can conclude (l) µi in (14) converges to a fixed point µ∗i . It has already been shown that, once Gaussian belief propagation converges, it converges to the centralized optimal estimate [1, 2] for both the linear Gaussian model and the GMRFs. The above analysis also applies to Gaussian BP on GMRFs. We then have the following two theorems for the linear Gaussian model and GMRFs, respectively. Theorem 2. For the linear Gaussian model, the marginal mean computed by Gaussian BP converges to the exact mean  (0) if ρ Qj QTj < 1 and [Cfi,j →i ]−1  0 for all j ∈ V, i ∈ B(j). Theorem 3. For the GMRF, the marginal mean  computed  by T e e Gaussian BP converges to the exact mean if ρ Qj Qj < 1 (`) and ∆Jj→fi,j = 0 for all j ∈ V, i ∈ B(j) . 4. CONCLUSION This paper has established distributed sufficient convergence conditions for Gaussian belief propagation for both the linear [1] J. Du, S. Ma, Y.-C. Wu, S. Kar, and J. M. F. Moura, “Convergence analysis of distributed inference with vector-valued Gaussian belief propagation,” submitted for publication, Nov. 2016. [Preprint Available]: https: //arxiv.org/pdf/1611.02010.pdf. [2] D. M. Malioutov, J. K. Johnson, and A. S. Willsky, “Walk-sums and belief propagation in Gaussian graphical models,” Journal of Machine Learning Research, vol. 7, no. 2, pp. 2031–2064, Feb. 2006. [3] X. Lan, S. Roth, D. Huttenlocher, and M. J. Black, “Efficient belief propagation with learned higher-order Markov random fields,” in European conference on computer vision. Springer, 2006, pp. 269–282. [4] Y. Hu, A. Kuh, T. Yang, and A. Kavcic, “A belief propagation based power distribution system state estimator,” IEEE Comput. Intell. Mag., vol. 6, no. 3, pp. 36–46, Aug 2011. [5] P. Som, T. Datta, N. Srinidhi, A. Chockalingam, and B. S. Rajan, “Low-complexity detection in largedimension MIMO-ISI channels using graphical models,” IEEE Journal of Selected Topics in Signal Processing, vol. 5, no. 8, pp. 1497–1511, 2011. [6] B. L. Ng, J. Evans, S. Hanly, and D. Aktas, “Distributed downlink beamforming with cooperative base stations,” IEEE Trans. Inf. Theory, vol. 54, no. 12, pp. 5491–5499, Dec 2008. [7] J. Du and Y.-C. Wu, “Distributed clock skew and offset estimation in wireless sensor networks: Asynchronous algorithm and convergence analysis,” IEEE Trans. Wireless Commun., vol. 12, no. 11, pp. 5908–5917, Nov 2013. [8] ——, “Network-wide distributed carrier frequency offsets estimation and compensation via belief propagation,” IEEE Trans. Signal Process., vol. 61, no. 23, pp. 5868–5877, 2013. [9] J. Du and Y. C. Wu, “Fully distributed clock skew and offset estimation in wireless sensor networks,” in 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, 2013, pp. 4499–4503. [21] J. Du, S. Ma, Y. C. Wu, and H. V. Poor, “Distributed hybrid power state estimation under pmu sampling phase errors,” IEEE Transactions on Signal Processing, vol. 62, no. 16, pp. 4052–4063, 2014. [10] J. Du, X. Liu, and L. Rao, “Proactive doppler shift compensation in vehicular cyber-physical systems,” arXiv preprint arXiv:1710.00778, 2017. [22] J. Du, S. Ma, Y. C. Wu, S. Kar, and J. M. F. Moura, “Convergence analysis of the information matrix in Gaussian belief propagation,” in 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Mar. 5-9, 2017, New Orleans, LA., pp. 4074–4078. [11] O. Shental, P. Siegel, J. Wolf, D. Bickson, and D. Dolev, “Gaussian belief propagation solver for systems of linear equations,” in 2008 IEEE International Symposium on Information Theory (ISIT 2008), July 2008, pp. 1863–1867. [12] G. Zhang, W. Xu, and Y. Wang, “Fast distributed rate control algorithm with QoS support in ad-hoc,” in 2010 IEEE Global Telecommunications Conference (GLOBECOM 2010). [13] B. J. Frey, “Local probability propagation for factor analysis,” in Neural Information Processing Systems (NIPS), Dec 1999, pp. 442–448. [14] X. Tan and J. Li, “Computationally efficient sparse Bayesian learning via belief propagation,” IEEE Trans. Signal Process., vol. 58, no. 4, pp. 2010–2021, April 2010. [15] F. Lehmann, “Iterative mitigation of intercell interference in cellular networks based on Gaussian belief propagation,” IEEE Trans. Veh. Technol., vol. 61, no. 6, pp. 2544–2558, July 2012. [16] D. Bickson and D. Malkhi, “A unifying framework for rating users and data items in peer-to-peer and social networks,” Peer-to-Peer Networking and Applications (PPNA) Journal, vol. 1, no. 2, pp. 93–103, 2008. [17] Y. Weiss and W. T. Freeman, “Correctness of belief propagation in Gaussian graphical models of arbitrary topology,” Neural Computation, vol. 13, no. 10, pp. 2173–2200, Mar. 2001. [18] C. C. Moallemi and B. V. Roy, “Convergence of minsum message passing for quadratic optimization,” IEEE Trans. Inf. Theory, vol. 55, no. 5, pp. 2413–2423, 2009. [19] F. R. Kschischang, B. J. Frey, and H.-A. Loeliger, “Factor graphs and the sum-product algorithm,” IEEE Trans. Inf. Theory, vol. 47, no. 2, pp. 498–519, Feb. 2001. [20] J. Du, S. Ma, Y.-C. Wu, S. Kar, and J. M. Moura, “Convergence analysis of belief propagation for pairwise linear Gaussian models,” in 2017 IEEE Global Conference on Signal and Information Processing, Nov. 14-16, 2017, Montreal, Canada.
7cs.IT
Kernel classification of connectomes based on earth mover’s distance between graph spectra arXiv:1611.08812v1 [cs.CV] 27 Nov 2016 Yulia Dodonova1,2 , Mikhail Belyaev2,1, Anna Tkachev1 , Dmitry Petrov1,2, and Leonid Zhukov3 1 - Kharkevich Institute for Information Transmission Problems, Moscow, Russia 2 - Skolkovo Institute of Science and Technology (Skoltech), Moscow, Russia 3 - National Research University Higher School of Economics, Moscow, Russia [email protected], [email protected], [email protected], [email protected], [email protected] Abstract. In this paper, we tackle a problem of predicting phenotypes from structural connectomes. We propose that normalized Laplacian spectra can capture structural properties of brain networks, and hence graph spectral distributions are useful for a task of connectome-based classification. We introduce a kernel that is based on earth mover’s distance (EMD) between spectral distributions of brain networks. We access performance of an SVM classifier with the proposed kernel for a task of classification of autism spectrum disorder versus typical development based on a publicly available dataset. Classification quality (area under the ROC-curve) obtained with the EMD-based kernel on spectral distributions is 0.71, which is higher than that based on simpler graph embedding methods. Keywords: connectomes, machine learning, graph spectra, earth mover’s distance, kernel SVM 1 Introduction Machine learning prediction of brain disorders based on neuroimaging data has gained increasing attention in recent years. Studies aiming at predicting brain disorders based on voxel-level and region-level MRI features are reviewed in [1] and [2]; these reviews also highlight some important pitfalls of machine learning based analyses of neuroimaging data. When it comes to classification of connectomes, the task becomes even more challenging. Mathematically, the input objects of machine learning algorithms are now graphs with particular properties. Let Xi be a macroscale brain network, yi be a class label (we only deal with yi ∈ {0, 1} throughout this study). Given a training set of pairs (Xi , yi ) and the test set of input objects Xj , the task is to make a good prediction of the unknown class label yj . The task is specific because of the particular objects Xi : these are relatively small undirected fully connected graphs with weighted edges and uniquely labeled nodes which are localized in 3D space. For structural connectomes, edges are weighted proportionally to the number of streamlines between the brain regions. 2 Dodonova, Belyaev, Tkachev, Petrov, Zhukov The most obvious approach to classification within these settings would be to adopt some strategy of transforming adjacency matrices into vectors from Rp because most classifiers work with this type of input objects. In this paper, we develop a different approach. We propose that spectra of the normalized graph Laplacians can capture the most essential structural properties of brain networks. Hence, spectral distributions of brain networks can differ in normal and pathological development. To account for differences in the spectral distributions of connectomes we propose to use an earth mover’s distance (EMD), a metric that appears in transportation problem as a discretized version of the mass transportation distance. We next use the pairwise distances between spectral distributions of brain networks to construct a kernel for a support vector machines (SVM) classifier. We evaluate the proposed approach for a task of classification of autism spectrum disorder versus typical development based on a publicly available dataset. We report classification quality that is higher than that obtained based on simpler graph embedding methods. 2 Spectral representation of graphs We propose that spectra of the normalized Laplacians can be used to meaningfully represent connectomes. Given an undirected weighted graph with n nodes, we define the adjacency matrix A as the n × n matrix with entries aij , where aij is the weight between the respective nodes (the weights are not necessarily binary). We define D as the diagonal matrix of weighted node degrees: X aij . (1) di = j The normalized graph Laplacian is given by: L = D−1/2 (D − A)D−1/2 (2) For an extensive theory on the normalized Laplacian spectra, we refer to [3]. The spectra of the normalized Laplacian are particularly informative because they have some useful properties. The eigenvalues are always in range from 0 to 2; this allows the comparison of networks with different sizes. Importantly, the overall shape of the eigenvalue distribution, its symmetry and the multiplicity of particular values also capture an important information about graph structure; Figure 1 gives an example illustration on a toy network. For the formal definitions and proofs, we refer to [4]. A paper [5] also plots many examples of the spectral distributions of the normalized Laplacians of the simulated and real networks; the latter include biological networks, weblog hyperlink graphs, power grids, US football games, and many others. The authors attempt to group these networks into classes based on the shape of their spectral distributions; they suggest that the shape of the spectral distribution of the networks of a particular class can provide insights Kernel classification of connectomes based on EMD between spectra 3 Fig. 1. Some examples of how particular graph structures appear in the distributions of the normalized Laplacian spectra a graph produced from the same original matrix by doubling each vertex (left) and adding identical cliques of size 5 (middle), and the distributions of the normalized Laplacian eigenvalues of these two graphs (right). A fragment of a real unweighted connectome is used as the original matrix; Gaussian kernel density reconstruction is used to plot distributions. into their structure and growth. However, the proposed classification scheme is rough and is based only on the visual evaluation of the plotted distributions. A similar work is done in [6]. The authors compare eigenvalue distributions of the normalized Laplacians across the structural brain networks of the cat, macaque and Caenorhabditis elegans; they describe similarities in these networks and also compare them to some random networks and real networks from other domains. Based on the visual evaluation of the plotted distributions, the authors claim that the close relation between the normalized Laplacian spectra of the analyzed networks suggests shared underlying structural properties of the neuronal systems of the macaque, cat and C. elegans. They conclude that the analysis of graph spectra reveals the structural brain networks to be in a specific class of networks, distinct from the other network classes. Taken together, these papers suggest that the graph spectra can serve as informative features for the task of brain network classification. Hence, the problem of classifying graphs transforms into a problem of classifying distributions of the eigenvalues associated with these graphs. In the next section, we discuss how this can be accommodated. 3 Classification of graphs based on distance between spectral distributions As discussed above, we aim to take into account the shape of the spectral distributions and the multiplicity of particular eigenvalues rather than simply consider the eigenvalues as feature vectors. Hence, we need to introduce a distance between spectral distributions. Provided that we can measure the pairwise differences between the distributions of graph spectra, we can construct a kernel based on these differences. Afterwards, we can use the kernel trick and feed the obtained kernel to an SVM classifier. 4 3.1 Dodonova, Belyaev, Tkachev, Petrov, Zhukov SVM classifier based on a distance matrix The SVM classifier is able to accept any input objects, not necessarily a set of vectors from Rp . This means that any positive semi-definite function K(xi , xj ) : X2 → R on the input data X can be used as a kernel for the SVM classifier provided that: N X N X K(xi , xj )ci cj ≥ 0 i=1 j=1 for any (x1 , x2 , . . . , xN ) ∈ X and any coefficients (c1 , c2 , . . . , cN ) ∈ R. There are no constraints on the structure of the input data X. Examples of kernels on graphs can be found in [7] and [8]. In this study, we explore behavior of a kernel that is based on distances between graph spectral distributions. Let Si be the spectrum of a normalized Laplaian Li and ∆(Si , Sj ) be a distance between spectra Si , Sj . We build a graph kernel K using the distance δ as follows: K(Si , Sj ) = e−δ(Si ,Sj ) 3.2 (3) Earth mover’s distance between spectral distributions Hence, we need to compute pairwise distances between spectral distributions. There are two possible ways to accommodate this. First, we can estimate the density using empirical values and use measures that work with localized data representations. We explored this method in our previous work [9]. We first split the entire range of eigenvalues into equal intervals (bins) and computed frequencies within each bin. We next considered the two probabilistic distance measures: the Kullback-Leibler divergence and the Jensen-Shannon distance. We obtained the information divergence based kernels by exponentiating these measures and examined their performance in the tasks of classification of autism spectrum disorder versus typical development and of the carriers versus noncarriers of an allele associated with the high risk of Alzheimer disease. The outcomes of the algorithm were extremely sensitive to the number of bins used to reconstruct density. On average, the classification quality was rather poor, with the area under the receiver operating characteristic curve (ROC AUC) of about 0.65, although with some arbitrary numbers of bins it occasionally unsystematically peaked higher. In this study, we introduce a different approach that does not require defining arbitrary bin sizes and hence overcomes the major weakness of the previously used method. The algorithm proposed here compares the spectral distributions directly based on the vectors of eigenvalues. To accommodate this, we propose to use the earth mover’s distance (EMD) [10], which measures the minimum cost of transforming one sample distribution into another. This metric receives its name from the idea behind it: if each distribution is represented by some amount of dirt, EMD is the minimum cost required to move the dirt of one distribution to Kernel classification of connectomes based on EMD between spectra 5 produce the other. The cost is the amount of dirt moved times the distance by which it is moved. The EMD is thus based on the solution to the transportation problem, which is a problem of finding a least expensive flow of goods from the suppliers to the consumers that satisfies the consumers’ demand. From this point, the EMD can also be viewed as a discretized version of the Monge-Kantorovich mass transportation distance, which is defined for continuous measures. In statistics, the EMD is also known as the Wasserstein metric between probability distributions. We refer to [11] for a review on the history of this measure. More technically, let {si1 , ..., sin } be the eigenvalues of spectrum Si . We put an equal measure 1/n to each point sik on real line. Let fkl be the flow of mass between the points sik and sjl . The EMD is the normalized flow of mass between sets Si = {si1 , ..., sin } and Sj = {sj1 , ..., sjn } that minimizes the overall cost: P j i k,l fkl |sk − sl | P emd(Si , Sj ) = argmin , (4) F ={fkl } k,l fkl Pn Pn with the constraints: fkl ≥ 0, k=1 fkl = 1/n, l=1 fkl = 1/n. The EMD is a metric, and hence the kernel (3) is a true positive semi-definite kernel. In what follows, we examine how SVM classifier with this kernel performs in a task of classification of autism spectrum disorder versus typical development. 4 Data We explore the performance of the proposed kernel using a publicly available UCLA Autism dataset (described in [12]). This dataset includes DTI-based connectivity matrices of 51 high-functioning autism spectrum disorder (ASD) subjects (6 females) and 43 typically developing (TD) subjects (7 females). Average age (standard deviation) is 13.0 (2.8) for ASD group and 13.1 (2.4) for TD group. Nodes are defined using parcellation scheme that is based on a large metaanalysis of functional MRI studies combined with whole-brain functional connectivity mapping. This scheme produces 264 equal-size brain regions and thus 264×264 connectivity matrices. Edges result from brain deterministic tractography. It is performed on voxelwise fractional anisotropy values using the fiber assignment by continuous tracking (FACT) algorithm [13]. Edge weights in the original matrices are proportional to the number of streamlines detected by the algorithm. 5 5.1 Methods Network construction For each dataset, we apply three different weighting schemes. Based on our previous findings[14], we expect that connectomes that capture information on both strength (number of streamlines) and lengths (physical distances between 6 Dodonova, Belyaev, Tkachev, Petrov, Zhukov brain regions) of the connections are most useful for classification, at least for this particular task. For a purpose of comparison, we also consider weightings that only take into account either strength or distance. For the former, we take the original weighted connectivity matrices. For the latter, we first binarize original connectomes and than scale the existing edges by their lengths: adist = ij 1 if aij > 0 else 0 , lij (5) where lij is the Euclidean distance between centers of the regions i and j. We use Montreal Neurological Institute (MNI) coordinates of region centers provided by the authors of the datasets to obtain the reasonable proxy of the distances between brain regions. Third, we combine the two weighting schemes and produce connectomes with weights defined by: aij acombined = , (6) ij lij For each of the three weighting schemes, we next scale each matrix by the a sum of its edge weights: ascaled = P ijaij . This scaling does not produce any ij i,j changes in the spectra of the normalized Laplacians; hence, this step is not needed for our proposed pipeline. However, we also use ”bag of edges” as the baseline features (to be described in the next section), and we use scaling to enhance between-subject comparison based on these features. 5.2 Classification pipeline For each of the three weighting schemes, we produce the normalized Laplacians of the connectomes and compute their spectra. We next compute the EMD-based kernels by (3), (4). To compute the pairwise EMD between spectra we use an implementation that uses the original samples of points and does not require any data reduction. The kernels are then fed to the SVM. The regularization parameter of the SVM classifier is fixed at 0.1, 1, 10, and 50. We report the results obtained for the models with the best value of this penalty parameter. We use two different approaches to produce baseline classification quality. First, we use the same eigenvalues of the normalized Laplacians and treat them as feature vectors. We run linear kernel SVM on the vectors of eigenvalues. The regularization parameter of the SVM classifier is fixed at the same values as above. Second, we vectorize each weighted adjacency matrix by taking the values of its upper triangle (the so-called ”bag of edges”) and use these vectors as baseline features. Again, we run linear kernel SVM on these features with the penalty parameter fixed at the same values as above. We use the ROC AUC to assess the predictive quality of the algorithms. We use 10-fold cross-validation and combine predictions on all test folds to estimate the classification quality on the entire sample. We repeat this procedure 100 times with different 10-fold splits, thus producing 100 ROC AUC values. We use Python 2.7 and IPython notebooks platform, specifically NumPy, SciPy, pandas, matplotlib, scikit-learn [15], and pyemd [16] libraries. All scripts will be available at https://github.com/YuliaD/BACON-2016. Kernel classification of connectomes based on EMD between spectra 6 6.1 7 Results and discussion Distributions of the normalized Laplacian eigenvalues We first plot spectral distributions of the connectomes in Figure 2. We use the group average ASD and TD matrices with the combined weights (6), compute the associated L and its spectrum. To produce the plots, we convolve the eigenvalues with a Gaussian kernel; that is, we plot the function: f (x) = P |x−s |2 √ 1 exp(− 2σ2j ). We use σ = 0.02. For purpose of illustration, we also λj 2πσ2 produce three random graphs and plot their respective spectra in Figure 2. The first one is the Erdös-Rényi (ER) graph for which the required number of connections is produced randomly. The second random graph is based on the Barabási-Albert (BA) preferential attachment model. The third graph is the Watts-Strogatz (WS) network with small-world properties (the rewiring probability is set to 0.2). The number of nodes and edges in these random graphs is set equal to that of the group average matrix of the real dataset. The plotting algorithm is the same as for the actual matrices. The plots produced for the human brain connectivity matrices differ from the respective plots obtained for the random graphs. Of the three random graph models, the small-world WS model produces a spectral distribution most close to that of the connectomes. Empirical distributions based on human brain networks are close to those of the cat, macaque and C. elegans described by [6]. Our plots exactly follow their description of the respective plots observed for the non-human connectomes: (1) the spectra are skewed to the left with the largest eigenvalue much closer to one than the smallest eigenvalue; (2) the distributions show a peak close to one; and (3) the smallest eigenvalues are scattered around a few small peaks at the beginning of the spectra. In general, this confirms an observation [6] that spectral distributions of brain networks share similar properties. However, average ASD and TD spectral distributions are very close and almost coincide. At the same time, the distributions of the normalized Laplacian eigenvalues of the individual connectomes shown in Figure 2 largely vary. Fig. 2. Distributions of the normalized Laplacian eigenvalues of the random graphs (left), average real connectomes (middle) and example individual connectomes of typically developing subjects (right). Random graphs are unweighted; average and individual connectomes are weighted by (6). Note different scales for the first plot. 8 6.2 Dodonova, Belyaev, Tkachev, Petrov, Zhukov Classification based on spectral distributions Figure 3 shows the classification results of the SVM with the EMD-based kernel on graph spectra, the linear kernel on graph spectra, and the linear kernel on the ”bag of edges”. Interestingly, the linear classifier that works with the ”bag of edges” slightly outperforms a similar classifier that works with the vectors of eigenvalues. This is surprising due to a huge dimensionality of the vectors of edges (equal to the number of elements in the upper triangle of a connectivity matrix). This also shows that the eigenvalues of the normalized Laplacian spectra per se do not help to represent connectome objects in a space where they would be separable. For the weighting schemes that are based solely on the strengths of the network connections or their physical lengths none of the algorithms works satisfactorily. However, for a weighting scheme that incorporates information on both strengths and lengths of the connections, the proposed pipeline works well and clearly outperforms the baselines. The ROC AUC averaged over 100 runs of the algorithm is 0.706, standard deviation is 0.022. First, this partly confirms our previous finding that weighting connectomes by both the number of streamlines and the physical distances enhances classification quality. This might be because long streamlines are more prone to bias of the tractography algorithm; downweighting long connections partly eliminates this bias. Second, the classification quality obtained with the EMD-based kernel SVM is better than the average classification results obtained in our previous work [9] using the probabilistic kernels. Importantly, the EMD-based kernel is certainly Fig. 3. Classification results obtained with the EMD kernel SVM on the eigenvalues of the normalized Laplacian, the linear kernel SVM on the eigenvalues of the normalized Laplacian, and the linear kernel SVM on the vectors of edges of the connectivity matrices. w, 1/l and w/l refer to the matrices with the original weights and the weights obtained by (5) and (6), respectively. Each boxplot shows a distribution of ROC AUC values over 100 runs of the algorithm with different 10-fold splits. Kernel classification of connectomes based on EMD between spectra 9 Fig. 4. Left: Average ROC curve obtained with the EMD kernel on the normalized Laplacian spectra; the mean value is the area under the interpolated average curve. Middle: Gram matrix based on the earth mover’s distances between the normalized Laplacian spectra; the squares show submatrices for the ASD (lower left) and TD (upper right) participants. Right: Precision and recall values over 100 repetitions of the SVM with the EMD kernel on the normalized Laplacian spectra. more robust in the sense that it does not require an intermediate step of density reconstruction but still allows to evaluate differences between the empirical eigenvalue distributions. Figure 4 provides more details on how the EMD-based SVM classifier performed on our dataset. The ROC curve is shown in the left. The middle plot shows a Gram matrix obtained by (3), (4); the submatrices for the ASD and TD subjects are in the lower left and upper right squares, respectively. This matrix suggests that the ASD subjects are somewhat closer to each other, while the TD group shows larger variability in pairwise difference values. In line with this, the right plot in Figure 4 shows that our algorithm performs quite well identifying ASD subjects (average recall value over 100 runs of the algorithm is 0.737, standard deviation is 0.025). At the same time, the algorithm somewhat tends to classify TD subjects as pathological (average precision value is 0.670, standard deviation is 0.019). 7 Conclusions We propose an algorithm that uses eigenvalue distributions of the normalized Laplacian spectra of structural brain networks to classify normal and pathological development based on connectomes. We compute pairwise distances between spectral distributions of connectomes using earth mover’s distance (EMD), a metric that appears as a solution to the transportation problem. Its main advantage over the previously explored probabilistic distances is that it takes into account the shapes of the spectral distributions and at the same time does not require density reconstruction from the empirical values. We compute a kernel based on this metric and run SVM classifier with this kernel. We examine the performance of the proposed algorithm for a task of classification of autism spectrum disorder versus typical development based on a publicly available dataset. 10 Dodonova, Belyaev, Tkachev, Petrov, Zhukov The best-performing SVM classifier with the EMD-based kernel outperformed the baselines and produced ROC AUC value of 0.71. This study generally confirms that spectral distributions of the normalized Laplacians capture some meaningful structural properties of brain networks which make them different from other network classes, and also suggests that spectral distributions of connectomes can help to distinguish normal and pathological brain development. Still, further studies are needed to explore whether these findings can generalize to other classification tasks and, importantly, other schemes of network construction (in terms of both definition of nodes and weighting of edges). Also, in this study we only discussed structural connectomes; spectral properties of functional brain networks are to be studied. References 1. Wolfers, T., Buitelaar, J.K., Beckmann, C.F., Franke, B., Marquand, A.F.: From estimating activation locality to predicting disorder: A review of pattern recognition for neuroimaging-based psychiatric diagnostics. Neurosci Biobehav Rev., 57, 328– 349 (2015) 2. Arbabshirani, M.R., Plis, S., Sui, J., Calhoun, V.D.: Single subject prediction of brain disorders in neuroimaging: Promises and pitfalls. NeuroImage (2016) 3. Chung F.: Spectral Graph Theory (1997) 4. Banerjee A., Jost J.: On the spectrum of the normalized graph Laplacian. Linear Algebra and its Applications, 428, 1112, 3015–3022 (2008) 5. Banerjee A., Jost J.: Spectral plot properties: towards a qualitative classification of networks. Networks and heterogeneous media, 3, 2, 395–411 (2008) 6. de Lange S.C., de Reus M.A., van den Heuvel M.P.: The Laplacian spectrum of neural networks. Frontiers in Computational Neuroscience, 1–12 (2014) 7. Gartner T. A survey of kernels for structured data. SIGKDD Explorations, 5, 1, 4958 (2003) 8. Borgwardt K.M. Graph kernels. Dissertation (2007) 9. Dodonova, Y., Korolev S., Tkachev A., Petrov, D., Zhukov, L., Belyaev, M.: Classification of structural brain networks based on information divergence of graph spectra. Machine Learning for Signal Processing Proceedings (2016, accepted). 10. Rubner, Y. , Tomasi, C., Guibas, L. J.: The earth movers distance as a metric for image retrieval, International Journal of Computer Vision, 40 (2000) 11. Vershik, A.: Long history of the Monge-Kantorovich transportation problem, The Mathematical Intelligencer, 35, 4, 1–9 (2013) 12. Rudie, J.D., Brown, J.A., Beck-Pancer, D., Hernandez, L.M., Dennis, E.L., Thompson, P.M., et al.: Altered functional and structural brain network organization in autism. Neuroimage Clin 2, 79–94 (2013) 13. Mori, S., Crain, B.J., Chacko, V.P., Van Zijl, P.C.: Three-dimensional tracking of axonal projections in the brain by magnetic resonance imaging. Annals of Neurology, 45, 265–269 (1999) 14. Petrov, D., Dodonova, Y., Zhukov, L., Belyaev, M.: Boosting Connectome Classification via Combination of Geometric and Topological Normalizations. Pattern Recognition in Neuroimaging Proceedings (2016, accepted) 15. Pedregosa et al.: Scikit-learn: Machine Learning in Python, Journal of Machine Learning Research, 12, 2825–2830 (2011) 16. Available at https://github.com/garydoranjr/pyemd.
9cs.NE
1 On the Structure and Computation of Random Walk Times in Finite Graphs Andrew Clark, Member, IEEE, Basel Alomair, Senior Member, IEEE, Linda arXiv:1709.01633v1 [cs.SY] 6 Sep 2017 Bushnell, Fellow, IEEE and Radha Poovendran, Fellow, IEEE Abstract We consider random walks in which the walk originates in one set of nodes and then continues until it reaches one or more nodes in a target set. The time required for the walk to reach the target set is of interest in understanding the convergence of Markov processes, as well as applications in control, machine learning, and social sciences. In this paper, we investigate the computational structure of the random walk times as a function of the set of target nodes, and find that the commute, hitting, and cover times all exhibit submodular structure, even in non-stationary random walks. We provide a unifying proof of this structure by considering each of these times as special cases of stopping times. We generalize our framework to walks in which the transition probabilities and target sets are jointly chosen to minimize the travel times, leading to polynomial-time approximation algorithms for choosing target sets. Our results are validated through numerical study. I. I NTRODUCTION A random walk is a stochastic process over a graph, in which each node transitions to one of its neighbors at each time step according to a (possibly non-stationary) probability distribution [1], [2]. Random walks on graphs are used to model and design a variety of stochastic systems. Opinion propagation in social networks, as well as gossip and consensus algorithms in communications and networked control systems, are modeled and analyzed via random walks [3], A. Clark is with the Department of Electrical and Computer Engineering, Worcester Polytechnic Institute, Worcester, MA, 01609. [email protected] B. Alomair is with the Center for Cybersecurity, King Abdulaziz City for Science and Technology, Riyadh, Saudi Arabia. [email protected] L. Bushnell and R. Poovendran are with the Department of Electrical Engineering, University of Washington, Seattle, WA, 98195-2500. {lb2, rp3}@uw.edu September 7, 2017 DRAFT 2 [4], [5], [6]. Random walks also serve as distance metrics in clustering, image segmentation, and other machine learning applications [7], [8], [9]. The behavior of physical processes, such as heat diffusion and electrical networks, can also be characterized through equivalent random walks [10], [11]. One aspect of random walks that has achieved significant research attention is the expected time for the walk to reach a given node or set of nodes [12], [13]. Relevant metrics include the hitting time, defined as the expected time for a random walk to reach any node in a given set, the commute time, defined as the expected time for the walk to reach any node in a given set and then return to the origin of the walk, and the cover time, which is the time for the walk to reach all nodes in a desired set. These times give rise to bounds on the rate at which the walk converges to a stationary distribution [1], and also provide metrics for quantifying the centrality or distance between nodes [14], [9]. The times of a random walk are related to system performance in a diverse set of network applications. The convergence rate of gossip and consensus algorithms is determined by the hitting time to a desired set of leader or anchor nodes [15], [16]. The effective resistance of an electrical network is captured by its commute time to the set of grounded nodes [17]. The performance of random-walk query processing algorithms is captured by the cover time of the set of nodes needed to answer the query [18]. Optimal control problems such as motion planning and traffic analysis are described by the probability of reaching a target set or the resource cost per cycle of reaching a target set infinitely often [19]. In each of these application domains, a set of nodes is selected in order to optimize one or more random walk metrics. The optimization problem will depend on whether the distribution of the random walk is affected by the choice of input nodes. Some systems will have a fixed walk distribution, determined by physical laws (such as heat diffusion or social influence propagation), for any set of input nodes. In other applications, the distribution can be selected during the design stage, and hence the distribution of the walk and the set to be reached can be jointly optimized, as in Markov decision processes. In both cases, however, the number of possible sets of nodes is exponential in the network size, making the optimization problem computationally intractable in the worst case, requiring additional structure of the random walk times. At present however, computational structures of random walks have received little attention by the research community. In this paper, we investigate the hitting, commute, cover, and cycle times, as well as the September 7, 2017 DRAFT 3 reachability probability, of a random walk as functions of a set of nodes. We show that these metrics exhibit a submodular structure, and give a unifying proof of submodularity for the different metrics. We consider both fixed distributions and the case where the set and distribution are jointly selected. We make the following specific contributions: • We formulate the problem of jointly selecting a set and a control policy in order to maximize the probability of reaching the set from any initial state, as well as the average (per cycle) cost of reaching the set infinitely often. • We prove that each problem can be approximated in polynomial time with provable optimality bounds using submodular optimization techniques. Our approach is to relate the existence of a probability distribution that satisfies a given cycle cost to the volume of a linear polytope, which is a submodular function of the desired set. We extend our approach to joint optimization of reachability and cycle cost, which we prove is equivalent to a matroid optimization problem. • In the case where the probability distribution is fixed, we develop a unifying framework, based on the submodularity of selecting subsets of stopping times, which includes proofs of the supermodularity of hitting and commute times and the submodularity of the cover time as special cases. Since the cover time is itself NP-hard to compute, we study and prove submodularity of standard upper bounds for the cover time. • We evaluate our results through numerical study, and show that the submodular structure of the system enables improvement over other heuristics such as greedy and centrality-based algorithms. This paper is organized as follows. In Section II, we review the related work. In Section III, we present our system model and background on submodularity. In Section IV, we demonstrate submodularity of random walk times when the walk distribution is chosen to optimize the times. In Section V, we study submodularity of random walk times with fixed distribution. In Section VI, we present numerical results. In Section VII, we conclude the paper. II. R ELATED WORK Commute, cover, and hitting times have been studied extensively, dating to classical bounds on the mixing time [20], [1]. Generalizations to these times have been proposed in [21], [22]. Connections between random walk times and electrical resistor networks were described in [17]. These classical works, however, do not consider the submodularity of the random walk times. September 7, 2017 DRAFT 4 Submodularity of random walk times has been investigated based on connections between the hitting and commute times of random walks, and the performance of linear networked systems [16], [23]. The supermodularity of the commute time was shown in [16]. The supermodularity of the hitting time was shown in [23] and further studied in [15]. These works assumed a fixed, stationary transition probability distribution, and also did not consider submodularity of the cover time. Our framework derives these existing results as special cases of a more general result, while also considering non-stationary transition probability distributions. Random walk times have been used for image segmentation and clustering applications. In these settings, the distance between two locations in an image is quantified via the commute time of a random walk with a probability distribution determined by a heat kernel [8]. Clustering algorithms were then proposed based on minimizing the commute time between two sets [24]. This work is related to the problem of selecting an optimal control policy for a Markov decision process [25]. Prior work has investigated selecting a control policy in order to maximize the probability of reaching a desired target set [26], [27], or to minimize the cost per cycle of reaching the target set [28]. These works assume that the target set is given. In this paper, we consider the dual problem of selecting a target set in order to optimize these metrics. III. BACKGROUND AND P RELIMINARIES This section gives background on random walk times, Markov decision processes, and submodularity. Notations used throughout the paper are introduced. A. Random Walk Times Let G = (V, E) denote a graph with vertex set V and edge set E. A random walk is a discrete-time random process Xk with state space V . The distribution of the walk is defined by a set of maps Pk : V k → ΠV , where V k = V × · · · × V and ΠV is the simplex of probability distributions over V . We have that P r(Xk = vk |X1 = v1 , · · · , Xk−1 = vk−1 ) = Pk (v1 , . . . , vk ). The random walk is stationary if there exists a stochastic matrix P such that P r(Xk = vk |X1 = v1 , . . . , Xk−1 = vk−1 ) = P (vk−1 , vk ). Matrix P is denoted as the transition matrix. A walk is ergodic if there exists a probability distribution π such that limk→∞ P k = 1π T , implying that September 7, 2017 DRAFT 5 the distribution of the walk will eventually converge to π regardless of the initial distribution. Throughout the paper, we let E(·) denote the expectation of a random variable. Let S ⊆ V be a subset of nodes in the graph. The hitting, commute, and cover time of S are defined as follows. Definition 1: First define the following functions: ν(S) = min {k : Xk ∈ S} κ(S, u) = min {k : Xk = u, Xj ∈ S for some j < k} φ(S) = min {k : ∀s ∈ S, ∃j ≤ k s.t. Xj = s} The hitting time of S from a given node v is equal to H(S, v) , E(ν(S)|X1 = v). The commute time of S from node v is equal to K(S, v) = E(κ(S, v)|X1 = v). The cover time of S from node v is equal to C(S, v) = E(φ(S)|X1 = v). Intuitively, the hitting time is the expected time for the random walk to reach the set S, the commute time is the expected time for a walk starting at a node v to reach any node in S and return to v, and the cover time is the expected time for the walk to reach all nodes in the set S. If π is a probability distribution, we can further generalize the above definitions to H(S, π), K(S, π), and C(S, π), which are the expected hitting, commute, and cover times when the initial state is chosen from distribution π. The times described above are all special cases of stopping times of a stochastic process. Definition 2: Let Z = {Zk : k ≥ 0} be a discrete-time stochastic process. A stopping time with respect to Z is a random variable τ taking values in {1, 2, 3, . . .} such that the event {τ = n} is determined completely by Z. The hitting time is a stopping time where τ = min {k : Xk ∈ S}. The cover time is a stopping time with τ = min {k : ∀i ∈ S, ∃ l ≤ k s.t. Xl = i}, while the commute time is a stopping time with τ = min {k : xk = u, xl ∈ S for some l < k}. B. Markov Decision Processes A Markov Decision Process (MDP) is a generalization of a Markov chain, defined as follows. September 7, 2017 DRAFT 6 Definition 3: An MDP M is a tuple M = (V, {Ai : i ∈ V }, P ), where V is a set of states, Ai is a set of actions at state i, and P is a transition probability function defined by P (i, a, j) = P r(Xk+1 = j|Xk = i, action a chosen at step k). Define A = Sn i=1 Ai and A = |A|. In the specific case where the action set is empty or consists of a single element at each node, the MDP reduces to a Markov chain. The set of actions at each node corresponds to the possible control inputs that can be supplied to the chain at that node. A control policy is a function that takes as input a sequence of states X1 , . . . , Xk and gives as output an action uk ∈ AXk . A stationary control policy is a control policy µ that depends only on the current state, and hence can be characterized by a function µ : V → A. We let P denote the set of valid policies. The control policy µ is selected in order to achieve a design goal of the system. Such goals are quantified via specifications on the random process Xk . Two relevant specifications are safety and liveness constraints. A safety constraint specifies that a set of states R should never be reached by the walk. A liveness constraint specifies that a given set of states S must be reached infinitely often. In an MDP, two optimization problems arise in order to satisfy such constraints, namely, the reachability and average-cost-per-cycle problems. The reachability problem consists of selecting a policy in order to maximize the probability that a desired set of nodes S is reached by the Markov process while the unsafe set R is not reached. The average-cost-per-cycle (ACPC) problem is defined via the following metric. Definition 4: The average cost per cycle metric from state s0 under policy µ is defined by ) (P N g(X , µ (X )) k k k k=0 , (1) J(s0 ) = lim sup E C(µ, N) N →∞ where g(Xk , µk (Xk )) is the cost of taking an action µk (Xk ) at state Xk , and C is the number of cycles up to time N. In the special case where g(Xk , µk (Xk )) = 1 for all states and actions, the average cost per cycle is the number of steps in between times when the set S is reached. The average cost per cycle can be viewed as the average number of steps in between times when the set S is reached. The ACPC problem consists of choosing the set S and policy µ in order to minimize J(s0 ). Applications of this problem include motion planning, in which the goal of a robot is to reach a desired state infinitely often while minimizing energy consumption. September 7, 2017 DRAFT 7 C. Submodularity Submodularity is a property of set functions f : 2W → R, where W is a finite set. A function is submodular if, for any sets S and T with S ⊆ T ⊆ W and any v ∈ / T, f (S ∪ {v}) − f (S) ≥ f (T ∪ {v}) − f (T ). A function is supermodular if −f is submodular, while a function is modular if it is both submodular and supermodular. For any modular function, a set of coefficients {ci : i ∈ W } can be defined such that f (S) = X ci . i∈S Furthermore, for any set of coefficients {ci : i ∈ W }, the function f (S) = max {ci : i ∈ S} is increasing and submodular, while the function min {ci : i ∈ S} is decreasing and supermodular. Any nonnegative weighted sum of submodular (resp. supermodular) functions is submodular (resp. supermodular). A matroid is defined as follows. Definition 5: A matroid M = (V, I) is defined by a set V and a collection of subsets I. The set I satisfies the following conditions: (i) ∅ ∈ I, (ii) B ∈ I and A ⊆ B implies that A ∈ I, and (iii) If |A| < |B| and A, B ∈ I, then there exists v ∈ B \ A such that (A ∪ {v}) ∈ I. The collection of sets I is denoted as the independent sets of the matroid. A basis is a maximal independent set. The uniform matroid Mk is defined by A ∈ I iff |A| ≤ k. A partition matroid is defined as follows. Definition 6: Let V = V1 ∪ · · · ∪ Vm with Vi ∩ Vj = ∅ for i 6= j be a partition of a set V . The partition matroid M = (V, I) is defined by A ∈ I if |A ∩ Vi | ≤ 1 for all i = 1, . . . , m. Finally, the union of matroids M = M1 ∨ M2 is defined by A ∈ I iff A = A1 ∪ A2 for A1 ∈ I1 and A2 ∈ I2 . IV. R ANDOM WALKS WITH O PTIMAL D ISTRIBUTIONS In this section, we consider the problem of selecting a set S of states for an MDP to reach in order to optimize a performance metric. We consider two problems, namely, the problem of selecting a set of states S in order to maximize the reachability probability to S while minimizing the probability of reaching an unsafe set R, and the problem of selecting a set of states S in order to minimize the ACPC. A motivating scenario is a setting where an unmanned vehicle September 7, 2017 DRAFT 8 must reach a refueling station or transit depot infinitely often, and the goal is to place the set of stations in order to maximize the probability of reaching one or minimize the cost of reaching. A. Reachability Problem Formulation The problem of selecting a set S with at most k nodes in order to maximize the probability of reaching S under the optimal policy µ is considered as follows. Let Z(S) denote the event that the walk reaches S at some finite time and does not reach the unsafe state R at any time. The problem formulation is given by maximizeS⊆V maxµ∈P P r(Z(S)|µ) s.t. |S| ≤ k (2) This formulation is equivalent to (3) maximizeµ maxS:|S|≤k P r(Z(S)|µ) The following known result gives a linear programming approach to maximizing the probability of reachability for a fixed set S. Lemma 1 ([29], Theorem 10.105): The optimal value of max {P r(Z(S)|µ) : µ ∈ P} is equal to min 1T x x ∈ Rn s.t. (4) xi ∈ [0, 1] ∀i xi = 1 ∀i ∈ S, xi = 0 ∀i ∈ R P xi ≥ nj=1 P (i, u, j)xj ∀i ∈ V, u ∈ Ui In addition to giving the optimal value of the maximal reachability problem, Eq. (4) can also be used to compute the optimal policy. In order for x to be the solution to (4), for each i ∈ V \ (R ∪ S), there must be an action u∗i such that xi = n X P (i, u∗i , j)xj . j=1 Otherwise, it would be possible to decrease xi and hence the objective function of (4). Hence the optimal policy µ is given by µ(i) = u∗i . n Based on Lemma 1, we formulate an equivalent problem to (2). Define a vector x ∈ Rn2 , with elements indexed as x̄Si . The element x̄Si can be viewed as the probability that the reachability September 7, 2017 DRAFT 9 condition is satisfied starting from node i when the set of states to be reached is S. The following lemma gives an optimization problem that generalizes Lemma 1 to the case where S can also be optimized. Lemma 2: The value of the optimization problem (3) is equal to the value of P minimize maxS:|S|≤k i∈V xSi x xSi = 1 ∀i ∈ S s.t. (5) xSi = 0 ∀i ∈ R P xSi ≥ nj=1 P (i, u, j)xSj ∀i, u ∈ Ai P Letting x∗ denote the solution to (5), the set S ∗ = arg maxS { ni=1 xSi } is the solution to (2). Proof: By Lemma 1, for each S, {xSi : i = 1, . . . , n} defines the optimal reachability probP S abilities for each node. Hence maxS:|S|≤k is the maximum reachability probability i∈V xi over all sets S. While Eq. (5) gives the maximum reachability, the number of optimization variables is exponential in the number of nodes, making the problem computationally intractable. In what follows, we formulate a relaxed problem that can be solved in polynomial time. Define a matrix P with dimensions nA2n ×n2n . The rows of P are indexed {(S, i, u) : S ⊆ {1, . . . , n}, i = 1, . . . , n, u ∈ A. P (S,i,u),(T,j) Let   P (i, u, j), S = T, u ∈ U i =  0, else Π = {xSi : xSi = 0 ∀i ∈ R, P x ≤ x}. As a first step, we have the following relaxation of (5) P S minimize maxS:|S|≤k i∈V xi  P P S +ρ S i∈S (1 − xi ) s.t. (6) x∈Π for some ρ > 0. The following lemma leads to a tractable equivalent formulation to (6). Lemma 3: The solution to (6) is equivalent to the solution to P  P N minimize maxS i=1 xi − ρ i∈S xi s.t. September 7, 2017 (7) x∈Π DRAFT 10 Proof: The solution to (6) is equal to a constant plus the solution to  P Pn S S x − ρ x minimize maxS:|S|≤k i∈S i i=1 i P P S −ρ S6=Smax i∈S xi s.t. x∈Π By choosing {xSi : i = 1, . . . , n} as the solution to (4) with desired set S, the last term of the objective function can be set to zero. Hence the variables {xSi : S 6= Smax } have no impact on the solution to the optimization problem, and the problem reduces to (7). The objective function of (7) is a pointwise maximum of convex functions and is therefore convex. A subgradient of the objective function at any point x0 , denoted v(x0 ), is given by   1 − λ, i ∈ S (x ) max 0 v(x0 )i =  1, else where Smax (x0 ) = arg min ( X i∈S ) (x0 )i : |S| ≤ k . Computing this subgradient is a modular optimization problem, and hence can be performed in linear time in S. A polynomial-time algorithm for solving (7) can be obtained using interior-point methods, as shown in Algorithm 1. The interior-point approach of Algorithm 1 thus gives an efficient algorithm for maximizing the optimal reachability problem by choosing the set. We further observe that more general constraints than |S| ≤ k can be constructed. One possible constraint is to ensure that, for some partition V1 , . . . , Vm , we have |S ∩ Vi | ≥ 1 for each i = 1, . . . , m. Intuitively, this constraint implies that there must be at least one state to be reached in each partition set Vi . This constraint is equivalent to the constraint S ∈ Mk , where Mk is the union of the partition matroid and the uniform matroid of rank k − m. The calculation of Smax (x0 ) then becomes ( ) X Smax (x0 ) = arg min (x0 )i : S ∈ Mk . i∈S This problem can also be solved in polynomial time due to the matroid structure of Mk using a greedy algorithm. September 7, 2017 DRAFT 11 Algorithm 1 Algorithm for selecting a set of states S to maximize probability of reachability. 1: procedure M AX R EACH (G = (V, E), U, P , R, k, ǫ, δ) 2: Input: Graph G = (V, E), set of actions Ui at each node i, probability distribution P , unsafe nodes R, number of states k, convergence parameters ǫ and δ. 3: Output: Set of nodes S 4: Φ ← barrier function for polytope Π 5: x←0 6: x′ ← 1 7: while ||x − x′ ||2 > ǫ do P S ← arg max { i∈S xi : |S| ≤ k} 8: 9: v←1 10: vi ← (1 − ρ) ∀i ∈ S 11: w ← ∇x Φ(x) 12: x′ ← x 13: x ← x + δ(v + w) 14: end while 15: S ← arg max { 16: return S 17: P i∈S xi : |S| ≤ k} end procedure B. Minimizing the Average Cost Per Cycle In order to interpret the minimum ACPC problem, we introduce the notions of gain and bias as follows. The gain-bias pair (Jµ , hµ ) is defined by Jµ = Pµ Jµ , hµ + Jµ = 1 + Pµ hµ + P̄µ Jµ , and (I − P̄µ )hµ + vµ = Pµ vµ , where Pµ is the transition matrix induced by policy µ. The gain can be interpreted as the average cost per cycle across all nodes in the network, while the bias is the deviation of each node’s cost per cycle from the average. The following result relates the gain-bias pair to the optimal ACPC policy. Theorem 1 ([30]): Suppose that there exists a policy µ and ρ ∈ R such that the gain-bias pair (J, h), where J = λ1, satisfies  λ + h(i) = min 1 + u∈Ui September 7, 2017 n X j=1 P (i, u, j)h(j) + λ X j ∈S /  P (i, u, j). (8) DRAFT 12 Then λ is the minimum value of the ACPC problem. Based on Theorem 1, in order to ensure that the minimum ACPC is no more than λ, it suffices to show that there is no h satisfying (8) for the chosen set S. Note that this condition is sufficient but not necessary. Hence the following optimization problem gives a lower bound on the ACPC minimize max λ S s.t. (9) P λ + h(i) ≤ 1 + nj=1 P (i, u, j)h(j) P +λ j ∈S / P (i, u, j) ∀i, u ∈ Ui The following theorem gives a sufficient condition for the minimum ACPC. Theorem 2: Suppose that, for any h, there exists u and i such that λ1{i ∈ S} + h(i) − n X P (i, u, j)h(j) > 1. (10) j=1 Then the ACPC is bounded above by λ. In order to prove Theorem 2, we introduce an augmented graph that will have the same ACPC cost. Define the graph G = (V , E) as follows. Let V = {il : i ∈ V, l = 0, 1}, E = {(i1 , i0 ) : i ∈ V } ∪ {(i0 , j) : (i, j) ∈ E}. The sets of actions satisfy U i0 = U i1 = Ui . The transition probabilities are given by P (i1 , u, i0 ) = 1, P (i0 , u, j1 ) = P (i, j). Finally, the set S for G is constructed from the set S for G via S = {i0 : i ∈ S}. The following result establishes the equivalence between the graph formulations. Proposition 1: The minimum ACPC of G with set S is equal to the minimum ACPC of G with set S. Proof: There is a one-to-one correspondence between policies on G and policies on G. Indeed, any policy µ on G can be extended to a policy µ on G by setting µi0 = µi and µi1 = 1 for all i. Furthermore, by construction, the ACPC for G with policy µ will be equal to the ACPC with policy µ. In particular, the cost per cycle of the minimum-cost policies will be equal. We are now ready to prove Theorem 2. September 7, 2017 DRAFT 13 Proof of Theorem 2: For the augmented graph, the constraint of Eq. (9) is equivalent to λ1{i ∈ S} + h(i1 ) ≤ h(i0 ) n X h(i0 ) − P (i, u, j)h(j1 ) ≤ 1 (11) (12) j=1 for all i, j, and u. Hence, in order for the minimum cost per cycle to be less than λ, at least one of (11) or (12) must fail for each h ∈ R2N . For each h, let Sh = {i : λ + h(i1 ) > h(i0 )}, so that the condition that the ACPC is less than λ is equivalent to Sh ∩ S 6= ∅ ∀h ∈ R2N . Furthermore, we can combine Eq. (11) and (12) to obtain λ1{i ∈ S} + h(i1 ) ≤ 1 + n X P (i, u, j)h(j1). j=1 We can then remove the subscripts to obtain λ1{i ∈ S} + h(i) ≤ 1 + n X P (i, u, j)h(j) j=1 as a necessary and sufficient condition for the ACPC to be at least λ. This is equivalent to (10). The following result maps the minimum ACPC problem to submodular optimization via Theorem 2. Proposition 2: Let P(λ, S) denote the polytope P(λ, S) = {h : Ah ≤ 1 − λ1{i ∈ S}} ∩ {||h||∞ ≤ ζ}. Then the function rλ (S) = vol(P(λ, S)) is decreasing and supermodular as a function of S. Furthermore, if rλ (S) = 0, then the ACPC is bounded above by λ. Proof: Define a sequence of functions rλN (S) as follows. For each N, partition the set P(0, ∅) = {h : Ah ≤ 1} into N equally-sized regions with center x1 , . . . , xN and volume δN . Define rλN (S) = N X δN 1{xl ∈ P(λ, S)}. l=1 Since P(λ, S) ⊆ P(0, ∅) for all S and λ, we have that vol(P(λ, S)) ≈ rλN (S) September 7, 2017 DRAFT 14 and lim rλN (S) = rλ (S). N →∞ The term 1{xl ∈ P(λ, S)} is equal to the decreasing supermodular function 1{Sxl ∩ S = ∅}. Hence rλN (S) is a decreasing supermodular function, and rλ (S) is a limit of decreasing supermodular functions and is therefore decreasing supermodular. Finally, we have that if rλ (S) = ∅, then for any ǫ > 0, there is no h satisfying Ah ≤ 1 − (λ + ǫ)1{i ∈ S}}. In Proposition 2, the constraint ||h||∞ ≤ ζ is added to ensure that the polytope is compact. Proposition 2 implies that ensuring that the ACPC is bounded above by λ is equivalent to the submodular constraint rλ (S) = 0. This motivates a bijection-based algorithm for solving the minimum ACPC problem (Algorithm 2). The following theorem describes the optimality bounds and complexity of the algorithm. Theorem 3: Algorithm 2 terminates in O (kn6 log λmax ) time. For any λ such that there exists a set S of size k satisfying rλ (S) = 0, Algorithm 2 returns a set Ŝ with ) ( rλ (∅) |Ŝ| . ≤ 1 + log |S| minv {rλ (Ŝ \ {v})} Proof: The number of rounds in the outer loop is bounded by log λmax . For each iteration of the inner loop, the objective function rλ (S) is evaluated kn times. Computing rλ (S) is equivalent to computing the volume of a linear polytope, which can be approximated in O(n5) time [31], for a total runtime of O(kn6 log λmax ). From [32], for any monotone submodular function f (S) and the optimization problem min {|S| : f (S) ≤ α}, the set Ŝ returned by the algorithm satisfies |Ŝ| ≤ 1 + log |S ∗ | September 7, 2017 ( f (V ) − f (∅) f (V ) − f (ŜT −1 ) ) , DRAFT 15 Algorithm 2 Algorithm for selecting a set of states S to minimize average cost per cycle. 1: procedure M IN ACPC(G = (V, E), U, P , R, k) 2: Input: Graph G = (V, E), set of actions Ui at each node i, probability distribution P , number of states k. 3: Output: Set of nodes S 4: λmax ← max ACPC for any v ∈ {1, . . . , n} 5: λmin ← 0 6: while |λmax − λmin | > δ do 7: S←∅ 8: λ← 9: while rλ (S) > 0 do λmax +λmin 2 10: v ∗ ← arg min {rλ (S ∪ {v}) : v ∈ {1, . . . , n}} 11: S ← S ∪ {v ∗ } 12: end while 13: if |S| ≤ k then λmax ← λ 14: 15: else λmin ← λ 16: 17: end if 18: end while 19: return S 20: end procedure where ŜT −1 is the set obtained at the second-to-last iteration of the algorithm. Applied to this setting, we have September 7, 2017 |Ŝ| ≤ 1 + log |S ∗ | ( = 1 + log ( ≤ 1 + log ( rλ (V ) − rλ (∅) rλ (V ) − rλ (ŜT −1 ) ) rλ (∅) ) rλ (ŜT −1 ) rλ (∅) minv {rλ (Ŝ \ {v})} ) . DRAFT 16 We note that the complexity of Algorithm 2 is mainly determined by the complexity of computing the volume of the polytope P(λ, S). This complexity can be reduced to O(n3 ) by computing the volume of the minimum enclosing ellipsoid of P(λ, S) instead. The ACPC problem can be extended to the case where the random walk is not irreducible, making the graph G disconnected, and hence the set S must be divided among a set of connected components G1 , . . . , Gm . This case can be considered by modifying Algorithm 2 to have rλ (S|Gi ) = 0 for all i = 1, . . . , m as the termination condition, thus ensuring that the ACPC is at most λ for all of the connected components. C. Joint Optimization of Reachability and ACPC In this section, we consider the problem of selecting a set S to satisfy safety and liveness constraints with maximum probability and minimum cost. This problem can be viewed as combining the maximum reachability and minimum ACPC problems formulated in the previous sections. As a preliminary, we define an end component of an MDP. Definition 7: For an MDP M = (V, A, P ), an end component (EC) is a subset of nodes V ′ ⊆ V , together with sets of actions {A′i : i ∈ V ′ } and a transition mapping P ′ : V ′ ×A′ ×V ′ → [0, 1]. The set V ′ satisfies v ∈ V ′ , u ∈ A′v , and P (v, u, v ′) > 0 implies v ′ ∈ V . Intuitively, an end component (V ′ , A′ , P ′) is a set of states and actions such that if only the actions in U ′ are played, the MDP will remain in V ′ for all time. A maximal end component (MEC) is an end component such that for any V ′ and A′′ , V ′ ⊆ V ′′ and A′ ⊆ A′′ implies that V ′′ and A′′ are not an EC. The following result shows the relationship between MECs and safety and liveness constraints. Lemma 4 ([30]): The probability that an MDP satisfies a safety and liveness specification defined by R and S is equal to the probability that the MDP reaches an MEC (V ′ , U ′ , P ′ ) with V ′ ∩ S 6= ∅ and V ′ ∩ R = ∅. We define an MEC with V ′ ∩ R = ∅ to be an accepting maximal end component (AMEC). By Lemma 4, the problem of maximizing the probability of satisfying the safety and liveness constraints is equal to the probability of reaching an MEC. This problem can be mapped to a maximum reachability problem by introducing an augmented MDP M̃ = (Ṽ , Ã, P̃ ), defined as follows. Let M1 = (V1′ , A′1 , P1′ ), . . . , MN = (VN′ , A′N , PN′ ) denote the set of MECs satisfying S  N ′ Vi′ ∩ S 6= ∅. The node set of the augmented graph is equal to V \ V ∪ {m1 , . . . , mN }. i=1 i September 7, 2017 DRAFT 17 The actions for nodes in V are unchanged, while the nodes m1 , . . . , mN have empty action sets. The transition probabilities are given by   P (i, u, j),    P    P (i, u, j),   j∈Vl′ P̃ (i, u, j) =     1,      0, S ′ i, j ∈ / M i=1 Vi , u ∈ Ai S ′ i∈ / M s=1 Vs , j = ml , u ∈ Ai i = j = ml i = ml , i 6= j In this MDP, the probability of reaching the set {m1 , . . . , mN } is equal to the probability of satisfying the safety and liveness constraints, and hence maximizing the probability of satisfying the constraints is equivalent to a reachability problem. We now formulate two problems of joint reachability and ACPC. The first problem is to minimize the ACPC, subject to the constraint that the probability of satisfying the constraints is maximized. The second problem is to maximize the probability of satisfying safety and liveness properties, subject to a constraint on the average cost per cycle. In order to address the first problem, we characterize the sets S that maximize the reachability probability. Lemma 5: Suppose that for each AMEC (V ′ , U ′ , P ′), S ∩ V ′ 6= ∅. Then S maximizes the probability of satisfying the safety and liveness constraints of the MDP. Proof: By Lemma 4, the safety and liveness constraints are satisfied if the walk reaches an MEC satisfying S ∩ V ′ 6= ∅. Hence, for any policy µ, the probability of satisfying the constraints is maximized when the S ∩ V ′ 6= ∅ for all MECs. Note that the converse of the lemma may not be true. There may exist policies that maximize the probability of satisfaction and yet do not reach some AMECs with positive probability. Lemma 5 implies that in order to formulate the problem of minimizing the ACPC such that the probability of achieving the specifications is maximized, it suffices to ensure that there is at least one node in each AMEC that belongs to S. We will show that this is equivalent to a matroid constraint on S. Define a partition matroid by M1 = (V, I) where I = {S : |S ∩ V ′ | ≤ 1 ∀ AMEC V ′ }. Let r denote the number of AMECs, and let Mk−r denote the uniform matroid with cardinality (k − r). Finally, let M = M1 ∨ Mk−r . The following theorem gives the equivalent formulation. September 7, 2017 DRAFT 18 Theorem 4: Let q(S) denote the ACPC for set S. Then the problem of selecting a set of up to k nodes in order to minimize the ACPC while maximizing reachability probability is equivalent to minimize q(S) s.t. S∈M (13) Proof: Since q(S) is strictly decreasing in S, the minimum value of the ACPC is achieved when |S| = k. In order to maximize the probability of satisfying the safety and liveness constraints, S must also contain at least one node in each AMEC, implying that S contains a basis of M1 . Hence the optimal set S ∗ consists of the union of one node from each AMEC (a basis of M1 ) and (k − r) other nodes (a basis of Mk−r ), and hence is a basis of M. Conversely, we have that the optimal solution to (13) satisfies the constraint |S| ≤ k and contains at least one node in each AMEC, and thus is also a feasible solution to the joint reachability and ACPC problem. Hence, we can formulate the problem of selecting S to minimize the ACPC as minimize max λ S∈M s.t. P λ + h(i) ≤ 1 + nj=1 P (i, u, j)h(j) P +λ j ∈S / P (i, u, j) (14) If there are multiple AMECs, then each AMEC (Vi′ , Ui′ , Pi′) will have a distinct value of average per cycle cost λi , which will be determined by S ∩ Vi′ . The problem of minimizing the worst-case ACPC is then given by minimize maxm λm (S ∩ Vm′ ) S∈M s.t. This problem is equivalent to P λm + h(i) ≤ 1 + nj=1 P (i, u, j)h(j) P ′ ′ +λ j ∈S / P (i, u, j) ∀i ∈ Vm , u ∈ Ai (15) minimize ζ S s.t. P ζ + h(i) ≤ 1 + nj=1 P (i, u, j)h(j) P ′ +ζ j ∈S / P (i, u, j) ∀i, u ∈ Ai (16) |S| ≤ k September 7, 2017 DRAFT 19 By Proposition 2, Eq. (16) can be rewritten as minimize ζ S PM m m=1 rζ (S s.t. (17) ∩ Vm′ ) = 0 |S| ≤ k where rζi (S) is the volume of the polytope P(ζ, S ∩ Vm′ ) defined as in Section IV-B. A bijectionbased approach, analogous to Algorithm 2, suffices to approximately solve (17). This approach is given as Algorithm 3. The following proposition describes the optimality bounds of Algorithm 3. Proposition 3: Algorithm 3 returns a value of ζ, denoted ζ̂, that satisfies ζ̂ < ζ ∗ , where ζ ∗ is the minimum ACPC that can be achieved by any set S satisfying ! PM m r (∅) m=1 ζ . |S| ≤ k 1 + log PM minv m=1 rζi (Ŝ \ {v}) (18) Proof: The proof is analogous to the proof of Theorem 3. The submodularity of rζi (S) P m implies that the set |Ŝ| is within the bound (18) of the minimum-size set |S ∗ | with M m=1 rζ (S) = 0, We now turn to the second joint optimization problem, namely, maximizing the reachability probability subject to a constraint ζ on the average cost per cycle. We develop a two-stage approach. In the first stage, we select a set of input nodes for each AMEC V1 , . . . , Vr in order to guarantee that the ACPC is less than ζ. In the second stage, we select the set of AMECs to include in order to satisfy the ACPC constraint while minimizing the number of inputs needed. For the first stage, for each AMEC we approximate the problem minimize |Si | s.t. (19) rζi (Si ) = 0 where rζi (Si ) = vol(P(ζ, Si )) is defined as in Section IV-B and restricted to (Vi′ , A′i , Pi′), and thus obtain a set of nodes Si such that the ACPC is bounded above by λ on the AMEC Vi when the set of desired states is Si . We let ci = |Si | denote the number of nodes required for each AMEC. The problem of selecting a subset of nodes to maximize reachability while satisfying this constraint on ζ can then be formulated as minimize maxS:Pi∈S ci ≤k s.t. September 7, 2017 x∈Π P N i=1 xi − λ P i∈S xi  (20) DRAFT 20 Algorithm 3 Algorithm for selecting a set of states S to minimize average cost per cycle. 1: procedure M IN ACPC M AX R EACH (G = (V, E), U, P , R, k) 2: Input: Graph G = (V, E), set of actions Ui at each node i, probability distribution P , number of states k. 3: Output: Set of nodes S 4: ζmax ← max ACPC for any v ∈ {1, . . . , n} 5: ζmin ← 0 6: while |ζmax − ζmin | > δ do 7: for i = 1, . . . , M do 8: S←∅ 9: ζ← while rλi (S) > 0 do 10: v ∗ ← arg min {rζ (S ∪ {v}) : 11: 12: ζmax +ζmin 2 v ∈ {1, . . . , n}} S ← S ∪ {v ∗ } 13: end while 14: 15: end for 16: if |S| ≤ k then λmax ← λ 17: 18: else λmin ← λ 19: 20: end if 21: end while 22: return S 23: end procedure by analogy to (7). The inner optimization problem of (20) is a knapsack problem, and hence is NP-hard and must be approximated at each iteration. In order to reduce the complexity of the problem, we introduce the following alternative formulation. We let Pλ denote the polytope September 7, 2017 DRAFT 21 satisfying the inequalities 1T v = β n X vi (1 − λ1{i ∈ S}) ≥ vj P (i, u, j) j=1 By Proposition 2, the condition that the reachability probability is at most ζ is equivalent to vol(P(ζ, Si ) = 0. Letting rλ (S) denote the volume of Pλ when the set of desired states is S, the problem is formulated as minimize s.t. P i∈T ci rλ (T ) = 0 (21) Problem (21) is a submodular knapsack problem with coverage constraints. An algorithm for solving it is as follows. The set T is initialized to ∅. At each iteration, find the element i that minimizes ci , rλ (T ) − rλ (T ∪ {i}) terminating when the condition rλ (T ) = 0 is satisfied. Hence, the overall approach is to select a collection of subsets Si : i = 1, . . . , M, representing the minimum-size subsets to satisfy the ACPC constraint on each AMEC Vi . We then select a set of AMECs to include in order to satisfy a desired constraint on reachability while minimizing the total number of inputs. The set S is then given by [ S= Si . i∈T The optimality gap of this approach is described as follows. Proposition 4: The set T chosen by the greedy algorithm satisfies ) ( 1 |T | , ≤ 1 + log |T ∗ | rλ (T̂ ) where T ∗ is the optimal solution to (21). Proof: We have that rλ is monotone decreasing and supermodular. Hence, by Theorem 1 of [32], the optimality bound holds. Combining the optimality bounds yields )! )! ( ( 1 1 |S| . 1 + log ≤ 1 + log |S ∗ | riζ (Ŝ) rλ (T̂ ) September 7, 2017 DRAFT 22 D. Optimal Hitting Time In this section, we consider the problem of minimizing the hitting time under a joint selection of the probability distribution and set. We have that the hitting time of node i under policy µ, denoted H(i, µ, S), satisfies H(i, µ, S) = 1 + n XX P (i, u, j)P r(µi = u)H(j, S) u∈Ai j=1 for i ∈ / S and H(i, S) = 0 for i ∈ S. Hence the optimal hitting time for a given set S is given by H(i, S) = 1 + min u ( n X ) P (i, u, j)H(j, S) . j=1 Thus the optimal hitting time problem is equivalent to the linear program maximize 1T v vi ≤ 1 + s.t. Pn j=1 P (i, u, j)vj ∀i, u ∈ Ai (22) vi = 0, i ∈ S The following lemma leads to an equivalent formulation to (22). Lemma 6: For a given graph G, there exists λ > 0 such that the conditions vi ≤ 1 + n X P (i, u, j)vj ∀i, u ∈ Ui (23) j=1 vi = 0 ∀i ∈ S (24) are equivalent to vi + λ1{i ∈ S}vi ≤ 1 + n X P (i, u, j)vj . (25) j=1 Proof: If (25) holds, then for λ sufficiently large we must have vi = 0 for all i ∈ S. The condition then reduces to vi ≤ 1 + n X P (i, u, j)vj j=1 for all i ∈ / S and u ∈ Ui , which is equivalent to (23). From Lemma 6, it follows that in order to ensure that the optimal hitting time for each node is no more than ζ, it suffices to ensure that for each v satisfying 1T v ≥ ζ, there exists at least one i and u such that 1+ n X P (i, u, j)vj < (1 + λ1{i ∈ S})vi . j=1 September 7, 2017 DRAFT 23 We define the function χv (S) as   1, (23) and (24) hold χv (S) =  0, else The following lemma relates the function χv (S) to the optimality conditions of Lemma 6. Lemma 7: The optimal hitting time corresponding to set S is bounded above by ζ if and only if χζ (S) , Z χv (S) dv = 0. {v:1T v≥ζ} Proof: Suppose that χζ (S) = 0. Then for each v satisfying 1T v ≥ ζ, we have that χv (S) = 0 and hence n X P (i, u, j)vj < (1 + λ1{i ∈ S})vi j=1 holds for some i and u ∈ Ui , and hence there is no v satisfying the conditions of (22) with 1T v = ζ for the given value of S. The following result then leads to a submodular optimization approach to computing the set S that minimizes the hitting time. Proposition 5: The function χ(S) = Z χv (S) dv {v:1T v≥ζ} is supermodular as a function of S. Proof: We first show that χv (S) is supermodular. We have that χv (S) = 1 if and only if there exists i ∈ S with vi 6= 0, or equivalently, supp(v) ∩ S 6= ∅. If χv (S) = χv (S ∪ {u}) = 0, then the condition supp(v) ∩ S 6= ∅ already holds, and hence χv (T ) = χv (T ∪ {u}). Since χ(S) is an integral of supermodular functions, it is supermodular as well. Furthermore, χ(S) can be approximated in polynomial time via a sampling-based algorithm [2]. Hence the problem of selecting a set of states S in order to minimize the optimal hitting time can be stated as minimize ζ s.t. min {|S| : χζ (S) = 0} ≤ k (26) Problem (26) can be approximately solved using an algorithm analogous to Algorithm 2, with rλ (S) replaced by χζ (S) in Lines 9 and 10, and λ replaced by ζ throughout. The following proposition gives optimality bounds for the revised algorithm. September 7, 2017 DRAFT 24 Proposition 6: The modified Algorithm 2 guarantees that the hitting time satisfies ζ ∗ (S) ≥ ζ ∗ (Ŝ), where Ŝ is the optimal solution when   k̂ = k 1 + log χ(∅) minv χ(S \ {v})  . (27) Proof: Since the function ζ ∗ (S) is supermodular, the number of states S selected by the greedy algorithm to satisfy ζ ∗ (S) = 0 satisfies (27). Hence, for the set Ŝ, since |S| ≤ k̂, we have that ζ ∗(S) ≥ ζ ∗(Ŝ). V. S UBMODULARITY WITH F IXED P ROBABILITY D ISTRIBUTION This section demonstrates submodularity of random walk times for walks with a probability distribution that does not depend on the set of nodes S. We first state a general result on submodularity of stopping times, and then prove submodularity of hitting, commute, cover, and coupling times as special cases. A. General Result Consider a set of stopping times Z1 , . . . , ZN for a random process Xk . Let W = {1, . . . , N}, and define two functions f, g : 2W → R by f (S) = E {max {Zi : i ∈ S}} g(S) = E {min {Zi : i ∈ S}} We have the following general result. Proposition 7: Let W = {1, . . . , N}. The functions f (S) and g(S) are nondecreasing submodular and nonincreasing supermodular, respectively. Proof: For any S and T with S ⊆ T , we have that f (T ) = E {max {max {Zi : i ∈ S}, max {Zi : i ∈ T \ S}}} ≥ E {max {Zi : i ∈ S}} = f (S), implying that f (S) is nondecreasing. The proof of monotonicity for g(S) is similar. To show submodularity of f (S), consider any sample path ω of the random process Xk . For any sample path, Zi is a deterministic nonnegative integer. Consider any sets S, T ⊆ {1, . . . , N}, September 7, 2017 DRAFT 25 and suppose without loss of generality that max {Zi (ω) : i ∈ S} ≥ max {Zi (ω) : i ∈ T }. Hence for any sets S, T ⊆ {1, . . . , N}, we have max Zi (ω) + max Zi (ω) = i∈S i∈T max Zi (ω) + max Zi (ω) i∈S∪T i∈T ≥ max Zi (ω) + max Zi (ω). i∈S∪T i∈S∩T Now, let Q = (i1 , . . . , iN ), where each ij ∈ {1, . . . , N}, be a random variable defined by Zi1 ≤ Zi2 ≤ · · · ≤ ZiN for each sample path, so that Q is the order in which the stopping times Zi are satisfied. For any ordering (i1 , . . . , iN ), we have   E max {Zi }|Q = (i1 , . . . , in ) i∈S   = E max {Zij }|Q = (i1 , . . . , in ) j:ij ∈S = max E(Zij |Q) , max αjQ . j:ij ∈S j:ij ∈S which is submodular by the same analysis as above. Taking expectation over all the realizations of Q, we have f (S) = X (i1 ,...,iN )  E max {Zi }|Q = (i1 , . . . , iN ) i∈S · P r(Q = i1 , . . . , iN )}   X  = max αjQ P r(Q = i1 , . . . , iN ) (i1 ,...,iN ) j:ij ∈S which is a finite nonnegative weighted sum of submodular functions and hence is submodular. The proof of supermodularity of g(S) is similar. Proposition 7 is a general result that holds for any random process, including random processes that are non-stationary. In the following sections, we apply these results and derive tighter conditions for hitting, commute, and cover times. B. Submodularity of Hitting and Commute Times In this section, we consider the problem of selecting a subset of nodes S in order to minimize the hitting time to S, H(π, S). The following result is a corollary of Proposition 7. Lemma 8: H(π, S) is supermodular as a function of S. Proof: Let Zi denote the stopping time corresponding to the event {Xk = i}, where Xk is a random walk on the graph. Then H(π, S) is supermodular by Proposition 7. September 7, 2017 DRAFT 26 Minimum cover time for different network sizes 40 180 Optimal Greedy Random 160 Minimum cover time 140 150 100 35 Average cost per cycle n= 10 n= 20 n= 30 200 Minimum cover time Comparison of ACPC under different algorithms Comparison of selection algorithms to minimize cover time 250 120 100 80 60 Random Centrality Submodular 30 25 20 15 10 40 50 5 20 0 0 0 0 5 10 15 20 25 30 0 2 4 6 8 10 12 14 16 18 20 Number of input nodes, k Number of input nodes, k (a) (b) 1 2 3 4 5 Number of input nodes, k (c) Fig. 1. Numerical evaluation for fixed probability distribution. (a) Minimum cover time as a function of number of nodes, obtained by varying the parameter λ for different network sizes. The minimum cover time steadily increases as a function of the number of nodes. (b) Comparison of minimum cover time for different optimization algorithms, namely, random selection, greedy algorithm and submodular minimization. (c) Performance of Algorithm 2 for minimizing the average cost per cycle. The results of Lemma 8 imply that a greedy algorithm is sufficient to achieve an upper bound of (1 − 1/e) on the hitting time. An analogous lemma for the commute time is as follows. Lemma 9: For any distribution u, the function K(S, u) is supermodular as a function of S. Proof: Let Zi denote the stopping time corresponding to the event {Xk = u, Xl = i for some l < k}. Then K(S, u) = E(mini∈S Zi ), and hence K(S, u) is supermodular as a function of S. P Lemma 9 can be extended to distributions π over the initial state u as K(S, π) = u K(S, u)π(u). The function K(S, π) is then a nonnegative weighted sum of supermodular functions, and hence is supermodular. C. Submodularity of Cover Time The submodularity of the cover time is shown as follows. Proposition 8: The cover time C(S) is nondecreasing and submodular as a function of S. Proof: The result can be proved by using Proposition 7 with the set of events {Zi : i ∈ S} where the event Zi is given as Zi = {Xk = i}. An alternative proof is as follows. Let S ⊆ T ⊆ V , and let v ∈ V \ T . The goal is to show that C(S ∪ {v}) − C(S) ≥ C(T ∪ {v}) − C(T ). Let τv (S) denote the event that the walk reaches v before reaching all nodes in the set S, noting that τv (T ) ⊆ τv (S). Let ZS , ZT , and Zv denote the times when S, T , and v are reached by the September 7, 2017 DRAFT 6 27 walk, respectively. We prove that the cover time is submodular for each sample path of the walk by considering different cases. In the first case, the walk reaches node v before reaching all nodes in S. Then C(S) = C(S ∪ {v}) and C(T ) = C(T ∪ {v}), implying that submodularity holds trivially. In the second case, the walk reaches node v after reaching all nodes in S, but before reaching all nodes in T . In this case, C(S ∪ {v}) − C(S) = Zv − ZS , while C(T ∪ {v}) − C(T ) = 0. In the last case, the walk reaches v after reaching all nodes in T . In this case, C(S ∪ {v}) − C(S) = Zv − ZS ≥ Zv − ZT = C(T ∪ {v}) − C(T ), implying submodularity. Taking the expectation over all sample paths yields the desired result. The submodularity of cover time implies that the problem of maximizing the cover time can be approximated up to a provable optimality bound. Similarly, we can select a set of nodes to minimize the cover time by min {C(S) − λ|S| : S ⊆ V |}. The cover time, however, is itself computationally difficult to approximate. Instead, upper bounds on the cover time can be used. We have the following preliminary result. Proposition 9 ([1]): For any set of nodes A, define tA min = mina,b∈A,a6=b Ea (τb ). Then the cover time C(S) is bounded by    1 1 A , f ′ (S). C(S) ≥ max tmin 1 + + · · · + A⊆S 2 |A| − 1 1 . The approximation f ′ (S) can be minimized as follows. We Define c(k) = 1 + 21 + · · · + |A|−1 first have the following preliminary lemma. Lemma 10: The function f ′ (S) is equal to f ′ (S) = max αk c(k), k=1,...,|S| where αk is the k-th largest value of Ea (τb ) among b ∈ S. Proof: Any set A with |A| = k will have the same value of c(A). Hence it suffices to find, for each k, the value of A that maximizes tA min with |A| = k. That maximizer is given by the k elements of S with the largest values of mina∈V E(τb ), and the corresponding value is αk . By Lemma 10, in order to select the minimizer of f ′ (S) − λ|S|, the following procedure is sufficient. For each k, select the k smallest elements of S, and compute βk c(k) − λk, where βk is the k-th smallest value of mina∈V Ea (τb ) over all b ∈ S. September 7, 2017 DRAFT 28 In addition, we can formulate the following problem of minimizing the probability that the cover time is above a given threshold. The value of P r(C(S) > K) can be approximated by taking a set of sample paths ω1 , . . . , ωN of the walk and ensuring that C(S; ωi ) > K in each sample path. This problem can be formulated as N 1 X 1{C(S; ωi ) > K}. P r(C(S) > K) ≈ N i=1 The function 1{C(S; ωi ) > K} is increasing and submodular, since it is equal to 1 if there is a node in S that is not reached during the first K steps of the walk and 0 otherwise. Hence the problem of minimizing the probability that the cover time exceeds a given threshold can be formulated as min {P r(C(S) > K − λ|S| : S ⊆ V } and solved in polynomial time. VI. N UMERICAL R ESULTS We evaluated our approach through numerical study using Matlab. We simulated both the fixed and optimal distribution cases. In the case of fixed distribution, our goal was to determine how the minimum cover time varied as a function of the number of input nodes and the network size. We generated an Erdos-Renyi random graph G(N, p), in which there is an edge (i, j) from node i to node j with probability p, independent of all other edges, and the total number of nodes is N. The value of N varied from N = 10 to N = 50. Figure 1(a) shows the minimum cover time as a function of the cardinality of S. Each data point was obtained by varying the parameter λ in f (S) − λ|S|, resulting in a trade-off curve between the cover time C(S) and the cardinality |S|. The minimum cover time is an increasing function of the number of inputs. We observed that the cover times were similar for the three network sizes. Figure 1(b) compares the optimal selection algorithm with a greedy heuristic and random selection of inputs. We found that the greedy algorithm closely approximates the optimum at a lower computation cost, while both outperformed the random input selection. In the optimal distribution case, we simulated the average cost per cycle (ACPC) problem. We first considered a lattice graph. The set of actions corresponded to moving left, right, up, or down. For each action, the walker was assumed to move in the desired direction with probability September 7, 2017 DRAFT 29 pc , and to move in a uniformly randomly chosen direction otherwise. If an “invalid” action was chosen, such as moving up from the top-most position in the lattice, then a feasible step was chosen uniformly at random. Figure 1(c) shows a comparison between three algorithms. The first algorithm selects a random set of k nodes as inputs. The second algorithm selects input nodes via a centrality-based heuristic, in which the most centrally located nodes are chosen as inputs. The third algorithm is the proposed submodular approach (Algorithm 2). We found that the submodular approach slightly outperformed the centrality-based method while significantly improving on random selection. VII. C ONCLUSION This paper studied the time required for a random walk to reach one or more nodes in a target set. We demonstrated that the problem of selecting a set of nodes in order to minimize random walk times including commute, cover, and hitting times has an inherent submodular structure that enables development of efficient approximation algorithms, as well as optimal solutions for some special cases. We considered two cases, namely, walks with fixed distribution, as well as walks in which the distribution is jointly optimized with the target set in order to minimize the walk times. In the first case, we developed a unifying framework for proving submodularity of the walk times, based on proving submodularity of selecting a subset of stopping times, and derived submodularity of commute, cover, and hitting time as special cases. As a consequence, we showed that a set of nodes that minimizes the cover time can be selected using only polynomial number of evaluations of the cover time, and further derived solution algorithms for bounds on the cover time. In the case where the distribution and target set are jointly optimized, we investigate the problems of maximizing the probability of reaching the target set, minimizing the average cost per cycle of the walk, as well as joint optimization of these parameters. We proved that the former problem admits a relaxation that can be solved in polynomial time, while the latter problem can be approximated via submodular optimization methods. In particular, the average cost per cycle can be minimized by minimizing the volume of an associated linear polytope, which we proved to be a supermodular function of the input set. R EFERENCES [1] D. A. Levin, Y. Peres, and E. L. Wilmer, Markov Chains and Mixing Times. American Mathematical Soc., 2009. September 7, 2017 DRAFT 30 [2] L. Lovász, “Random walks on graphs,” Combinatorics, Paul erdos is eighty, vol. 2, pp. 1–46, 1993. [3] J. Ghaderi and R. Srikant, “Opinion dynamics in social networks: A local interaction game with stubborn agents,” in American Control Conference (ACC), 2013. IEEE, 2013, pp. 1982–1987. [4] S. Boyd, A. Ghosh, B. Prabhakar, and D. Shah, “Randomized gossip algorithms,” IEEE/ACM Transactions on Networking (TON), vol. 14, no. SI, pp. 2508–2530, 2006. [5] 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. [6] P. Sarkar and A. W. Moore, “Random walks in social networks and their applications: a survey,” Social Network Data Analytics, pp. 43–77, 2011. [7] N. L. D. Khoa and S. Chawla, “Large scale spectral clustering using approximate commute time embedding,” arXiv preprint arXiv:1111.4541, 2011. [8] L. Yen, F. Fouss, C. Decaestecker, P. Francq, and M. Saerens, “Graph nodes clustering based on the commute-time kernel,” Advances in Knowledge Discovery and Data Mining, pp. 1037–1045, 2007. [9] F. Fouss, A. Pirotte, J.-M. Renders, and M. Saerens, “Random-walk computation of similarities between nodes of a graph with application to collaborative recommendation,” IEEE Transactions on Knowledge and Data Engineering, vol. 19, no. 3, 2007. [10] G. F. Lawler, Random Walks and the Heat Equation. American Mathematical Society, 2010. [11] P. G. Doyle and J. L. Snell, Random Walks and Electric Networks. Mathematical Association of America,, 1984. [12] G. Brightwell and P. Winkler, “Maximum hitting time for random walks on graphs,” Random Structures & Algorithms, vol. 1, no. 3, pp. 263–276, 1990. [13] U. Feige, “A tight upper bound on the cover time for random walks on graphs,” Random Structures & Algorithms, vol. 6, no. 1, pp. 51–54, 1995. [14] L. Yen, M. Saerens, A. Mantrach, and M. Shimbo, “A family of dissimilarity measures between nodes generalizing both the shortest-path and the commute-time distances,” in Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2008, pp. 785–793. [15] F. Hunt, “An algorithm for identifying optimal spreaders in a random walk model of network communication,” Journal of Research of the National Institute of Standards and Technology, vol. 121, 2016. [16] A. Clark, L. Bushnell, and R. Poovendran, “A supermodular optimization framework for leader selection under link noise in linear multi-agent systems,” IEEE Transactions on Automatic Control, vol. 59, no. 2, pp. 283–296, 2014. [17] A. K. Chandra, P. Raghavan, W. L. Ruzzo, R. Smolensky, and P. Tiwari, “The electrical resistance of a graph captures its commute and cover times,” Computational Complexity, vol. 6, no. 4, pp. 312–340, 1996. [18] C. Avin and C. Brito, “Efficient and robust query processing in dynamic environments using random walk techniques,” Proceedings of the 3rd international symposium on Information processing in sensor networks, pp. 277–286, 2004. [19] X. C. Ding, S. L. Smith, C. Belta, and D. Rus, “MDP optimal control under temporal logic constraints,” IEEE Conference on Decision and Control (CDC), pp. 532–538, 2011. [20] D. Aldous and J. Fill, Reversible Markov Chains and Random Walks on Graphs. Berkeley, 2002. [21] D. Coppersmith, P. Tetali, and P. Winkler, “Collisions among random walks on a graph,” SIAM Journal on Discrete Mathematics, vol. 6, no. 3, pp. 363–374, 1993. [22] C. Banderier and R. P. Dobrow, “A generalized cover time for random walks on graphs,” Formal Power Series and Algebraic Combinatorics, pp. 113–124, 2000. [23] A. Clark, B. Alomair, L. Bushnell, and R. Poovendran, “Minimizing convergence error in multi-agent systems via leader September 7, 2017 DRAFT 31 selection: A supermodular optimization approach,” IEEE Transactions on Automatic Control, vol. 59, no. 6, pp. 1480–1494, 2014. [24] H. Qiu and E. R. Hancock, “Clustering and embedding using commute times,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 29, no. 11, 2007. [25] J. Fu, N. Atanasov, U. Topcu, and G. J. Pappas, “Optimal temporal logic planning in probabilistic semantic maps,” in Robotics and Automation (ICRA), 2016 IEEE International Conference on. IEEE, 2016, pp. 3690–3697. [26] C. H. Papadimitriou and J. N. Tsitsiklis, “The complexity of markov decision processes,” Mathematics of operations research, vol. 12, no. 3, pp. 441–450, 1987. [27] M. Maı̈ga, N. Ramdani, L. Travé-Massuyès, and C. Combastel, “A comprehensive method for reachability analysis of uncertain nonlinear hybrid systems,” IEEE Transactions on Automatic Control, vol. 61, no. 9, pp. 2341–2356, 2016. [28] C. Belta, “Formal synthesis of control strategies for dynamical systems,” in Decision and Control (CDC), 2016 IEEE 55th Conference on. IEEE, 2016, pp. 3407–3431. [29] C. Baier, J.-P. Katoen, and K. G. Larsen, Principles of Model Checking. MIT press, 2008. [30] X. 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, vol. 59, no. 5, pp. 1244–1257, 2014. [31] L. Lovász and M. Simonovits, “Random walks in a convex body and an improved volume algorithm,” Random Structures & Algorithms, vol. 4, no. 4, pp. 359–412, 1993. [32] L. A. Wolsey, “An analysis of the greedy algorithm for the submodular set covering problem,” Combinatorica, vol. 2, no. 4, pp. 385–393, 1982. Andrew Clark (M’15) is an Assistant Professor in the Department of Electrical and Computer Engineering at Worcester Polytechnic Institute. He received the B.S. degree in Electrical Engineering and the M.S. PLACE PHOTO HERE degree in Mathematics from the University of Michigan - Ann Arbor in 2007 and 2008, respectively. He received the Ph.D. degree from the Network Security Lab (NSL), Department of Electrical Engineering, at the University of Washington - Seattle in 2014. He is author or co-author of the IEEE/IFIP William C. Carter award-winning paper (2010), the WiOpt Best Paper (2012), and the WiOpt Student Best Paper (2014), and was a finalist for the IEEE CDC 2012 Best Student-Paper Award. He received the University of Washington Center for Information Assurance and Cybersecurity (CIAC) Distinguished Research Award (2012) and Distinguished Dissertation Award (2014). He holds a patent in privacy-preserving constant-time identification of RFID. His research interests include control and security of complex networks, submodular optimization, control-theoretic modeling of network security threats, and deception-based network defense mechanisms. September 7, 2017 DRAFT 32 Basel Alomair (SM’16) is an Associate Professor and Founding Director of the National Center for Cybersecurity Technology (C4C) in King Abdulaziz City for Science and Technology (KACST), an PLACE PHOTO HERE Affiliate Professor and co-director of the Network Security Lab (NSL) at the University of WashingtonSeattle, an Affiliate Professor at King Saud University (KSU), and an Information Security Officer at the Technology Control Company (TCC). He received the B.S. degree in Electrical Engineering from the King Saud University and the M.S. degree in Electrical and Computer Engineering from the University of Wisconsin - Madison in 1998 and 2003, respectively. He received the Ph.D. degree from the Network Security Lab, Department of Electrical Engineering, at the University of Washington - Seattle in 2011. He was recognized by the IEEE Technical Committee on Fault-Tolerant Computing (TC-FTC) and the IFIP Working Group on Dependable Computing and Fault Tolerance (WG 10.4) with the 2010 IEEE/IFIP William Carter Award for his significant contributions in the area of dependable computing. His research in information security was recognized with the 2011 Outstanding Research Award from the University of Washington. He was also the recipient of the 2012 Distinguished Dissertation Award from the University of Washingtons Center for Information Assurance and Cybersecurity (UW CIAC), and he was a co-author of the 2014 WiOpt Best Student Paper Award. Linda Bushnell (F’17) is a Research Associate Professor and the Director of the Networked Control Systems Lab in the Electrical Engineering Department at the University of Washington. She received the PLACE PHOTO HERE B.S. degree and M.S. degree in Electrical Engineering from the University of Connecticut - Storrs in 1985 and 1987, respectively. She received the M.A. degree in Mathematics and the Ph.D. degree in Electrical Engineering from the University of California - Berkeley in 1989 and 1994, respectively. She also received the MBA from the University of Washington Foster School of Business in 2010. Her research interests include networked control systems, control of complex networks, and secure-control. She was elected a Fellow of the IEEE for her contributions to networked control systems. She is a recipient of the US Army Superior Civilian Service Award, NSF ADVANCE Fellowship, and IEEE Control Systems Society Recognition Award. She was the Co-Editor of a special issue of the Asian Journal of Control and Guest Editor for three issues of the IEEE Control Systems Magazine. For the IEEE Control Systems Society, she is a Member of the Board of Governors, a Distinguished Lecturer, a Chair of the Women in Control Standing Committee, a member of the TC Control Education, a member of the History Committee, and the Liaison to IEEE Women in Engineering. She is also the Treasurer of the American Automatic Control Council. September 7, 2017 DRAFT 33 Radha Poovendran (F’15) is a Professor and the Chair of the Electrical Engineering Department at the University of Washington (UW). He is the Director of the Network Security Lab (NSL) at the University PLACE PHOTO HERE of Washington. He is the Associate Director of Research of the UW Center for Excellence in Information Assurance Research and Education. He received the B.S. degree in Electrical Engineering and the M.S. degree in Electrical and Computer Engineering from the Indian Institute of Technology- Bombay and University of Michigan - Ann Arbor in 1988 and 1992, respectively. He received the Ph.D. degree in Electrical and Computer Engineering from the University of Maryland - College Park in 1999. His research interests are in the areas of wireless and sensor network security, control and security of cyber-physical systems, adversarial modeling, smart connected communities, control-security, games-security and information theoretic security in the context of wireless mobile networks. He was elected a Fellow of the IEEE for his contributions to security in cyber-physical systems. He is a recipient of the NSA LUCITE Rising Star Award (1999), National Science Foundation CAREER (2001), ARO YIP (2002), ONR YIP (2004), and PECASE (2005) for his research contributions to multi-user wireless security. He is also a recipient of the Outstanding Teaching Award and Outstanding Research Advisor Award from UW EE (2002), Graduate Mentor Award from Office of the Chancellor at University of California - San Diego (2006), and the University of Maryland ECE Distinguished Alumni Award (2016). He was co-author of award-winning papers including IEEE/IFIP William C. Carter Award Paper (2010) and WiOpt Best Paper Award (2012). September 7, 2017 DRAFT
3cs.SY
Computer-Aided Knee Joint Magnetic Resonance Image Segmentation - A Survey Boyu Zhang1, Yingtao Zhang2, H. D. Cheng2, Min Xian3, Shan Gai4, Olivia Cheng5,6, Kuan Huang1 Abstract—Osteoarthritis (OA) is one of the major health issues among the elderly population. MRI is the most popular technology to observe and evaluate the progress of OA course. However, the extreme labor cost of MRI analysis makes the process inefficient and expensive. Also, due to human error and subjective nature, the inter- and intra-observer variability is rather high. Computer-aided knee MRI segmentation is currently an active research field because it can alleviate doctors and radiologists from the time consuming and tedious job, and improve the diagnosis performance which has immense potential for both clinic and scientific research. In the past decades, researchers have investigated automatic/semi-automatic knee MRI segmentation methods extensively. However, to the best of our knowledge, there is no comprehensive survey paper in this field yet. In this survey paper, we classify the existing methods by their principles and discuss the current research status and point out the future research trend in-depth. Index Terms— Magnetic resonance imaging (MRI); Knee Osteoarthritis; Segmentation; Computer-aided Diagnosis (CAD); Bone. I. INTRODUCTION K nee osteoarthritis (OA) is chronic and progressive disease characterized by structural changes in cartilage, bone, synovium, and other joint structures [1-3]. Knee OA is one of the leading cause of disability in the United States, which results a decrease in quality of life as well as a large financial burden on health care systems and society. Knee OA is prevalent and costly. It was estimated that symptomatic knee OA afflicts more than 9.9 million US adults in 2010 [4]. In the meantime, the estimated average lifetime treatment cost for each person diagnosed with knee OA was $140,300 [5]. There is growing understanding about knee OA after decades of research, although the pathogenesis of knee OA and the development mechanism is still unknown. One of the main effects of knee OA is the degradation of the articular cartilage, causing pain and loss of joints mobility [6]. Therefore, the 1 Department of Computer Science, Utah State University, Logan, Utah 84322, USA 2 School of Computer Science and Technology, Harbin Institute of Technology, China 3 Department of Computer Science, University of Idaho, Idaho Falls, Idaho 83402 USA 4 School of Information Engineering, Nanchang Hangkong University, Nanchang 330063, China. 5 Collingwood General and Marine Hospital, Collingwood, ON L9Y 3Z1, Canada 6 Department of Surgery, McMaster University, Hamilton, ON L8S 4L8, Canada. volume and thickness of knee joint cartilage are the most important criteria to evaluate the course of Knee OA and to plan the treatments. Different medical imaging modalities could be employed to investigate and quantitatively measure the knee joint cartilage, such as X-ray, Magnetic resonance imaging (MRI), and Computed Tomography (CT) [7]. Among them, X-ray and CT have similar responses on soft tissues and cartilage, and only can estimate cartilage thickness through the distance between bones [8]. A technology of CT, referred as knee arthrography, could overcome the above disadvantage, and display the articular cartilage clearly [9]. However, the pre-injection, which is requisite in knee arthrography, may cause pain and anxiety for some people besides possible complications [10]. MRI is the leading imaging modality for noninvasive assessment of the articular cartilage, and the cartilage deterioration can be analyzed effectively [11, 12]. MRI employs powerful magnetic field and radio frequency pulses to produce images of organs, soft tissues, bones, and virtually all internal body structures [13]. Knee MRI provides high-resolution images of the structures within the knee joint, including bones, cartilages, tendons, ligaments, muscles, and blood vessels, from different angles. A regular knee MRI image may contain hundreds of slices (e.g., 160 slices per scan in OAI dataset [14-16]), depending on the sample rate. It costs hours for experienced radiologists to analyze a single scan [14]. The significant labor cost makes the diagnosis expensive, inefficient, and difficult to reproduce. The computer-aided segmentation technologies of knee MRI are in urgent need [17]. Automatic/semi-automatic segmentation is difficult due to the low contrast, noise, and especially the thin structure of cartilage. The efforts against such issues have been devoted for decades [11, 12, 17, 18]. Automatic volume and thickness measurements based on the manual label is the first step toward automatic analysis. The semi-automatic segmentation methods perform knee MRI segmentation with the intervention of doctors/radiologists through human-computer interaction. Semi-automatic segmentation could be accomplished using a variety of algorithms, such as active contours [19-22], region growing [23-25], Ray Casting [26, 27], Live Wire [28], Watershed [29], etc. Instead of sketching accurate boundaries manually, semi-automatic methods can generate accurate contours for each tissue in MRI scan based on a few landmarks, which is much more efficient and less afflictive. Semi-automatic methods have been widely applied to both scientific research and clinical practice because of the effectiveness. Accompany with the development of computer vision, pattern recognition, and machine learning, many automatic methods for knee MRI segmentation have been proposed, such as deformable models [30-32], classification-based methods [33-37], and graph-based methods [38-40], etc. Fully automatic segmentation is the major research goal in the field and has great potential. Knee MRI segmentation, a specific subfield of multi-atlas image segmentation [41], has developed rapidly in recent decades. Researchers have conducted the surveys in related areas, such as brain MRI image segmentation [42], 3D medical image segmentation [43], Multi-atlas image segmentation [41], etc. However, to the best of our knowledge, there is no effective survey for knee MRI segmentation yet. This paper describes the knee MRI segmentation principles and gives a comprehensive review of computer-aided knee MRI segmentation methods. Moreover, we compare the existing methods advantages/disadvantages and point out the future research direction. The rest of this paper is organized as follows: Section 2 summarizes the existing knee joint MRI segmentation methods; Section 3 describes the volume and thickness measurement methods; Section 4 gives a brief view of existing benchmarks and dataset as well as the performance evaluation metrics; and Section 5 concludes the entire paper and points out the future trend. II. KNEE MR IMAGE SEGMENTATION A. Overview Accurate segmentation plays an essential role in computer-aided knee osteoarthritis diagnosis, and different methods were developed in recent decades. Depending on the level of automation, the existing methods could be categorized into manual segmentation, semi-automatic segmentation, and automatic segmentation. In the procedure of manual segmentation, the radiologists sketch the contours of different tissues on the MR images in a slice by slice manner. Manual segmentation is very labor intensive and time-consuming. It could take 3 to 4 hours for a well-trained radiologist to finish single scan. In addition, manual segmentation suffers from low reproducibility. Semi-automatic methods are proposed to address the disadvantages of the manual method, by introducing computer algorithms. Semi-automatic methods, such as active contour [20-22, 44-51] and region growing [24, 25, 37, 52-55], provide a human-computer interface that users (radiologists/doctors) can input their professional knowledge (landmarks) into the system. Then the algorithm will generate the tissue boundaries based on the given landmarks automatically. Semi-automatic segmentation methods benefit from the professional knowledge and avoid intensive labor. Computer-Aided Diagnosis (CAD) systems equipped semi-automatic segmentation software are widely applied in the clinic because of the high accuracy. The past decades have witnessed the rapid development of automatic knee joint segmentation. Researchers in both academia and medicine expect that by using computers with the related software, the systems can segment MRI images and quantize the cartilage thickness and volume with minimum or no human intervention. Fully automatic segmentation can be achieved by different approaches, such as pixel/voxel classification [33-37, 56-66], deformable model [20-22, 30-32, 44-51, 67-78] and graph-based methods [38-40, 79, 80]. Fully automatic knee joint segmentation suffers from the low contrast of MR image and the thin structure of the cartilage. Most state-of-the-art methods share the similar procedure. They start at the bone segmentation, which is less complex; and then sketch the boundaries of cartilage based on the result of bone segmentation. The cartilage volume and thickness are the principal factors in OA diagnosis and progress evaluation. In general, the measurement of cartilage volume is quite straightforward. The task can be done by simply counting the number of pixels when the boundaries of cartilage are determined. However, the evaluation of thickness is more complex. Several studies define the thickness of 2-D MR image slice [21] while others define the thickness of 3-D space [48]. 3-D Euclidean Distance Transformation (EDT) [81] is commonly used to determine the distance between the cartilage surface and the Bone-Cartilage Interface (BCI). There are also researches transfer 3-D cartilage structures into thickness map and find local cartilage loss among the map [46]. Bones are the biggest and the most salient structure in the knee joint. Other structures, such as cartilage, are attached to the bones. The segmentation of bones is simpler than cartilage segmentation due to higher contrast and much clearer edges. Many methods perform cartilage segmentation based on bone segmentation results; while other methods solve both bone and cartilage segmentation at the same time. There are also researchers develop end-to-end systems to solve the knee MR image segmentation problem in full. B. Deformable Models Deformable models [82], ones of the most intensively studied model-based approaches for computer-aided medical image analysis, can accommodate the often-significant variability of biological structures over time and across different individuals. This subsection surveys the applications of deformable models to knee joint MRI segmentation. 1) Active Contours Active contour models [20] [83] are very popular for semi-automatic medical image segmentation. An active contour model is defined by a set of points vi , where i = 0,1, … , n − 1; the internal elastic energy Ei and external energy Ee . The internal energy controls the deformations made to the snake, and the external energy term drives the curve to the object contour. The algorithm seeks the best segmentation by minimizing the energy function. A bunch of active contour models were introduced for knee MRI segmentation, such as B-spline [44, 48], Bezier spline [45], geodesic snake [50], GVF snake [51], and snake [22, 46, 49]. The performance of active contour models depends very much on the selection of initialization points. However, there existed hardly any literature about how to select the initial points in the field of knee MRI analysis. Existing methods [20-22, 44-51] started from the points inputted by human operators. Active contour models benefit from the participation of human experts, as well as the real-time guidance and correction. However, the dependence on human participation hindered the development of the algorithms. Different models and energy functions were utilized in knee MRI segmentation. Carballido-Gamio et al. [45] proposed a Bezier spline-based method. The edges were found based on the first derivative of the brightness using bicubic interpolation along the line profiles. Cohen et al. [48] used an interpolated cubic B-spline curve to fit the initial set of points. The algorithm evaluated the image gradient vector using the Prewitt convolution kernel [84]. Parametric spline models were convenient for user interaction and were easier to implement. However, the global information was not considered in parametric spline models, and the models were difficult to converge. The classic snake models considered both local features and global shapes. Kauffmann et al. [62] minimized the edge energy to deform the contour over the most significant neighboring image edge. A symmetric Windowed-Sinc filter was utilized to conduct contour regulation. Lynch et al. [44, 85] considered both the sign of the edge strength and the local direction of the boundary in the classical snake model. Brem et al. [49] and Duryea et al. [22] utilized snake model for knee MRI segmentation. The classical snake models were sensitive to the initialization. The optimization of these models was non-convex, and it could fall into a local minimum. Another disadvantage of the classic snake models was their difficulties in fitting concave boundaries. By introducing gradient vector flow as a new external force, GVF snake model could solve the sensitivity to initialization and the fitting problem on concave shape boundary. Tang et al. [51] utilized GVF snake for knee MRI segmentation, and the experimental results showed that the method achieved better reproducibility, comparing to previous studies. Lorigo et al. [50] utilized GAC snake model for knee MRI segmentation and achieved accurate results. GAC snake model was based on the relationship between active contours and the computation of geodesics or minimal distance curves. The algorithm was robust to initialization and could handle the topological variances of the curve. However, the algorithm had difficulties when the edges were blur or with low contrast. Methods based on active contour model segmented knee MRI in a slice-by-slice manner. The broad application of slice selection technics could speed up the segmentation process, reduce the labor cost, and improve the performance. The method in [22] performed a two-dimensional segmentation on each slice of the MRI. A slice near the center of the cartilage plate was selected, and a seed point on the bone-cartilage margin was marked. The software then employed an automated edge tracking algorithm to segment the cartilage on the slice. An automatic active contour algorithm was utilized to refine the segmentation. Once a central slice was segmented, the software proceeded to an adjacent slice using the computer-delineated margins from the previous slice and an active contour edge-detection algorithm conducted automatic segmentation. A similar strategy was used in [44] and [49]. Active contours had been widely applied to knee MRI segmentation. High precision could be achieved by making a minimal number of user inputs. Active contours also allowed an experienced user to guide, correct and validate the segmentation results in real-time. However, the active contours had limitations in convergence, and the optimization problem leads uncertainty and poor stability of the segmentation. Table 1 presents the existing knee MRI segmentation methods based on active contour model and lists the weakness of the methods. Table 1 Active Contour for Knee Joint Segmentation Method Publication Target Geodesic Active Contour. Lorigo et al. [50]. Bone Cubic B-spline; Bezier Spline. Cohen et al. [48]; Lynch et al. [44]; Carballido-Gamio et al. [45, 47]. Cartilage Directional GVF Snake. Tang et al. [51]. Cartilage Active Contour. Duryea et al. [22]; Kauffmann et al. [46]; Brem et al. [49]. Cartilage Weakness GAC snake model was sensitive to edge clarity. Further process was needed for these methods; The methods were sensitive to initialization; The optimization was non-convex; The convergence was not guaranteed. GVF snake model could not handle long, thin concave shape. Sensitive to initialization; The optimization is non-convex, and the algorithm will fall into local minimum easily; 2) Statistical Shape Models The Statistic Shape Models (SSMs) [43] represent the shape of target objects using a set of n landmarks and learn the valid ranges of shape variation from a training set of the labelled images. The shape model can be matched with new image using different algorithms, where the Active Shape model (ASM) [69, 86] and Active Appearance Model (AAM) are the most widely studied. Compared to the active contour models, AAMs are more informative and allow the algorithms to locate target object without operator intervention. They could converge to object boundaries base on shape restrictions, where the active contour models are powerless. Both AAM and ASM use the same underlying statistical model of the target object shape. However, ASM seeks to match a set of model points to an image and AAM seeks to match both the position of the model points and a representation of the object texture to an image. There are two key differences between the two algorithms [87]: First, ASM only uses the image texture in small regions around the landmark points, whereas AAM uses the appearance of the whole region; second, ASM minimize the distance between model points and the corresponding points found in the image, whereas AAM seeks to minimize the difference between the synthesized model image and the target image. In general, ASM is faster, and it locates feature point location more accurately, comparing to AAM. However, AAM gives a better match to the texture. Solloway et al. [21] used 2D ASM to segment bone and cartilage in a slice-by-slice manner. In addition to modeling shape variation, the method modeled the gray-level appearance of the objects of interest by examining small image patches around each landmark point. They claimed that their local appearance model could reduce the dependency of sharp edges. 2D methods could hardly model 3D structures because the relationship between slices was ignored. Moreover, the results of 2D methods need further processing in most cases. 3D methods attract more attention comparing to 2D methods. ASM and AAM are built utilizing labeled MRI samples. Because of the inter-object variations, finding the correspondences between the dense landmarks is a crucial step for both model construction and segmentation. Most studies [30-32, 67, 70, 71, 76, 78] utilized minimum description length (MDL) [88] and its variations [89] to find the correspondences. Besides MDL, Schmid et al. [77] preferred the approach of Dalal et al. [90]. They claimed their method did not require any specific shape topology and was appropriate to refine a previous correspondence. Registration technologies are widely applied to model initialization. Fripp et al. [67] argued that the method in [21] was sensitive to initialization. They introduced a robust affine registration to initialize the model automatically. In [30, 31], the authors introduced a robust affine registration to initialize the model automatically. The introduction of registration could enhance the robustness to initialization. As an essential component of ASM and AAM algorithms, principal component analysis (PCA) was applied in most studies to describe the main directions of shape variation in a training set of example shapes. Beside PCA which captures global shape variations, Markov Random Fields (MRF) were used to capture global shape variations and local deformations, respectively [74]. Table 2 The ASMs and the AAMs for Knee MRI Segmentation Model Targets Solloway et al. [21]. ASM (2D) Bone/Cartilage Fripp et al. [30, 31, 67]; Schmid et al. [74, 77]. ASM (3D) Bone Gilles et al. [75]; Seim et al. [73]. ASM (3D) Bone/Cartilage Vincent et al. [32]; Williams et al. [70, 71]. AAM Bone/Cartilage Weakness 1. 3D structures were ignored in the model; 2. Post processing was needed. 1. The search for initial model pose parameters can be very time consuming; 2. The initialization was based on manually defined landmarks. 1. Such models only reach a local optimum and depend heavily on their initial position; 2. The cartilage segmentation largely depends on the preset parameter ‘thickness.' Variation outside these spaces cannot be properly captured if no subsequent relaxation step is used; For ASM, iterative approaches are usually employed to find the best match with new images. For each iteration, the algorithm examines the region around current model points (Xi , 𝑌𝑌𝑖𝑖 )to find the best nearby match (Xi′ , Yi′ ), then updates the parameters (𝑡𝑡𝑥𝑥 , 𝑡𝑡𝑦𝑦 , 𝑠𝑠, 𝜃𝜃, 𝑏𝑏) for the best fit of the model to the newly found point set X'. The process will repeat until convergence. Instead of searching around each model point locally, AAMs seek to minimize the difference between a new image and a synthesized appearance model. Under the restriction of a set of model parameters, a hypothesis for shape 𝑥𝑥 , and texture 𝑔𝑔𝑚𝑚 is generated for the instance. Then the difference between the hypothesis and the image is evaluated by computing 𝛿𝛿𝑔𝑔 = 𝑔𝑔𝑠𝑠 − 𝑔𝑔𝑚𝑚 , where 𝑔𝑔𝑠𝑠 is the image texture. The final segmentation is done by minimizing the magnitude of |𝛿𝛿𝑔𝑔 |. ASM and AAM can model the structure in the knee joint well and could be applied to both bone and cartilage segmentation. These models perform better on bone segmentation than on cartilage segmentation because of the thin structure of the cartilage. AAMs and ASMs highly rely on the datasets used and thus are not easy to reproduce. Table 2 summarizes the existing studies based on AAMS and ASMs. C. Classification-based Methods Both voxel classification-based methods and region-growing methods share the same principle that one or more classifiers are learned from training samples to distinguish foreground from background. Classification based methods are robust and could benefit from the growing size of the training data. Furthermore, voxel classification-based methods are the most effective and straightforward way to achieve fully-automatic knee MRI segmentation. 1) Voxel Classification A lot of efforts had been devoted to voxel classification (VC) based methods in recent years. These methods have obvious advantages. First, the philosophical model is concise, and the computing process is straightforward; second, a variety of features, both local and global, could be combined to achieve a better performance; and third, these methods could obtain better performance by effectively utilizing substantial training samples. The over-segmentation of the cartilage surface is one of the main drawbacks. Moreover, the VC based methods are inefficient compared with other methods because of the considerable number of voxels. The first study on VC based knee MRI segmentation, which was also considered as the first fully-automatic knee joint MRI segmentation [37], was reported by Folkesson et al. [33]. The framework included a two-class kNN classifier for distinguishing foreground (articular cartilage) from other tissues, and a three-class kNN classifier assigned each voxel as bones (tibial and femoral), cartilage and background. A variety of features were used that included the 3-jet (first, second and third order derivatives on 𝑥𝑥, 𝑦𝑦, 𝑧𝑧 [91]), the Hessian matrix, the structure tensor (ST) [92], etc. They claimed that Hessian and ST were the most effective features. The above method was extended in [58], where the combination of two binary classifiers replaced the single three-class classifier. It was reported that the combination of binary classifiers outperformed the three-class classifier. The method achieved 84.14%, 99.89%, 0.811 on sensitivity, specificity, and DSC, respectively. A further study improved the efficiency by focusing mainly on the cartilage voxels [64]. The 2.5 hour segmentation duration of the original algorithm impeded its application [33]. In recent years, more VC based methods were proposed to accompany with the rapid advance of the computational power. A two-stage classification framework was utilized to achieve accurate cartilage segmentation [57]. They used kNN as the first classifier for highly accurate background detection. Then they use a non-linear SVM to make the final decision on voxels that were not identified. Shan et al. [34] developed the algorithm based on Folkesson’s methods [33, 58, 64] by using a probabilistic version of kNN classifier to integrate the classification results into a Bayesian framework. The spotlight of this work is to introduce multi-atlas registration for generating the spatial prior. An extensive validation of the proposed method and the results were summarized in [35]. Moreover, this method was utilized in [60] as the foundation for disease region detection using knee MRI. Wang et al. [63] presented a novel multiresolution patch-based segmentation framework that established a coarse initial segmentation quickly using the lowest resolution image and then refined the results using higher resolutions subsequently. kNN was utilized as the classifier and slices were selected based on a histogram of gradients. Table 3 VC based Methods for Knee Joint Segmentation Classifier Folkesson et al. [33] KNN Folkesson et al. [58] KNN Prasson et al. [57] KNN+SVM Shan et al. [34] Probabilistic KNN Wang et al. [63] KNN Liu et al. [62] Random Forest Dam et al. [56] KNN Prasson et al. [59] CNN Pros The method could segment knee MRI fully automated. The combination of two-class KNN outperformed the three-class KNN [33]. The computational efficiency was improved by using two-stage classification framework. The spatial prior generated by multi-atlas registration improved both performance and computational efficiency. The introduced novel multiresolution patch-based segmentation framework allowed a coarse-to-fine segmentation. Improved the performance by introducing context information. The rigid multi-atlas registration allowed the multi-structure segmentation. The introduced deep feature improved the performance. Cons 1. Very low computational efficiency; 2. Over-segmentation on the BCI; 3. The training process is time-consuming; 4. A large number of training samples are needed. The voxel classifier focuses on the local feature of each voxel and its position. To improve the performance, researchers try to add the global feature into the voxel classification. Liu et al. [62] utilized random forest as voxel classifier and combined appearance features and context feature. They claimed that the cartilage was typically small and thus the tentative segmentation results were too unreliable to provide satisfactory context information. They introduced a multi-atlas registration process to solve the problem. Dam et al. [56] proposed a segmentation framework combining rigid multi-atlas registration with voxel classification in a multi-structure setting. They registered two given scans by maximizing the normalized mutual information [93] (NMI) using L-BFGS-B (Fortran subroutines for large-scale bound constrained optimization) optimization [94]. They solved the unbalance between different structures by utilizing a simple sampling scheme. In the training process, kNN was selected as a voxel classifier and floating forward feature selection [95] was used for feature selection based on the Dice volume overlap score. The experiments utilized 1907 samples. A basic idea to improve the performance of voxel classification methods is to improve the classifier. Prasson et al. [59] introduced the deep feature to knee MRI segmentation. They used a Convolutional Neural Network as the classifier, and the features were similar to that in [64]. As the most popular methods, voxel classification-based methods consider not only the local appearance but also the relationship among slices. The current trend is to combine the global feature with voxel classification method. How to reduce the dependency on position information is another important problem to solve. Table 3 summarizes the representative VC based segmentation algorithms. 2) Region Growing Region growing [23] is one of the most popular image segmentation methods. As the first step of region growing, one or more seed points must be selected. Then the regions grew from the seed points to the adjacent points depending on a region membership criterion. The criterion could be, for instance, pixel intensity, grayscale texture, color, etc. Region growing methods are categorized as classification-based methods since the above process could be solved as a binary classification problem. Region growing methods have been extensively studied in other areas as well. In knee MRI segmentation, most region growing based methods are semi-automatic because the seed points need to be selected manually [25]. An automatic method to select seed points was presented [37]. In this method, a candidate was generated with a 3-D Gaussian, and a classifier determined whether it was cartilage. The candidates that were classified into cartilage were selected as the seeds. Then the result of the voxel classification was used as the criteria of region growing. Region growing methods have difficulties in handling the thin structure of cartilage; therefore, it is widely applied on bone segmentation, and only few researchers utilize it on cartilage segmentation. D. Graph-based Methods Graph-based segmentation is widely used in multi-surface and multi-object segmentation tasks. The methods model the initial segmentation by utilizing graph model and then optimize the model by minimizing specific cost functions. Most graph-based methods need pre-segmentation results as the initialization. There are methods constructed pre-segmentation results automatically [37, 53]. A layered optimal graph image segmentation of multiple objects and surfaces (LOGISMOS) was proposed [40]. The algorithm took a pre-segmentation result as the input, then performed the segmentation task by utilizing graph model. The final segmentation was accomplished by optimizing the cost function. In [39], a level set based algorithm for automated bone surface pre-segmentation was used as initialization; then the implicit surface was converted to an explicit triangular mesh which was optimized. Finally, the mesh was used to initialize a graph in a narrow band around the pre-segmented bone surface, and a multi-surface graph search algorithm was used to obtain the precise cartilage and bone surfaces simultaneously. In [38], Li et al. employed a graph-construction scheme based on triangulated surface meshes obtained from a topological pre-segmentation and utilized an efficient graph-cut algorithm for global optimality. In [80], seeds were manually marked to indicate cartilage and non-cartilage. The seeds were propagated slice-by-slice, and a graph cuts algorithm segmented the cartilage regions automatically. The optimal segmentation satisfies the global criteria. The pre-segmentation could be performed automatically. In [79], a content-based, two-pass disjoint block discovery mechanism was designed to support automation, segmentation initialization, and post-processing. The block discovery was achieved by classifying the image content to bone and background blocks according to their similarity to the categories in the training data collected from typical bone structures and background. The classified blocks are used to design an efficient graph-cut based segmentation algorithm. This algorithm required constructing a graph using image pixel data followed by applying a maximum-flow algorithm which generates a minimum graph-cut as an initial image segmentation. Content-based refinements and morphological operations were applied to obtain the final segmentation. Graph-based methods achieve impressive results on knee MRI segmentation as widely applied models. The efficiency of graph-based methods is lower than that of deformable models but higher than that of VC-based methods. One of the major disadvantages of graph-based methods is that these methods need pre-segmentation results to initialize. Graph-based methods work well for refining the segmentation, but it is difficult to build an end-to-end system. based on classification and statistical model. Lynch et al. [46] utilized 3D registration technology to remove human interaction and subjectivity from the process. Atlas-based segmentation is one of the most widely applied methods for MAS. The idea is easy to understand, and there are many methods. However, the performance of registration process is time-consuming, and at least one labeled slice is needed. F. Summary Each knee MRI segmentation method has its advantages and disadvantages. The ACs start at the initial points provided by a human expert. The Region Growing algorithms need pre-selected seed points. Graph-based methods need initialization. The atlas-based methods need at least one labeled slice as initialization. There are difficulties to provide initialization for the above methods. Comparatively, the fully automated framework could be developed more naturally utilize SSMs, AAMs, and classification-based methods. Computational complexity is a major factor. The deformable models are the most efficient. The Atlas-based methods need higher computational power because of the global searching and optimization. The computational complexity is high for the VC-based classification methods. These methods need to process each voxel in the feature space. The graph-based methods need both high storage and high time complexity. Providing a proper initialization could accelerate these algorithms. Table 4 Comparison of Different Methods E. Multi-atlas Segmentation Graph-based methods achieve impressive results on knee MRI segmentation as widely applied models. The efficiency of graph-based methods is lower than that of deformable models but higher than that of VC-based methods. One of the major disadvantages of graph-based methods is that these methods need pre-segmentation results to initialize. Graph-based methods work well for refining the segmentation, but it is difficult to build an end-to-end system. The segmentation of Knee MRI is a typical Multi-Atlas Segmentation (MAS) [41] problem. MAS problems could be solved by propagating the label from one labeled slice to other slices. This process can also be understood as registering unlabeled slices to one or more labeled slices. Atlas-based methods [85, 96-98] had been studied extensively since the last century. In [98], segmentation was achieved through registration which aims at reforming the atlas such that the conditional posterior of the learned (atlas) density was maximized. Authors also employed primal/dual linear programming to accelerate the registration process. In some research, registration is used to provide the initial segmentation. Lee et al. [96] registered all training cases to a target image by a nonrigid registration scheme and selected the best-matched atlases. A locally weighted vote (LWV) algorithm was applied to merge the information from the atlases and generate the initial segmentation. Atlas-based methods could combine with other methods Method Pros 1. SSMs and AAMs 2. 1. Active Contour Voxel Classification 2. 1. 2. 3. Graph-based 1. 2. Atlas-based 1. 2. The methods could be fully-automatic; The models could handle incomplete boundaries well. Low computational complexity; The methods could achieve accurate result with expert interaction. Concise model; High accuracy; The performance could be improved by providing more training samples. High accuracy; Global optimization could be achieved. High accuracy; The process and the results are intuitionistic. Cons 1. 2. 1. 2. 1. 2. 1. 2. 1. 2. The methods have difficulties for cartilage modeling; The performance largely depends on the representativeness of the training samples. It is hard to build automatic system based on Active Contour; Convergence problem. Over-segmentation and the need of post-processing; Computational complexity is high. High computational complexity and high storage requirement; Initialization is needed in most cases. Existing labeled slices should be provided; Difficulties in handling the variations SSMs and AAMs could handle the missing boundaries well. ACs have problems in converging, and missing boundary may lead to unstable. In general, ACs are two-dimensional methods and SSMs and AAMs could work in both 2D and 3D. The 3D structure could provide more information and may produce better performance. SSMs and AAMs learn parameters from training samples. Thus, the sample selection plays a key role in the system. Deformable models work well on bone segmentation. However, SSMs and AAMs are not suitable for cartilage segmentation well because of the thin and curve structure of the cartilage. ACs could be applied to cartilage segmentation directly with human intervention. SSMs and AAMs obtain better performance by finding initial points or correspondences based on the results of bone segmentation. The presence of over segmented protrusions on the surfaces of the segmented cartilage compartments was the main drawback of the VC based methods, besides the high computational complexity. The cartilage edge is not smooth enough in the results of VC-based methods, and there are often holes in disconnected areas. However, classification-based methods develop rapidly. These methods could make structure information into segmentation and gain benefits from the growing size of the training data. [51] calculated the norm vector based on the plain composed of the point and its nearest points, instead of only one point. The so-called ‘T-norm’ method could avoid the possible instability. In 3D spaces, the most widely used methods are 3D Euclidean distance transformation [31, 45, 66, 81, 99] and Laplace equation [31, 60]. Some heuristic searching methods are also used to find the nearest points, such as searching along the normal direction from the inner cartilage [103] and ‘Spans and Ridge’ [100, 101]. Some researchers transfer the original coordination system into a BCI based coordination system in which it can simply calculate the thickness map [46]. Table 5 summarizes the typical methods for thickness measurement. Table 5 Typical Thickness Measurement Methods. Authors 2D/3D Method Weakness IV. BENCHMARK AND EVALUATION 1. The distance defined in 2D space could not accurately reflect the true thickness; 2. The method is unstable. The distance defined in 2D space could not accurately reflect the true thickness. The method is unstable when the BCI is not smooth. Use Effective dataset or benchmark is essential for doctor training and scientific research. Researchers in knee MR image segmentation area utilize different datasets to verify their methods. This section summarizes the experimental data and the current public benchmark and dataset. Collecting experimental data for knee MR image segmentation research is difficult. A lot of studies were performed with a relatively small number of samples [25, 44, 45, 50, 51, 54, 55]. Lynch et al. [44] performed their experiments on a dataset with four patients (2 with OA and 2 with meniscal surgery). Kauffmann et al. verified their method on only 2 OA patients. There are also some studies on porcine knees [45], cadaveric human knee [24, 48, 51], or even synthetic MRI data [46]. The Osteoarthritis Initiative (OAI) [16] establishes and maintains a natural history database for osteoarthritis that includes clinical evaluation data, radiological (x-ray and magnetic resonance) images, and a biospecimen repository from 4796 men and women, ages 45-79, enrolled between February 2004 and May 2006. Currently, it provides up to 108-month follow-up of these cases. The data in OAI are widely utilized in different studies. In the viewpoint of knee MR image segmentation, the disadvantage of OAI data is that no segmentation results (ground truths) are provided. The MICCAI grand challenge published SKI10 data [14] with fully verified segmentation results. SKI10 data contains 50 testing data and 100 training data. In 2012, MICCA grand challenge published PROMISE12 dataset for knee MR image segmentation [104]. The dataset contains 49 training samples and 29 testing samples. All samples in PROMISE12 are segmented. The disadvantage of this dataset is the segmentation results are not validated. Table 4 presents the content and feature of existing public benchmarks for knee MR image segmentation research. Solloway et al. [21]. 2D ‘M-Norm’ Tang et al. [51]. 2D ‘T-norm’. Cohen et al. [48]. 3D Ray casting. 3D 3D Euclidean distance transformation. 3D ‘Spans and Ridges’. 3D 3D Laplace-equation. High computational cost. 3D Thickness map High computational cost. Stammberger et al. [81, 99]. Carballido-Gamio et al. [45, 47]. Fripp et al. [31]. Williams et al. [100, 101]. Shan et al. [34, 35] Huang et al. [60]. Kauffmann et al. [46]. High computational cost. The method is unstable when the BCI is not smooth. III. QUANTITATIVE MEASUREMENT The volume and thickness of the cartilage are crucial factors in OA diagnosis and progress evaluation. The measurement methods [12] play key roles in clinical trials as well as in scientific research. This section summarizes existing measurement methods for cartilage volume and thickness. Literature shows that the volume measurement methods have been extensively investigated. By providing the inner and outer surface/boundary of the cartilage, the measurement of cartilage volume could be accomplished straightforwardly by counting pixels or voxels; therefore, it is considered as a solved problem in most studies [24, 28-31, 52]. The measurement of the thickness is more complex comparing to the volume measurement. The most widely accepted concept of thickness is the shortest distance between the base points on the BCI and their corresponding points. However, researchers employ different definitions of thickness in studies. The calculation of thickness could be performed in both 2D and 3D spaces, and the strategies to find the corresponding points can be different. In some early studies [24] and [102], the thickness was defined as the distance between base points on BCI and the corresponding intersection points on the cartilage surface. Solloway et al. [21] proposed a 2D method referred as ‘M-norm.' They calculated the medial axis between inner and outer surfaces and equally spaced a certain number of points along the medial axis. At each point, the normal was cast toward both inner and outer boundaries, and the thickness was saved as the distance between intersection points. Tang et al. Table 6 Benchmarks for Knee MR Image Segmentation Dataset OAI [16] SKI10 [14] PROMISE12 [104] Content 4,796 participants as of Dec 2016, longest 108 months’ follow-up 100 training samples, 50 test samples 49 training samples, 29 testing samples Ground Truth No segmentation results Segmented and validated Segmented, but not validated Different objects and criteria could be utilized to evaluate the performance of knee MR image segmentation methods. Most studies employ the volume of cartilage and thickness of cartilage to evaluate the performance. For semi-automatic segmentation methods, the test-retest reproducibility is a principal factor for evaluation. In general, the ground truths of knee MR image segmentation come from the results sketched by radiologists. The manual segmentation results are used as the ground truths for semi-automatic and automatic segmentation evaluation. The semi-automatic segmentation results by professional users are employed to evaluate the performance of automatic methods as well. The most accepted criteria are Dice similarity coefficient (DSC), sensitivity and specificity. Let the segmentation result and the ground truth be A and B; the DSC value, sensitivity, and specificity could be calculated as follows: 2|𝐴𝐴 ∩ B| 𝐷𝐷𝐷𝐷𝐷𝐷(𝐴𝐴, 𝐵𝐵) = |𝐴𝐴| + |𝐵𝐵| |𝐴𝐴 ∩ 𝐵𝐵| 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆(𝐴𝐴, 𝐵𝐵) = |𝐵𝐵| |𝐴𝐴𝑐𝑐 ∩ 𝐵𝐵𝑐𝑐 | 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆(𝐴𝐴, 𝐵𝐵) = |𝐵𝐵𝑐𝑐 | Sensitivity and specificity measures are true classification ratios of cartilage and background classes. DSC is maximized in the case of a good compromise between sensitivity and specificity. Therefore, it is an important indicator for evaluating the accuracy of segmentation. V. CONCLUSION AND FUTURE TREND Computer-aided knee MRI segmentation has immense potential in clinical diagnosis, as well as in scientific research. The central issue in knee MRI segmentation is to find the boundary of bone and cartilage accurately. For bone segmentation, the existing literature supports that the deformable model-based methods can handle bone segmentation well. The region-growing based semi-automatic methods also achieve satisfactory results. Voxel/pixel classification-based methods could handle bone segmentation well. However, researchers prefer deformable models for bone segmentation due to the higher computational efficiency. The segmentation of articular cartilage still needs further investigation, especially the fully-automatic cartilage segmentation. 2D deformable models, such as snake, can solve cartilage segmentation problem well in semi-automatic manner. But 3D deformable models are not robust due to the thin structure of cartilage. Voxel classification-based methods are growing rapidly, even with their high computational cost. There are two strategies for knee MRI segmentation. The first strategy is to label one or a group of slices first and then propagate the labels to unlabeled slices. The other way is to work in 3D feature space. Current literature supports that the 3D feature space strategy performs better than label propagation by considering the relationship between slices. OAI is the largest and the most important dataset for the knee OA research. However, the samples in OAI are not labeled for segmentation purpose. The sample numbers of the current public benchmarks are still not sufficient for the studies. Large-scale benchmark with validated segmentation results (ground truths) is important and essential for future studies. Researchers need to validate their methods by using the benchmark including the labeled follow-up cases. Accurate and efficient classifiers are in urgent need for cartilage segmentation research. The classifier performance is the key factor affecting the segmentation results. The pattern recognition and machine learning technologies provide more powerful classifiers such as CNN, FCN, etc. These methods have great potential to achieve better results. REFERENCES [1] E. Losina, M. E. Daigle, L. Suter, D. Hunter, D. Solomon, R. Walensky, et al., "Disease-modifying drugs for knee osteoarthritis: can they be cost-effective?," Osteoarthritis and cartilage, vol. 21, pp. 655-667, 2013. [2] D. T. Felson, "Osteoarthritis as a disease of mechanics," Osteoarthritis and cartilage, vol. 21, pp. 10-15, 2013. [3] D. T. Felson, R. C. Lawrence, P. A. Dieppe, and et al., "Osteoarthritis: New insights. part 1: the disease and its risk factors," Annals of Internal Medicine, vol. 133, pp. 635-646, 2000. [4] D. S. Jevsevar, "Treatment of Osteoarthritis of the Knee: Evidence‐Based Guideline," Journal of the American Academy of Orthopaedic Surgeons, vol. 21, pp. 571-576, 2013. [5] E. Losina, A. D. Paltiel, A. M. Weinstein, E. Yelin, D. J. Hunter, S. P. Chen, et al., "Lifetime medical costs of knee osteoarthritis management in the United States: impact of extending indications for total knee arthroplasty," Arthritis care & research, vol. 67, pp. 203-215, 2015. [6] B. Heidari, "Knee osteoarthritis prevalence, risk factors, pathogenesis and features: Part I," Caspian journal of internal medicine, vol. 2, pp. 205-212, 2011. [7] W. P. Chan, P. Lang, M. P. Stevens, K. Sack, S. Majumdar, D. W. Stoller, et al., "Osteoarthritis of the knee: comparison of radiography, CT, and MR imaging to assess extent and severity," AJR. American journal of roentgenology, vol. 157, pp. 799-806, 1991. [8] H. J. Braun and G. E. Gold, "Diagnosis of osteoarthritis: imaging," Bone, vol. 51, pp. 278-288, 2012. [9] B. Ghelman, "Meniscal tears of the knee: evaluation by high-resolution CT combined with arthrography," Radiology, vol. 157, pp. 23-27, 1985. [10] A. Newberg, C. Munn, and A. Robbins, "Complications of arthrography," Radiology, vol. 155, pp. 605-606, 1985. [11] F. Eckstein, F. Cicuttini, J.-P. Raynauld, J. Waterton, and C. Peterfy, "Magnetic resonance imaging (MRI) of articular cartilage in knee osteoarthritis (OA): morphological assessment," Osteoarthritis and cartilage, vol. 14, pp. 46-75, 2006. [12] F. Eckstein, D. Burstein, and T. M. Link, "Quantitative MRI of cartilage and bone: degenerative changes in osteoarthritis," NMR in Biomedicine, vol. 19, pp. 822-854, 2006. [13] R. R. Edelman and S. Warach, "Magnetic resonance imaging," New England Journal of Medicine, vol. 328, pp. 708-716, 1993. [14] T. Heimann, B. J. Morrison, M. A. Styner, M. Niethammer, and S. Warfield, "Segmentation of knee images: A grand challenge," in Proc. MICCAI Workshop on Medical Image Analysis for the Clinic, 2010, pp. 207-214. [15] M. Hakky, M. Jarraya, C. Ratzlaff, A. Guermazi, and J. Duryea, "Validity and responsiveness of a new measure of knee osteophytes for osteoarthritis studies: data from the osteoarthritis initiative," Osteoarthritis and Cartilage, vol. 23, pp. 2199-2205, 2015. [16] F. Eckstein, W. Wirth, and M. C. Nevitt, "Recent advances in osteoarthritis imaging-the Osteoarthritis Initiative," Nature Reviews Rheumatology, vol. 8, pp. 622-630, Oct 2012. [17] M. Boesen, K. Ellegaard, M. Henriksen, H. Gudbergsen, P. Hansen, H. Bliddal, et al., "Osteoarthritis year in review 2016: imaging," Osteoarthritis and Cartilage, vol. 25, pp. 216-226, Feb 2017. [18] S. S. Gornale, P. U. Patravali, and R. R. Manza, "A Survey on Exploration and Classification of Osteoarthritis Using Image Processing Techniques," International Journal of Scientific and Engineering Research (IJSER), ISSN, vol. 7, pp. 2229-5518, 2016. [19] V. Caselles, R. Kimmel, and G. Sapiro, "Geodesic active contours," International journal of computer vision, vol. 22, pp. 61-79, 1997. [20] M. Kass, A. Witkin, and D. Terzopoulos, "Snakes: Active contour models," International journal of computer vision, vol. 1, pp. 321-331, 1988. [21] S. Solloway, C. E. Hutchinson, J. C. Waterton, and C. J. Taylor, "The use of active shape models for making thickness measurements of articular cartilage from MR images," Magnetic Resonance in Medicine, vol. 37, pp. 943-952, 1997. [22] J. Duryea, G. Neumann, M. Brem, W. Koh, F. Noorbakhsh, R. Jackson, et al., "Novel fast semi-automated software to segment cartilage for knee MR acquisitions," Osteoarthritis and cartilage, vol. 15, pp. 487-492, 2007. [23] R. Adams and L. Bischof, "Seeded region growing," IEEE Transactions on pattern analysis and machine intelligence, vol. 16, pp. 641-647, 1994. [24] F. Eckstein, A. Gavazzeni, H. Sittek, M. Haubner, A. Lösch, S. Milz, et al., "Determination of knee joint cartilage thickness using three‐dimensional magnetic resonance chondro ‐ crassometry (3D MR ‐ CCM)," Magnetic Resonance in Medicine, vol. 36, pp. 256-265, 1996. [25] S. K. Pakin, J. G. Tamez-Pena, S. Totterman, and K. J. Parker, "Segmentation, surface extraction, and thickness computation of articular cartilage," in Medical Imaging 2002, 2002, pp. 155-166. [26] P. Dodin, J.-P. Pelletier, J. Martel-Pelletier, and F. Abram, "Automatic human knee cartilage segmentation from 3-D magnetic resonance images," IEEE Transactions on Biomedical Engineering, vol. 57, pp. 2699-2711, 2010. [27] P. Dodin, J. Martel-Pelletier, J.-P. Pelletier, and F. Abram, "A fully automated human knee 3D MRI bone segmentation using the ray casting technique," Medical & biological engineering & computing, vol. 49, pp. 1413-1424, 2011. [28] A. J. Gougoutas, A. J. Wheaton, A. Borthakur, E. M. Shapiro, J. B. Kneeland, J. K. Udupa, et al., "Cartilage volume quantification via Live Wire segmentation," Academic radiology, vol. 11, pp. 1389-1395, 2004. [29] V. Grau, A. Mewes, M. Alcaniz, R. Kikinis, and S. K. Warfield, "Improved watershed transform for medical image segmentation using prior information," IEEE transactions on medical imaging, vol. 23, pp. 447-458, 2004. [30] J. Fripp, S. Crozier, S. K. Warfield, and S. Ourselin, "Automatic segmentation of the bone and extraction of the bone–cartilage interface from magnetic resonance images of the knee," Physics in Medicine and Biology, vol. 52, p. 1617, 2007. [31] J. Fripp, S. Crozier, S. K. Warfield, and S. Ourselin, "Automatic segmentation and quantitative analysis of the articular cartilages from magnetic resonance images of the knee," IEEE transactions on medical imaging, vol. 29, pp. 55-64, 2010. [32] G. Vincent, C. Wolstenholme, I. Scott, and M. Bowes, "Fully automatic segmentation of the knee joint using active appearance models," Medical Image Analysis for the Clinic: A Grand Challenge, pp. 224-230, 2010. [33] J. Folkesson, E. Dam, O. F. Olsen, P. Pettersen, and C. Christiansen, "Automatic segmentation of the articular cartilage in knee MRI using a hierarchical multi-class classification scheme," in International Conference on Medical Image Computing and Computer-Assisted Intervention, 2005, pp. 327-334. [34] L. Shan, C. Charles, and M. Niethammer, "Automatic multi-atlas-based cartilage segmentation from knee MR images," in 2012 9th IEEE International Symposium on Biomedical Imaging (ISBI), 2012, pp. 1028-1031. [35] L. Shan, C. Zach, C. Charles, and M. Niethammer, "Automatic atlas-based three-label cartilage segmentation from MR knee images," Medical image analysis, vol. 18, pp. 1233-1246, 2014. [36] J. Pang, P. Li, M. Qiu, W. Chen, and L. Qiao, "Automatic articular cartilage segmentation based on pattern recognition from knee MRI images," Journal of digital imaging, vol. 28, pp. 695-703, 2015. [37] C. N. Öztürk and S. Albayrak, "Automatic segmentation of cartilage in high-field magnetic resonance images of the knee joint with an improved voxel-classification-driven region-growing algorithm using vicinity-correlated subsampling," Computers in biology and medicine, vol. 72, pp. 90-107, 2016. [38] K. Li, S. Millington, X. Wu, D. Z. Chen, and M. Sonka, "Simultaneous segmentation of multiple closed surfaces using optimal graph searching," in Biennial International Conference on Information Processing in Medical Imaging, 2005, pp. 406-417. [39] S. Millington, K. Li, X. Wu, S. Hurwitz, and M. Sonka, "Automated simultaneous 3D segmentation of multiple cartilage surfaces using optimal graph searching on MRI images," Osteoarthritis Cartilage, vol. 13, p. S130, 2005. [40] Y. Yin, X. Zhang, R. Williams, X. Wu, D. D. Anderson, and M. Sonka, "LOGISMOS—layered optimal graph image segmentation of multiple objects and surfaces: cartilage segmentation in the knee joint," IEEE transactions on medical imaging, vol. 29, pp. 2023-2037, 2010. [41] J. E. Iglesias and M. R. Sabuncu, "Multi-atlas segmentation of biomedical images: a survey," Medical image analysis, vol. 24, pp. 205-219, 2015. [42] M. A. Balafar, A. R. Ramli, M. I. Saripan, and S. Mashohor, "Review of brain MRI image segmentation methods," Artificial Intelligence Review, vol. 33, pp. 261-274, 2010. [43] T. Heimann and H.-P. Meinzer, "Statistical shape models for 3D medical image segmentation: a review," Medical image analysis, vol. 13, pp. 543-563, 2009. [44] J. A. Lynch, S. Zaim, J. Zhao, A. Stork, C. G. Peterfy, and H. K. Genant, "Cartilage segmentation of 3D MRI scans of the osteoarthritic knee combining user knowledge and active contours," in Medical Imaging 2000, 2000, pp. 925-935. [45] J. Carballido-Gamio, J. Bauer, K.-Y. Lee, S. Krause, and S. Majumdar, "Combined image processing techniques for characterization of MRI cartilage of the knee," in Conf Proc IEEE Eng Med Biol Soc, 2005, p. e6. [46] C. Kauffmann, P. Gravel, B. Godbout, A. Gravel, G. Beaudoin, J.-P. Raynauld, et al., "Computer-aided method for quantification of cartilage thickness and volume changes using MRI: validation study using a synthetic model," IEEE transactions on Biomedical Engineering, vol. 50, pp. 978-988, 2003. [47] J. Carballido-Gamio, J. S. Bauer, R. Stahl, K.-Y. Lee, S. Krause, T. M. Link, et al., "Inter-subject comparison of MRI knee cartilage thickness," Medical image analysis, vol. 12, pp. 120-135, 2008. [48] Z. A. Cohen, D. M. McCarthy, S. D. Kwak, P. Legrand, F. Fogarasi, E. J. Ciaccio, et al., "Knee cartilage topography, thickness, and contact areas from MRI: in-vitro calibration and in-vivo measurements," Osteoarthritis and cartilage, vol. 7, pp. 95-109, 1999. [49] M. Brem, P. Lang, G. Neumann, P. Schlechtweg, E. Schneider, R. Jackson, et al., "Magnetic resonance image segmentation using semi-automated software for quantification of knee articular cartilage—initial evaluation of a technique for paired scans," Skeletal radiology, vol. 38, pp. 505-511, 2009. [50] L. M. Lorigo, O. Faugeras, W. E. L. Grimson, R. Keriven, and R. Kikinis, "Segmentation of bone in clinical knee MRI using texture-based geodesic active contours," in International Conference on Medical Image Computing and Computer-Assisted Intervention, 1998, pp. 1195-1204. [51] J. Tang, S. Millington, S. T. Acton, J. Crandall, and S. Hurwitz, "Surface extraction and thickness measurement of the articular cartilage from MR images using directional gradient vector flow snakes," IEEE Transactions on Biomedical Engineering, vol. 53, pp. 896-907, 2006. [52] M. A. Piplani, D. G. Disler, T. R. McCauley, T. J. Holmes, and J. P. Cousins, "Articular cartilage volume in the knee: semiautomated determination from three-dimensional reformations of MR images," Radiology, vol. 198, pp. 855-859, 1996. [53] P. Wang, X. He, Y. Li, X. Zhu, W. Chen, and M. Qiu, "Automatic Knee Cartilage Segmentation Using Multi-Feature Support Vector Machine and Elastic Region Growing for Magnetic Resonance Images," Journal of Medical Imaging and Health Informatics, vol. 6, pp. 948-956, 2016. [54] T. Kapur, P. Beardsley, S. Gibson, W. Grimson, and W. Wells, "Model-based segmentation of clinical knee MRI," in Proc. IEEE Int’l Workshop on Model-Based 3D Image Analysis, 1998, pp. 97-106. [55] R. Dalvi, R. Abugharbieh, D. Wilson, and D. R. Wilson, "Multi-contrast MR for enhanced bone imaging and segmentation," in 2007 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, 2007, pp. 5620-5623. [56] E. B. Dam, M. Lillholm, J. Marques, and M. Nielsen, "Automatic segmentation of high-and low-field knee MRIs using knee image quantification with data from the osteoarthritis initiative," Journal of Medical Imaging, vol. 2, pp. 024001-024001, 2015. [57] A. Prasoon, C. Igel, M. Loog, F. Lauze, E. Dam, and M. Nielsen, "Cascaded classifier for large-scale data applied to automatic segmentation of articular cartilage," in SPIE Medical Imaging, 2012, pp. 83144V-83144V-9. [58] J. Folkesson, O. F. Olsen, P. Pettersen, E. Dam, and C. Christiansen, "Combining binary classifiers for automatic cartilage segmentation in knee MRI," in International Workshop on Computer Vision for Biomedical Image Applications, 2005, pp. 230-239. [59] A. Prasoon, K. Petersen, C. Igel, F. Lauze, E. Dam, and M. Nielsen, "Deep feature learning for knee cartilage segmentation using a triplanar convolutional neural network," in International Conference on Medical Image Computing and Computer-Assisted Intervention, 2013, pp. 246-253. [60] C. Huang, L. Shan, H. C. Charles, W. Wirth, M. Niethammer, and H. Zhu, "Diseased Region Detection of Longitudinal Knee Magnetic Resonance Imaging Data," IEEE transactions on medical imaging, vol. 34, pp. 1914-1927, 2015. [61] A. Prasoon, C. Igel, M. Loog, F. Lauze, E. B. Dam, and M. Nielsen, "Femoral cartilage segmentation in Knee MRI scans using two stage voxel classification," in 2013 35th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2013, pp. 5469-5472. [62] Q. Liu, Q. Wang, L. Zhang, Y. Gao, and D. Shen, "Multi-atlas context forests for knee MR image segmentation," in International Workshop on Machine Learning in Medical Imaging, 2015, pp. 186-193. [63] Z. Wang, C. Donoghue, and D. Rueckert, "Patch-based segmentation without registration: application to knee MRI," in International Workshop on Machine Learning in Medical Imaging, 2013, pp. 98-105. [64] J. Folkesson, E. B. Dam, O. F. Olsen, P. C. Pettersen, and C. Christiansen, "Segmenting articular cartilage automatically using a voxel classification approach," IEEE transactions on medical imaging, vol. 26, pp. 106-115, 2007. [65] Q. Wang, D. Wu, L. Lu, M. Liu, K. L. Boyer, and S. K. Zhou, "Semantic context forests for learning-based knee cartilage segmentation in 3D MR images," in International MICCAI Workshop on Medical Computer Vision, 2013, pp. 105-115. [66] J. G. Tamez-Peña, J. Farber, P. C. Gonzalez, E. Schreyer, E. Schneider, and S. Totterman, "Unsupervised segmentation and quantification of anatomical knee features: data from the Osteoarthritis Initiative," IEEE Transactions on Biomedical Engineering, vol. 59, pp. 1177-1186, 2012. [67] J. Fripp, P. Bourgeat, A. J. Mewes, S. K. Warfield, S. Crozier, and S. Ourselin, "3D statistical shape models to embed spatial relationship information," in International Workshop on Computer Vision for Biomedical Image Applications, 2005, pp. 51-60. [68] R. H. Davies, C. J. Twining, T. F. Cootes, J. C. Waterton, and C. J. Taylor, "3D statistical shape models using direct optimisation of description length," in European conference on computer vision, 2002, pp. 3-20. [69] T. F. Cootes, C. J. Taylor, D. H. Cooper, and J. Graham, "Active shape models-their training and application," Computer vision and image understanding, vol. 61, pp. 38-59, 1995. [70] T. G. Williams, A. P. Holmes, J. C. Waterton, R. A. Maciewicz, C. E. Hutchinson, R. J. Moots, et al., "Anatomically corresponded regional analysis of cartilage in asymptomatic and osteoarthritic knees by statistical shape modelling of the bone," IEEE transactions on medical imaging, vol. 29, pp. 1541-1559, 2010. [71] T. G. Williams, G. Vincent, M. Bowes, T. Cootes, S. Balamoody, C. Hutchinson, et al., "Automatic segmentation of bones and inter-image anatomical correspondence by volumetric statistical modelling of knee MRI," in 2010 IEEE International Symposium on Biomedical Imaging: From Nano to Macro, 2010, pp. 432-435. [72] C. Lorenz and N. Krahnstöver, "Generation of point-based 3D statistical shape models for anatomical objects," Computer vision and image understanding, vol. 77, pp. 175-191, 2000. [73] H. Seim, D. Kainmueller, H. Lamecker, M. Bindernagel, J. Malinowski, and S. Zachow, "Model-based auto-segmentation of knee bones and cartilage in MRI data," Medical Image Analysis for the Clinic: A Grand Challenge, Beijing, 2010. [74] J. Schmid and N. Magnenat-Thalmann, "MRI bone segmentation using deformable models and shape priors," in International conference on medical image computing and computer-assisted intervention, 2008, pp. 119-126. [75] B. Gilles and N. Magnenat-Thalmann, "Musculoskeletal MRI segmentation using multi-resolution simplex meshes with medial representations," Medical image analysis, vol. 14, pp. 291-302, 2010. [76] T. G. Williams, A. P. Holmes, J. C. Waterton, R. A. Maciewicz, A. F. Nash, and C. J. Taylor, "Regional quantitative analysis of knee cartilage in a population study using MRI and model based correspondences," in Biomedical Imaging: Nano to Macro, 2006. 3rd IEEE International Symposium on, 2006, pp. 311-314. [77] J. Schmid, J. Kim, and N. Magnenat-Thalmann, "Robust statistical shape models for MRI bone segmentation in presence of small field of view," Medical image analysis, vol. 15, pp. 155-168, 2011. [78] A. Amami, Z. B. Azouz, and M. T.-H. Alouane, "Weakly supervised 3D Reconstruction of the Knee Joint from MR Images Using a Volumetric Active Appearance Model," 2015. [79] S. Y. Ababneh, J. W. Prescott, and M. N. Gurcan, "Automatic graph-cut based segmentation of bones from knee magnetic resonance images for osteoarthritis research," Medical image analysis, vol. 15, pp. 438-448, 2011. [80] K. Bae, H. Shim, C. Tao, S. Chang, J. Wang, R. Boudreau, et al., "Intra-and inter-observer reproducibility of volume measurement of knee cartilage segmented from the OAI MR image set using a novel semi-automated segmentation method," Osteoarthritis and Cartilage, vol. 17, pp. 1589-1597, 2009. [81] T. Stammberger, F. Eckstein, K.-H. Englmeier, and M. Reiser, "Determination of 3 D cartilage thickness data from MR imaging: Computational method and reproducibility in the living," Magnetic resonance in medicine, vol. 41, pp. 529-536, 1999. [82] T. McInerney and D. Terzopoulos, "Deformable models in medical image analysis: a survey," Medical image analysis, vol. 1, pp. 91-108, 1996. [83] T. F. Chan and L. A. Vese, "Active contours without edges," IEEE Transactions on image processing, vol. 10, pp. 266-277, 2001. [84] J. C. Russ and R. P. Woods, "The image processing handbook," ed: LWW, 1995. [85] J. A. Lynch, S. Zaim, J. Zhao, C. G. Peterfy, and H. K. Genant, "Automating measurement of subtle changes in articular cartilage from MRI of the knee by combining 3D image registration and segmentation," in Medical Imaging 2001, 2001, pp. 431-439. [86] T. F. Cootes, G. J. Edwards, and C. J. Taylor, "Active appearance models," in European conference on computer vision, 1998, pp. 484-498. [87] T. F. Cootes, G. J. Edwards, and C. J. Taylor, "Comparing active shape models with active appearance models," in Bmvc, 1999, pp. 173-182. [88] R. H. Davies, C. J. Twining, T. F. Cootes, J. C. Waterton, and C. J. Taylor, "A minimum description length approach to statistical shape modeling," IEEE Transactions on Medical Imaging, vol. 21, pp. 525-537, 2002. [89] T. F. Cootes, C. J. Twining, V. S. Petrovic, R. Schestowitz, and C. J. Taylor, "Groupwise Construction of Appearance Models using Piece-wise Affine Deformations," in BMVC, 2005, pp. 879-888. [90] P. Dalal, B. C. Munsell, S. Wang, J. Tang, K. Oliver, H. Ninomiya, et al., "A fast 3D correspondence method for statistical shape modeling," in Computer Vision and Pattern Recognition, 2007. CVPR'07. IEEE Conference on, 2007, pp. 1-8. [91] L. M. J. Florack, The syntactical structure of scalar images: Universiteit Utrecht, Faculteit Geneeskunde, 1993. [92] J. Weickert, Anisotropic diffusion in image processing vol. 1: Teubner Stuttgart, 1998. [93] C. Studholme, D. L. Hill, and D. J. Hawkes, "An overlap invariant entropy measure of 3D medical image alignment," Pattern recognition, vol. 32, pp. 71-86, 1999. [94] C. Zhu, R. H. Byrd, P. Lu, and J. Nocedal, "Algorithm 778: L-BFGS-B: Fortran subroutines for large-scale bound-constrained optimization," ACM Transactions on Mathematical Software (TOMS), vol. 23, pp. 550-560, 1997. [95] P. Pudil, J. Novovičová, and J. Kittler, "Floating search methods in feature selection," Pattern recognition letters, vol. 15, pp. 1119-1125, 1994. [96] J.-G. Lee, S. Gumus, C. H. Moon, C. K. Kwoh, and K. T. Bae, "Fully automated segmentation of cartilage from the MR images of knee using a multi-atlas and local structural analysis method," Medical physics, vol. 41, p. 092303, 2014. [97] V. Pedoia, X. Li, F. Su, N. Calixto, and S. Majumdar, "Fully automatic analysis of the knee articular cartilage T1ρ relaxation time using voxel‐based relaxometry," Journal of Magnetic Resonance Imaging, 2015. [98] B. Glocker, N. Komodakis, N. Paragios, C. Glaser, G. Tziritas, and N. Navab, "Primal/dual linear programming and statistical atlases for cartilage segmentation," in International Conference on Medical Image Computing and Computer-Assisted Intervention, 2007, pp. 536-543. [99] T. Stammberger, J. Hohe, K. H. Englmeier, M. Reiser, and F. Eckstein, "Elastic registration of 3D cartilage surfaces from MR image data for detecting local changes in cartilage thickness," Magnetic resonance in medicine, vol. 44, pp. 592-601, 2000. [100] T. G. Williams, C. J. Taylor, Z. Gao, and J. C. Waterton, "Corresponding articular cartilage thickness measurements in the knee joint by modelling the underlying bone (commercial in confidence)," in Biennial International Conference on Information Processing in Medical Imaging, 2003, pp. 126-135. [101] T. G. Williams, C. J. Taylor, J. C. Waterton, and A. Holmes, "Population analysis of knee cartilage thickness maps using model based correspondence," in Biomedical Imaging: Nano to Macro, 2004. IEEE International Symposium on, 2004, pp. 193-196. [102] F. Heuer, M. Sommers, J. Reid, and M. Bottlang, "Estimation of cartilage thickness from joint surface scans: Comparative analysis of computational methods," ASME-PUBLICATIONS-BED, vol. 50, pp. 569-570, 2001. [103] M. Swamy and M. S. Holi, "Knee joint articular cartilage segmentation, visualization and quantification using image processing techniques: a review," Int. J. Comput. Appl., vol. 42, 2012. [104] G. Litjens, R. Toth, W. van de Ven, C. Hoeks, S. Kerkstra, B. van Ginneken, et al., "Evaluation of prostate segmentation algorithms for MRI: the PROMISE12 challenge," Medical image analysis, vol. 18, pp. 359-373, 2014.
1cs.CV
Hypothesis Testing For Densities and High-Dimensional Multinomials: Sharp Local Minimax Rates Sivaraman Balakrishnan† Larry Wasserman† arXiv:1706.10003v1 [math.ST] 30 Jun 2017 Department of Statistics† Carnegie Mellon University Pittsburgh, PA 15213 {siva,larry}@stat.cmu.edu July 3, 2017 Abstract We consider the goodness-of-fit testing problem of distinguishing whether the data are drawn from a specified distribution, versus a composite alternative separated from the null in the total variation metric. In the discrete case, we consider goodness-of-fit testing when the null distribution has a possibly growing or unbounded number of categories. In the continuous case, we consider testing a Lipschitz density, with possibly unbounded support, in the low-smoothness regime where the Lipschitz parameter is not assumed to be constant. In contrast to existing results, we show that the minimax rate and critical testing radius in these settings depend strongly, and in a precise way, on the null distribution being tested and this motivates the study of the (local) minimax rate as a function of the null distribution. For multinomials the local minimax rate was recently studied in the work of Valiant and Valiant [30]. We re-visit and extend their results and develop two modifications to the χ2 -test whose performance we characterize. For testing Lipschitz densities, we show that the usual binning tests are inadequate in the low-smoothness regime and we design a spatially adaptive partitioning scheme that forms the basis for our locally minimax optimal tests. Furthermore, we provide the first local minimax lower bounds for this problem which yield a sharp characterization of the dependence of the critical radius on the null hypothesis being tested. In the low-smoothness regime we also provide adaptive tests, that adapt to the unknown smoothness parameter. We illustrate our results with a variety of simulations that demonstrate the practical utility of our proposed tests. 1 Introduction Hypothesis testing is one of the pillars of modern mathematical statistics with a vast array of scientific applications. There is a well-developed theory of hypothesis testing starting with the work of Neyman and Pearson [22], and their framework plays a central role in the theory and practice of statistics. In this paper we re-visit the classical goodness-of-fit testing problem of distinguishing the hypotheses: H0 : Z1 , . . . , Zn ∼ P0 versus H1 : Z1 , . . . , Zn ∼ P ∈ A (1) for some set of distributions A. This fundamental problem has been widely studied (see for instance [19] and references therein). A natural choice of the composite alternative, one that has a clear probabilistic interpretation, excludes a total variation neighborhood around the null, i.e. we take A = {P : 1 TV(P, P0 ) ≥ /2}. This is equivalent to A = {P : kP − P0 k1 ≥ }, and we use this representation in the rest of this paper. However, there exist no consistent tests that can distinguish an arbitrary distribution P0 from alternatives separated in `1 ; see [2, 17]. Hence, we impose structural restrictions on P0 and A. We focus on two cases: 1. Multinomial testing: When the null and alternate distributions are multinomials. 2. Lipschitz testing: When the null and alternate distributions have Lipschitz densities. The problem of goodness-of-fit testing for multinomials has a rich history in statistics and popular approaches are based on the χ2 -test [24] or the likelihood ratio test [5, 22, 32]; see, for instance, [9, 11, 21, 23, 25] and references therein. Motivated by connections to property testing [26], there is also a recent literature developing in computer science; see [3, 10, 13, 30]. Testing Lipschitz densities is one of the basic non-parametric hypothesis testing problems and tests are often based on the Kolmogorov-Smirnov or Cramér-von Mises statistics [7, 27, 31]. This problem was originally studied from the minimax perspective in the work of Ingster [14, 15]. See [1, 12, 14] for further references. In the goodness-of-fit testing problem in (1), previous results use the (global) critical radius as a benchmark. Roughly, this global critical radius is a measure of the minimal separation between the null and alternate hypotheses that ensures distinguishability, as the null hypothesis is varied over a large class of distributions (for instance over the class of distributions with Lipschitz densities or over the class of all multinomials on d categories). Remarkably, as shown in the work of Valiant and Valiant [30] for the case of multinomials and as we show in this paper for the case of Lipschitz densities, there is considerable heterogeneity in the critical radius as a function of the null distribution P0 . In other words, even within the class of Lipschitz densities, testing certain null hypotheses can be much easier than testing others. Consequently, the local minimax rate which describes the critical radius for each individual null distribution provides a much more nuanced picture. In this paper, we provide (near) matching upper and lower bounds on the critical radii for Lipschitz testing as a function of the null distribution, i.e. we precisely upper and lower bound the critical radius for each individual Lipschitz null hypothesis. Our upper bounds are based on χ2 -type tests, performed on a carefully chosen spatially adaptive binning, and highlight the fact that the standard prescriptions of choosing bins with a fixed width [28] can yield sub-optimal tests. The distinction between local and global perspectives is reminiscent of similar effects that arise in some estimation problems, for instance in shape-constrained inference [4], in constrained least-squares problems [6] and in classical Fisher Information-Cramér-Rao bounds [18]. The remainder of this paper is organized as follows. In Section 2 we provide some background on the minimax perspective on hypothesis testing, and formally describe the local and global minimax rates. We provide a detailed discussion of the problem of study and finally provide an overview of our main results. In Section 3 we review the results of [30] and present a new globally-minimax test for testing multinomials, as well as a (nearly) locally-minimax test. In Section 4 we consider the problem of testing a Lipschitz density against a total variation neighbourhood. We present the body of our main technical result in Section 4.3 and defer technical aspects of this proof to the Appendix. In each of Section 3 and 4 we present simulation results that demonstrate the superiority of the tests we propose and their potential practical applicability. In the Appendix, we also present several other results including a brief study of limiting distributions of the test statistics under the null, as well as tests that are adaptive to various parameters. 2 2 Background and Problem Setup We begin with some basic background on hypothesis testing, the testing risk and minimax rates, before providing a detailed treatment of some related work. 2.1 Hypothesis testing and minimax rates Our focus in this paper is on the one sample goodness-of-fit testing problem. We observe samples Z1 , . . . , Zn ∈ X , where X ⊂ Rd , which are independent and identically distributed with distribution P . In this context, for a fixed distribution P0 , we want to test the hypotheses: H0 : P = P0 versus (2) H1 : kP − P0 k1 ≥ n . Throughout this paper we use P0 to denote the null distribution and P to denote an arbitrary alternate distribution. Throughout the paper, we use the total variation distance (or equivalently the `1 distance) between two distributions P and Q, defined by TV(P, Q) = sup |P (A) − Q(A)| (3) A where the supremum is over all measurable sets. If P and respect to a common dominating measure ν, then Z 1 1 TV(P, Q) = |p − q|dν = kp − qk1 ≡ 2 2 Q have densities p and q with 1 kP − Qk1 . 2 (4) We consider the total variation distance because it has a clear probabilistic meaning and because it is invariant under one-to-one transformations [8]. The `2 metric is often easier to work with but in the context of distribution testing its interpretation is less intuitive. Of course, other metrics (for instance Hellinger, χ2 or Kullback-Leibler) can be used as well but we focus on TV (or `1 ) throughout this paper. It is well-understood [2, 17] that without further restrictions there are no uniformly consistent tests for distinguishing these hypotheses. Consequently, we focus on two restricted variants of this problem: 1. Multinomial testing: In the multinomial testing problem, the domain of the distributions is X = {1, . . . , d} and the distributions P0 and P are equivalently characterized by vectors p0 , p ∈ Rd . Formally, we define, d n o X M = p : p ∈ Rd , pi = 1, pi ≥ 0 ∀ i ∈ {1, . . . , d} , i=1 and consider the multinomial testing problem of distinguishing: H0 : P = P0 , P0 ∈ M versus H1 : kP − P0 k1 ≥ n , P ∈ M. (5) In contrast to classical “fixed-cells” asymptotic theory [25], we focus on high-dimensional multinomials where d can grow with, and potentially exceed the sample size n. 2. Lipschitz testing: In the Lipschitz density testing problem the set X ⊂ Rd , and we restrict our attention to distributions with Lipschitz densities, i.e. letting p0 and p denote 3 the densities of P0 and P with respect to the Lebesgue measure, we consider the set of densities: ) ( Z d p(x)dx = 1, p(x) ≥ 0 ∀ x, |p(x) − p(y)| ≤ Ln kx − yk2 ∀ x, y ∈ R , L(Ln ) = p : X and consider the Lipschitz testing problem of distinguishing: H0 : P = P0 , P0 ∈ L(Ln ) versus H1 : kP − P0 k1 ≥ n , P ∈ L(Ln ). (6) We emphasize, that unlike prior work [1, 12, 15] we do not require p0 to be uniform. We also do not restrict the domain of the densities and we consider the low-smoothness regime where the Lipschitz parameter Ln is allowed to grow with the sample size. Hypothesis testing and risk. Returning to the setting described in (2), we define a test φ as a Borel measurable map, φ : X n 7→ {0, 1}. For a fixed null distribution P0 , we define the set of level α tests: n o Φn,α = φ : P0n (φ = 1) ≤ α . (7) The worst-case risk (type II error) of a test φ over a restricted class C which contains P0 is n o Rn (φ; P0 , n , C) = sup EP [1 − φ] : kP − P0 k1 ≥ n , P ∈ C . The local minimax risk is1 : Rn (P0 , n , C) = inf Rn (φ; P0 , n , C). φ∈Φn,α (8) It is common to study the minimax risk via a coarse lens by studying instead the critical radius or the minimax separation. The critical radius is the smallest value n for which a hypothesis test has non-trivial power to distinguish P0 from the set of alternatives. Formally, we define the local critical radius as: n o n (P0 , C) = inf  : Rn (P0 , n , C) ≤ 1/2 . (9) The constant 1/2 is arbitrary; we could use any number in (0, 1 − α). The local minimax risk and critical radius depend on the null distribution P0 . A more common quantity of interest is the global minimax risk Rn (n , C) = sup Rn (P0 , n , C). (10) P0 ∈C The corresponding global critical radius is n o n (C) = inf n : Rn (n , C) ≤ 1/2 . (11) In typical non-parametric problems, the local minimax risk and the global minimax risk match up to constants and this has led researchers in past work to focus on the global minimax risk. We show that for the distribution testing problems we consider, the local critical radius 1 Although our proofs are explicit in their dependence on α, we suppress this dependence in our notation and in our main results treating α as a fixed strictly positive universal constant. 4 in (9) can vary considerably as a function of the null distribution P0 . As a result, the global critical radius, provides only a partial understanding of the intrinsic difficulty of this family of hypothesis testing problems. In this paper, we focus on producing tight bounds on the local minimax separation. These bounds yield as a simple corollary, sharp bounds on the global minimax separation, but are in general considerably more refined. Poissonization: In constructing upper bounds on the minimax risk—we work under a simplifying assumption that the sample size is random: n0 ∼ Poisson(n). This assumption is standard in the literature [1, 30], and simplifies several calculations. When the sample size is chosen to be distributed as Poisson(n), it is straightforward to verify that for any fixed set A, B ⊂ X with A ∩ B = ∅, under P the number of samples falling in A and B are distributed independently as Poisson(nP (A)) and Poisson(nP (B)) respectively. In the Poissonized setting, we consider the averaged minimax risk, where we additionally average the risk in (8) over the random sample size. The Poisson distribution is tightly concentrated around its mean and this additional averaging only affects constant factors in the minimax risk and we ignore this averaging in the rest of the paper. 2.2 Overview of our results With the basic framework in place we now provide a high-level overview of the main results of this paper. In the context of testing multinomials, the results of [30] characterize the local and global minimax rates. We provide the following additional results: • In Theorem 2 we characterize a simple and practical globally minimax test. In Theorem 4 building on the results of [10] we provide a simple (near) locally minimax test. In the context of testing Lipschitz densities we make advances over classical results [12, 14] by eliminating several unnecessary assumptions (uniform null, bounded support, fixed Lipschitz parameter). We provide the first characterization of the local minimax rate for this problem. In studying the Lipschitz testing problem in its full generality we find that the critical testing radius can exhibit a wide range of possible behaviours, based roughly on the tail behaviour of the null hypothesis. • In Theorem 5 we provide a characterization of the local minimax rate for Lipschitz density testing. In Section 4.1, we consider a variety of concrete examples that demonstrate the rich scaling behaviour exhibited by the critical radius in this problem. • Our upper and lower bounds are based on a novel spatially adaptive partitioning scheme. We describe this scheme and derive some of its useful properties in Section 4.2. In the Supplementary Material we provide the technical details of the proofs. We briefly consider the limiting behaviour of our test statistics under the null in Appendix A. Our results show that the critical radius is determined by a certain functional of the null hypothesis. In Appendix D we study certain important properties of this functional pertaining to its stability. Finally, we study tests which are adaptive to various parameters in Appendix F. 3 Testing high-dimensional multinomials P Given a sample Z1 , . . . , Zn ∼ P define the counts X = (X1 , . . . , Xd ) where Xj = ni=1 I(Zi = j). The local minimax critical radii for the multinomial problem have been found in Valiant and Valiant [30]. We begin by summarizing these results. 5 Without loss of generality we assume that the entries of the null multinomial p0 are sorted so that p0 (1) ≥ p0 (2) ≥ . . . ≥ p0 (d). For any 0 ≤ σ ≤ 1 we denote σ-tail of the multinomial by:   d  X  Qσ (p0 ) = i : p0 (j) ≤ σ . (12)   j=i The σ-bulk is defined to be Bσ (p0 ) = {i > 1 : i ∈ / Qσ (p0 )}. (13) Note that i = 1 is excluded from the σ-bulk. The minimax rate depends on the functional: 3/2  X Vσ (p0 ) =  p0 (i)2/3  . (14) i∈Bσ (p0 ) For a given multinomial p0 , our goal is to upper and lower bound the local critical radius n (p0 , M) in (9). We define, `n and un to be the solutions to the equations 2 : ( `n (p0 ) = max 1 , n r V`n (p0 ) (p0 ) n ) ( , un (p0 ) = max 1 , n r Vun (p0 )/16 (p0 ) n ) . (15) With these definitions in place, we are now ready to state the result of [30]. We use c1 , c2 , C1 , C2 > 0 to denote positive universal constants. Theorem 1 ([30]). The local critical radius n (p0 , M) for multinomial testing is upper and lower bounded as: c1 `n (p0 ) ≤ n (p0 , M) ≤ C1 un (p0 ). (16) Furthermore, the global critical radius n (M) is bounded as: C2 d1/4 c2 d1/4 √ ≤ n (M) ≤ √ . n n Remarks: • The local critical radius is roughly determined by the (truncated) 2/3-rd norm of the multinomial p0 . This norm is maximized when p0 is uniform and is small when p0 is sparse, and at a high-level captures the “effective sparsity” of p0 . √ • The global critical radius can shrink to zero even when d  n. When d  n almost all categories of the multinomial are unobserved but it is still possible to reliably distinguish any p0 from an `1 -neighborhood. This phenomenon is noted for instance in the work of [23]. We also note the work of Barron [2] that shows that when d = ω(n), no test can have power that approaches 1 at an exponential rate. 2 These equations always have a unique solution since the right hand side monotonically decreases to 0 as the left hand side monotonically increases from 0 to 1. 6 • The local critical radius can be much smaller than the global minimax radius. If the multinomial p0 is nearly (or exactly) s-sparse then the critical radius is upper and lower √ bounded up to constants by s1/4 / n. Furthermore, these results also show that it is possible √ to design consistent tests for sufficiently structured null hypotheses: in cases when d  n, and even in cases when d is infinite. • Except for certain pathological multinomials, the upper and lower critical radii match up to constants. We revisit this issue in Appendix D, in the context of Lipschitz densities, where we present examples where the solutions to critical equations similar to (15) are stable and examples where they are unstable. In the remainder of this section we consider a variety of tests, including the test presented in [30] and several alternatives. The test of [30] is a composite test that requires knowledge of n and the analysis of their test is quite intricate. We present an alternative, simple test that is globally minimax, and then present an alternative composite test that is locally minimax but simpler to analyze. Finally, we present a few illustrative simulations. 3.1 The truncated χ2 test We begin with a simple globally minimax test. From a practical standpoint, the most popular test for multinomials is Pearson’s χ2 test. However, in the high-dimensional regime where the dimension of the multinomial d is not treated as fixed the χ2 test can have bad power due to the fact that the variance of the χ2 statistic is dominated by small entries of the multinomial (see [20, 30]). A natural thought then is to truncate the normalization factors of the χ2 statistic in order to limit the contribution to the variance from each cell of the multinomial. Recalling that (X1 , . . . , Xd ) denote the observed counts, we propose the test statistic: Ttrunc = d X (Xi − np0 (i))2 − Xi i=1 max{1/d, p0 (i)} := d X (Xi − np0 (i))2 − Xi i=1 θi (17) and the corresponding test,  φtrunc = I Ttrunc v  u d u2 X 2 p (i) 0 . > nt α θi2 (18) i=1 This test statistic truncates the usual normalization factor for the χ2 test for any entry which falls below 1/d, and thus ensures that very small entries in p0 do not have a large effect on the variance of the statistic. We emphasize the simplicity and practicality of this test. We have the following result which bounds the power and size of the truncated χ2 test. We use C > 0 to denote a positive universal constant. Theorem 2. Consider the testing problem in (5). The truncated χ2 test has size at most α, i.e. P0 (φtrunc = 1) ≤ α. Furthermore, there is a universal constant C > 0 such that if for any 0 < ζ ≤ 1 we have that, √   C d 1 1 2 √ + n ≥ , (19) n α ζ then the Type II error of the test is bounded by ζ, i.e. P (φtrunc = 0) ≤ ζ. 7 Remarks: • A straightforward consequence of this result together with the result in Theorem 1 is that the truncated χ2 test is globally minimax optimal. • The classical χ2 and likelihood ratio tests are not generally consistent (and thus not globally minimax optimal) in the high-dimensional regime (see also, Figure 2). • At a high-level the proof follows by verifying that when the alternate hypothesis is true, under the condition on the critical radius in (19), the test statistic is larger than the threshold in (18). To verify this, we lower bound the mean and upper bound the variance of the test statistic under the alternate and then use standard concentration results. We defer the details to the Supplementary Material (Appendix B). 3.2 The 2/3-rd + tail test The truncated χ2 test described in the previous section, although globally minimax, is not locally adaptive. The test from [30], achieves the local minimax upper bound in Theorem 1. We refer to this as the 2/3-rd + tail test. We use a slightly modified version of their test when testing Lipschitz goodness-of-fit in Section 4, and provide a description here. The test is a composite two-stage test, and has a tuning parameter σ. Recalling the definitions of Bσ (p0 ) and Qσ (p0 ) (see (12)), we define two test statistics T1 , T2 and corresponding test thresholds t1 , t2 : r X nP0 (Qσ (p0 )) T1 (σ) = (Xj − np0 (j)), t1 (α, σ) = , α j∈Qσ (p0 ) sP 2/3 2 X (Xj − np0 (j))2 − Xj j∈Bσ 2n p0 (j) . T2 (σ) = , t (α, σ) = 2 2/3 α pj j∈Bσ (p0 ) We define two tests: 1. The tail test: φtail (σ, α) = I(T1 (σ) > t1 (α, σ)). 2. The 2/3-test: φ2/3 (σ, α) = I(T2 (σ) > t2 (α, σ)). The composite test φV (σ, α) is then given as: φV (σ, α) = max{φtail (σ, α/2), φ2/3 (σ, α/2)}. (20) With these definitions in place, the following result is essentially from the work of [30]. We use C > 0 to denote a positive universal constant. Theorem 3. Consider the testing problem in (5). The composite test φV (σ, α) has size at most α, i.e. P0 (φV = 1) ≤ α. Furthermore, if we choose σ = n (p0 , M)/8, and un (p0 ) as in (15), then for any 0 < ζ ≤ 1, if n (p0 , M) ≥ Cun (p0 ) max{1/α, 1/ζ}, then the Type II error of the test is bounded by ζ, i.e. P (φV = 0) ≤ ζ. Remarks: 8 (21) • The test φV is also motivated by deficiencies of the χ2 test. In particular, the test includes two main modifications to the χ2 test which limit the contribution of the small entries of p0 : some of the small entries of p0 are dealt with via a separate tail test and further the normalization of the χ2 test is changed from p0 (i) to p0 (i)2/3 . • This result provides the upper bound of Theorem 1. It requires that the tuning parameter σ is chosen as n (p0 , M)/8. In the Supplementary Material (Appendix F) we discuss adaptive choices for σ. • The proof essentially follows from the paper of [30], but we maintain an explicit bound on the power and size of the test, which we use in later sections. We provide the details in Appendix B. While the 2/3-rd norm test is locally minimax optimal its analysis is quite challenging. In the next section, we build on results from a recent paper of Diakonikolas and Kane [10] to provide an alternative (nearly) locally minimax test with a simpler analysis. 3.3 The Max Test An important insight, one that is seen for instance in Figure 1, is that many simple tests are optimal when p0 is uniform and that careful modifications to the χ2 test are required only when p0 is far from uniform. This suggests the following strategy: partition the multinomial into nearly uniform groups, apply a simple test within each group and combine the tests with an appropriate Bonferroni correction. We refer to this as the max test. Such a strategy was used by Diakonikolas and Kane [10], but their test is quite complicated and involves many constants. Furthermore, it is not clear how to ensure that their test controls the Type I error at level α. Motivated by their approach, we present a simple test that controls the type I error as required and is (nearly) locally minimax. As with the test in the previous section, the test has to be combined with the tail test. The test is defined to be φmax (σ, α) = max{φtail (σ, α/2), φM (σ, α/2)}, where φM is defined as follows. We partition Bσ (p0 ) into sets Sj for j ≥ 1, where n p0 (2) p0 (2) o Sj = t : < p (t) ≤ . 0 2j 2j−1 We can bound the total number of sets Sj by noting that for any i ∈ Bσ (p0 ), we have that p0 (i) ≥ σ/d, so that the number of sets k is bounded by dlog2 (d/σ)e. Within each set we use a modified `2 statistic. Let X Tj = [(Xt − np0 (t))2 − Xt ] (22) t∈Sj for j ≥ 1. Unlike the traditional `2 statistic, each term in this statistic is centered around Xt . As observed in [30], this results in the statistic having smaller variance in the n  d regime. Let _ φM (σ, α) = I(Tj > tj ), (23) j 9 where tj = v h i u u 2kn2 P 2 p (t) 0 t t∈Sj α . (24) Theorem 4. Consider the testing problem in (5). Suppose we choose σ = n (p0 , M)/8, then the composite test φmax (σ, α) has size at most α, i.e. P0 (φmax = 1) ≤ α. Furthermore, there is a universal constant C > 0, such that for un (p0 ) as in (15), if for any 0 < ζ ≤ 1 we have that, (√ 2 n (p0 , M) ≥ Ck un (p0 ) max k 1 , α ζ ) , (25) then the Type II error of the test is bounded by ζ, i.e. P (φmax = 0) ≤ ζ. Remarks: • Comparing the critical radii in Equations (25) and (16), and noting that k ≤ dlog2 (8d/n )e, we conclude that the max test is locally minimax optimal, up to a logarithmic factor. • In contrast to the analysis of the 2/3-rd + tail test in [30], the analysis of the max test involves mostly elementary calculations. We provide the details in Appendix B. As emphasized in the work of [10], the reduction of testing problems to simpler testing problems (in this case, testing uniformity) is a more broadly useful idea. Our upper bound for the Lipschitz testing problem (in Section 4) proceeds by reducing it to a multinomial testing problem through a spatially adaptive binning scheme. 3.4 Simulations In this section, we report some simulation results that demonstrate the practicality of the proposed tests. We focus on two simulation scenarios and compare the globally-minimax truncated χ2 test, and the 2/3rd + tail test [30] with the classical χ2 -test and the likelihood ratio test. The χ2 statistic is, Tχ2 = d X (Xi − np0 (i))2 − np0 (i) np0 (i) i=1 , and the likelihood ratio test statistic is TLRT = 2 d X  Xi log i=1 Xi np0 (i)  . In Appendix G, we consider a few additional simulations as well as a comparison with statistics based on the `1 and `2 distances. In each setting described below, we set the α level threshold via simulation (by sampling from the null 1000 times) and we calculate the power under particular alternatives by averaging over a 1000 trials. 10 Uniform Null, Dense Alternate Uniform Null, Sparse Alternate 1 0.9 0.9 0.8 0.8 0.7 0.7 0.6 0.6 Power Power 1 0.5 0.4 Chi-sq. Truncated chi-sq LRT 2/3rd and tail 0.5 0.4 0.3 0.3 Chi-sq. Truncated chi-sq LRT 2/3rd and tail 0.2 0.1 0 0 0.2 0.4 0.6 0.8 0.2 0.1 0 1 ℓ1 Distance 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 ℓ1 Distance Figure 1: A comparison between the truncated χ2 test, the 2/3rd + tail test [30], the χ2 -test and the likelihood ratio test. The null is chosen to be uniform, and the alternate is either a dense or sparse perturbation of the null. The power of the tests are plotted against the `1 distance between the null and alternate. Each point in the graph is an average over 1000 trials. Despite the high-dimensionality (i.e. n = 200, d = 2000) the tests have high-power, and perform comparably. 1. Figure 1 considers a high-dimensional setting where n = 200, d = 2000, the null distribution is uniform, and the alternate is either dense (perturbing each coordinate by a scaled Rademacher) or sparse (perturbing only two coordinates). In each case we observe that all the tests perform comparably indicating that a variety of tests are optimal around the uniform distribution, a fact that we exploit in designing the max test. The test from [30] performs slightly worse than others due to the Bonferroni correction from applying a two-stage test. 2. Figure 2 considers a power-law null where p0 (i) ∝ 1/i. Again we take n = 200, d = 2000, and compare against a dense and sparse alternative. In this setting, we choose the sparse alternative to only perturb the first two coordinates of the distribution. We observe two notable effects. First, we see that when the alternate is dense, the truncated χ2 test, although consistent in the high-dimensional regime, is outperformed by the other tests highlighting the need to study the local-minimax properties of tests. Perhaps more surprising is that in the setting where the alternate is sparse, the classical χ2 and likelihood ratio tests can fail dramatically. The locally minimax test is remarkably robust across simulation settings. However, it requires that we specify n , a drawback shared by the max test. In Appendix F we provide adaptive alternatives that adapt to unknown n . 4 Testing Lipschitz Densities In this section, we focus our attention on the Lipschitz testing problem (6). As is standard in non-parametric problems, throughout this section, we treat the dimension d as a fixed 11 Power Law Null, Dense Alternate 0.9 0.9 0.8 0.8 0.7 0.7 0.6 0.6 0.5 0.4 Chi-sq. Truncated chi-sq LRT 2/3rd and tail 0.5 0.4 0.3 0.3 Chi-sq. Truncated chi-sq LRT 2/3rd and tail 0.2 0.1 0 Power Law Null, Sparse Alternate 1 Power Power 1 0 0.1 0.2 0.3 0.4 0.5 0.2 0.1 0 0.6 ℓ1 Distance 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 ℓ1 Distance Figure 2: A comparison between the truncated χ2 test, the 2/3rd + tail test [30], the χ2 -test and the likelihood ratio test. The null is chosen to be a power law, and the alternate is either a dense or sparse perturbation of the null. The power of the tests are plotted against the `1 distance between the null and alternate. Each point in the graph is an average over 1000 trials. The truncated χ2 test despite being globally minimax optimal, can perform poorly for any 2 particular fixed null. The √ χ and likelihood ratio tests can fail to be consistent even when n is quite large, and n  d. (universal) constant. Our emphasis is on understanding the local critical radius while making minimal assumptions. In contrast to past work, we do not assume that the null is uniform or even that its support is compact. We would like to be able to detect more subtle deviations from the null as the sample size gets large and hence we do not assume that the Lipschitz parameter Ln is fixed as n grows. The classical method, due to Ingster [15, 16] to constructing lower and upper bounds on the critical radius, is based on binning the domain of the density. In particular, upper bounds were obtained by considering χ2 tests applied to the multinomial that results from binning the null distribution. Ingster focused on the case when the null distribution P0 was taken to be uniform on [0, 1], noting that the testing problem for a general null distribution could be “reduced” to testing uniformity by modifying the observations via the quantile transformation corresponding to the null distribution P0 (see also [12]). We emphasize that such a reduction alters the smoothness class tailoring it to the null distribution P0 . The quantile transformation forces the deviations from the null distribution to be more smooth in regions where P0 is small and less smooth where P0 is large, i.e. we need to re-interpret smoothness of the alternative density p as an assumption about the function p(F0−1 (t)), where F0−1 is the quantile function of the null distribution P0 . We find this assumption to be unnatural and instead aim to directly test the hypotheses in (6). We begin with some high-level intuition for our upper and lower bounds. • Upper bounding the critical radius: The strategy of binning domain of p0 , and then testing the resulting multinomial against an appropriate `1 neighborhood using a locally minimax test is natural even when p0 is not uniform. However, there is considerable flexibility in how precisely to bin the domain of p0 . Essentially, the only constraint in the choice of bin-widths is that the approximation error (of approximating the density by its piecewise constant, histogram approximation) is sufficiently well-controlled. When the null is not uniform the choice of fixed bin-widths is arbitrary and as we will see, 12 sub-optimal. A bulk of the technical effort in constructing our optimal tests is then in determining the optimal inhomogenous, spatially adaptive partition of the domain in order to apply a multinomial test. • Lower bounding the critical radius: At a high-level the construction of Ingster is similar to standard lower bounds in non-parametric problems. Roughly, we create a collection of possible alternate densities, by evenly partitioning the domain of p0 , and then perturbing each cell of the partition by adding or subtracting a small (sufficiently smooth) bump. We then analyze the optimal likelihood ratio test for the (simple versus simple) testing problem of distinguishing p0 from a uniform mixture of the set of possible alternate densities. We observe that when p0 is not uniform once again creating a fixed bin-width partition is not optimal. The optimal choice of bin-widths is to choose larger bin-widths when p0 is large and smaller bin-widths when p0 is small. Intuitively, this choice allows us to perturb the null distribution p0 more when the density is large, without violating the constraint that the alternate distribution remain sufficiently smooth. Once again, we create an inhomogenous, spatially adaptive partition of the domain, and then use this partition to construct the optimal perturbation of the null. Define, γ := 2 , 3+d (26) and for any 0 ≤ σ ≤ 1 denote the collection of sets of probability mass at least 1 − σ as Bσ , i.e. Bσ := {B : P0 (B) ≥ 1 − σ}. Define the functional, Z Tσ (p0 ) := inf B∈Bσ B pγ0 (x)dx 1/γ . (27) We refer to this as the truncated T -functional3 . The functional Tσ (p0 ) is the analog of the functional Vσ (p0 ) in (14), and roughly characterizes the local critical radius. We return to study this functional in light of several examples, in Section 4.1 (and Appendix D). In constructing lower bounds we will assume that the null density lies in the interior of the Lipschitz ball, i.e. we assume that for some constant 0 ≤ cint < 1, we have that, p0 ∈ L(cint Ln ). This assumption avoids certain technical issues that arise in creating perturbations of the null density when it lies on the boundary of the Lipschitz ball. Finally, we define for two universal constants C ≥ c > 0 (that are explicit in our proofs) the upper and lower critical radii: vn (p0 ) =  Ld/2 n T Cvn (p0 ) (p0 ) n  2 4+d , wn (p0 ) =  Ld/2 n T cwn (p0 ) (p0 ) n  2 4+d . (28) With these preliminaries in place we now state our main result on testing Lipschitz densities. We let c, C > 0 denote two positive universal constants (different from the ones above). Theorem 5. The local critical radius n (p0 , L(Ln )) for testing Lipschitz densities is upper bounded as: n (p0 , L(Ln )) ≤ Cwn (p0 ). 3 (29) Although the set B that achieves the minimum in the definition of Tσ (p0 ) need not be unique, the functional itself is well-defined. 13 Furthermore, if for some constant 0 ≤ cint < 1 we have that, p0 ∈ L(cint Ln ), then the critical radius is lower bounded as cvn (p0 ) ≤ n (p0 , L(Ln )). (30) Remarks: • A natural question of interest is to understand the worst-case rate for the critical radius, or equivalently to understand the largest that the T -functional can be. Since the T functional can be infinite if the support is unrestricted, we restrict our attention to Lipschitz densities with a bounded support S. In this case, letting µ(S) denote the Lebesgue measure of S and using Hölder’s inequality (see Appendix D) we have that for any σ > 0, Tσ (p0 ) ≤ (1 − σ)µ(S) 1−γ γ . (31) Up to constants involving γ, σ this is attained when p0 is uniform on the set S. In other words, the critical radius is maximal for testing the uniform density against a Lipschitz, `1 neighborhood. In this case, we simply recover a generalization of the result of [15] for testing when p0 is uniform on [0, 1]. • The main discrepancy between the upper and lower bounds is in the truncation level, i.e. the upper and lower bounds depend on the functional Tσ (p0 ) for different values of the parameter σ. This is identical to the situation in Theorem 1 for testing multinomials. In most non-pathological examples this functional is stable with respect to constant factor discrepancies in the truncation level and consequently our upper and lower bounds are typically tight (see the examples in Section 4.1). In the Supplementary Material (see Appendix D) we formally study the stability of the T -functional. We provide general bounds and relate the stability of the T -functional to the stability of the level-sets of p0 . The remainder of this section is organized as follows: we first consider various examples, calculate the T -functional and develop the consequences of Theorem 5 for these examples. We then turn our attention to our adaptive binning, describing both a recursive partitioning algorithm for constructing it as well as developing some of its useful properties. Finally, we provide the body of our proof of Theorem 5 and defer more technical aspects to the Supplementary Material. We conclude with a few illustrative simulations. 4.1 Examples The result in Theorem 5 provides a general characterization of the critical radius for testing any density p0 , against a Lipschitz, `1 neighborhood. In this section we consider several concrete examples. Although our theorem is more generally applicable, for ease of exposition we focus on the setting where d = 1, highlighting the variability of the T -functional and consequently of the critical radius as the null density is changed. Our examples have straightforward d-dimensional extensions. When d = 1, we have that γ = 1/2 so the T -functional is simply: Z 2 p Tσ (p0 ) = inf p0 (x)dx , B∈Bσ B where Bσ is as before. Our interest in general is in the setting where σ → 0 (which happens as n → ∞), so in some examples we will simply calculate T0 (p0 ). In other examples however, the truncation at level σ will play a crucial role and in those cases we will compute Tσ (p0 ). 14 Example 1 (Uniform null). Suppose that the null distribution p0 is Uniform[a, b] then, T0 (p0 ) = |b − a|. Example 2 (Gaussian null). Suppose that the null distribution p0 is a Gaussian, i.e. for some ν > 0, µ ∈ R, p0 (x) = √ 1 exp(−(x − µ)2 /(2ν 2 )). 2πν In this case, a simple calculation (see Appendix C) shows that, T0 (p0 ) = (8π)1/2 ν. Example 3 (Beta null). Suppose that the null density is a Beta distribution: p0 (x) = 1 Γ(α + β) α−1 β−1 x x = xα−1 xβ−1 , Γ(α)Γ(β) B(α, β) where Γ and B denote the gamma and beta functions respectively. It is easy to verify that, Z 1 2 p B 2 ((α + 1)/2, (β + 1)/2) . T0 (p0 ) = p0 (x)dx = B(α, β) 0 To get some sense of the behaviour of this functional, we consider the case when α = β = t → ∞. In this case, we show (see Appendix C) that for t ≥ 1, π 2 −1/2 e4 −1/2 t ≤ T (p ) ≤ t . 0 0 4e4 4 In particular, we have that T0 (p0 )  t−1/2 . Remark: • These examples illustrate that in the simplest settings when the density p0 is close to uniform, the T -functional is roughly the effective support of p0 . In each of these cases, it is straightforward to verify that the truncation of the T -functional simply affects constants so that the critical radius scales as: 2/5 √ Ln T0 (p0 ) n  , n where T0 (p0 ) in each case scales as roughly the size of the (1 − n )-support of the density p0 , i.e. as the Lebesgue measure of the smallest set that contains (1 − n ) probability mass. This motivates understanding the Lipschitz density with smallest effective support, and we consider this next. Example 4 (Spiky null). Suppose that the null hypothesis is:   0 ≤ x ≤ √1L  Ln x n p0 (x) = √2L − Ln x √1L ≤ x ≤ √2L n n n   0 otherwise, then we have that T0 (p0 )  √1 . Ln 15 Remark: • For the spiky null distribution we obtain an extremely fast rate, i.e. we have that the critical radius n  n−2/5 , and is independent of the Lipschitz parameter Ln (although, we note that the null p0 is more spiky as Ln increases). This is the fastest rate we obtain for Lipschitz testing. In settings where the tail decay is slow, the truncation of the T -functional can be crucial and the rates can be much slower. We consider these examples next. Example 5 (Cauchy distribution). The mean zero, Cauchy distribution with parameter α has pdf: 1 α2 . πα x2 + α2 As we show (see Appendix C), the T -functional without truncation is infinite, i.e. T0 (p0 ) = ∞. However, the truncated T -functional is finite. In the Supplementary Material we show that for any 0 ≤ σ ≤ 0.5 (recall that our interest is in cases where σ → 0),       1 2e 4α 4α 2 ln ≤ Tσ (p0 ) ≤ ln2 , π σ π πσ p0 (x) = i.e. we have that Tσ (p0 )  ln2 (1/σ). Remark: • When the null distribution is Cauchy as above, we note that the rate for the critical radius is no longer the typical n  n−2/5 , even when the other problem specific parameters (Ln and the Cauchy parameter α) are held fixed. We instead obtain a slower n  (n/ log2 n)−2/5 rate. Our final example, shows that we can obtain an entire spectrum of slower rates. Example 6 (Pareto null). For a fixed x0 > 0 and for 0 < α < 1, suppose that the null distribution is ( αxα 0 for x ≥ x0 , α+1 p0 (x) = x 0 for x < x0 . This distribution for 0 < α < 1 has thicker tails than the Cauchy distribution. The T -functional without truncation is infinite, i.e. T0 (p0 ) = ∞, and we can further show that (see Appendix C): 2 4αx0 − 1−α 4αx0  − 1−α 2α − 1 σ = Tσ (p0 ) ≤ σ α . 2 (1 − α) (1 − α)2 In the regime of interest when σ → 0, we have that Tσ (p0 ) ∼ σ − 1−α α . Remark: • We observe that once again, the critical radius no longer follows the typical rate: n  n−2/5 . Instead we obtain the rate, n  n−2α/(2+3α) , and indeed have much slower rates as α → 0, indicating the difficulty of testing heavy-tailed distributions against a Lipschitz, `1 neighborhood. We conclude this section by emphasizing the value of the local minimax perspective and of studying the goodness-of-fit problem beyond the uniform null. We are able to provide a sharp characterization of the critical radius for a broad class of interesting examples, and we obtain faster (than at uniform) rates when the null is spiky and non-standard rates in cases when the null is heavy-tailed. 16 4.2 A recursive partitioning scheme At the heart of our upper and lower bounds are spatially adaptive partitions of the domain of p0 . The partitions used in our upper and lower bounds are similar but not identical. In this section, we describe an algorithm for producing the desired partitions and then briefly describe some of the main properties of the partition that we leverage in our upper and lower bounds. We begin by describing the desiderata for the partition from the perspective of the upper bound. Our goal is to construct a test for the hypotheses in (6), and we do so by constructing a partition (consisting of N + 1 cells) {A1 , . . . , AN , A∞ } of Rd . Each cell Ai for i ∈ {1, . . . , N } will be a cube, while the cell A∞ will be arbitrary but will have small total probability content. We let, K := N [ Ai . (32) i=1 We form the R multinomial corresponding to the partition {P0 (A1 ), . . . , P0 (AN ), P0 (A∞ )}, where P0 (Ai ) = Ai p0 (x)dx. We then test this multinomial using the counts of the number of samples falling in each cell of the partition. Requirement 1: A basic requirement of the partition is that it must ensure that a density p that is at least n far away in `1 distance from p0 should remain roughly n away from p0 when converted to a multinomial. Formally, for any p such that kp − p0 k1 ≥ n , p ∈ L(Ln ) we require that for some small constant c > 0, N X |P0 (Ai ) − P (Ai )| + |P0 (A∞ ) − P (A∞ )| ≥ cn . (33) i=1 Of course, there are several ways to ensure this condition is met. In particular, supposing that we restrict attention to densities supported on [0, 1] then it suffices for instance to choose roughly Ln /n even-width bins. This is precisely the partition considered in prior work [1, 15, 16]. When we do not restrict attention to compactly supported, uniform densities an even-width partition is no longer optimal and a careful optimization of the upper and lower bounds with respect to the partition yields the optimal choice. The optimal partition has bin-widths that are roughly taken proportional to pγ0 (x), where the constant of proportionality is chosen to ensure that the condition in (33) is satisfied. Precisely determining the constant of proportionality turns out to be quite subtle so we defer a discussion of this to the end of this section. Requirement 2: A second requirement that arises in both our upper and lower bounds is that the cells of our partition (except A∞ ) are not chosen too wide. In particular, we must choose the cells small enough to ensure that the density is roughly constant on each cell, i.e. on each cell we need that for any i ∈ {1, . . . , N }, supx∈Ai p0 (x) ≤ 3. inf x∈Ai p0 (x) (34) Using the Lipschitz property of p0 , this condition is satisfied if any point x is in a cell of diameter at most p0 (x)/(2Ln ). Taken together the first two requirements suggest that we need to create a partition such that: for every point x ∈ K the diameter of the cell A containing the point x, should be roughly, diam(A) ≈ min {θ1 p0 (x), θ2 pγ0 (x)} , 17 where θ1 is to be chosen to be smaller than 1/(2Ln ), and θ2 is chosen to ensure that Requirement 1 is satisfied. Algorithm 1 constructively establishes the existence of a partition satisfying these requirements. The upper and lower bounds use this algorithm with slightly different parameters. The key idea is to recursively partition cells that are too large by halving each side. This is illustrated in Figure 3. The proof of correctness of the algorithm uses the smoothness of p0 in an essential fashion. Indeed, were the density p0 not sufficiently smooth then such a partition would likely not exist. In order to ensure that the algorithm has a finite termination, we choose two parameters a, b  n (these are chosen sufficiently small to not affect subsequent results): • We restrict our attention to the a-effective support of p0 , i.e. we define Sa to be the smallest cube centered at the mean of p0 such that, P0 (Sa ) ≥ 1 − a. We begin with A∞ = Sac . • If the density in any cell is sufficiently small we do not split the cell further, i.e. for a parameter b, if supx∈A p0 (x) ≤ b/vol(Sa ) then we do not split it, rather we add it to A∞ . By construction, such cells have total probability content at most b. e denote the e } we let xi denote its centroid, and we let N For each cube Ai for i ∈ {1, . . . , N number of cubes created by Algorithm 1. Algorithm 1: Adaptive Partition 1. Input: Parameters θ1 , θ2 , a, b. 2. Set A∞ = ∅ and A1 = Sa . 3. For each cube Ai do: • If sup p0 (xi ) ≤ x∈Ai b , vol(Sa ) (35) then remove Ai from the partition and let A∞ = A∞ ∪ Ai . • If diam(Ai ) ≤ min {θ1 p0 (xi ), θ2 pγ0 (xi )} , (36) then do nothing to Ai . • If Ai fails to satisfy (35) or (36) then replace Ai by a set of 2d cubes that are obtained by halving the original Ai along each of its axes. 4. If no cubes are split or removed, STOP. Else go to step 3. 5. Output: Partition P = {A1 , . . . , ANe , A∞ }. Requirement 3: The final major requirement is two-fold: (1) we require that the γ-norm of the density over the support of the partition should be upper bounded by the truncated T -functional, and (2) that the density over the cells of the partition be sufficiently large. This necessitates a further pruning of the partition, where we order cells by their probability content and successively eliminate (adding them to A∞ ) cells of low probability until we 18 ×10 2 -3 1 0.9 100 1.8 0.8 200 1.6 0.7 300 1.4 400 0.6 500 1.2 0.5 600 1 700 0.8 0.4 0.3 0.2 800 0.6 0.1 900 0.4 0 1000 0 200 400 600 800 0.2 0.4 0.6 0.8 1 1000 (b) (a) Figure 3: (a) A density p0 on [0, 1]2 evaluated on a 1000 × 1000 grid. (b) The corresponding spatially adaptive partition P produced by Algorithm 1. Cells of the partition are larger in regions where the density p0 is higher. have eliminated mass that is close to the desired truncation level. This is accomplished by Algorithm 2. Algorithm 2: Prune Partition 1. Input: Unpruned partition P = {A1 , . . . , ANe , A∞ } and a target pruning level c. Without loss of generality we assume P0 (A1 ) ≥ P0 (A2 ) ≥ . . . ≥ P0 (ANe ). e } let Q(j) = 2. For any j ∈ {1, . . . , N ∗ such that, Q(j ) ≤ c. PNe i=j P0 (Ai ). Let j ∗ denote the smallest positive integer 3. If Q(j ∗ ) ≥ c/5: • Set N = j ∗ − 1, and A∞ = A∞ ∪ Aj ∗ ∪ . . . ∪ ANe . 4. If Q(j ∗ ) ≤ c/5: • Set N = j ∗ − 1, α = min{c/(5P0 (AN )), 1/5}, and A∞ = A∞ ∪ Aj ∗ ∪ . . . ∪ ANe . • AN is a cube, i.e. for some δ > 0, AN = [a1 , a1 + δ] × · · · × [ad , ad + δ]. Let D1 = [a1 , (1 − α)(a1 + δ)] × · · · × [ad , (1 − α)(ad + δ)] and D2 = AN − D1 . Set: AN = D1 and A∞ = A∞ ∪ D2 . 5. Output: P † = {A1 , . . . , AN , A∞ }. It remains to specify a precise choice for the parameter θ2 . We do so indirectly by defining a function µ : R 7→ R that is closely related to the truncated T -functional. For x ∈ R we define µ(x) as the smallest positive number that satisfies the equation:   Z p0 (y) n p0 (y)γ n = min , dy. (37) x µ(x) Rd If x < 1/n then we obtain a finite value for µ(x), otherwise we take µ(x) = ∞. The following 19 result, relates µ to the truncated T -functional. Lemma 1. For any 0 ≤ x < 1/n , γ γ Tx (p0 ) ≤ µ(x) ≤ 2Tx (p0 ). n n /2 (38) With the definition of µ in place, we now state our main result regarding the partitions produced by Algorithms 1 and 2. We let P denote the unpruned partition obtained from Algorithm 1 and P † denote the pruned partition obtained from Algorithm 2. For each cell Ai we denote its centroid by xi . We have the following result summarizing some of the important properties of P and P † . Lemma 2. Suppose we choose, θ1 = 1/(2Ln ), θ2 = n /(8Ln µ(1/4)), a = b = n /1024, c = n /512, then the partition P † satisfies the following properties: 1. [Diameter control] The partition has the property that, 1 min {θ1 p0 (xi ), θ2 pγ0 (xi )} ≤ diam(Ai ) ≤ min {θ1 p0 (xi ), θ2 pγ0 (xi )} . 5 (39) 2. [Multiplicative control] The density is multiplicatively controlled on each cell, i.e. for i ∈ {1, . . . , N } we have that, supx∈Ai p0 (x) ≤ 2. inf x∈Ai p0 (x) (40) 3. [Properties of A∞ ] The cell A∞ has probability content roughly n , i.e. n n ≤ P (A∞ ) ≤ . 2560 256 (41) 4. [`1 distance] The partition preserves the `1 distance, i.e. for any p such that kp − p0 k1 ≥ n , p ∈ L(Ln ), N X |P0 (Ai ) − P (Ai )| + |P0 (A∞ ) − P (A∞ )| ≥ i=1 n . 8 5. [Truncated T -functional] Recalling the definition of K in (32), we have that, Z pγ0 (x)dx ≤ Tγn /5120 (p0 ). (42) (43) K 6. [Density Lower Bound] The density over K is lower bounded as:  inf p0 (x) ≥ x∈K n 5120µ(1/5120) 1/(1−γ) . (44) Furthermore, for any choice of the parameter θ2 the unpruned partition P of Algorithm 1 satisfies (39) with the constant 5 sharpened to 4, (40) and the upper bound in (41). 20 The proof of this result is technical and we defer it to Appendix E. While we focused our discussions on the properties of the partition from the perspective of establishing the upper bound in Theorem 5 it turns out that several of these properties are crucial in proving the lower bound as well. The optimal adaptive partition creates larger cells in regions where the density p0 is higher, and smaller cells where p0 is lower. This might seem counter-intuitive from the perspective of the upper bound since we create many low-probability cells which are likely to be empty in a small finite-sample, and indeed this construction is in some sense opposite to the quantile transformation suggested by previous work [12, 15]. However, from the perspective of the lower bound this is completely natural. It is intuitive that our perturbation be large in regions where the density is large since the likelihood ratio is relatively stable in these regions, and hence these changes are more difficult to detect. The requirement of smoothness constrains the amount by which we can we can perturb the density on any given cell, i.e. for a large perturbation the corresponding cell should have a large diameter leading to the conclusion that we must use larger cells in regions where p0 is higher. In this section, we have focused on providing intuition for our adaptive partitioning scheme. In the next section we provide the body of the proof of Theorem 5, and defer the remaining technical aspects to the Supplementary Material. 4.3 Proof of Theorem 5 We consider the lower and upper bounds in turn. 4.3.1 Proof of Lower Bound We note that the lower bound in (30) is trivial when n ≥ 1/C so throughout the proof we focus on the case when n is smaller than a universal constant, i.e. when n ≤ C1 . Preliminaries: We begin by briefly introducing the lower bound technique due to Ingster (see for instance [14]). Let P be a set of distributions and let Φn be the set level α tests based on n observations where 0 < α < 1 is fixed. We want to bound the minimax type II error ζn (P) = inf sup P n (φ = 0). φ∈Φn P ∈P R Define Q as Q(A) = P n (A)dπ(P ), where π is a prior distribution whose support is contained in P. In particular, if π is uniform on a finite set P1 , . . . , PN then Q(A) = 1 X n Pj (A). N j Given n observations we define the likelihood ratio Z Z Y p(Zj ) p(Z1 , . . . , Zn ) dQ Wn (Z1 , . . . , Zn ) = = dπ(p) = dπ(p). n dP0 p0 (Z1 , . . . , Zn ) p0 (Zj ) j Lemma 3. Let 0 < ζ < 1 − α. If E0 [Wn2 (Z1 , . . . , Zn )] ≤ 1 + 4(1 − α − ζ)2 then ζn (P) ≥ ζ. 21 (45) Roughly, this result asserts that in order to produce a minimax lower bound on the Type II error, it suffices to appropriately upper bound the second moment under the null of the likelihood ratio. The proof is standard but presented in Appendix E for completeness. A natural way to construct the prior π on the set of alternatives, is to partition the domain of p0 and then to locally perturb p0 by adding or subtracting sufficiently smooth “bumps”. In the setting where the partition has fixed-width cells this construction is standard [1, 15] and we provide a generalization to allow for variable width partitions and to allow for non-uniform p0 . Formally, let ψ be a smooth bounded function on the hypercube I = [−1/2, 1/2]d such that Z Z ψ(x)dx = 0 and ψ 2 (x)dx = 1. I I Let P = {A1 , . . . , AN , A∞ } be any partition that satisfies the condition in (40), and further let {x1 , . . . , xN } denote the centroids of the cells {A1 , . . . , AN }. Suppose further, that each cell Aj for j ∈ {1, . . . , N } is a cube with side-length cj hj for some constants cj ≤ 1, and 1 hj = √ min{θ1 p0 (xj ), θ2 pγ0 (xj )}. d Let η = (η1 , η2 , . . . , ηN ) be a Rademacher sequence and define pη = p0 + N X ρj ηj ψj (46) j=1 where each ρj ≥ 0 and ψj (t) = for t ∈ Aj . Hence, R Aj ψj (t) = 0 and R Aj  1 d/2 d/2 ψ cj hj t − xj cj hj  ψj2 (t) = 1. Finally, let us denote:   8kψ 0 k∞ ω1 := max kψk∞ , , (1 − cint ) and ω2 := kψk1 . With these definitions in place we state a result that gives a lower bound for a sequence of perturbations ρj that satisfy certain conditions. Lemma 4. Let α, ζ and n be non-negative numbers with 1−α−ζ > 0. Let C0 = 1+4(1−α−ζ)2 . Assume that for each j ∈ {1, . . . , N }, ρj and hj satisfy: d/2 (a) ρj ≤ (b) N X cj ω1 1+ d2 Ln hj d/2 d/2 ρj cj hj j=1 (c) N X ρ4j j=1 p20 (xj ) then the Type II error of any test is at least ζ. 22 ≤ (47) n ω2 (48) log C0 , 4n2 (49) ≥ Effectively, this lemma generalizes the result of Ingster [15] to allow for non-uniform p0 and further allows for variable width bins. The proof proceeds by verifying that under the conditions of the lemma, pη is sufficiently smooth, and separated from p0 by at least n in the `1 metric. We let the prior be uniform on the the set of possible distributions pη and directly analyze the second moment of the likelihood ratio, and obtain the result by applying Lemma 3. See Appendix E for the proof of this lemma. It is worth noting the condition in (47), which ensures smoothness of pη , allows for larger perturbations ρj for bins where hj is large, which is one of the key benefits of using variable bin-widths in the lower bound. With this result in place, to produce the desired minimax lower bound it only remains to specify the partition, select a sequence of perturbations ρj and verify that the conditions of Lemma 4 are satisfied. Final Steps: We begin by specifying the partition. We define,   ω2 √ ,1 . ν = min ω1 4d+1 d For the lower bound we do not need to prune the partition, rather we simply apply Algorithm 1 with θ1 = 1/(2Ln ), and θ2 = n /(Ln νµ(2/ν)). We choose a = b = n /1024, and denote the resulting partition P = {A1 , . . . , AN , A∞ }. Using Lemma 2 we have that the partition satisfies (39) with the constant 5 replaced by 4, (40) and the upper bound in (41). We now choose a sequence {ρ1 , . . . , ρN }, and proceed to verify that the conditions of Lemma 4 are satisfied. We choose, d/2 ρj = cj ω1 1+ d2 Ln hj , thus ensuring the condition in (47) is satisfied. Verifying the condition in (48): Recall the definition of µ in (37),   Z p0 (y) n p0 (y)γ n dy, = min , ν 2 νµ(2/ν) Rd provided that n ≤ ν/2 which is true by our assumption on the critical radius. Recalling the definition of K in (32), we have that,   Z p0 (y) n p0 (y)γ n P (A∞ ) min , dy ≥ − . 2 νµ(2/ν) ν 2 K We define the function 1 h(y) := √ min d  p0 (y) n p0 (y)γ , 2Ln Ln νµ(2/ν)  , and as a consequence of the property (40) we obtain that for any y ∈ Aj for j ∈ {1, . . . , N }, hj ≥ h(y) . 2 This in turn yields that, L N X j=1 hd+1 j 1 ≥ √ 2 d  Z min K p0 (y) n p0 (y)γ , 2 νµ(2/ν) 23  1 dy ≥ √ 2 d  n P (A∞ ) − ν 2  n ≥ √ , 4 dν where the final step uses the upper bound in (41). We then have that, N X d/2 d/2 ρj cj hj = j=1 N X Ln cdj hd+1 j j=1 ω1 ≥ N X Ln hd+1 j 4d ω1 j=1 ≥ n , ω2 which establishes the condition in (48). Verifying the condition in (49): We note the inequality (which can be verified by simple case analysis) that for a, b, u, v ≥ 0, u v min{a, b} ≤ min{a u+v b u+v , b}, in particular for u = 1, v = 3 + d we obtain, 1 min{a, b} ≤ min{(ab3+d ) 4+d , b}. (50) Returning to the condition in (49) we have that, N X j=1 N N 2d 4+2d d 4+d ρ4j L4n X cj hj L4n X hj hj ≤ 4 ≤ 4 , p0 (xj )2 ω1 j=1 p0 (xj )2 ω1 j=1 p0 (xj )2 using the fact that cj ≤ 1. Using the chosen values for hj we obtain that, N X j=1 ( 4+d )   N X ρ4j hdj p0 (xj ) 4+d n pγ0 (xj ) L4n ≤ √ 4+d min , p0 (xj )2 p (x )2 2Ln Ln νµ(2/ν) ω14 d j=1 0 j ( 4+d )  N γ X (i) hdj p0 (xj )3 3+d  p (x ) L4n n j n 0 ≤ min , √ 4+d 2 3+d p (x ) L νµ(2/ν) 2L (L νµ(2/ν)) 4 0 j n n n ω d j=1 1 = ≤ ≤ 3+d n √ 4+d Ldn µ(2/ν)3+d ν 4+d ω14 d 23+d n √ 4+d Ldn µ(2/ν)3+d ν 4+d ω14 d 23+d n √ 4+d Ldn µ(2/ν)3+d ν 4+d ω14 d  p0 (xj ) n p0 (xj )γ , 2/ν µ(2/ν) j=1   Z p0 (x) n p0 (x)γ min , dx 2/ν µ(2/ν) K   Z p0 (x) n p0 (x)γ min , dx 2/ν µ(2/ν) Rd hdj min  24+d n (ii) ≤ N X √ 4+d . Ldn µ(2/ν)3+d ν 4+d ω14 d where (i) follows from the inequality in (50), and (ii) uses (37). Using Lemma 1 we obtain, γ µ(2/ν) ≥ T2 (p0 ), n /ν provided that n ≤ ν/2. This yields that, N X j=1 ρ4j 24+d n ≤ √ 4+d , 2 p0 (xj ) 2 d Ln T2n /ν (p0 )ν 4+d ω14 d 24 C0 and we require that this quantity is upper bounded by log . For constants c1 , c2 that depend 4n2 only on the dimension d it suffices to choose n as the solution to the equation: d/2 Ln Tc2 n (p0 ) log C0 c1 n n = !2/(4+d) and an application of Lemma 4 yields the lower bound of Theorem 5. 4.3.2 Proof of Upper Bound In order to establish the upper bound, we construct an adaptive partition using Algorithms 1 and 2, and utilize the test analyzed in Theorem 3 from [30] to test the resulting multinomial. For the upper bound we use the partition P † studied in Lemma 2, i.e. we take θ1 = 1/(2Ln ), θ2 = n /(8Ln µ(1/4)), a = b = n /1024 and c = n /512. Using the property in (42), it suffices to upper bound the V -functional in (14), for σ = n /128. The following technical lemma shows that the truncated V -functional is upper bounded by the V -functional over the partition excluding A∞ . For the partition P † , we have the associated multinomial q := {P0 (A1 ), . . . , P0 (A∞ )}. With these definitions in place we have the following result. Lemma 5. For the multinomial q defined above, the truncated V -functional is upper bounded as: 2/3 Vn /128 (q) ≤ N X P0 (Ai )2/3 := κ. i=1 We prove this result in Appendix E. Roughly, this lemma asserts that our pruning is less aggressive than the tail truncation of the multinomial test from the perspective of controlling the 2/3-rd norm. With this claim in place it only remains to upper bound κ. Using the property in (40) we have that, κ≤ N X 2/3 (2p0 (xi )vol(Ai )) 2/3 ≤2 N X p0 (xi )2/3 d/3 i=1 i=1 hi hdi . Using the condition in (44) verify that for all x ∈ K we have that n pγ0 (x) θ1 p0 (x) ≥ , 10240Ln µ(1/5120) and this yields that for a constant c > 0 for each i ∈ {1, . . . , N }, cn pγ0 (xi ) hi ≥ . Ln µ(1/5120) Using the property in (40) we then obtain that for a constant C > 0,  κ≤C Ln µ(1/5120) n 25 d/3 Z K pγ0 (x)dx, and using the property (43) and Lemma 1, we obtain that for constants c, C > 0 that,  d/3 Ln 2/3 Tc (p0 ). κ≤C n n With Lemma 5 we obtain that for the multinomial q,  d/2 3/2 Ln Vn /128 (q) ≤ C Tcn (p0 ), n which together with the upper bound of Theorem 1 yields the desired upper bound for Theorem 5. We note that a direct application of Theorem 1 yields a bound on the critical radius that is the maximum of two terms, one scaling as 1/n and the other being the desired term in Theorem 5. In Lipschitz testing, the 1/n term is always dominated by the term involving the truncated functional. This follows from the lower bound on the truncated functional shown in (86). 4.4 Simulations In this section, we report some simulation results on Lipschitz testing. We focus on the case when d = 1. In Figure 4 we compare the following tests: 1. 2/3-rd + Tail Test: This is the locally minimax test studied in Theorem 5, where we use our binning Algorithm followed by the locally minimax multinomial test from [30]. 2. Chi-sq. Test: Here we use our binning Algorithm followed by the standard χ2 test. 3. Kolmogorov-Smirnov (KS) Test: Since we focus on the case when d = 1, we also compare to the standard KS test based on comparing the CDF of p0 to the empirical CDF. 4. Naive Binning: Finally, we compare to the approach of using fixed-width bins, together with the χ2 test. Following the prescription of Ingster [15] (for the case when p0 is uniform) we choose the number of bins so that the `1 -distance between the null and alternate is approximately preserved, i.e. denoting the effective support to be S we choose the bin-width as n /(Ln µ(S)). We focus on two simulation scenarios: when the null distribution is a standard Gaussian, and when the null distribution has a heavier tail, i.e. is a Pareto distribution with parameter α = 0.5. We create the alternate density by smoothly perturbing the null after binning, and choose the perturbation weights as in our lower bound construction in order to construct a near worst-case alternative. We set the α-level threshold via simulation (by sampling from the null 1000 times) and we calculate the power under particular alternatives by averaging over a 1000 trials. We observe several notable effects. First, we see that the locally minimax test can significantly out perform the KS test as well the test based on fixed bin-widths. The failure of the fixed bin-width test is more apparent in the setting where the null is Pareto as the distribution has a large effective support and the naive binning is far less parsimonious than the adaptive binning. On the other hand, we also observe that at least in these simulations the χ2 test and the locally minimax test from [30] perform comparably when based on our adaptive binning indicating the crucial role played by the binning procedure. 26 1 2/3-rd and tail KS test Chi-sq test Naive Binning + Chi-sq 0.9 0.8 0.9 0.8 0.7 0.7 0.6 0.6 Power Power Generalized Pareto with parameter 0.5 null, Dense Alternate Gaussian Null, Dense Alternate 1 0.5 0.5 0.4 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0 0.05 0.1 0.15 0.2 0.25 0.3 2/3-rd and tail KS test Chi-sq test Naive Binning + Chi-sq 0 0.1 0.35 0.15 0.2 ℓ1 Distance 0.25 0.3 0.35 0.4 ℓ1 Distance Figure 4: A comparison between the KS test, multinomial tests on an adaptive binning and multinomial tests on a fixed bin-width binning. In the figure on the left we choose the null to be standard Gaussian and on the right we choose the null to be Pareto. The alternate is chosen to be a dense near worst-case, smooth perturbation of the null. The power of the tests are plotted against the `1 distance between the null and alternate. Each point in the graph is an average over 1000 trials. 5 Discussion In this paper, we studied the goodness-of-fit testing problem in the context of testing multinomials and Lipschitz densities. For testing multinomials, we built on prior works [10, 30] to provide new globally and locally minimax tests. For testing Lipschitz densities we provide the first results that give a characterization of the critical radius under mild conditions. Our work highlights the heterogeneity of the critical radius in the goodness-of-fit testing problem and the importance of understanding the local critical radius. In the multinomial testing problem it is particularly noteworthy that classical tests can perform quite poorly in the high-dimensional setting, and that simple modifications of these tests can lead to more robust inference. In the density testing problem, carefully constructed spatially adaptive partitions play a crucial role. Our work motivates several open questions, and we conclude by highlighting a few of them. First, in the context of density testing we focused on the case when the density is Lipschitz. An important extension would be to consider higher-order smoothness. Surprisingly, Ingster [16] shows that bin-based tests continue to be optimal for higher-order smoothness classes when the null is uniform on [0, 1]. We conjecture that bin-based tests are no longer optimal when the null is not uniform, and further that the local critical radius is roughly determined by the solution to: " n (p0 )  d/2s Ln Sn (p0 ) (p0 ) n #2s/(4s+d) , where the functional S is defined as in (27) with γ = 2s/(3s + d), and Ln is the radius of the Hölder ball. Second, it is possible to invert our locally minimax tests in order to construct confidence intervals. We believe that these intervals might also have some local adaptive properties that are worthy of further study. Finally, in the Appendix, we provide some basic 27 results on the limiting distributions of the multinomial test statistics under the null when the null is uniform, and it would be interesting to consider the extension to settings where the null is arbitrary. 6 Acknowledgements This work was partially supported by the NSF grant DMS-1713003. The authors would like to thank the participants of the Oberwolfach workshop on “Statistical Recovery of Discrete, Geometric and Invariant Structures”, for their generous feedback. Suggestions by various participants including David Donoho, Richard Nickl, Markus Reiss, Vladimir Spokoiny, Alexandre Tsybakov, Martin Wainwright, Yuting Wei and Harry Zhou have been incorporated in various parts of this manuscript. References [1] Ery Arias-Castro, Bruno Pelletier, and Venkatesh Saligrama. Remember the curse of dimensionality: The case of goodness-of-fit testing in arbitrary dimension, 2016. [2] Andrew R. Barron. Uniformly powerful goodness of fit tests. Ann. Statist., 17(1):107–124, 03 1989. [3] Tugkan Batu, Lance Fortnow, Eldar Fischer, Ravi Kumar, Ronitt Rubinfeld, and Patrick White. Testing random variables for independence and identity. In 42nd Annual Symposium on Foundations of Computer Science, FOCS 2001, 14-17 October 2001, Las Vegas, Nevada, USA, pages 442–451, 2001. [4] Tony Cai and Mark Low. A framework for estimation of convex functions. Statistica Sinica, 2015. [5] G. Casella and R.L. Berger. Statistical Inference. Duxbury advanced series in statistics and decision sciences. Thomson Learning, 2002. [6] Sourav Chatterjee. A new perspective on least squares under convex constraint. Ann. Statist., 42(6):2340–2381, 12 2014. doi: 10.1214/14-AOS1254. [7] Harald Cramér. On the composition of elementary errors. Scandinavian Actuarial Journal, 1928(1):13–74, 1928. [8] L. Devroye and L. Gyorfi. Nonparametric Density Estimation: The L1 View. Wiley Interscience Series in Discrete Mathematics. Wiley, 1985. [9] Persi Diaconis and Frederick Mosteller. Methods for Studying Coincidences, pages 605–622. Springer New York, New York, NY, 2006. [10] Ilias Diakonikolas and Daniel M. Kane. A new approach for testing properties of discrete distributions. 2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS), 2016. [11] Stephen E. Fienberg. The use of chi-squared statistics for categorical data problems. Journal of the Royal Statistical Society. Series B (Methodological), 41(1):54–64, 1979. 28 [12] E. Giné and R. Nickl. Mathematical Foundations of Infinite-Dimensional Statistical Models. Cambridge University Press, 2015. [13] Oded Goldreich and Dana Ron. On testing expansion in bounded-degree graphs. In Studies in Complexity and Cryptography., pages 68–75. Springer, 2011. [14] Y. Ingster and I.A. Suslina. Nonparametric Goodness-of-Fit Testing Under Gaussian Models. Lecture Notes in Statistics. Springer, 2003. [15] Yu. I. Ingster. Minimax detection of a signal in `p metrics. Journal of Mathematical Sciences, 68(4):503–515, 1994. [16] Yuri Izmailovich Ingster. Adaptive chi-square tests. Zapiski Nauchnykh Seminarov POMI, 244:150–166, 1997. [17] L. LeCam. Convergence of estimates under dimensionality restrictions. Ann. Statist., 1 (1):38–53, 01 1973. [18] E.L. Lehmann and G. Casella. Theory of Point Estimation. Springer Verlag, 1998. ISBN 0387985026. [19] E.L. Lehmann and J.P. Romano. Testing Statistical Hypotheses. Springer Texts in Statistics. Springer New York, 2006. [20] Paul Marriott, Radka Sabolova, Germain Van Bever, and Frank Critchley. Geometry of Goodness-of-Fit Testing in High Dimensional Low Sample Size Modelling. Springer International Publishing, 2015. [21] Carl Morris. Central limit theorems for multinomial sums. Ann. Statist., 3(1):165–188, 01 1975. [22] J. Neyman and E. S. Pearson. On the problem of the most efficient tests of statistical hypotheses. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 231:289–337, 1933. [23] Liam Paninski. A coincidence-based test for uniformity given very sparsely sampled discrete data. IEEE Trans. Information Theory, 54(10):4750–4755, 2008. [24] Karl Pearson. On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. Philosophical Magazine Series 5, 50(302):157–175, 1900. [25] Timothy R. C. Read and Noel A. C. Cressie. Goodness-of-fit statistics for discrete multivariate data. Springer-Verlag Inc, 1988. [26] Dana Ron. Property testing: A learning theory perspective. Foundations and Trends R in Machine Learning, 1(3):307–402, 2008. [27] N. V. Smirnov. On the Estimation of the Discrepancy Between Empirical Curves of Distribution for Two Independent Samples. Bul. Math. de l’Univ. de Moscou, 2:3–14, 1939. [28] G.W. Snedecor and W.G. Cochran. Statistical methods. Iowa State University Press, 1980. 29 [29] V. G. Spokoiny. Adaptive hypothesis testing using wavelets. Ann. Statist., 24(6):2477–2498, 12 1996. [30] Gregory Valiant and Paul Valiant. An automatic inequality prover and instance optimal identity testing. 2014 IEEE 55th Annual Symposium on Foundations of Computer Science (FOCS), pages 51–60, 2014. [31] R. Von Mises. Wahrscheinlichkeit, Statistik und Wahrheit. Schriften zur wissenschaftlichen Weltauffassung. J. Springer, 1928. [32] S. S. Wilks. The large-sample distribution of the likelihood ratio for testing composite hypotheses. Ann. Math. Statist., 9(1):60–62, 03 1938. A Limiting behaviour of test statistics under the null In this section, we consider the problem of finding the asymptotic distribution of the multinomial test statistics under the null. Broadly, there is a dichotomy between classical asymptotics where the null distribution is kept fixed and a high-dimensional asymptotic where the number of cells is growing and the null distribution can vary with the number of cells. We present a few simple results on the limiting behaviour of our test statistics when the null is uniform and highlight some open problems. Although our techniques generalize in a straightforward way to non-uniform null distributions, they do not necessarily yield tight results. We focus on the family of test statistics that we use in our paper, that are weighted χ2 -type statistics: T (w) = d X (Xi − np0 (i))2 − Xi wi i=1 , (51) where each wi is a positive weight that is a fixed function of p0 (i). This family includes the 2/3-rd statistic from [30], the truncated χ2 statistic that we propose, and the usual χ2 and `2 statistics. When the null is uniform, this family of test statistics reduces to simple re-scalings of the `2 statistic in (22): T`2 = d X   (Xi − np0 (i))2 − Xi . i=1 Our results are summarized in the following lemma. Lemma 6. 1. Classical Asymptotics: For any fixed p0 , the statistic T (w) under the null converges in distribution to a weighted sum of χ2 distributions, i.e. for Z1 , . . . , Zd ∼ χ21 , d X pi T (w) → (Zi − 1) . wi d (52) i=1 2. High-dimensional Asymptotics: Suppose p0 is uniform and d → ∞, then we have that, √ • If n/ d → ∞, then T d p `2 → N (0, 1). Var0 (T`2 ) 30 √ • If n/ d → 0, then T d p `2 → δ0 . Var0 (T`2 ) Remarks: • The behaviour of the χ2 -type statistics under classical asymptotics is well understood and we do not prove the claim in (52). • Focusing on the high-dimensional setting, the asymptotic distribution of the test statistic is Gaussian in the regime where the risk of the optimal test tends to 0 as n → ∞, and is degenerate in the√regime where there are no consistent tests. In the most interesting regime when, n/ d → c, the optimal test can have non-trivial risk, and the limiting distribution is neither Gaussian nor degenerate. • More broadly, an important open question is to characterize the limiting distribution of the test statistic, under both the null and the alternate in the high-dimensional asymptotic. Proof. The first part follows, by checking the Lyapunov conditions. We denote ζi = (Xi − np0 (i))2 − Xi . and can calculate the sum of the variances as: s2d = d X var(ζi ) = i=1 2n2 . d The Lyapunov condition then requires that, d 1 X 4 lim Eζi = 0. d→∞ s4 d i=1 A straightforward computation gives that, Eζi4 = 8 n3 n4 n2 + 144 + 60 , d2 d3 d4 so that the Lyapunov condition is satisfied provided that, d3 → 0, d→∞ n6 lim which is indeed the case. √ In order to verify the degenerate limit it suffices to show that when n/ d → 0, then the number of categories that have strictly larger than one occurrence converges to 0. When each observed category is observed only once we have that the test statistic is deterministic, i.e., T`2 = d X i=1 n2 ζi = (d − n) 2 + n d 31  n2 2n − d2 d  . When rescaled by the standard deviation we obtain that, T p `2 = var0 (T`2 ) r    2 d n2 n 2n (d − n) 2 + n → 0. − 2n2 d d2 d Finally, we can bound the probability that any category is observed more than once as: P (∃ i, Xi ≥ 2) ≤ d X P (Xi ≥ 2) i=1 ≤ d X exp(−λ) i=1 ≤ ∞   X n k k=2 d Cn2 → 0. d Taken together these facts give the desired degenerate limit. B B.1 Analysis of Multinomial Tests Proof of Theorem 2 In this section we analyze the truncated χ2 test. For convenience, throughout this proof we we work with a scaled version of the statistic in (17), i.e. we let T := Ttrunc /d and abusing notation slightly we redefine θi appropriately, i.e. we take θi = max{1, dp0 (i)}. We begin by controlling the size of the truncated χ2 test. Fix any multinomial p on [d], and suppose we denote ∆i = p0 (i) − p(i), then a straightforward computation shows that, Ep [T ] = n 2 d X ∆2 i i=1 Varp [T ] = θi , (53) d X  1  2 2n p0 (i)2 + 2n2 ∆2i − 4n2 ∆i p0 (i) + 4n3 ∆2i p0 (i) − 4n3 ∆3i . 2 θ i=1 i (54) This yields that the null variance of T is given by: Var0 [T ] = d X 2n2 p0 (i)2 i=1 θi2 , which together with Chebyshev’s inequality yields the desired bound on the size. Turning our attention to the power of the test we fix a multinomial p ∈ P1 . Denote the α level threshold of the test by v u d u2 X p0 (i)2 t tα = n . α θi2 i=1 32 We observe that, if we can verify the following two conditions: tα ≤ Ep [T ] s2 (55) Varp [T ] , ζ Ep [T ] ≥ 2 (56) then we obtain that P (φtrunc = 0) ≤ ζ. To see this, observe that P (φtrunc = 0) ≤ P1 (T − Ep [T ] < tα − Ep [T ]) ≤ P1 ((T − Ep [T ])2 < (tα − Ep [T ])2 ) Varp [T ] 4Varp [T ] ≤ ≤ ≤ ζ. 2 (tα − Ep [T ]) Ep [T ]2 Condition in Equation (55): This condition reduces to verifying the following, 2tα ≤ n 2 d X ∆2 i i=1 θi , and as a result we focus on lower bounding the mean under the alternate. By Cauchy-Schwarz we obtain that, d X ∆2 2 2n k∆k2 ≥ n. ≥ Pd 1 ≥ Pd θi 2d i=1 θi i=1 {1 + dp0 (i)} i i=1 (57) We can further upper bound tα as v u r d u2 X 2 p0 (i)2 t tα = n ≤n , 2 α dα θi i=1 using the fact that p0 (i)/θi ≤ d1 . This yields that Equation (55) is satisfied if: √ 2n 2 2 ≥√ , 2d dαn which is indeed the case. Condition in Equation (56): We can upper bound the variance under the alternate as: Varp [T ] ≤ = d X  1  2 4n p0 (t)2 + 4n2 ∆2t + 4n3 ∆2t p0 (t) − 4n3 ∆3t 2 θ t=1 t d X 4n2 p0 (t)2 t=1 | θt2 {z U1 + d X 4n2 ∆2 t t=1 } | θt2 {z } U2 + d X 4n3 ∆2 p0 (t) t=1 | Consequently, it suffices to verify that, p 4 X 2 Ui /ζ ≤ 1. Ep [T ] i=1 33 t θt2 {z U3 + d X −4n3 ∆3 t t=1 } | θt2 {z U4 } . for i = {1, 2, 3, 4} and we do this by bounding each of these terms in turn. For the first term we follow a similar argument to the one dealing with the first condition, qP p √ p0 (t)2 d 8d t=1 θt2 2 U1 /ζ 8 d 1 √ ≤√ ≤ . ≤ 2 2 Ep [T ] 4 ζnn ζnn For the second term, r 1 ζ p 4 2 U2 /ζ ≤ Ep [T ] n2 ∆2t θt2 Pd t=1 Ep [T ] q P 4 ζ1 dt=1 ≤ n2 ∆2t θt Ep [T ] 4 . =p ζEp [T ] Using Equation (57) we obtain that, Ep [T ] ≥ n2 2n , 2d which in turn yields that, 2 p √ U2 /ζ 1 8 d √ ≤ . ≤ Ep [T ] 4 nn ζ Turning our attention to the third term we obtain that, r p 4 2 U3 /ζ = Ep [T ] 1 ζ Pd t=1 n3 ∆2t p0 (t) θt2 Ep [T ] ≤ q P d n 4 dζ t=1 Ep [T ] n2 ∆2t θt q n 4 dζ =p . Ep [T ] Using the lower bound on the mean we obtain that, 2 p U3 /ζ 8 1 √ ≤ . ≤ Ep [T ] 4 nn ζ For the final term, r p 4 2 U4 /ζ ≤ Ep [T ] 1 Pd ζ t=1 Ep [T ] n3 |∆3t | θt2 r 4 ≤ n3 ζ Pd t=1 Ep [T ] |∆3t | θt2 s  Pd 4 ζ1 i=1 ≤ n2 ∆2i 3/2 4/3 θi Ep [T ] , where the last step uses the monotonicity of the `p norms. Observing that θi ≥ 1, we have r   q n2 ∆2i 3/2 1 Pd p 1 4 4 i=1 ζ θ ζ i 2 U4 /ζ 8d1/4 1 ≤ = ≤ ≤ . √ √ 1/4 1/2 Ep [T ] Ep [T ] 4 Ep [T ] ζn n This completes the proof. 34 B.2 Proof of Theorem 3 Recall the definition of Bσ in (13). We define: X ∆Bσ = |p0 (i) − p(i)|, (58) i∈Bσ and pmin,σ = min p0 (i). (59) i∈Bσ Our main results concern the combined test φV in (20). It is easy to verify that the size of this test is at most α so it only remains to control its power. We first provide a general result that allows for a range of possible values for the parameter σ. Lemma 7. For any σ ≤ n 8 , if  n ≥ 2 max 2 1 , α ζ   max 1 4096Vσ/2 (p0 ) , σ 2n  , then the Type II error P (φV = 0) ≤ ζ. Taking this lemma as given, it is straightforward to verify the result of Theorem 3. In particular, if we take σ = n /8, then we recover the result of the theorem. Proof of Lemma 7: As a preliminary, we state two technical results from [30]. The following result is Lemma 6 in [30].   Vσ (p0 )1/3 Vσ (p0 ) Lemma 8. For any c ≥ 1, suppose that n ≥ c max 1/3 , ∆2 , then we have that pmin,σ ∆Bσ Varp (T2 (σ)) ≤ Bσ 16 [Ep (T2 (σ))]2 . c The following result appears in the proof of Proposition 1 of [30]. Lemma 9. For any c ≥ 1, suppose that, n ≥ 2c Vσ/2 (p0 ) , ∆2Bσ then we have that, ( n ≥ c max Vσ (p0 )1/3 Vσ (p0 ) , 1/3 ∆2Bσ p ∆B min,σ ) . σ With these two results in place, we can now complete the proof. We divide the space of alternatives into two sets:     X S1 = p : kp − p0 k1 ≥ n , |p0 (i) − p(i)| ≥ 3σ   i∈Qσ (p0 )     X S2 = p : kp − p0 k1 ≥ n , |p0 (i) − p(i)| < 3σ .   i∈Qσ (p0 ) 35 In order to show desired result it then suffices to show that when p ∈ S1 , P (φ1 = 0) ≤ ζ, and that when p ∈ S2 , P (φ2 = 0) ≤ ζ. We verify each of these claims in turn. When p ∈ S1 : In this case, we have that P (Qσ (p0 )) ≥ 2σ. Under the alternate we have that T1 (σ) ∼ Poi(nP (Qσ (p0 ))) − nP0 (Qσ (p0 )). This yields, P (φtail = 0) ≤ P (Poi(nP (Qσ (p0 ))) < ρnP (Qσ (p0 ))) , (60) where P0 (Qσ (p0 )) 1 ρ= + P (Qσ (p0 )) P (Qσ (p0 )) r P0 (Qσ (p0 )) . nα Provided ρ ≤ 1 we obtain via Chebyshev’s inequality that, P (φtail = 0) ≤ 1 n(1 − ρ)2 P 1 (Qσ (p0 )) . We further have that,   1 1 ρ≤ 1+ √ . 2 nασ Under the conditions that, n≥ 4 , ασ we obtain that ρ ≤ 1/2, which yields that, P (φtail = 0) ≤ 2 ≤ ζ, nσ where the final inequality uses the condition on n. When p ∈ S2 : In this case, we first observe that the bulk deviation must be sufficiently large. Concretely, at most n /2 deviation can occur in the largest element and at most 3σ occurs in the tail, i.e. ∆Bσ ≥ n n − 3σ ≥ . 2 8 Our next goal will be to upper bound the test threshold, t2 (α/2, σ). In particular, we claim that, r 2Var(T2 (σ)) t2 (α/2, σ) ≤ (61) α Taking this for now and supposing that our sample size can be written as  claim as given  1/3 σ (p0 ) σ (p0 ) n = c max T1/3 , T∆ , for some c ≥ 1, we can use Lemma 8 and Chebyshev’s inequality 2 pmin,σ ∆Bσ Bσ to obtain that, 1 q , P (φ2/3 = 0) ≤ p c ( 16 − α2 )2 36 provided that p c 16 ≥ q 2 α. Thus, it suffices to ensure that, ( )   Tσ (p0 )1/3 Tσ (p0 ) 2 1 max , n ≥ 64 max , , 1/3 α ζ ∆2Bσ p ∆B min,σ σ to obtain that P (φ2/3 = 0) ≤ ζ as desired. Using Lemma 9, we have that this holds under the condition on n. It remains to verify the claim in (61). In order to do so we just note that the variance of the statistic is minimized at the null, i.e. Var(T2 (σ)) ≥ X 2n2 p0 (i)2/3 = i∈Bσ αt22 (α/2, σ) . 2 as desired. B.3 Proof of Theorem 4 Fix any multinomial p on [d], and suppose we denote ∆i = p0 (i) − p(i), then a straightforward computation shows that, X Ep [Tj ] = n2 ∆2t , (62) t∈Sj Varp [Tj ] = X  2n2 p0 (t)2 + 2n2 ∆2t − 4n2 ∆t p0 (t) + 4n3 ∆2t p0 (t) − 4n3 ∆3t . (63) t∈Sj This in turn yields that the null variance of Tj is simply Var0 [Tj ] = 2n2 Chebyshev’s inequality we then obtain that: P t∈Sj p(t)2 . By P0 (Tj > tj ) ≤ α/k, which together with the union bound yields, P0 (φmax = 1) ≤ α. As in the proof of Theorem 3 we consider two cases: when p ∈ S1 and when p ∈ S2 . Since the composite test includes the tail test, the analysis of the case when p ∈ S1 is identical to before. Now, we consider the case when p ∈ S2 . We have further partitioned the bulk of the distribution into at most k sets, so that at least one of the sets Sj must witness a discrepancy of at least n /(8k), i.e. when p ∈ S2 we have that, X n sup |p0 (i) − p(i)| ≥ . 8k j i∈Sj Let j ∗ denote the set that witnesses this discrepancy. We focus the rest of the proof on this fixed set Sj ∗ and show that under the alternate Tj ∗ > tj ∗ with sufficiently high probability. Suppose that for j ∗ we can verify the following two conditions: tj ∗ ≤ Ep [Tj ∗ ] s2 Ep [Tj ∗ ] ≥ 2 37 Varp [Tj ∗ ] , ζ (64) (65) then we obtain that P (φmax = 0) ≤ ζ. To see this, observe that P (φmax = 0) ≤ P (Tj ∗ − Ep [Tj ∗ ] < tj ∗ − Ep [Tj ∗ ]) ≤ P ((Tj ∗ − Ep [Tj ∗ ])2 < (tj ∗ − Ep [Tj ∗ ])2 ) Varp [Tj ∗ ] 4Varp [Tj ∗ ] ≤ ≤ ≤ ζ. 2 ∗ ∗ (tj − Ep [Tj ]) Ep [Tj ∗ ]2 Consequently, we focus the rest of the proof on showing the above two conditions. We let dj ∗ denote the size of Sj ∗ . Condition in Equation (64): Observe that, P X i∈Sj ∗ ∆2i ≥ 2 |∆i | dj ∗ i∈Sj ∗ ≥ 2n . 64k 2 dj ∗ (66) Using Equations (24) and (62), it suffices to check that, s P 2k i∈Sj ∗ p0 (i)2 X n ≤ n2 ∆2j , α i∈Sj ∗ and applying the lower bound in Equation (66) it suffices if, s P 2 2 n 1 2k i∈Sj ∗ p0 (i) ≥ . 64k 2 dj ∗ n α Denote the maximum and minimum entry of the multinomial on Sj ∗ as bj ∗ and aj ∗ respectively. Noting that on each bin the multinomial is roughly uniform one can further observe that, sX 3/2 3/2 dj ∗ p0 (i)2 ≤ dj ∗ bj ∗ ≤ 2dj ∗ aj ∗ ≤ 2Vn /8 (p0 ). i∈Sj ∗ This yields that the first condition is satisfied if, 2n ≥ 256k 5/2 Vn /8 (p0 ) √ , n α which is indeed the case. Condition in Equation (65): We proceed by upper bounding the variance under the alternate. Using Equation (63) we have, X   Varp [Tj ∗ ] = 2n2 p0 (t)2 + 2n2 ∆2t − 4n2 ∆t p0 (t) + 4n3 ∆2t p0 (t) − 4n3 ∆3t t∈Sj ∗ ≤ X   4n2 p0 (t)2 + 4n2 ∆2t + 4n3 ∆2t p0 (t) − 4n3 ∆3t t∈Sj ∗ X X X ≤ 4n2 b2j ∗ dj ∗ + 4n2 ∆2t + 4n3 bj ∗ ∆2t −4n3 ∆3t . | {z } t∈Sj ∗ t∈Sj ∗ t∈Sj ∗ U1 | {z } | {z }| {z } U2 U3 38 U4 In order to check the desired condition, it suffices to verify that s Ui Ep [Tj ∗ ] ≥ 8 , ζ for each i ∈ {1, 2, 3, 4}. We consider these tasks in sequence. For the first term we obtain that it suffices if, 1/2 ! X ∗d ∗ 16b j j √ ∆2i ≥ , n ζ i∈S ∗ j and applying the lower bound in Equation (66), and from some straightforward algebra it is sufficient to ensure that, 2n ≥ 2048k 2 Vn /8 (p0 ) √ , n ζ which is indeed the case. For the second term, some simple algebra yields that it suffices to have that,   X 144 2 ∆i ≥ . (67) n2 ζ i∈Sj ∗ In order to establish this, we need to appropriately lower bound n. Let pmin denote the smallest entry in Bn /8 (p0 ). For a sufficiently large universal constant C > 0, let us denote: # "r k 1 2 + . θk,α := Ck α ζ Then using the lower bound on n we obtain, n≥ θk,α Vn /16 (p0 ) = 2n θk,α Vn /16 (p0 )1/3 hP i∈Bn p0 (i)2/3 /16 (p0 ) 2n i . Now denote B = Bn /16 (p0 )\Bn /8 (p0 ), then we have that, pmin + X pi ≥ n /16, i∈B so that, X p0 (i)2/3 ≥ i∈Bn /16 (p0 ) X p0 (i)2/3 + 2/3 pmin i∈B = 1 1/3 pmin " # X 2/3 p0 (i)2/3 pmin + pmin ≥ i∈B This gives the lower bound, n≥ θk,α Vn /16 (p0 1/3 )1/3 ≥ θk,α P t∈Sj ∗ p0 (t)2/3 1/3 16n pmin 16n pmin 39 1/2 p θk,α dj ∗ ≥ . 16n n 1/3 16pmin . Returning to the bound in Equation (67), and using the lower bound in Equation (66) we obtain that it suffices to ensure that ! n 192n p p √ ≥ , 8k dj ∗ θk,α dj ∗ ζ which is indeed the case. Turning our attention to the term involving U3 we have, that by some simple algebra it suffices to verify that,   X 144bj ∗ 2 ∆i ≥ . nζ i∈Sj ∗ Using the lower bound in Equation (66) we obtain that it is sufficient to ensure,   144bj ∗ 2n ≥ , 64k 2 dj ∗ nζ 3/2 and with the observation that dj ∗ bj ∗ ≤ 2dj ∗ aj ∗ ≤ 2Vn /8 (p0 ) we obtain, ! 2V 18432k (p ) 0 n /8 2n ≥ , nζ which is indeed the case. Finally, we turn our attention to the term involving U4 . In this case we have that it suffices to show that, sP 3 X i∈Sj ∗ ∆i 1/2 2 n ∆i ≥ 16 , ζ i∈Sj ∗ by the monotonicity of the `p norm it suffices then to show that, vh i3/2 u P u 2 ∆ X t i∈Sj ∗ i n1/2 ∆2i ≥ 16 , ζ i∈Sj ∗ and after some simple algebra this yields that it suffices to have, X ∆2i ≥ i∈Sj ∗ (16)4 , ζ 2 n2 and this follows from an essentially identical argument to the one handling the term involving U2 . This completes the proof. C Proofs for Examples of Lipschitz Testing In this Section we provide proofs of the claims in Section 4.1. For convenience, we restate all the claims in the following lemma. Lemma 10. • Suppose that p0 is a standard one-dimensional Gaussian, with mean µ, and variance ν 2 , then we have that: T0 (p0 ) = (8π)1/2 ν. 40 (68) • Suppose that p0 is a Beta distribution with parameters α, β. Then we have, Z T0 (p0 ) = 1p 2 p0 (x)dx = 0 B 2 ((α + 1)/2, (β + 1)/2) , B(α, β) (69) where B : R2 7→ R is the Beta function. Furthermore, if we take α = β = t ≥ 1, then we have that, π 2 −1/2 e4 −1/2 t ≤ T (p ) ≤ t . 0 0 4e4 4 (70) • Suppose that p0 is Cauchy with parameter α, then we have that, T0 (p0 ) = ∞. Furthermore, if 0 ≤ σ ≤ 0.5 then,       4α 1 4α 2e 2 ln ≤ Tσ (p0 ) ≤ ln2 . π σ π πσ (71) (72) • Suppose that p0 has a Pareto distribution with parameter α then we have that, T0 (p0 ) = ∞, (73) while the truncated T -functional satisfies: 2 4αx0  − 1−α 4αx0 − 1−α 2α − 1 σ α . σ = T (p ) ≤ σ 0 (1 − α)2 (1 − α)2 (74) Proof. Notice that Claims (71) and (73) follow by taking σ → 0 in Claims (72) and (74) respectively. We prove the remaining claims in turn. Proof of Claim (68): Observe that, Z ∞ 2 1 2 2 T0 (p0 ) = √ exp(−(x − µ) /(4ν ))dx 2πν −∞ 1 =√ 4πν 2 2πν √ = 8πν. Proof of Claim (69): The Beta density can be written as: p0 (x) = Γ(α + β) α−1 β−1 1 x x = xα−1 xβ−1 , Γ(α)Γ(β) B(α, β) where Γ : R 7→ R denotes the Gamma function. Some simple algebra yields that the T functional is simply: Z T0 (p0 ) = 1p p0 (x)dx = 0 B((α + 1)/2, (β + 1)/2) p . B(α, β) 41 (75) Proof of Claim (70): We now take α = β = t ≥ 1 in the above expression. To prove the claim we use standard approximations to the Beta function derived using Stirling’s formula. Recall, that by Stirling’s formula we have that:  n n √ √  n n 2πn ≤ n! ≤ e n . e e We begin by upper bounding the Beta function for integers α, β ≥ 0: (α − 1)!(β − 1)! α!β! α + β Γ(α)Γ(β) = = Γ(α + β) (α + β − 1)! (α + β)! αβ √ 2 α β e α+β αβα β exp(α + β) √ ≤√ α + β(α + β)α+β exp(α + β) 2π αβ s e2 α+β αα β β =√ . αβ (α + β)α+β 2π B(α, β) = Now, setting α = β = t ≥ 1, we obtain: e2 2−2t B(t, t) ≤ √ √ . π t We can similarly lower bound the Beta function as: √ 2 2π 2−2t √ . B(t, t) ≥ e t We also need to bound the Beta function at certain non-integer values. In particular, we observe that, B(t + 1, t + 1) ≤ B(t + 1/2, t + 1/2) ≤ B(t, t), so that we can similarly sandwich the Beta function at these non-integer values as: e2 2−2t 2π 2−2t √ . ≤ B(t + 1/2, t + 1/2) ≤ √ √ . 4e t π t With these bounds in place we can now upper and lower bound the T -functional in (75). We can upper bound this expression by considering the cases when t is odd and t is even separately, and taking the worse of these two bounds to obtain: T (p0 ) ≤ e2 −1/4 t . 2 Similarly, using the above results we can lower bound the T -functional as: T (p0 ) ≥ π −1/4 t , 2e2 and this yields the claim. Proof of Claim (72): We are interested in the truncated T -functional. The set Bσ of probability content 1 − σ, takes the form [−α, α], where π   πσ  α = γ tan (1 − σ) = γ cot . 2 2 42 Using the inequality that cot(x) ≤ x1 , we can upper bound α as: α≤ 2γ . πσ Similarly, we can (numerically) lower bound α by noting that for 0 ≤ σ ≤ 0.5 we have that, α≥ γ . 4σ With these bounds in place, we can now proceed to upper and lower bound the truncated T functional. Concretely, "Z # Z 2γ Z 2γ γ πσ πσ 1 γ 1 1 2γ p Tσ (p0 ) ≤ √ dx ≤ √ dx + dx πγ − 2γ πγ 0 γ x x2 + γ 2 γ πσ    2 2γ 1 + ln ≤√ πγ πσ r    γ 2e =2 ln . π πσ In a similar fashion, we can lower bound the functional as: r    γ 1 ln . Tσ (p0 ) ≥ 2 π σ Taken together these bounds give the desired claim. Proof of Claim (74): We treat x0 as a fixed constant. The CDF for the Pareto family of distributions takes the simple form:  x α 0 , for x ≥ x0 , F (x) = 1 − x we obtain that the set Bσ takes the form [x0 , x0 σ −1/α ]. So that the truncated functional is simply: Z x0 σ −1/α Tσ (p0 ) = p p0 (x; x0 , α)dx x0 √  2 αx0  − 1−α = σ 2α − 1 , 1−α which yields the desired claim. D Properties of the T -functional The rate for Lipschitz testing is largely dependent on the truncated T -functional of the null hypothesis. In this section we establish several properties of the T -functional, and its stability with respect to perturbations. There are two notions of stability of the truncated T -functional that are of interest: its stability with respect to perturbation of the truncation parameter, and its stability with respect to perturbations of the density p0 . In particular, the truncation stability determines the discrepancy between the upper and lower bounds in Theorem 5. 43 Our interest is in the difference between Tσ1 (p0 ) and Tσ2 (p0 ) (where without loss of generality we take σ1 ≤ σ2 ). We show that if the support of the density is stable with respect to the truncation parameter then so is the T -functional. Intuitively, the discrepancy can be large only if the density has a long σ1 -tail but a relatively small σ2 -tail. Returning to the definition of the T -functional in (27), we let Bσ1 and Bσ2 denote the sets that achieve the infimum for Tσ1 and Tσ2 respectively. These are not typically well-defined for two reasons: the set may not be unique and the infimum might not be attained. The second problem can be easily dealt with by introducing a small amount of slack. To deal with the non-uniqueness we simply choose the sets that have maximal overlap in Lebesgue measure, i.e. we define Bσ1 and Bσ2 to be two sets that have maximal Lebesgue overlap such that, Z 2 p p0 (x)dx ≥ Tσ1 (p0 ) − ξ, B σ1 Z 2 p p0 (x)dx ≥ Tσ2 (p0 ) − ξ, B σ2 for an arbitrary small ξ > 0. The quantity ξ may be taken as small as we like and has no effect when chosen small enough so we ignore it in what follows. We define, S = Bσ1 \Bσ2 which measures the stability of the support with respect to changes in the truncation parameter, i.e. if the Lebesgue measure µ(S) is small then the support is stable. With these definitions in place we have the following lemma: Lemma 11. For any two truncation levels σ1 ≤ σ2 , we have that, Tσγ1 (p0 ) − Tσγ2 (p0 ) ≤ (σ1 − σ2 )γ µ(S)1−γ . Remarks: • Since γ < 1, this result asserts that if the support of the density is stable with respect to the truncation parameter then so is the truncated T -functional. This is the case in all the examples we considered in Section 4.1. • If we restrict attention to compactly supported densities then we can upper bound µ(S) by the Lebesgue measure of the support indicating that in these cases the truncated T -functional is somewhat stable. • On the other hand this result also gives insight into when the truncated functional is not stable. In particular, it is straightforward to construct examples of densities p0 which have a very long σ1 -tail but a light σ2 -tail, in which case this discrepancy can be arbitrarily large. Noting however that in our bounds the regime of interest is when the truncation parameter is not fixed, i.e. when σ → 0, in which case this discrepancy can be large only for carefully constructed pathological densities. Proof. The result follows using Hölder’s inequality: Z γ γ Tσ1 (p0 ) − Tσ2 (p0 ) = pγ0 (x)dx S Z γ p0 (x) = µ(S) dx S µ(S) Z γ p0 (x) ≤ µ(S) dx S µ(S) = µ(S)1−γ (σ1 − σ2 )γ . 44 In order to understand the stability of the T -functional with respect to perturbations of p0 it is natural to consider a form of the modulus of continuity. We restrict our attention to densities p0 which have support contained in a fixed set S, and denote these densities by L(Ln , S), and only consider the case when d = 1 and hence γ = 1/2. Focussing on the case when the truncation parameter is fixed (say to 0) we define: s(p0 , τ, S) = sup p,p0 ∈L(Ln ,S),kp−p0 k1 ≤τ |T0γ (p) − T0γ (p0 )|. With these definitions in place, we have the following result: Lemma 12. For any p0 , the modulus of continuity of the T -functional is upper bounded as: p s(p0 , τ, S) ≤ τ µ(S). Remark: • This result guarantees that for densities that are close in `1 , their corresponding T functionals are close, provided that we restrict attention to compactly supported densities. • On the other hand, an inspection of the proof below reveals that if we eliminate the restriction of compact support, then for any density p0 , we can construct a density p that is close in `1 but has an arbitrarily large discrepancy in the T -functional, i.e. the T -functional can be highly unstable to perturbations of p0 if we allow densities with arbitrary support. Proof. Notice that, Z p p ( p(x) − p0 (x))dx S Z p p 1 = µ(S) ( p(x) − p0 (x)) dx µ(S) S sZ p p 1 ≤ µ(S) ( p(x) − p0 (x))2 dx µ(S) S T0γ (p) − T0γ (p0 ) = (i) ≤ p p µ(S)kp − p0 k1 ≤ τ µ(S), where (i) uses the fact that the Hellinger distance is upper bounded by the `1 distance. D.1 Proof of Claim (31) This claim is a straightforward consequence of Hölder’s inequality. We have that, Z Tσ (p0 ) = inf B∈Bσ B pγ0 (x)dx 1/γ . We restrict our attention to densities with support contained in a fixed set S. We let Bσ denote an arbitrary set in Bσ that minimizes the above integral (dealing with non-uniqueness 45 as before). Then, Tσγ (p0 ) Z = µ(Bσ ) Bσ pγ0 (x) dx µ(Bσ ) Z (i) ≤ µ(Bσ ) Bσ p0 (x) dx µ(Bσ ) γ = µ(Bσ )1−γ (1 − σ)γ ≤ µ(S)1−γ (1 − σ)γ where (i) uses Hölder’s inequality. This yields the claim. For the uniform distribution u on the set S we have that for any set Bσ of mass 1 − σ, Z 1 γ Tσ (u) = dx γ Bσ µ (S) = µ(S)1−γ (1 − σ), which matches the result of (31) up to constant factors involving σ and γ. In particular, our interest is in the regime when σ → 0, and γ is a constant, in which case the two quantities are equal. E Technical Results for Lipschitz Testing In this section we provide the remaining technical proofs related the Theorem 5. We begin with the preliminary Lemmas 3 and 4. E.1 E.1.1 Preliminaries Proof of Lemma 3 Let A be all sets A such that P0n (A) ≤ α. Now ζn (P) ≥ inf Q(φ = 0) ≥ 1 − α − sup |Q(A) − P0n (A)| φ ≥ 1 − α − sup |Q(A) − A A∈A n P0 (A)| 1 = 1 − α − kQ − P0n k1 . 2 Note that kQ − P0n k1 = E0 |Wn (Z1 , . . . , Zn ) − 1| ≤ p E0 [Wn2 (Z1 , . . . , Zn )] − 1. The result then follows from (45). E.1.2 Proof of Lemma 4 We divide the proof into several claims. Claim 1: Each pη is a density function. Note that Z pη (x)dx = 1. 46 Now we show it is non-negative. Let x ∈ Aj . Then pη (x) = p0 (x) + ρj ηj ψj (x) ≥ p0 (x) − ρj ψj (x) ρj ≥ p0 (x) − d/2 d/2 kψk∞ . cj hj Now, we observe that for each piece of our partition we have that, √ √ p0 (xj ) Ln αβ dhj p0 (x) ≥ ≥ ≥ Ln dhj , 2 2 where we use the fact that αβ ≥ 2. We then obtain that it suffices to choose, d/2 ρj ≤ Ln cj d/2+1 kψk∞ hj , which is ensured by the condition in Equation (47). Claim 2: Each pη ∈ L(Ln ). Let x, y be two points, and that x ∈ Aj , y ∈ Ak . We consider two cases: when neither of j, k are ∞, and when at least one of them is. Noting that we do not perturb A∞ the second case follows from a similar argument to that of the first case. In the first case, we have that:     x − xj ρj ηj ρk ηk y − xk |pη (y) − pη (x)| ≤ |p0 (x) − p0 (y)| + d/2 d/2 ψ − d/2 d/2 ψ ck hk cj hj ck hk cj hj     y − xk x − xk ρk ηk ρ k ηk ≤ cint Ln kx − yk + d/2 d/2 ψ − d/2 d/2 ψ ck hk ck hk ck hk ck hk     y − xj x − xj ρ j ηj ρj ηj + d/2 d/2 ψ − d/2 d/2 ψ cj hj cj hj cj hj cj hj ≤ cint Ln kx − yk + ρk kψ 0 k∞ kx − yk d/2+1 d/2+1 hk + ρj kψ 0 k∞ kx − yk d/2+1 d/2+1 hj ck , cj so that it suffices to ensure that for i ∈ {1, . . . , N }, d/2+1 d/2+1 ρi ≤ (1 − cint )Ln ci hi 0 2kψ k∞ , which is ensured by the condition in (47). Claim 3. R |p0 − pη | ≥ . We have Z XZ XZ |p0 − pη | = |p0 − pη | = j = = X Aj j Z |ψj | = ρj j Aj X d/2 d/2 ρj cj hj j X j |ρj ηj ψj | Aj Z ρj Aj d/2 d/2 |ψ| = c1 47 ψ cj hj Z [−1/2,1/2]d  1 X j x − xj cj hj d/2 d/2 ρj cj hj  ≥ , where we use the condition in (48). Taken together claims 1, 2 and 3 show that pη ∈ L(Ln ) and that kpη − p0 k1 ≥ n . Claim 4: Likelihood ratio bound. For observations {Z1 , . . . , Zn } the likelihood ratio is given as X Y pη (Zi ) 1 Wn (Z1 , . . . , Zn ) = N 2 p0 (Zi ) N η∈{−1,1} i and Wn2 (Z1 , . . . , Zn ) = = 1 22N 1 22N Y pη (Zi )pν (Zi ) X X p0 (Zi )p0 (Zi ) ! ! PN PN X Y j=1 ρj νj ψj (Zi ) j=1 ρj ηj ψj (Zi ) 1+ . 1+ p0 (Zi ) p0 (Zi ) N η∈{−1,1}N ν∈{−1,1}N X η∈{−1,1}N ν∈{−1,1} i i Taking the expected value over Z1 , . . . , Zn , and using the fact that the ψj s have disjoint support we obtain  n N X X X 1 1 + E0 [Wn2 (Z1 , . . . , Zn )] = 2N ρ2j ηj νj aj  2 j=1 η∈{−1,1}N ν∈{−1,1}N   X X X 1 exp n ≤ 2N ρ2j ηj νj aj  2 N N η∈{−1,1} j ν∈{−1,1} where Z aj = Aj ≤ ψj2 (z) 1 dz = p0 (z) p0 (zj ) Z ψj2 (z) Aj p0 (zj ) dz p0 (z) 2 . p0 (zj ) Thus E0 [Wn2 (Z1 , . . . , Zn )] ≤ Eη,ν enhη,νi where we use the weighted inner product defined as: X hη, νi := ρ2j ηj νj aj . j Hence, E0 [Wn2 (Z1 , . . . , Zn )] ≤ Eη,ν enhη,νi = Y Eenηj νj j = Y Y Y (1 + n2 ρ4j a2j ) ≤ exp(n2 ρ4j a2j ) cosh(nρ2j aj ) ≤  X   j = exp j  j j    X ρ4j  n2 ρ4j a2j ≤ exp 4n2 ≤ C0 ,   p20 (xj )  j where the final inequality uses the condition in (49). From Lemma 3, it follows that the Type II error of any test is at least δ. 48 E.2 Further technical preliminaries Our analysis of the pruning in Algorithm 2 uses various results that we provide in this section. Lemma 13. Let P be a distribution with density p and let γ ∈ [0, 1). Let A = {x : p(x) ≥ t} for some t. Define θ = P (A). Finally, let B = {B : P (B) ≥ θ}. Then, for every B ∈ B, Z Z pγ (x)dx ≤ pγ (x)dx. A B Proof. Let S1 = A Then Z Z γ p (x)dx − A So it suffices to show that \ Bc, S2 = Ac Z γ S1 pγ (x)dx p (x)dx − S1 ≤ R S2 B. Z γ p (x)dx = B R \ pγ (x)dx. pγ (x)dx. S2 Note that: 1. S1 and S2 are disjoint, 2. inf y∈S1 p(y) ≥ supy∈S2 p(y) and R R 3. S1 p(x)dx ≤ S2 p(x)dx. R R where the last fact follows since A p(x)dx ≤ B p(x)dx. Thus, letting g(x) = 1/p1−γ (x), we have that g(x) ≤ g(y) for all x ∈ S1 and y ∈ S2 . So Z Z γ p (x)dx = S1 Z p(x)g(x)dx ≤ sup g(x) p(x)dx x∈S1 x∈S1 Z Z ≤ sup g(x) p(x)dx ≤ inf g(x) p(x)dx x∈S2 x∈S1 x∈S2 x∈S2 Z Z ≤ p(x)g(x)dx = pγ (x)dx. S1 S2 S2 The following lemma concerns the optimal truncation of a piecewise constant function. Suppose we have a piecewise constant positive function f , which is constant on the partition {A1 , . . . , AN }. Without loss of generality suppose that A1 , . . . , AN are arranged in decreasing order of the value of f on the cell Ai . The lemma follows from lemma 13. S Lemma 14.R With the notation introduced above suppose that we construct a set A = ti=1 Ai and let θ = A f (x) then we have that for any γ ≤ 1 Z Z γ f (x)dx ≤ R inf f γ (x)dx. A B, B f (x)≥θ 49 B The following result is the discrete analogue of the one above. Suppose that we have a sequence {p1 , . . . , pd } of positive numbers sorted as p1 ≥ p2 ≥ . . . pd . By replacing Lebesgue measure in Lemma 13 by the counting measure we get: P Lemma 15. Suppose we construct a set of indices A = {1, . . . , t} and let θ = ti=1 pi , then we have that, t X 2/3 pi J i=1 E.3 2/3 X ≤ min j∈J , P k∈J pj . pk ≥θ Proof of Lemma 2 We divide the proof into two steps: the first step analyzes the output of Algorithm 1, and the second step analyzes the pruning of Algorithm 2. E.3.1 Analysis of Algorithm 1 We analyze Algorithm 1, with the paramters: θ1 = 1/(2Ln ) and a, b = n /1024. We allow θ2 > 0 to be arbitrary. Before turning our attention to the main properties, we verify that the partition created by Algorithm 1 is indeed finite. It is immediate to check that the partition P † = {A1 , . . . , ANe , A∞ } has the property that P (A∞ ) ≤ a + b, which yields the upper bound of property (41). We claim that no cell Ai has very small diameter. Recall that Algorithm 1 is run on Sa a set of probability content 1 − a (centered around the mean of p0 ). Define, pmin = b , vol(Sa ) Suppose that,  1 min θ1 pmin , θ2 pγmin , (76) 4 then let us denote the parent cell of Ai by Ui and its centroid by yi . The parent cell Ui , satisfies the condition that: diam(Ai ) < diam(Ui ) <  1 min θ1 pmin , θ2 pγmin . 2 Since this cell was split, we must have that neither stopping rule (35) or (36) was satisfied. We claim that if the second stopping rule was not satisfied it must be the case that, p0 (yi ) ≤ pmin . 2 Indeed, if the second rule is not satisfied we obtain that: min {θ1 p0 (yi ), θ2 pγ0 (yi )} ≤  1 min θ1 pmin , θ2 pγmin , 2 which via some simple case analysis of the min’s, together with the fact that γ < 1 yields the desired claim. Now using the Lipschitz property and the fact that θ1 = 1/(2Ln ), we have that: sup p0 (x) ≤ p0 (yi ) + Ln diam(Ui ) < x∈Ui 50 pmin pmin + < pmin . 2 4 This means that the first stopping rule was in fact satisfied and we could not have split Ui . This in turn means that every cell in our partition (excluding A∞ ) has diameter at least: diam(Ai ) >  1 min θ1 pmin , θ2 pγmin . 4 This yields that our produced partition is finite and in turn that algorithm terminates in a finite number of steps. Proof of Claim 39: Our final task is to show that the partition satisfies the condition that, 1 min {θ1 p0 (xi ), θ2 pγ0 (xi )} ≤ diam(Ai ) ≤ min {θ1 p0 (xi ), θ2 pγ0 (xi )} . 4 The upper bound is straightforward since it is enforced by our stopping rule. To observe that the lower bound is always satisfied we note that if diam(Ai ) < 1 min {θ1 p0 (xi ), θ2 pγ0 (xi )} , 4 then denoting the parent cell of Ai to be Ui (with centroid yi ) we obtain that, diam(Ui ) < 1 min {θ1 p0 (xi ), θ2 pγ0 (xi )} . 2 Using this we obtain that, 3 p0 (yi ) ≥ p0 (xi ) − Ln diam(Ui ) ≥ p0 (xi ). 4 This yields that, diam(Ui ) < 1 min {θ1 p0 (yi ), θ2 pγ0 (yi )} < min {θ1 p0 (yi ), θ2 pγ0 (yi )} , 2(3/4)γ where in our final step we use the fact that γ < 1. This results in a contradiction since this means that Ui satisfies our stopping rule and would not have been split. Proof of Claim (40): This is a straightforward consequence of the previous property. In particular, we have that diam(Ai ) ≤ θ1 p0 (xi ), with θ1 = 1/(2Ln ) so that, sup p0 (x) ≤ p0 (xi ) + Ln x∈Ai θ1 p0 (xi ) 5 ≤ p0 (xi ). 2 4 Similarly, inf p0 (x) ≤ p0 (xi ) − Ln x∈Ai θ1 p0 (xi ) 3 ≤ p0 (xi ), 2 4 which yields the desired claim. E.3.2 Analysis of Algorithm 2 We now turn our attention to studying the properties of the pruned partition P = {A1 , . . . , AN , A∞ }. For this algorithm, we choose θ2 = n /(8Ln µ(1)) and take c = n /512. Proof of Claim (39): The pruning algorithm completely eliminates some cells, adding them to A∞ . In the case when Q(j ∗ ) ≤ c/5 we change the diameter of the final cell AN , shrinking it by a 1 − α factor. By definition α ≤ 1/5, and this yields Claim (39). 51 Proof of Claim (40): Since the pruning step either eliminates cells, adding them to A∞ , or reduces their diameter this claim follows directly from the fact that this property holds for P † . Proof of Claim (41): The pruning eliminates cells of total additional mass at most c so we obtain that, P (A∞ ) ≤ a + b + c ≤ n /256 verifying the upper bound in (41). To verify the lower bound, we claim that the difference in the probability mass of the unpruned partition, {A1 , . . . , ANe } and the pruned partition {A1 , . . . , AN } is at least c/5, i.e. P0 e N [ N  [  Aj − P0 Aj ≥ c/5. j=1 j=1 In the case when Q(j ∗ ) ≥ c/5 the claim is direct. When this is not the case then the cell AN was too large, so that Q(j ∗ ) + P0 (AN ) ≥ c, which implies that, P0 (AN ) ≥ 4c/5. Let xN be the center of AN . Using property (40) and the fact that (1 − α))d ≤ (1 − α) verify that, P0 (D1 ) ≤ 4(1 − α)P0 (AN ). Using the definition of α we obtain that P0 (D1 ) ≥ c/5 as desired. Proof of Claim (42): We claim that the partition satisfies the property that, Ln N X diam(Ai )vol(Ai ) ≤ i=1 n . 4 (77) Taking this claim as given we verify the property (42). We divide the proof into two cases: 1. P (A∞ ) ≥ n /4: In this case we obtain that, N X |P0 (Ai ) − P (Ai )| + |P0 (A∞ ) − P (A∞ )| ≥ |P0 (A∞ ) − P (A∞ )| ≥ n /8, i=1 using the upper bound in property (41). 2. P (A∞ ) ≤ n /4: In this case we observe that, Z Z Z |p0 (x) − p(x)|dx ≤ p0 (x)dx + A∞ A∞ p(x)dx ≤ A∞ 3n , 8 and this yields that, Z |p0 (x) − p(x)|dx ≥ n (1 − 3/8). Rd \A∞ Now denoting by p̄ the approximation of p by a density equal to the average of p on each cell of the partition we have that, Z Z Z |p0 (x) − p(x)|dx ≤ |p0 (x) − p¯0 (x)|dx + |p(x) − p̄(x)|dx Rd \A∞ Rd \A∞ + N X Rd \A∞ |p0 (Ai ) − p(Ai )|dx. i=1 52 For any Ln -Lipschitz density we have that, N X Z |p(x) − p̄(x)|dx ≤ Ln Rd \A ∞ diam(Ai )vol(Ai ) ≤ i=1 n , 4 using claim (77). This yields that, N X |p0 (Ai ) − p(Ai )| + |p0 (A∞ ) − p(A∞ )| ≥ i=1 N X |p0 (Ai ) − p(Ai )| ≥ n (1 − 7/8) = n /8, i=1 as desired. It remains to prove claim (77). Notice that, Ln N X diam(Ai )vol(Ai ) ≤ i=1 N X min {θ1 p0 (xi ), θ2 pγ0 (xi )} vol(Ai ) (i) ≤2 Rd i=1  Z =2 Rd (ii) = n pγ0 (x) p0 (x) , 2Ln 8Ln µ(1/4) Z {θ1 p0 (x), θ2 pγ0 (x)} dx  dx n , 4 where step (i) uses property (40) and (ii) uses the definition of µ in (37). Proof of Claim (43): Recall that we have chosen c = n /512. In order to prove this claim we need to use properties of the pruning step. Let us define pe0 (x) as the piecewise constant density formed by replacing p0 (x) by its maximum value over the cell containing x, and 0 outside the support of {A1 , . . . , ANe }. We note that, Z Z γ p0 (x)dx ≤ peγ0 (x)dx. (78) K K Now, abusing notation slightly and ignoring the set A∞ we denote the original partition as {A1 , . . . , ANe }, which we take as sorted by the values in g0 , and the pruned partition as {A1 , . . . , AN }, noting that we might potentially have split the last cell AN into two cells. We Se let A = N i=1 Ai . Let us denote,   Z Z B = B : B ⊂ A, pe0 (x)dx ≤ pe0 (x)dx . Bc Using Lemma 14 we obtain that, Z K peγ0 (x)dx Kc Z ≤ inf B∈B B peγ0 (x)dx. (79) Noting, that Z Z Kc pe0 (x)dx ≥ c p0 (x)dx ≥ , 5 Kc and defining,  C= Z c C : C ⊂ A, pe0 (x)dx ≤ 5 Cc 53  . we obtain that, Z inf B∈B B peγ0 (x)dx Z ≤ inf C∈C C peγ0 (x)dx. (80) Defining,  D= Z c D : D ⊂ A, p0 (x)dx ≤ 10 Dc  , we see that D⊂C⊂B so that Z inf C∈C C peγ0 (x)dx Z γ ≤ 2 inf D∈D D γ pγ0 (x)dx ≤ 2γ Tc/10 . (81) Putting together Equations (78), (79), (80) and (81) we obtain the desired result. Proof of Claim (44): In order to lower bound the density over the pruned partition we will show that our pruning step is approximately a level set truncation. We have that for any point x that is removed and any point y that is retained it must be the case that, p0 (x) ≤ 2p0 (y). where we used property (40). Let K denote the set of points retained by the pruning. The above observation yields that, there exists some t ≥ 0 such that, {p0 ≥ t} ⊆ K ⊆ {p0 ≥ t/2}. We know that R K p0 (x)dx ≤ 1 − c/10. Consider, the set G(u) = {x : p0 (x) ≥ u} . Suppose that for some u we can show that, P(K) ≤ P(G(u)), then we can conclude that t ≥ u, and further that the density on K is at least u/2. It thus only remains to find a value u such that P(G(u)) ≥ 1 − c/10. Suppose we choose 1/(1−γ)  c u = 10µ(c/(10)) , and recall that,  Z = min p0 (x) pγ0 (x) , c/(10) µ(c/(10))  dx. Over the set Gc the minimizer is always the first term above which yields, Z p0 (x) ≥ dx, Gc c/(10) i.e. that P(Gc ) ≤ c/10, as desired. This in turn yields the claim. 54 E.4 Proof of Lemma 5 To show this, it suffices to show that more mass is truncated from q than is truncated from p, i.e. that N +1 X qi ≥ P (A∞ ), (82) s+1 and then we apply Lemma 15. To show (82) we proceed as follows. Note that P (A∞ ) = qa for P +1 some a. If s ≤ a then N s+1 qi ≥ P (A∞ ) follows immediately. Now suppose that s > a. From P +1 PN +1 the definition of s we know that qs + N s+1 qi ≥ /128 so that s+1 qi ≥ /128 − qs . Since PN +1 P +1 s > a, qs ≤ P (A∞ ) ≤ /256 and so s+1 qi ≥ /256 ≥ P (A∞ ) so that N s+1 qi ≥ P (A∞ ) as required. Thus (82) holds. F Adapting to Unknown Parameters In this section, we consider ways to choose the parameter σ for the max test, and for the test in [30], and then consider tests that are adaptive to the typically unknown smoothness parameter Ln . F.1 Choice of σ The max test and the test from [30] require choosing the truncation parameter σ = n /8. In typical settings, we do not assume that n is known. We consider the case of the test from [30] though our ideas generalize to the max test in a straightforward way. Perhaps the most natural way to choose the parameter σ is to solve the critical equation and choose σ accordingly, i.e. we find σ e that satisfies: ( r ) Vσe/16 (p0 ) 1 σ e = max , , (83) n n and then we choose the tuning parameter σ := C max{1/α, 1/ζ}e σ , for a sufficiently large constant C > 0. When the unknown n ≥ 8C max{1/α, 1/ζ}e σ , then it is clear that our choice guarantees that the tuning parameter σ is chosen sufficiently small, i.e. σ ≤ n /8 as desired. It is also clear that the test has size at most α. It remains to understand the Type II error. Inverting the above relationship we see that,   1 Vσe/16 (p0 ) n = max , . σ e σ e2 Noting that σ/2 ≥ σ e/16, and that C max{1/α, 1/ζ} ≥ 1 we obtain that,     1 Vσ/2 (p0 ) 1 Vσ/2 (p0 ) n ≥ C max{1/α, 1/ζ} max , ≥ C max{1/α, 1/ζ} max , . σ σ2 σ 2n An application of Lemma 7 shows that the Type II error of the test is at most ζ as desired. Thus, we see that this test provides the same result as the test in Theorem 3 without knowledge of n . Although adequate from a theoretical perspective, the previous choice of the parameter depends on an unknown (albeit universal) constant. An alternative is to consider a range of 55 possible values for the parameter σ and appropriately adjust the threshold α via a Bonferroni correction. One natural range is to consider scalings of the parameter σ e in (83). More generally, if we considered Σ = {σ1 , . . . , σK }, a natural goal would be to compare the risk of the Bonferroni corrected test to the oracle test which minimizes the risk over the set Σ of possible tuning parameters. We leave a more detailed analysis of this test to future work. F.2 Adapting to unknown Ln Our tests for Lipschitz testing, in addition to assuming knowledge of n use knowledge of the Lipschitz constant Ln in constructing the binning. The techniques from the previous section can be used to construct tests without knowledge of n . Constructing tests which are adaptive to unknown smoothness parameters is a problem which has received much attention in classical works. We focus only on establishing upper bounds. Some lower bounds follow from standard arguments and we highlight important open questions in the sequel. In order to define precisely the notion of an adaptive test, we follow the prescription of Spokoiny [29] (see also [12, 16]). As in (28) define a sequence of critical radii wn (p0 , L) as the solutions to the critical equations: wn (p0 , L) = Ld/2 Tcwn (p0 ,L) (p0 ) n !2/(4+d) for a sufficiently small constant c > 0. We now define the adaptive upper critical radii as the solutions to the critical equations: wna (p0 , L) = Ld/2 log(n)Tcwna (p0 ,L) (p0 ) n !2/(4+d) . (84) We can upper bound the ratio: wna (p0 , L) ≤ (log(n))2/(4+d) . wn (p0 , L) This ratio upper bounds the price for adaptivity. It will be necessary to distinguish the (known) smoothness parameter of the null from the possibly unknown parameter Ln in (6). We will denote the smoothness parameter of p0 by L0 . We note that in the setting where Ln was known, we assumed that both p0 , p ∈ L(Ln ) and this in turn requires that Ln ≥ L0 . We take α, ζ > 0 to be fixed constants. For a sufficiently large constant C > 0 we define the class of densities: L(Ln , wna ) = {p : p ∈ L(Ln ), kp − p0 k1 ≥ C max{1/α, 1/ζ}wna (p0 , Ln )}. For some p0 ∈ L(L0 ), consider the hypothesis testing problem of distinguishing: [ H0 : p = p0 , p0 ∈ L(L0 ) versus H1 : p ∈ L(Ln , wna ). (85) Ln ≥L0 In order to precisely define our testing procedure we first show that there are natural upper bounds on Ln . In particular, we claim that when Ln  n2/d L0 then the critical radius remains lower bounded by a constant. We have the following lemma. We let C` , c > 0 denote universal constants. 56 Lemma 16. If Ln ≥ C` n2/d L0 , then n (p0 , Ln ) ≥ c. Thus we restrict our attention to the regime where Ln ∈ [L0 , Cn2/d L0 ], for a sufficiently large constant C > 0. A natural strategy is then to consider a discretization of the set of possible values for Ln , 2/d ) L = {L0 , 2L0 , . . . , 2log2 (Cn L0 }. Our adaptive test then simply performs the binning test described in Theorem 5 for each choice of Ln ∈ L, with the threshold α reduced by a factor of dlog2 (Cn2/d ) + 1e. We refer to this test as the adaptive Lipschitz test. We have the following result: Theorem 6. Consider the testing problem in (85). The adaptive Lipschitz test has Type I error at most α, and has Type II error at most ζ. Remarks: • Comparing the non-adaptive critical radii in (28) and the adaptive critical radii in (84) we see that we lose a factor of (log(n))2/(4+d) . A natural question is whether such a loss is necessary. • Classical results [16] consider adapting to an unknown Hölder exponentps and show that for testing uniformity (with deviations in the `2 metric) a loss of a factor ( log log(n))2s/(4s+d) is necessary and sufficient. In our setting, the loss is of a logarithmic factor instead of a log log factor and this is a consequence of the fact that the high-dimensional multinomial tests we build on [30] are not in general exponentially consistent (i.e. their power and size do not tend to zero at an exponential rate). We hope to develop a more precise understanding of this situation in future work. Proof. The proof follows almost directly from our previous analysis of Theorem 5 so we only provide a brief sketch. It is straightforward to check that the Bonferroni correction controls the size of the adaptive Lipschitz test at α. Let j ∗ denote the smallest integer such that, ∗ 2j L0 ≥ Ln . In order to bound the Type II error, it is sufficient to show that under the alternate, the test corresponding to the index j ∗ rejects the null hypothesis with probability ∗ at least 1 − ζ. Noting that the ratio 2j L0 /Ln ≤ 2 this follows directly from the proof of Theorem 5. F.2.1 Proof of Lemma 16 In order to establish this claim, it suffices to show that the lower bound on the critical radius in (28) is at least a constant. By the monotonicity of the critical equation, it suffices to show that for some small constant c > 0 we have that, !2/(4+d) d/2 Ln TCc (p0 ) c≤ , n where C > 0 is the universal constant in (28). We choose c < C/2 so we obtain that it suffices to show, !2/(4+d) d/2 Ln T1/2 (p0 ) . c≤ n 57 We claim that for any p0 ∈ L(L0 ) there is a universal constant C1 > 0 such that, T1/2 (p0 ) ≥ C1 d/2 . (86) L0 Taking this claim as given for now we see that, d/2 Ln T1/2 (p0 ) n !2/(4+d) d/2 C1 Ln ≥ !2/(4+d) C1 ≥ d/2 L0 n !2/(4+d) ≥ c, d/2 C` as desired. Proof of Claim (86): As a preliminary we first produce an upper bound on any Lipschitz density. We claim that, there exists a constant C > 0 depending only on the dimension such d/(d+1) that any L0 -Lipschitz density p0 is upper bounded as kp0 k∞ ≤ CL0 . Without loss of generality let us suppose the density p0 is maximized at x = 0. The density p0 is then lower bounded by the function, g0 (x) = (kp0 k∞ − L0 kxk) I(kp0 k∞ − L0 kxk ≥ 0). The integral of this function is straightforward to compute, and since p0 must integrate to 1 we obtain that, Z Z vd kpkd+1 ∞ 1 = p0 (x)dx ≥ g0 (x)dx = , d d + 1 L x x 0 where vd denotes the volume of the d-dimensional unit ball. This in turn yields the upper bound,  kpk∞ ≤ d+1 vd 1/(d+1) d/(d+1) L0 , as desired. With this result in place we can lower bound the truncated T -functional. In particular, letting Bσ denote a set of probability content 1 − σ that (nearly) minimizes the truncated T -functional we have that, Tσγ (p0 ) Z = Bσ pγ0 (x)dx Z  p0 (x) ≥ Bσ 1−γ dx kpk∞ ≥ vd d+1 1/(3+d) d/(3+d) L0 which gives the bound,  Tσ (p0 ) ≥ vd d+1 1/2 (1 − σ)(3+d)/2 d/2 L0 as desired. Taking σ = 1/2 yields the desired claim. 58 1−σ , , Uniform Null, Uniform Alternate 1 0.9 0.9 0.8 0.8 0.7 0.7 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.5 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0.2 0.4 0.6 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.6 Power Power 0.6 0 Uniform Null, Sparse Alternate 1 0 0.8 0 ℓ1 Distance 0.2 0.4 0.6 0.8 ℓ1 Distance Figure 5: A comparison between the truncated χ2 test, the 2/3rd + tail test [30], the χ2 -test, the likelihood ratio test, the `1 test and the `2 test. The null is chosen to be uniform, and the alternate is either a dense or sparse perturbation of the null. The power of the tests are plotted against the `1 distance between the null and alternate. Each point in the graph is an average over 1000 trials. Despite the high-dimensionality (i.e. n = 200, d = 2000) the tests have high-power, and perform comparably. G Additional Simulations In this section we re-visit the simulations for multinomials. We add comparisons to tests based on the `1 and `2 statistics which are given as T`1 = d X |Xi − np0 (i)|, i=1 and T`2 = d X (Xi − np0 (i))2 . i=1 In addition to the alternatives that are created by dense and sparse perturbations of the null we also consider two other perturbations: one where we perturb each coordinate of the null by an amount proportional to the entry p0 (i), and one where we perturb each coordinate by p0 (i)2/3 , in magnitude with a Rademacher sign. The latter perturbation is close to the worst-case perturbation considered by [30] in their proof of local minimax lower bounds. We take n = 200, d = 2000 and each point in the graph is an average over 1000 trials. Once again we observe that the truncated χ2 test we propose, and the 2/3rd + tail test from [30] are remarkably robust. All tests are comparable when the null is uniform, while distinctions are clearer for the power law null. The `2 test appears to have high-power against sparse alternatives suggesting potential avenues for future investigation. 59 Power Law Null, Uniform Alternate 1 0.9 0.9 0.8 0.8 0.7 0.7 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.5 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.6 Power Power 0.6 0 Power Law Null, Sparse Alternate 1 0 0.6 0 0.1 0.2 ℓ1 Distance 0.9 0.8 0.8 0.7 0.6 0.7 0.8 0.7 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.5 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 Chi-sq. L2 L1 Truncated chi-sq LRT 2/3rd and tail 0.6 Power 0.6 Power 0.5 Power Law Null, Alternate Prop. to Null 1 0.9 0 0.4 ℓ1 Distance Power Law Null, 2/3-rd Alternate 1 0.3 0 0.7 ℓ1 Distance 0 0.2 0.4 0.6 0.8 ℓ1 Distance Figure 6: A comparison between the truncated χ2 test, the 2/3rd + tail test [30], the χ2 -test, the likelihood ratio test, the `1 test and the `2 test. The null is chosen to be a power law with p0 (i) ∝ 1/i. We consider four possible alternates, the first uniformly perturbs the coordinates, the second is a sparse perturbation only perturbing the first two coordinates, the third perturbs each co-ordinate proportional to p0 (i)2/3 and the final setting perturbs each coordinate proportional to p0 (i). The power of the tests are plotted against the `1 distance between the null and alternate. Each point in the graph is an average over 1000 trials. 60
10math.ST
Article An Analysis of the Value of Information when Exploring Stochastic, Discrete Multi-Armed Bandits Isaac J. Sledge1 and José C. Príncipe2 1 arXiv:1710.02869v2 [cs.AI] 3 Mar 2018 2 * Department of Electrical and Computer Engineering, University of Florida; Computational NeuroEngineering Laboratory (CNEL), University of Florida; [email protected] Department of Electrical and Computer Engineering, University of Florida; Department of Biomedical Engineering, University of Florida; Computational NeuroEngineering Laboratory (CNEL), University of Florida; [email protected] Correspondence: [email protected], [email protected]; Tel.: +x-xxx-xxx-xxxx The work of the authors was funded via grant N00014-15-1-2103 from the US Office of Naval Research. The first author was additionally funded by a University of Florida Research Fellowship, a Robert C. Pittman Research Fellowship, and an ASEE Naval Research Enterprise Fellowship. Academic Editor: name Received: 12 October 2017; Accepted: 16 February 2018; Published: 26 February 2018 Abstract: In this paper, we propose an information-theoretic exploration strategy for stochastic, discrete multi-armed bandits that achieves optimal regret. Our strategy is based on the value of information criterion. This criterion measures the trade-off between policy information and obtainable rewards. High amounts of policy information are associated with exploration-dominant searches of the space and yield high rewards. Low amounts of policy information favor the exploitation of existing knowledge. Information, in this criterion, is quantified by a parameter that can be varied during search. We demonstrate that a simulated-annealing-like update of this parameter, with a sufficiently fast cooling schedule, leads to a regret that is logarithmic with respect to the number of arm pulls. Keywords: Multi-armed bandits, exploration, exploitation, exploration-exploitation dilemma, reinforcement learning, information theory 1. Introduction There are many environment abstractions encountered in reinforcement learning [1]. One of the simplest examples is the stochastic multi-armed bandit abstraction [2,3]. It is a gambling-based paradigm that can be used to model challenging real-world problems where the environment has a single state and multiple action choices [4]. The stochastic, discrete multi-armed-bandit abstraction consists of a finite set of probability distributions with associated expected values and variances. Each probability distribution is an abstraction of a slot machine, which is colloquially referred to as a one-armed bandit. Initially, each of the distributions is unknown. The agent, a gambler, can choose at discrete time instants to pull one of the slot-machine arms to receive a stochastic reward. The objective of the gambler is to maximize his or her return, which is the sum of the rewards received over a sequence of arm pulls. Since the reward distributions may differ from machine to machine, the objective of the gambler is equivalent to discovering the machine with the best possible pay-off, as early as possible. He or she should then keep gambling using that machine, assuming that the distributions are fixed. An issue faced in the stochastic multi-armed bandit abstraction is the trade-off between the competing processes of action exploration and exploitation. In some instances, it may be necessary for the gambler to try slot machines that have not been extensively played. More complete knowledge about the pay-off statistics may be obtained, as a result, which can inform the gambler about how to improve the accrued reward. This is referred to as exploration. In other instances, it may be prudent for the gambler to exclusively play on the machine that he Entropy 2018, 20, 155; doi:10.3390/e20030155 www.mdpi.com/journal/entropy Entropy 2018, 20, 155 2 of 33 or she currently perceives to be the best. This is referred to as exploitation, since the gambler is leveraging his or her existing knowledge about the pay-off statistics to choose an appropriate machine. A reasonable balance between exploration and exploitation is needed, even for this simple environment. Without an ability to explore, the gambler may fail to discover that one slot machine has a higher average return than the others. Without an ability to exploit, the gambler may fail to pull the best arm often enough to obtain a high pay-off. Many methods have been developed that attempt to optimally explore for the discrete, stochastic multi-armed-bandit abstraction. One way to quantify their success has been through regret (see appendix A). Regret is the expected total loss in rewards that is incurred due to not pulling the optimal arm at the current episode. Lai and Robbins have proved that a gambler’s regret over a finite number of pulls can be bounded below by the logarithm of the number of pulls [5]. There is no gambling strategy with better asymptotic performance. There are approaches available that can achieve logarithmic regret for stochastic, multi-armed bandits. Prominent examples include the upper-confidence-bound method [6,7] and its many extensions [8,9], Thompson sampling [2,10], and the minimum empirical divergence algorithm [11,12]. The stochastic-based epsilon-greedy [13] and the stochastic-based exponential-weight-explore-or-exploit algorithms [13,14] can also obtain logarithmic regret. Most of these approaches adopt reasonable assumptions about the rewards: they assume that the supplied rewards are independent random variables with stationary means. In this paper, we propose a stochastic exploration tactic that, for this abstraction, has a weaker assumption on the reward distributions than some bandit algorithms. That is, we assume that the distribution of each new random reward can depend, in an adversarial way, on the previous pulls and observed rewards, provided that the reward mean is fixed. Our approach is based on the notion of the value of information due to Stratonovich [15,16], which implements an information-theoretic optimization criterion. We have previously applied the value of information to the reinforcement learning problem. In [17], we showed that the value of information could be formulated to explore multi-state, multi-action Markov decision processes. This yielded a Gibbs-based stochastic search strategy. Our simulation results for an arcade-game domain showed that this search strategy outperformed two popular exploration approaches. This was because the value of information aggregates the Markov chains underlying the Markov decision process [18]. It hence performs dynamics reduction during the learning process, which simplifies the search for a high-performing policy. In [19], we extended the value of information to include an uncertainty-based search component so that unexplored regions of the policy space could be explicitly identified and searched. This improved performance was predicated on adjusting the amount of exploration during learning according to a policy cross-entropy heuristic. We showed that this criterion could outperform many uncertainty-based search strategies for arcade-game environments. In these previous works, we only considered empirical aspects of the value of information. We did not assess its theoretical capabilities. The primary aim and novelty of this paper is to understand how the value of information can implement an optimal-regret search mechanism. We do this for discrete single-state, multi-action Markov decision processes in this paper, so as to make the analysis tractable. This is a crucial first step to showing that this criterion can optimally explore Markov decision processes, as such optimality is not known, given that we are the first to use this criterion for reinforcement learning. In this setting, the value of information has two equivalent interpretations. The first is that the criterion describes the expected utility gain against the effort to transform the initial arm-selection policy to the optimal selection policy. The second is that it describes the largest increase of average rewards associated with actions that carry a certain amount of information about the environment. In either case, the criterion is defined by two terms that specify a negative free energy in a thermodynamics sense. The first term quantifies the expected rewards of the initially chosen probabilistic policy. The second term measures the divergence between the initial probabilistic policy and the optimal policy. The interplay of these two terms facilitates an optimal search for the best-paying arm under the specified constraints. Both the policy information and the policy transformation costs are described by a tunable parameter that automatically emerges through the optimization of the value of information criterion. This parameter can be viewed as a kind of inverse temperature. It limits how much the initial policy can transform, which Entropy 2018, 20, 155 3 of 33 implicitly dictates the amount of exploration. Small values of the parameter near zero impose great constraints on the policy transformation costs. This forces the policy to remain roughly the same as the initial policy. The exploitation of the current best slot-machine lever will therefore dominate. In essence, the amount of information available to the agent about the environment is severely limited, so it is unable to determine if it should change its behaviors. As the parameter value becomes infinite, the expected policy return becomes increasingly important. The transformation costs are essentially ignored for this to occur. The agent becomes free to consider slot-machine arms that differ from the current best policy in a effort to improve regret. We face certain practical challenges when applying the value of information to multi-armed bandits. One of these entails showing how the criterion can be optimized to produce an action-selection strategy. To deal with this issue, we reformulate the criterion into an equivalent variational form that is convex. We then provide an iterative, coordinate-descent-based approach for uncovering global solutions of this variational expression. The coordinate-descent update leads to a formula for probabilistically weighting action choices that mirrors soft-max-like selection, a common exploration heuristic in reinforcement learning. This weighting process defines a probability that a certain arm will be chosen based upon that arm’s expected reward and the value of the inverse-temperature parameter. Arms with higher expected rewards will be chosen more frequently than those with lower average rewards. The final choice of which arm to pull is made stochastically, which spurs an investigation of the action space. Another challenge that we face is how to achieve optimal regret. We propose to use a simulated-annealing-type schedule for adjusting the inverse-temperature parameter. We prove that the sequence of policy distributions generated under this annealing schedule will converge to a distribution concentrated only on the optimal policies. A sufficiently quick cooling of the inverse-temperature parameter additionally ensures that logarithmic regret can be obtained. This is an interesting finding, as soft-max-like exploration has largely been demonstrated to have either linear-logarithmic or polylogarithmic regret, not logarithmic regret, for the stochastic, multi-armed bandit problem [20,21,24]. The remainder of this paper is organized as follows. We begin, in section 2, with an overview of the multi-armed bandit literature. We predominantly focus on methodologies that rely on stochastic search, as the value of information is also a stochastic approach. We briefly compare the value of information with these methods. Section 3 outlines our methodology. We begin, in section 3.1, by introducing the value of information from a multi-armed bandit perspective. Interpretations for this criterion are provided. In section 3.2, we provide the solution to criterion, which takes the form of a parameterized Gibbs distribution. We modify the Gibbs distribution so as to overcome sampling bias issues that hamper conventional weighted-random styles of exploration. We also provide two potential parameter annealing schedules, each of which has its own advantages and disadvantages. Our theoretical treatment of the value of information is given in appendix A. We prove that two algorithms based on this information-theoretic criterion can yield logarithmic regret for appropriate parameter annealing schedules. In section 4, we assess the empirical capabilities of the value of information for the bandit problem. We begin this section by covering our experimental protocols in section 4.1. In sections 4.2 and 4.3, we present our simulation results. We assess the performance of the value of information for the fixed-exploration case in section 4.2.1 and the tuned case in section 4.2.2. Performance comparisons against other bandit algorithms are presented in section 4.3. Since the value of information implements a weighted-random search, we consider a variety of stochastic-based sampling techniques, such as -greedy exploration, soft-max-based selection, and reinforcement comparison. We also compare against the deterministic upper-confidence-bound method. Our results indicate that the value of information outperforms these alternate approaches in a variety of circumstances. Additional comparisons against state-of-the-art techniques are provided in an online appendix. The results show that our information-theoretic criterion is highly competitive and often achieves a similar regret over a finite number of slot-machine plays. Section 5 summarizes the findings of the paper and reiterates that the novelty of the paper is our analysis of value-of-information criterion. We also outline directions for future research in this section. Entropy 2018, 20, 155 4 of 33 2. Literature Review Many exploration schemes have been advanced over the years. Most of these schemes have been developed for rather general models like multi-state, multi-action Markov decision processes. We refer to the survey of Kaelbling et al. [22] for overviews of such schemes. In this section, we consider popular stochastic exploration tactics for the discrete bandit problem with a discrete number of action possibilities [23]; this is because the value of information implements a stochastic search approach. We note, though, that several other variants of the bandit problem exist. These include adversarial bandits [6,24], non-stationary bandits [6,24], associative bandits [6,25], and budgeted bandits [26], each of which has pertinent exploration-exploitation strategies. Extensions of the bandit problem to the continuous case have also been made [27–29]. One of the most widely employed exploration strategies for discrete, stochastic multi-armed bandits is the -greedy method [30]. Epsilon-greedy exploration entails choosing either a random arm, with a probability given by the value of , or the arm with the highest mean reward. For practical problems, the mean reward is estimated from the observed rewards up to the current pull. The simplest form of -greedy exploration is the -first strategy. This approach consists of initially performing an exploration phase during learning, then switching to a pure exploitation phase. In the exploration phase, the arms are randomly selected and pulled during the first k rounds, where k is a pre-specified number of rounds. Sub-optimal arms may or may not be dropped from the search process during this stage. During the remaining (1 − )k rounds, the lever with the highest estimated mean from the exploration phase is pulled. This is referred to as the exploitation phase. As Even-Dar et al. have shown [31], a log-linear number of pulls O((|A|/α2 )log(|A|/κ)) during the exploration phase is an upper bound to find an α-optimal arm with probability at least 1 − κ. Here, |A| represents the number of bandit arms. This result can be viewed as an analysis of the asymptotic behavior of the -first mechanism from a probabilistically-absolutely-correct framework. Mannor and Tsitsiklis [32] provided complementary results for a lower bound and proved that it is also log-linear. In certain circumstances, context information may be available, at each round, to help determine which arm should be pulled. -first exploration can also be used for such contextual bandits [33]. More advanced schemes have been proposed that rely on Gaussian processes [34,35] or exponential-weighting for exploration and exploitation using expert advice (Exp4) [24,36]. In the -first method, the value of  remains fixed during the learning process. This is a rather restrictive assumption, since it prevents the decision-making process from getting arbitrarily close to the optimal lever. Researchers have proposed so-called -changing strategies to deal with this issue. Many such methods entail modifying  across consecutive arm pulls so that the optimal action choice can be made asymptotically. For certain classes of reward distributions, Cesa-Bianchi and Fischer [20] showed that a squared-log regret of O(ϑlog(|A|/β 2 )/β 2 + log(k) + ϑlog2 (k)/β 2 ) can be obtained for -changing strategies after k rounds. Their approach was referred to as GreedyMix. Here, β, ϑ are parameters, independent of the number of arm pulls k, that describe reward statistics for each of the |A| arms. In GreedyMix, they assumed that  would be decreased logarithmically with respect to the number of rounds. Auer, Cesa-Bianchi, and Fischer [13] later showed that a log regret of O(log(k/ϑ) + (1 + β 2 )ϑ) could be obtained for GreedyMix by choosing good initial values for . Another widely utilized exploration mechanism is soft-max selection. Soft-max selection entails pulling arms in a stochastic fashion according to a Gibbs distribution. This distribution specifies probabilities for choosing a given lever based upon its expected reward relative to all other possible rewards. Levers with high expected rewards are assigned greater probability mass than those with lower rewards. A single, user-adjustable parameter τ is present in the distribution that controls the degree of randomness in the lever-selection process. Values of τ close to zero lead to a greedy selection strategy: the arm with the highest expected reward is consistently favored over all other arms. Values of τ close to one yield a uniform selection strategy: no action is favored over others, regardless of the expected rewards. τ is sometimes referred to as temperature, which is due to the connections between the Gibbs distribution and the theory of thermodynamics. Soft-max selection can be modified into τ -first and τ -changing strategies. In the former case, τ is set so that exploration is performed only at the beginning of the learning process. The latter case involves monotonically Entropy 2018, 20, 155 5 of 33 adjusting the temperature τ from some sufficiently high value to a low value according to either a linear or logarithmic schedule. A logarithmic cooling case was investigated by Cesa-Bianchi and Fischer [20]. They showed that a log-squared regret of O(ϑlog(|A|/β 2 )/β 2 + log(k) + ϑlog2 (k)/β 2 ) can be obtained after k rounds by their SoftMix algorithm. As before, β, ϑ are parameters that depend on the expected values of the reward distributions for the |A| arms. A more complicated variant of the soft-max selection, the exponential-weight algorithm for exploration and exploitation (Exp3), was proposed by Auer, Cesa-Bianchi, and Fischer in [13]. Exp3 entails probabilistically choosing a lever based upon an amended Gibbs distribution. The role of the amended distribution is to divide the expected reward by the probability that the action was chosen. Auer et al. showed that a cumulative regret bound of O((|A|klog(|A|k/κ))1/2 ), with probability of at least 1 − κ, was possible for finding the α-optimal arm when using Exp3. This bound is optimal, as the authors demonstrated that a matching lower bound could be obtained under general circumstances. MacMahan and Streeter [14] later revised Exp3 and Exp4 to take advantage of expert advice and systematically remove irrelevant arms. They furnished a tighter bound of O((Sklog(M ))1/2 ), where S  |A| is a variable that measures the extent to which the expert recommendations agree and M is the number of experts. In the next section, we provide a soft-max style of action selection for discrete, multi-armed bandits. Our methods are based on the value-of-information criterion proposed by Stratonovich. When applied to reinforcement learning, the value of information quantifies the expected trade-off between policy information and expected rewards. It yields a search process governed by a Gibbs distribution parameterized according to the amount of policy information τk . We show that a modified τk -changing learning style yields a regret of O(log(k)); this is best regret bound that can be achieved for a stochastic multi-armed bandit problem [4]. For this approach, we assume that knowledge of the mean slot-machine rewards are available to inform the choice of a hyperparameter. This regret bound is an interesting result, as Gibbs-based approaches with a monotone learning-rate sequence have previously only obtained polylogarithmic regret [20,21]. We additionally propose a method with a straightforward means of selecting the hyperparameter. The second approach leads to a regret of O(log(k)1+2θ ), which can be made arbitrarily close to a logarithmic regret by choosing a small θ. No prior knowledge of the reward statistics are needed, unlike in the first method, to achieve this regret bound. This makes it competitive against other Gibbs-based, distribution-free schemes, such as Exp3 and Exp4 [24], which only obtain linear-logarithmic regret. 3. Methodology Our approach to addressing the multi-arm bandit problems follows from the theory of Stratonovich [15, 16]. Stratonovich proposed a mathematical framework for quantitative decision making under information constraints, which took the form of an optimization criterion known as the value of information. The value of information is based on the premise that the inflow of novel information can be used to increase rewards in decision-making problems. That is, the more environmental details that are made available to the agent, the more informed its decisions will be and hence the better the rewards should be. Here, information will take the form of policy transformation costs. We have previously shown that the value of information can be applied to multi-state, multi-action decision-making problems that can be solved using reinforcement learning [17,19,37]. Here, we simplify this criterion from the multi-state case to that of the single-state so that it is suitable for addressing the multi-armed bandit problem. This is the simplest abstraction that will allow us to see under what conditions the search can be optimal. Extensions of the theoretical results that we obtain for this abstraction may prove useful in the multi-state, multi-action case. In this setting, we assume that an initial probabilistic arm-selection policy is provided. Such a policy could assign equal probabilities of choosing each arm, for example. The value of information is an optimization problem that seeks a transformed version of this initial policy that yields the highest rewards. The initial policy is not necessarily allowed to change arbitrarily, though, across each arm-pull round. Rather, the transformation is governed by a bounded information constraint term. The lower the bound, the less that the initial policy entries can be modified during a single arm pull. This behavior can impact the obtainable rewards if the initial Entropy 2018, 20, 155 6 of 33 policy is poor. Conversely, the higher the bound, the more that the initial policy can be adjusted in a given round and hence the greater the potential reward improvement. The degree of policy transformation must be delicately balanced to obtain the best pay-out. As we will show, the information bounds are dictated by a single parameter that emerges from converting this single-term constrained optimization problem into a two-term unconstrained problem. This parameter simultaneously dictates how much weighted-random-based exploration is performed. We introduce another parameter that adds a uniform-random exploration component, which is crucial for obtaining optimal regret. It is well known that a constant amount of exploration typically leads to linear regret [20]. A systematic adjustment of exploration is needed to achieve sub-linear regret. We hence consider a simulated-annealing-type approach for tuning the two parameters across each arm pull. As we noted above, we provide two different annealing cooling schedules that switch between near-perfect exploration and near-perfect exploration in a finite number of pulls. We prove in appendix A that these schedules achieve logarithmic regret. Our definition of regret is given in appendix A. We also state our assumptions on the reward distributions in this appendix. We have provided a table of our variable notation to track the many terms that we define in both this section and the appendix. This table is included at the end of the paper as a supplemental attachment. 3.1. Value of Information In the context of multi-armed bandits, we assume that an agent’s initial behavior is described by a prior distribution p0 (aik ). Here, aik ∈ A represents the ith arm pulled in the kth round; a single round, which we also refer to as an iteration, is equivalent to one arm pull. The variable A is the set of all arms. The agent transforms its behavior to a posterior-like distribution p(aik ), which is referred to as the policy. We will also use πki to denote the policy distribution. This transformation occurs in a way that optimally trades off the expected utility against the transformation costs for going from p0 (aik ) to p(aik ). This trade-off is given by the following extremization problem, which is the value of information for the Shannon information case, ! ! X X X p(aik ) i i i maxp(aik ) p(ak )Xk such that p(ak )log ≤ ϕinf . (1) p0 (aik ) k=1,2,... aik ∈A aik ∈A | {z } {z } | P k=1,2,... Eai [Xki ] k DKL (p(aik )kp0 (aik )) This expression can be viewed as a problem of finding a version p(aik ) of the initial policy that achieves maximal expected rewards in the case where the initial policy p0 (aik ) can only change by a prescribed amount. Here, ϕinf ∈ R+ is a non-negative value that represents the transformation amount bound. The variable Xki ∈ R represents the reward for the ith arm aik ∈ A chosen after k arm pulls; it can also be interpreted as a random variable. The optimization term in (1) can be described in more detail as follows: Optimization Term: Expected Returns. The term to be optimized represents the expected returns P i i i i k=1,2,... Eaik [Xk ] = k=1,2,... p(ak )Xk associated with an arm-selection strategy p(ak ) that provides the best pay-out Xki over all arm pulls k. The selection strategy p(aik ) is initially unknown. However, it is assumed to be related to the specified prior p0 (aik ), in some manner, as described by the information constraint bound. P As the number of arm pulls becomes infinite, the agent will have complete knowledge of the environment, assuming that the information constraint bound DKL (p(aik )kp0 (aik )) ≤ ϕinf is equal to the action random P variable entropy ϕinf = − aj ∈A p(aj )log(p(aj )). This term will eventually produce globally optimal pay-outs. Optimal pay-outs can also be achieved if the information constraint bound is annealed at a sufficiently rapid pace. The agent’s arm-selection behavior becomes entirely deterministic in such situations, as only the best arm will be pulled. The policy p(aik ) becomes a delta function in the limit. Otherwise, the agent’s behavior will be stochastic. That is, the policy p(aik ) will be described by a discrete unimodal distribution that is not quite uniform and not quite a delta function. Entropy 2018, 20, 155 7 of 33 The constraint term in (1) can be interpreted as follows: Constraint Term: Transformation Cost. The constraint term, DKL (p(aik )kp0 (aik )), a Kullback-Leibler divergence, quantifies the divergence between the posterior p(aik ) and the prior p0 (aik ). This term is bounded above by some non-negative value ϕinf , which implies that the amount of overlap will be artificially limited by the chosen ϕinf . The value of ϕinf dictates by how much the prior p0 (aik ) can change to become the posterior p(aik ). If ϕinf is zero, then the transformation costs are infinite. The posterior will therefore be equivalent to the prior and no exploration will be performed. The expected pay-out will not be maximized for non-optimal priors. If ϕinf is larger than the random variable entropy, then the transformation costs are ignored. The prior is free to change to the optimal-reward policy, since the exploration of arms dominates. For values of ϕinf between these two extremes, the agent weighs the expected improvement in rewards against the transformation costs. A mixture of exploration and exploitation occurs. The constraint can also be viewed as describing the amount of information available to the agent about the environment. That is, for small values of ϕinf , the agent has little knowledge about the problem domain. It is unable to determine how to best adapt its action-selection strategy. As ϕinf increases, more information is made available to the agent, which allows it to refine its behavior. In the limit, the agent has the potential for complete knowledge about the environment, which means the action choice will be reward-optimal. The value of information, given by (1), therefore describes the best pay-out that can be achieved for a specified policy transformation cost. It has the dual interpretation of quantifying how sensitive the arm-selection process will be to environment knowledge, as communicated through the Shannon information term. This constrained criterion given in (1) can be converted into the following unconstrained variational expression that defines a free-energy difference, in a thermodynamics sense. The unconstrained problem follows from the theory of Lagrange multipliers, ! ! X X 1 X p(aik ) i i i , (2) maxp(aik ) p(ak )Xk − p(ak )log τk i p0 (aik ) k=1,2,... aik ∈A ak ∈A {z } | τk−1 log( P i ai ∈A k p0 (aik )eτk Xk ) for some non-negative τk . The parameter τk−1 sets the relative importance between the transformation cost and the pay-out maximization. τk−1 can be viewed as an inverse temperature that can change as the number of arm pulls increases. Adjusting τk−1 across each arm pull modifies the amount of exploration that is performed. We discuss ways this can be done, so as to achieve optimal regret, in the next subsection. The value of information can be posed as the dual problem of maximizing the informational overlap subject to a cost constraint. Both problems are equivalent. For this dual extremization problem, it is easier to see that it convex, as it relies on the minimization of a Kullback-Leibler divergence ! ! X X X p(aik ) i i i − minp(aik ) p(ak )log such that p(ak )Xk ≤ ϕcost (3) p0 (aik ) k=1,2,... aik ∈A aik ∈A | {z } | {z } P DKL (p(aik )kp0 (aik )) k=1,2,... Eai [Xki ] k for ϕcost ∈ R+ . The equivalency of (1) and (3) follows from an application of Stjernvall’s dominance theory and some additional arguments. We can state this constrained criterion in an unconstrained variational form as a negative free-energy difference, ! ! X X X p(aik ) 1 i i i − minp(aik ) p(ak )log − p(ak )Xk , (4) τk p0 (aik ) k=1,2,... aik ∈A aik ∈A | {z } −τk−1 log( P ai ∈A k i p0 (aik )eτk Xk ) Entropy 2018, 20, 155 8 of 33 subject to some non-negative τk . The optimization term in (3) has been analyzed for general multi-state, multi-action reinforcement learning in [17,19]. Here, it can be viewed as follows: Optimization Term: Transformation Amount. The value of information was previously defined by the greatest increase of pay-outs associated with a transformation-cost-constrained policy. The only term in the criterion now measures the transformation costs of the policy. Due to the minimization of the Kullback-Leibler divergence −DKL (p(aik )kp0 (aik )), the criterion seeks to find a policy p(aik ), with a potentially unlimited conversion cost, that can achieve a specified upper bound on the expected pay-out P i k=1,2,... Eaik [Xk ] over a number of arm pulls. Likewise, the constraint term in (3) can be interpreted as follows: Constraint Term: Pay-Out Limit. The constraint bounds a policy’s range of the expected returns Eaik [Xki ] by a value ϕcost . As ϕcost approaches infinity, we seek the policy with the highest pay-out. For this to happen, the policy space must be searched finely. Exploration will therefore dominate. As ϕcost becomes zero, the constraint to find the policies with the best returns is relaxed. The policy space is searched coarsely, and exploitation dominates. For some value of ϕcost between these two extremes, exploitation becomes more prevalent than exploration. The actual value for this to occur will be application-dependent. The amount of transformation cost can have a profound impact on the resulting action-selection choices. If the cost is high, which corresponds to a policy of limited complexity, then the expected returns for a given policy may be low. This can imply that an agent may not be capable of executing enough actions to complete its objective. Alternatively, when the transformation cost is low, then the agent may therefore be capable of executing more actions than in the former situation. However, such a policy might not be parsimonious, and the agents may take unnecessary actions that can either negatively or neutrally impact the expected returns. For many problems, though, there is a clear region in which the trade-off between policy complexity and simplicity yields meaningful return improvements. 3.2. Value-of-Information Policies The process of decision-making using the value of information proceeds as follows. At the beginning, the agent finds itself in an environment where it is performing optimally, given the information constraints, according to the prior. The agent then experiences a change in the environment, which leads to a change in the rewards. As a consequence of this environmental change, the previous policy is no longer optimal and a new one needs to be found. This requires the maximization of the negative free-energy difference. It is known that the exponential-based Gibbs distribution maximizes the negative free-energy difference, ! i eqk /τk Xki i i i p(ak+1 ) = P , q = I , i k+1 qk /τk p(aik ) k (5) aj ∈A e | {z } i πk+1 = exponential component i where qk+1 is an estimate of the expected reward for the ith arm ai ∈ A. As before, superscripts on variables indicate the index for the particular arm that was pulled, while subscripts on variables indicate the iteration it was pulled. The update given in (5) can be viewed as a type of coordinate descent where the step-size is automatically chosen at each iteration. We consider the following modification of the Gibbs distribution in (5), which is a kind of mixture model. This was done to ensure that logarithmic regret could be easily obtained, ! Pk i γk Xki i e s=1 qs /τs i i , qk+1 p(ak+1 ) = (1−γk ) P + = I . Pk j |A| p(aik ) k s=1 qs /τs (6) aj ∈A e | {z } i πk+1 = exponential component + uniform component Entropy 2018, 20, 155 9 of 33 Algorithm 1: τk -changing Exploration: VoIMix Input: d: real number in the unit interval such that 0 < d < minj µ∗ −µj , for all aj ∈ A\a∗ . 1 2 3 4 5 Define the sequences γk and τk−1 for k = 1, 2, . . . by ! 5|A| γk = min 1, and either kd2 ! d(|A|/γk +1) 1 −1 log 1+ or τk = |A|/γk +1 2|A|/γk −d2 ! d+2d|A|/γk 1 τk−1 = log 1+ . 1+2|A|/γk 2|A|/γk Let q j = 0 for j = 1, . . . , |A|. for eachk = 1, 2, . . . do Pull an arm drawn from the distributions πk1 , . . ., where Pk i γk e s=1 qs /τs i + . πk+1 = (1−γk ) P Pk j qs /τs |A| s=1 e j a ∈A Let i be the index of the pulled arm and Xki the i , where obtained reward. Set qki = Xki Iki /πk+1 j i Ik = 1 and Ik = 0 for all j 6= i. Algorithm 2: τk -changing Exploration: AutoVoIMix Input: θ: real number in the range (0, 0.5). 1 Define the sequences γk and τk−1 for k = 1, 2, . . . by ! 5|A| 2θ log (k) and γk = min 1, k τk−1 = 2 3 4 5 ! log−θ (k)(|A|/γk +1) 1 log 1+ . |A|/γk +1 2|A|/γk Let q j = 0 for j = 1, . . . , |A|. for eachk = 1, 2, . . . do Pull an arm drawn from the distributions πk1 , . . ., where Pk i γk e s=1 qs /τs i + πk+1 = (1−γk ) P . Pk j qs /τs |A| s=1 e j a ∈A Let i be the index of the pulled arm and Xki the i obtained reward. Set qki = Xki Iki /πk+1 , where j i Ik = 1 and Ik = 0 for all j 6= i. Here, we have introduced a uniform-random exploration component from [13]. This mixture model is parameterized by the inverse temperature τk−1 and a mixing coefficient γk . For this update, Xsi represents the current estimate of the expected reward for arm ais , and qsi is a version of it that is transformed by the allocation rule p(aik+1 ) = πki and an indicator variable Iki . Observe that this transformed reward is modified by the parameters τ1 , . . . , τs , up to round s = k, and then aggregated across all previous arm pulls ai1 , . . . , ais , up to round s = k. This differs from previous variants of exponential-weighting algorithms, such as soft-max selection, where only the current value of τk modifies the sum of aggregated rewards for arms ai1 , . . . , ais , up to s = k. Both user-selectable parameters in (6) have the following functionality: τk : Inverse Temperature Term. This parameter can be interpreted as an inverse-temperature-like parameter. As τk−1 approaches zero, we arrive at a low-temperature thermodynamic system of particles. Such a collection particles will have low kinetic energy and hence their position will not vary greatly. In i the context of learning, this situation corresponds to policies πki , πk+1 , . . . that will not change much due to a low-exploration search. Indeed, the allocation rule will increasingly begin to favor the arm with the highest current reward estimate, with ties broken randomly. All other randomly selectable arms will be progressively ignored. On the other hand, as τk−1 goes off to infinity, we have a high-temperature system i of particles, which has a high kinetic energy. The arm-selection policy πk+1 can change drastically as a result. In the limit, all arms are pulled independently and uniformly at random. Values of the inverse-temperature parameter between these two extremes implement searches for arms that are a blend of exploration and exploitation. γk : Mixing Coefficient Term. This parameter can be viewed as a mixing coefficient for the model: it switches the preference between the exponential distribution component and the uniform distribution component. For values of the mixing coefficient converging to one, the exponential component is i increasingly ignored. The resulting arm-choice probability distributions πk+1 become uniform. The chance of any arm being selected is the same, regardless of the expected pay-out. This corresponds to a pure exploration strategy. As the mixing coefficient becomes zero, the influence of the exponential i term consequently rises. The values of πk+1 will hence begin dictate how frequently a given arm will be chosen based upon its energy, as described by the reward pay-out, and the inverse temperature. Depending on the value of the inverse-temperature parameter, τk−1 , the resulting search will either be exploration-intensive, exploitation-intensive, or somewhere in between. Entropy 2018, 20, 155 10 of 33 There are a few reasons why we considered this modification of the Gibbs distribution. The foremost reason relates to the temperature parameter: it is difficult to define a continuous parameter update schedule to go from near-perfect exploration to near-perfect exploitation in a finite number of iterations. A means of effectively switching between these two arm-play strategies, in a finite amount of time, is needed in practical situations. The above mixture model is one such way of achieving this goal without sacrificing optimal regret. In particular, it can be shown that the contribution of the Gibbs-distribution component is to force an exploitation of the best-paying arm much more quickly than what occurs for GreedyMix [13]. The above update therefore spends less time unnecessarily exploring the space, which increases the chance of pulling the arm associated with the best-paying slot machine early during learning. Another reason we utilize this form of the Gibbs distribution is to avoid a well-known exploration flaw. It can be demonstrated that, for many soft-max-type sampling schemes, the optimal arm may not be pulled enough for finite starting values of the inverse-temperature parameter. Sub-par returns may be frequently witnessed. Our model, in contrast, tends to produce sequences of arm pulls that search the action space well. This is due to the incorporation of the uniform distribution component, which acts as an extra exploration factor. The summation of previous expected rewards, versus just the current reward, also helps. It tends to smooth out the rewards from slot machines with high variance but sub-optimal means, thereby ensuring that they are played less often than better machines. To take advantage of this model, a principled means of choosing both the inverse-temperature and the mixing coefficient parameters is required. One way to do this is by employing a type of simulated annealing. Under this scheme, empirical convergence is realized by letting both parameters monotonically decrease to zero according to some cooling schedule. We have introduced two possible cooling schedules, in algorithms 1 and 2, which yield optimal and near-optimal regret for the bandit problem, respectively. These schedules are inspired from GreedyMix, but avoid factors that would lead to log-squared regret. For algorithm 1, named VoIMix, we set γk = Θ(1/k) and τk−1 = Θ(log(k)). Two cooling schedules are given for τk−1 in algorithm 1, both of which yield equivalent regret. It is important to note that algorithm 1 requires the user to supply a real-valued input parameter d, which is used to update both γk and τk−1 . Selecting initial values of this parameter can be difficult, in practice. It relies on knowledge about the slot machine average rewards and the global-best expected rewards, both of which are unknown to the gambler a priori. In algorithm 2, called AutoVoIMix, the parameter d from algorithm 1 has been removed and is implicitly calculated by way of another real-valued term θ, which is more straight-forward to specify. For values of θ near zero, algorithm 2 achieves nearly logarithmic regret. A great many arm pulls are needed for this to occur, though. Setting θ near 0.5 achieves log-squared regret. The slot-machine arms need to be pulled only a few times before this happens. The parameter update schedules given in these algorithms can be explained as follows. Initially, there is a long period of pure exploration. The length of this period is dictated by d, in VoIMix, and θ, for AutoVoIMix; higher values of either parameter increase the period. It also depends on the number of arms, with larger amounts of them leading to a lengthier period. The mixing coefficient, γk , is set to one during this time. The inverse-temperature term, τk−1 , is set to some value greater than zero. The exponential mixture component is i therefore largely ignored in favor of the uniform component. The arm-selection policy πk+1 will sample all of the arms in a uniform manner during this time. This period of exploration corresponds to the case where the inverse-temperature is infinite, if we had used a purely exponential formulation. As the number of arm pulls i increases, the weight of the exponential term on the policy πk+1 becomes greater. γk begins to decay toward zero at a rate determined by both the number of arms and the user-supplied parameter. This, in turn, causes τk−1 to decrease toward zero. Higher-paying arms are chosen more frequently, which is due to the increased importance of the exponential component. Eventually, only the arm with the best pay-out will be chosen. In appendix A, we show that these hybrid allocation rules did not come about arbitrarily. They were designed to yield logarithmic regret for the discrete, stochastic multi-armed bandit problem. In particular, we apply a variety of inequalities to systematically bound the expected value of the policy probabilities for sub-optimal arms (see proposition A.1). We eventually obtain that E[πki ] = O(1/k) for non-optimal arms aik at round k (see proposition A.2). It follows from this bound that the regret is O(log(k)) Entropy 2018, 20, 155 11 of 33 after k arm pulls. This is an improvement from the regret bound O(log2 (k)) obtained for soft-max-based selection when employing monotone inverse-temperature sequences [20]. Note that it is necessary to perform this regret analysis, as the results obtained by Auer et al. [13] do not automatically extend to our hybrid uniformand exponential-component update. In [13], the authors only considered a uniform-random exploration term that was driven by a monotone exploration parameter decrease schedule. For the distribution-free AutoVoIMix, we again systematically bound the expected value of the policy probabilities for sub-optimal arms to get that E[πki ] = O(log2θ (k)/k) (see proposition A.4). We obtain a regret of O(log(k)1+2θ ) after k arm pulls. This regret bound becomes increasingly equivalent to that of SoftMix selection when θ → 0.5 and approaches logarithmic regret as θ → 0. As before, it is necessary to perform this regret analysis. The weak bounds obtained by Auer et al. [24] for their distribution-free approaches were for the case where the exploration remained fixed across each arm pull. In our case, the hyperparameters are adjusted across a given simulation. As well, the exponential terms in their method and our own are different. In either VoIMix or AutoVoIMix, the exponential terms are a function of the previously accrued rewards, not just the immediately received reward. In appendix A, we also quantify the upper and lower probability bounds for choosing a sub-optimal slot machine arm (see proposition A.3). Such results are important, as they can be used to assess the quality of the exploration process at any arm pull past a given point during learning. Through these bounds, we are also able to demonstrate that the value of information has a much higher chance of pulling the optimal arm than other schemes, including that of Auer et al. [13]. This finding theoretically illustrates the benefit of combining a uniform-random component with the exponential component that arises naturally through optimizing the value-of-information criterion. Attempting to create a purely Gibbs-distribution-based exploration scheme that yields logarithmic regret is a difficult problem that has yet to be solved [21]. All of the results obtained for VoIMix and AutoVoIMix apply to the adversarial bandit algorithm without any modification [4]. This is due to the general assumption that we make on the reward distributions, which is outlined in appendix A. 3.2.1. Automated Hyperparameter Selection It is difficult, a priori, to arrive at good hyperparameter values d and θ. An option is to set and iteratively adapt the hyperparameters during the learning process, similar to what we did with the other terms. A heuristic that we have found to work well involves the use of the policy cross-entropy [19], " ! !# Pk i X e s=1 τs qs γk i Eπki − log (1−γk ) P =− πki log(πk+1 ). + Pk j |A| e s=1 τs qs j i a ∈A a ∈A The policy cross-entropy is a bounded measure of the agent’s learning rate: it can be viewed as the rate of change for probabilistic policies across arm pulls k and k + 1. If the arm-selection probabilities change by a great amount, then the cross-entropy will be near one. The acquisition of new behaviors is therefore prevalent, which typically precedes steep rises pay-outs across a few episodes. If arm-selection probabilities change only slightly, then the cross-entropy will be near zero. Existing behaviors are hence retained, leading to moderate or negligible improvements in rewards. Such connections suggest an efficient learning scheme. A low hyperparameter value should be used, in the beginning, to survey the entire action space. Reasonably high-performing arms be quickly uncovered when doing so. Eventually, the cross-entropy will dwindle and reach a near-steady-state value. Before this occurs, the hyperparameter should be gradually increased to promote a more thorough investigation of the policy space. This determination can be done using threshold tests. If no further improvement is possible over a reasonable period, then the hyperparameter should be steadily decreased toward its minimum valid value. We will use this scheme in some of our simulations. This scheme is conceptually supported by statistical thermodynamics. It is known that the entropy of an isolated system can only increase. This leads to the conclusion that entropy is maximized at thermal equilibrium. When the system is not isolated, the maximum entropy principle is replaced by the minimum free energy Entropy 2018, 20, 155 12 of 33 principle. In the context of the value of information, the Lagrangian is the free energy. This principle states that the Lagrangian cannot increase and therefore reaches its minimum value at thermal equilibrium. By annealing the hyperparameter, the system is always kept either at or near equilibrium. At zero temperature, the system reaches the minimum energy configuration. This corresponds to the situation where we have the best policy. 4. Simulations In the previous section, we provided an information-theoretic criterion for quantifying the expected increase in rewards associated with transformation-constrained policies. We also developed a means for optimizing this criterion, which provides a probabilistic mechanism for choosing a given arm based on its past history of expected rewards. In this section, we quantify the empirical performance of the criterion. The aims of our simulations are multi-fold. First, we want to assess the relative performance of our value-of-information-based exploration approach with existing ones. We would also like to gauge how well our results align with theoretical expectations. Secondly, we want to determine how the value-of-information search mechanism investigates the problem domain. Toward this end, we consider a series of difficult bandit problems. We demonstrate that the value-of-information-based VoIMix and AutoVoIMix can effectively address these problems. We first consider the case where the two exploration parameters of VoIMix and AutoVoIMix are fixed to constant values across the rounds. Four inverse-temperature parameter values are used to establish the baseline performance and illustrate the effects of a certain amount of weighted-random exploration on each problem. Three mixing coefficient values are used to understand how uniform-random search can aid in finding the best-paying arm by avoiding the sampling bias issue. We then compare these results to the case where the parameters are allowed to adapt according to the cooling schedules given in the previous section. This is done to highlight the regret improvement and empirically justify the two algorithms. Both VoIMix and AutoVoIMix rely on a hyperparameter that defines the length of a pure-exploration search period. From a theoretical standpoint, the value of this hyperparameter is immaterial, as all valid values will yield the same regret in the limit. Empirically, the hyperparameter value can impact the short-term pay-outs, as we show. This is an important caveat for investigators looking to apply the value of information to practical problems. Choosing good hyperparameter values can be difficult, though, even for AutoVoIMix. We therefore rely on a cross-entropy heuristic for tuning the values across each arm pull. We show that adjusting the hyperparameters yields lower regret and higher pay-outs than the fixed-value case. This indicates that either of our methods could be well suited for real-world bandit applications. We consider five other bandit algorithms for comparative purposes. Two of these algorithms, -greedy and soft-max, were chosen due not only to their popularity, but also their commonalities with the value of information. Stochastic, soft-max-based derivatives, such as pursuit methods and reinforcement comparison, are also employed. Both approaches rely on different search mechanisms, which offers experimental variety. Lastly, we consider the deterministic, tuned and un-tuned upper confidence bound approaches. Our simulation results reveal that the value of information outperforms these methods either in general or in specific instances. Explanations for this behavior are provided so that practitioners can determine when to potentially employ a given methodology. 4.1. Simulation Preliminaries The difficulty of the multi-armed bandit problem is fully characterized by two attributes: the distribution properties used to model the slot machines and the number of slot-machine arms. For our simulations, the rewards for each of the slot-machine arms were sampled from normal distributions. We originally considered a range of additional distributions, such as uniform, inverse normal, and triangular, but found that the results were highly similar. We therefore only report the findings for the normal distribution. The means of the slot-machine reward distributions were chosen uniformly from the unit interval and fixed for the duration of the simulation. We evaluate the algorithms for a reward distribution variance of σ 2 = 1, which is fixed. The value corresponds to standard deviations that are one-hundred percent of the interval Entropy 2018, 20, 155 13 of 33 containing the expected values. This yields a complex problem no matter the number of arms, as the reward distributions have a wide spread and overlap significantly. The agent must therefore judiciously sample each of the arms so that the one with the best average pay-out can be identified and consistently pulled. Another aspect that changes the difficulty of the problem is the number of slot machines. We evaluate the algorithms for three, ten, and thirty slot machine arms. Three arms leads to fairly easy tasks, while ten arms furnishes marginally difficult ones. Over thirty arms begins to provide tasks that are challenging. Originally, we considered greater numbers of slot machine arms. However, we found that their relative behaviors are mostly consistent with with the thirty-armed case. For the value of information, we assume that an initial policy is supplied. The results in the appendix indicate that regret is independent of the initial policy. Nevertheless, we specify that the initial policies have uniform probabilities, so as to not introduce bias that could lead to simpler problems. 4.2. Value of Information Results and Analysis 4.2.1. Fixed-Parameter Case We assess the performance of the value of information in two situations: when the parameters τk and k remain fixed across arm pulls during learning and when they are updated automatically. Short-term simulation results for the former case are presented in figure 4.1. Note that for all of the regret plots in this section, we divide the regret, at each round, by the number of arm pulls. Therefore, this modified regret should decrease toward zero as the number of rounds increases. Exploration Amount and Performance. Figure 4.1(a) contains probability simplex plots for VoIMix. Such plots highlight the arm-selection probability distributions of the iterates during the learning process for the three-armed bandit problem. They indicate how VoIMix is investigating the action space across all of the Monte Carlo trials and if it is focusing on sub-optimal arms. The optimal action for these three-armed bandit problems is associated with the bottom, left corner of the simplex. We hence expect to see a purple-colored region near this corner of the plot, which would indicate that the optimal action is selected frequently during learning. All of the other corners should have either red- or orange-colored regions, as these actions should not be consistently chosen after a series of initial arm pulls. The value of information operates under the premise that more information can lead to an increase in accrued rewards due to a more thorough exploration of the action space. The plots given in figure 4.1(a) show that the empirical results are aligned with these expectations, at least for the three-armed bandit case. For a fixed low inverse-temperature τk−1 , VoIMix is reserved in its search due to the effects of the information constraint on the prior. The iterates briefly explore the two sub-optimal arms on the top and right sides of the simplex before congregating on the left half of the simplex. The distribution for the left-hand plot of figure 4.1(a) indicates that the iterates quickly converge to the optimal arm. For high τk−1 values, larger portions of the simplex are investigated before converging to the optimal arm. Between τk−1 ≈ 0.15 and τk−1 ≈ 1.0, the simplex distribution does not change greatly for this problem. Figure 4.1 also contains plots of the average regret as a function of time, the average reward, and the cumulative chance that the optimal arm is chosen. The first two criteria summarize how the methods handled the problem. The third criterion is relevant to assess for applications in which minimizing the number of sub-optimal arm plays is crucial. The averages reported in these plots were derived from a thousand Monte Carlo simulations so as to eliminate the bias of any overly poor or good runs. They are also a function of different parameter choices that correspond to varying amounts of exploration. Figures 4.1(b) and (c) highlight the effects of the inverse-temperature parameter τk−1 on the performance. As τk−1 decreases, the episode-averaged regret tends to drop rapidly during the first few arm pulls. Likewise, the average reward increases more rapidly. The effect becomes much more pronounced as the number of bandit arms is small. Both occurrences are a product of quickly finding either the best-paying arm or well-paying arms. As the number of arms increases, there is a reversal in this trend: larger values of τk−1 begin to yield better long-term results due to the increased exploration that is needed to sample all of the arms. We present additional results in tables B.1(a) and (b) of the online appendix. Entropy 2018, 20, 155 14 of 33 �-����� ������ ������� ������� �/���� ���� �-����� ������ ������� ������� �/���� ��� � ��� �-����� ������ ������� ������� �/���� ��� ��� ��� ��� �-����� ������ ������� ������� �/���� ��� �� (a) 50. 100. 150. 200. Number of Arm Pulls 250. Avg. Regret Value of Inf. Exploration, 10-Armed Bandit Average Regret Performance 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. Value of Inf. Exploration, 30-Armed Bandit Average Regret Performance Avg. Regret 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Negligible Exploration: 1/tau=0.01 (b) 250. 50. 100. 150. 200. Number of Arm Pulls 250. Value of Inf. Exploration, 10-Armed Bandit Average Reward Performance 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. Value of Inf. Exploration, 30-Armed Bandit Average Reward Performance 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Low Exploration: 1/tau=0.1 250. Cumulative Probability 0.8 0.6 0.4 0.2 0. 50. 250. Value of Inf. Exploration, 10-Armed Bandit Average Optimal Arm Selection Prob. 0.6 0.4 0.2 0. 50. 100. 150. 200. Number of Arm Pulls 250. Value of Inf. Exploration, 30-Armed Bandit Average Optimal Arm Selection Prob. 0.4 0.3 0.2 0.1 0. 50. Moderate Exploration: 1/tau=0.5 (c) 100. 150. 200. Number of Arm Pulls Cumulative Probability 0. Value of Inf. Exploration, 3-Armed Bandit Average Optimal Arm Selection Prob. Cumulative Probability 0.2 1. 0.75 0.5 0.25 0. Avg. Reward 0.4 Avg. Reward 0.6 Value of Inf. Exploration, 3-Armed Bandit Average Reward Performance Avg. Reward Avg. Regret Value of Inf. Exploration, 3-Armed Bandit Average Regret Performance 100. 150. 200. Number of Arm Pulls 250. High Exploration: 1/tau=1.0 (d) Figure 4.1: Results for the value-of-information-based VoIMix for the fixed-parameter case. The plots in (a) highlight the regions in the action probability simplex that are visited during the simulations for the three-armed bandit problem. Cooler colors (purple, blue and green) correspond to probability triples that are encountered often during learning. Cooler Warmer (yellow, orange, and red) correspond to probability triples that are not seen often. The correct action is the one associated with the bottom, left corner of the simplex. The simplex plots were produced for fixed parameter values and averaged across independent simulations. The plots in (b), (c), and (d) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. The red, orange, green, and blue curves correspond to fixed inverse temperatures of τ −1 = 0.01, 0.1, 0.5, and 1.0, respectively. Figure 4.1(d) captures the cumulative probability of choosing the optimal arm. These plots show that the fixed-parameter case of VoIMix was unable to reliably find the best-paying arm with a high probability. As the number of arms increased, the short-term cumulative probability dropped, regardless of the amount of exploration τk−1 that was used. It can be seen, however, that higher amounts of exploration more frequently uncover the optimal arm. This occurrence aligns with the preceding regret and reward results. The inverse-temperature parameter τk−1 is not the only way to control the search amount in VoIMix. The mixing coefficient γk also dictates how finely the action space will be investigated. For the simulations in figure 4.1, we assumed that the mixing coefficient was 0.1. One in ten arm pulls would therefore be random. Setting it higher, for these problems, often led to increasingly more exploration than was necessary. The rewards dropped and the regret was inflated, the results of which are presented in table B.1(c). Setting the mixing coefficient lower also impacted the results, as the pay-out became worse. Such results are given in table B.1(d). Entropy 2018, 20, 155 15 of 33 �-����� ������ ������� ������� �/���� �������� � ��� �-����� ������ ������� ����������� �/���� �������� ��� ��� ��� �� (a) 1. 0.5 0. 5000. 10 000. Number of Arm Pulls 15 000. 1. 0.5 0. 5000. 10 000. Number of Arm Pulls Negligible Exploration: 1/tau=0.01 1. 0. 5000. 10 000. Number of Arm Pulls 15 000. 15 000. 2. 1. 0. 5000. 10 000. Number of Arm Pulls Low Exploration: 1/tau=0.1 15 000. 5000. 10 000. Number of Arm Pulls 15 000. Value of Inf. Exploration, 10-Armed Bandit Average Optimal Arm Selection Prob. 1. 0.8 0.6 0.4 0.2 0. 5000. 10 000. Number of Arm Pulls 15 000. Value of Inf. Exploration, 30-Armed Bandit Average Optimal Arm Selection Prob. 1. 0.8 0.6 0.4 0.2 0. Moderate Exploration: 1/tau=0.5 AutoVoIMix Exploration (c) Cumulative Probability Avg. Reward 2. VoIMix Exploration (b) 15 000. Value of Inf. Exploration, 30-Armed Bandit Average Reward Performance Avg. Regret Soft-Max Exploration, 30-Armed Bandit Average Regret Performance 5000. 10 000. Number of Arm Pulls Value of Inf. Exploration, 10-Armed Bandit Average Reward Performance Cumulative Probability Avg. Regret Value of Inf. Exploration, 10-Armed Bandit Average Regret Performance 0. Value of Inf. Exploration, 3-Armed Bandit Average Optimal Arm Selection Prob. 1. 0.8 0.6 0.4 0.2 0. Cumulative Probability 15 000. 1. 0.5 Avg. Reward 5000. 10 000. Number of Arm Pulls Value of Inf. Exploration, 3-Armed Bandit Average Reward Performance 1.5 Avg. Reward Avg. Regret Value of Inf. Exploration, 3-Armed Bandit Average Regret Performance 1. 0.8 0.6 0.4 0.2 0. 5000. 10 000. Number of Arm Pulls 15 000. High Exploration: 1/tau=1.0 (d) Figure 4.2: Long-term results for the value-of-information-based VoIMix and AutoVoIMix for the fixed and variable parameter case. The hyperparameters d and θ are fixed for each method. The plots in (a) highlight the regions in the action probability simplex that are visited during the simulations for the three-armed bandit problem. The plots in (b), (c), and (d) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. In these plots, the purple curves correspond to VoIMix where the inverse-temperature and mixing parameters are allowed to vary throughout the simulation, according to the cooling schedule given in the previous section. The dark blue curves correspond to AutoVoIMix where the inverse-temperature and mixing coefficient are allowed to vary throughout the simulation, according to the cooling schedule given in the previous section. The red, orange, green, and blue curves correspond to fixed inverse temperatures of τ −1 = 0.01, 0.1, 0.5, and 1.0, respectively. 4.2.2. Adaptive-Parameter Case The results given above are for the case where the parameter values were constant throughout the simulation. This is useful for understanding the algorithmic behaviors in different scenarios. Leaving the parameters fixed can, however, lead to linear regret in the worst case. It is therefore not indicative of the true capabilities of VoIMix, which is known to have logarithmic regret. We now consider VoIMix and AutoVoIMix when the temperature changes across each arm pull. We also highlight the effects of the hyperparameters and show the performance improvements that can be obtained when choosing them automatically. Exploration Amount and Performance. In figure 4.2, we provide results for both VoIMix and AutoVoIMix over a longer number of iterations. These results are for the cases where τk−1 and γk are either fixed or automatically tuned according to the cooling schedules given in the previous section. Entropy 2018, 20, 155 16 of 33 Plots of the probability simplexes for the tuned versions of VoIMix and AutoVoIMix are given in figure 4.2(a). As before, these plots highlight the distribution of iterates during the learning process. The iterates should converge to the bottom, left corner of the simplex, which is the optimal action for the three-armed bandit case. This occurs for VoIMix: after about 250 to 750 arm pulls, there is high chance selecting the optimal arm. The blue- and green-colored region in the bottom, left corner of the simplex plot corroborates this claim. The dark-purple-colored region in the left, bottom corner of the simplex indicates that the probability of selecting the optimal arm becomes near-unity and stays that way throughout a majority of the learning process. The yellowand orange-colored portions of the plot indicate that VoIMix heavily considered the arm associated with the bottom-right corner of the simplex early during learning. This was the second-best paying arm in all of our Monte Carlo trials. Different results were observed for AutoVoIMix. The corresponding probability simplex plot in figure 4.2(a) captures that a large portion of the iterates cluster near the middle of the simplex. Each arm has a near-equiprobable chance of being chosen. This region of yellow and orange colors arises from the iterates for the first 5000 arm pulls, which is when a majority of the exploration is performed. Eventually, the optimal arm was identified. The iterates traced an almost direct path from the middle of the simplex to the bottom, left corner. This path has a slightly more green color than the paths to the other two corners, suggesting that arm probabilities from this part of the simplex were consistently selected later in the learning process. The probability for choosing the optimal arm was high near the end of learning, which led to the purple-colored region in this corner. As shown in figure 4.2(b), the regret for the adaptive-parameter case typically improved beyond the results of the fixed-parameter case after several hundred to thousand iterations. The rate at which the regret dropped depended on the number of slot-machine arms. Such events signaled that a high-paying arm was reliably uncovered and consistently chosen with a high probability, which can be gleaned from figure 4.2(d). The total rewards also jumped, after a few thousand arm pulls, compared to the best results for the fixed-parameter case. This can be seen in figure 4.2(c). This event coincided with the end of the perfect exploration period and a decay of the inverse-temperature parameter and mixing coefficient. Quantitative comparisons showing that the variable-parameter case yielded better performance than the fixed case are provided in table B.2(a) in the appendix. A drawback of VoIMix is that setting the single hyperparameter can prove difficult. This is because it relies on knowledge of the reward distributions to which gamblers are not privy. We introduced AutoVoIMix as a way to circumvent this issue. However, AutoVoIMix tends to choose subpar arms compared to the non-fixed-parameter version of VoIMix, which can be seen in figure 4.2(d). On average, the regret and total rewards are worse, compared to VoIMix, when relying on parameter annealing, as indicated in figures 4.2(b) and 4.2(c). Quantitative comparisons between the fixed-parameter VoIMix case and variable-parameter AutoVoIMix case are provided in table B.2(b) in the appendix. Hyperparameter Values and Performance. Both VoIMix and AutoVoIMix have a single hyperparameter that must be chosen by the investigator. For VoIMix, we set hyperparameter value dk to halfway between zero and the smallest mean reward difference. For AutoVoIMix, we also set the hyperparameter θk in the middle of the valid range. This offered a reasonable period for exploration and hence yielded good performance. Reducing dk or increasing θk typically shortened the exploration phase, which led to one of two outcomes. One possibility was that the optimal arm was sampled frequently enough for it to be consistently selected after the main exploration phase. The regret was reduced compared to the results shown here. This occurred for bandits with a small number of arms. The other possibility, which occurred frequently, was that an unnecessary amount of arm exploration was performed, especially when dealing with only a few slot-machine arms. The optimal arm could be reliably identified in this case. However, the regret was penalized due to the agent not finding and sticking with the optimal arm sooner. This is highlighted in tables B.3(a) and B.4(a) in the appendix. Raising dk in VoIMix or reducing θk in AutoVoIMix had a similar effect as this latter case. It led to lengthier periods of exploration. Results are provided in tables B.3(b) and B.4(b) in the appendix. We observed that VoIMix consistently outperformed AutoVoIMix, regardless of the hyperparameter values. Entropy 2018, 20, 155 17 of 33 In the previous section, we introduced a cross-entropy-based scheme for adapting the hyperparameters. When using this scheme, the total regret and accrued pay-out for VoIMix improved compared to the situation where the best-performing hyperparameter value was fixed a priori. This is illustrated in table B.5(a) in the appendix. For AutoVoIMix, we witnessed a similar behavior; results are provided in table B.5(b) in the appendix. In either case, we increased the hyperparameter value by twenty percent, over a window of thirty episodes, every time the cross-entropy fell below one third. Once the cross-entropy changed by no more than ten percent across fifty episodes, we decreased the hyperparameter value by thirty percent every twenty episodes. 4.2.3. Fixed- and Variable-Parameter Case Discussions Our simulations have demonstrated that VoIMix and AutoVoIMix are capable of effectively addressing the discrete multi-armed bandit problem. We now discuss aspects of these methods’ results. Exploration Amount Discussions. We considered two possible instances of VoIMix: one where its parameters were fixed another where they varied. Our simulations showed that the latter outperformed the former. This was because a constant amount of exploration might explore either too greatly or not thoroughly enough to achieve good performance. Without the optimal annealing schedule that we provided, substantial trial and error testing would be needed to find reasonable exploration amounts for practical problems. Our simulation results highlight that the automatically tuned VoIMix outperforms the automatically tuned AutoVoIMix for these bandit problems. This was also witnessed when adjusting the methods’ hyperparameters according to the cross-entropy heuristic. Such results align with our theoretical analyses. AutoVoIMix can only approach logarithmic regret when its hyperparameter value θk tends toward zero. VoIMix can achieve logarithmic regret in the limit, no matter the value of its hyperparameter dk in the valid range. We have additionally provided distribution plots of the arm-selection probabilities overlaid on the simplex. These plots highlighted that the best-paying arm can be uncovered when the temperature τk−1 is either fixed or automatically adjusted. We only considered simplex distribution plots for the three-armed bandit problem. It is not possible to produce exact plots of the probability simplex for bandit problems with more arms, since those probability vectors often cannot be losslessly embedded in a three-dimensional domain. When manually lowering the temperature, the iterates became more focused and targeted the optimal arm more frequently. This is because the temperature value ensures that only the best-paying arm is chosen with a high probability. When raising the temperature, the search process near-uniformly considered a larger portion of the simplex. The chance of choosing an arm approaches that of any other arm. Even when considering τk−1 = 1.0, which represents a high amount of policy change, the optimal arm could still be uncovered about half of the time. The corresponding simplex plot shows that the iterates do routinely pull the optimal arm after a few thousand plays. For our simulations, we sorted the arm rewards so that the best-playing arm is in the bottom-left corner of the simplex and the worst playing arm is in the top-middle corner. We thus expected that the iterates would tend to cluster on the bottom half of the simplex. However, the worst-paying arm appears to be played just as frequently as the second-best paying arm. Additional analysis revealed that this was due to the high variance of the reward distributions: it was often possible for the worst arm to have a better rewards over many arm pulls than the second-best arm. Both arms would therefore have a high probability of being chosen across multiple iterations. The choice of one of these arms over the other changed frequently, which is why the search process near-uniformly investigated these regions of the simplex values of τk−1 away from one. When automatically tuning the inverse temperature according to VoIMix, the resulting simplex plot indicates that it quickly starts to play the optimal arm. Only the two best-paying arms are routinely sampled, which did not happen in the fixed-parameter case. This materialized due to a steep drop in the exploration rate during training, which would emphasize the selection of arms with high expected rewards. We witnessed this behavior for problems with many more arms. The tuned version of VoIMix will thus likely perform well for real-world bandit problems. It automatically modifies the amount of search exploration in proportion to the intrinsic complexity of the problem. This is a major advantage compared to manually choosing the exploration amount. Entropy 2018, 20, 155 18 of 33 For the tuned AutoVoIMix, the center regions of the simplex are more thoroughly explored before the optimal arm is consistently pulled. Such investigations may yield little useful insights about the slot-machine distributions after a few hundred to thousand arm pulls. Many arm pulls will hence be required before the regret can be decreased. This can prove problematic for application domains where the physical time and effort needed to supply rewards to the agent is high; the utility of drug-based treatments in clinical trials is one such example. Both VoIMix and AutoVoIMix can achieve the same long-term rewards and appear to reliably identify the optimal arm. However, VoIMix does so at a much faster rate, leading to a better short-term regret. If practitioners can rely on auxiliary knowledge about their bandit problems to choose good hyperparameter values, then VoIMix should be favored compared to AutoVoIMix. Otherwise, AutoVoIMix should be utilized, with the understanding that the ease of choosing its hyperparameter is traded off against a, potentially, poor initial regret. Hyperparameter Value Discussions. An issue faced when using many multi-armed bandit algorithms, including VoIMix and AutoVoIMix, is the proper setting of hyperparameter values by investigators. Such hyperparameters often have a great impact on the corresponding results. They are also difficult to set so that the corresponding regret bounds hold. To help avoid choosing poor values, we provided a semi-automated scheme of adapting the hyperparameters dk and θk based upon the policy cross-entropy This led to improved empirical performance. In the case of VoIMix, this improvement occurred because the hyperparameter dk was often close to the upper bound of the average reward difference minj µ∗ − µj . Learning happens very quickly over the first few arm pulls compared to when the values of dk are close to zero. For AutoVoIMix, θk was set to θk ≈ 0.5, which likewise led to a quick and effective survey of the space. The value of θk was then iteratively decreased toward zero to promote a more judicious sampling of arms that can lead to near-logarithmic regret in the limit. The reason why this hyperparameter adjustment approach worked is because the rate of reward improvement is connected with the policy cross-entropy. The rate of cost reduction depends on both the current inverse temperature and mixing coefficient values and hence the hyperparameter value. Any changes made to the hyperparameter cause a deformation of the system’s free energy from the Shannon information term in the Lagrangian, when the inverse temperature is zero, to the distortion term. It is therefore obtaining the global minimizer of the value of information at low values of the inverse temperature and tracking the evolution of this minimum as the inverse temperature parameter is increased by way of the hyperparameter. Lower hyperparameter values are considered to be better for AutoVoIMix. As the hyperparameter decreases toward zero, so does the power term of the logarithm that defines both the mixing coefficient and the inverse temperature. This causes the regret to eventually approach optimality. A great many arm pulls are needed for this to occur, though, unlike in VoIMix. Raising the hyperparameter value reduces the number of pulls needed for the regret to become optimal. The regret becomes log-squared, however, which leads to worse behaviors than for the baseline case. The expected theoretical performance should be no better than soft-max selection in this situation. Empirically, AutoVoIMix manages to accrue a higher total pay-out than the soft-max-based SoftMix in such instances, as we will show in the next subsection. This could be attributed to the fact that the AutoVoIMix regret has a smaller-magnitude constant factor. The increase in performance could also be due to the additional exploration factor in the probability mass assignment. 4.3. Methodological Comparisons To provide context for these results, we have compared the value of information to other commonly used approaches for addressing the bandit problem. These include epsilon-greedy, soft-max, pursuit, and reinforcement-comparison exploration, all of which are stochastic. We also consider the deterministic upper-confidence-bound method. As before, the results given are averaged over a thousand Monte Carlo trials. We also provide comparisons of the value of information against state-of-the-art techniques including the minimum empirical divergence algorithm [11,12], Thompson sampling [2,10], and various extensions of the upper-confidence-bound method [8,9]. Our results indicate that the value of information is competitive against these techniques, as it often supplies similar regret. It also pulls sub-optimal arms as infrequently as these Entropy 2018, 20, 155 19 of 33 Epsilon-Greedy Exp., 10-Armed Bandit Average Regret Performance 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. 50. 100. 150. 200. Number of Arm Pulls Negligible Exploration: eps=0.01 1. 0.75 0.5 0.25 0. 50. 100. 150. 200. Number of Arm Pulls 250. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Low Exploration: eps=0.1 Epsilon-Greedy Exp., 3-Armed Bandit Average Optimal Arm Selection Prob. 50. 250. 1. 0.8 0.6 0.4 0.2 0. 50. (c) 100. 150. 200. Number of Arm Pulls 250. 100. 150. 200. Number of Arm Pulls 250. Epsilon-Greedy Exp., 30-Armed Bandit Average Optimal Arm Selection Prob. 250. 0.8 0.6 0.4 0.2 0. 50. Moderate Exploration: eps=0.5 VoIMix Exploration UCB Exploration (b) 1. 0.8 0.6 0.4 0.2 0. Epsilon-Greedy Exp., 10-Armed Bandit Average Optimal Arm Selection Prob. Epsilon-Greedy Exp., 30-Armed Bandit Average Reward Performance Avg. Regret Epsilon-Greedy Exp., 30-Armed Bandit Average Regret Performance 2. 1.5 1. 0.5 0. �� Epsilon-Greedy Exp., 10-Armed Bandit Average Reward Performance Avg. Regret 1. ��� Epsilon-Greedy Exp., 3-Armed Bandit Average Reward Performance 250. 1.5 ��� Avg. Reward 100. 150. 200. Number of Arm Pulls (a) Avg. Reward 50. ��� Avg. Reward Epsilon-Greedy Exp., 3-Armed Bandit Average Regret Performance Avg. Regret 1. 0.8 0.6 0.4 0.2 0. ��� �-����� ������ ������� �������-������� ���� ��� Cumulative Probability � �-����� ������ ������� �������-������� ���� ��� Cumulative Probability �-����� ������ ������� �������-������� ���� ��� Cumulative Probability �-����� ������ ������� �������-������� ���� ���� 100. 150. 200. Number of Arm Pulls 250. High Exploration: eps=1.0 (d) Figure 4.3: Results for the -greedy-based GreedyMix for the fixed-parameter case. The plots in (a) highlight the regions in the action probability simplex that are visited during the simulations for the three-armed bandit problem. The correct action is the one associated with the bottom, left corner of the simplex. The simplex plots were produced for fixed parameter values and averaged across independent simulations. The plots in (b), (c), and (d) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. The red, orange, green, and blue curves correspond to fixed exploration values of  = 0.01, 0.1, 0.5, and 1.0, respectively. alternate schemes. Due to page constraints, the corresponding simulations and discussions are provided in an online appendix. 4.3.1. Stochastic Methods: -Greedy and Soft-Max The -greedy-based GreedyMix and soft-max-based SoftMix [20] are two of the more popular heuristic approaches for solving multi-armed bandits. GreedyMix is based upon the principle of taking random actions and random times and greedily choosing the best-paying arm in all other instances. SoftMix relies on a weighted-random approach to arm selection, similar to VoIMix and AutoVoIMix. That is, it weights each of the arms according to their expected pay-outs and stochastically chooses an arm using those weights. Results for GreedyMix and SoftMix are given in figures 4.3 and 4.4, respectively. Despite only achieving a log-squared regret, SoftMix does well in the short term due to its weighted-random style of search. It accounts for the expected reward when deciding whether or not to explore new arms. Accurate means for well-paying arms are also created, which aids in choices that will initially reduce regret and improve rewards by a substantial amount; this can be seen in figures 4.3(b) and 4.3(c). GreedyMix, in contrast, merely selects arbitrary arms, regardless of their quality. This haphazard selection can impede exploration early in the learning process, as sub-optimal arms may be frequently chosen. Poorer Entropy 2018, 20, 155 20 of 33 250. Soft-Max Exploration, 10-Armed Bandit Average Regret Performance Avg. Regret 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. 50. 100. 150. 200. Number of Arm Pulls Negligible Exploration: 1/tau=0.01 Avg. Reward 1. 0.75 0.5 0.25 0. 50. 100. 150. 200. Number of Arm Pulls 250. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Low Exploration: 1/tau=0.1 1. 0.8 0.6 0.4 0.2 0. Soft-Max Exploration, 3-Armed Bandit Average Optimal Arm Selection Prob. 50. (c) 100. 150. 200. Number of Arm Pulls 250. Soft-Max Exploration, 10-Armed Bandit Average Optimal Arm Selection Prob. 250. 1. 0.8 0.6 0.4 0.2 0. 50. 100. 150. 200. Number of Arm Pulls 250. Soft-Max Exploration, 30-Armed Bandit Average Optimal Arm Selection Prob. 250. 0.8 0.6 0.4 0.2 0. 50. Moderate Exploration: 1/tau=0.5 VoIMix Exploration UCB Exploration (b) �� Soft-Max Exploration, 30-Armed Bandit Average Reward Performance Avg. Regret Soft-Max Exploration, 30-Armed Bandit Average Regret Performance 2. 1.5 1. 0.5 0. ��� Soft-Max Exploration, 10-Armed Bandit Average Reward Performance 2. 1.5 ��� Avg. Reward 100. 150. 200. Number of Arm Pulls (a) Avg. Reward 50. ��� Soft-Max Exploration, 3-Armed Bandit Average Reward Performance Avg. Regret Soft-Max Exploration, 3-Armed Bandit Average Regret Performance 1. 0.75 0.5 0.25 0. ��� �-����� ������ ������� ����-���� �/���� ��� Cumulative Probability � �-����� ������ ������� ����-���� �/���� ��� Cumulative Probability �-����� ������ ������� ����-���� �/���� ��� Cumulative Probability �-����� ������ ������� ����-���� �/���� ���� 100. 150. 200. Number of Arm Pulls 250. High Exploration: 1/tau=1.0 (d) Figure 4.4: Results for the soft-max-based SoftMix for the fixed-parameter case. The plots in (a) highlight the regions in the action probability simplex that are visited during the simulations for the three-armed bandit problem. The correct action is the one associated with the bottom, left corner of the simplex. The simplex plots were produced for fixed parameter values and averaged across independent simulations. The plots in (b), (c), and (d) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. The red, orange, green, and blue curves correspond to fixed inverse temperatures of τ −1 = 0.01, 0.1, 0.5, and 1.0, respectively. results than SoftMix are usually returned. This can be seen when comparing the plots from figures 4.3(b)–(d) to those from figures 4.4(b)–(d). Figures 4.3(a) and 4.4(a) illustrate that GreedyMix and SoftMix yield probability distributions that resemble those for the fixed-parameter VoIMix. Low amounts of exploration perform best for the three-armed bandit problem. The iterates tend to congregate in bottom-left corner of the simplex, which corresponds to the best-paying arm. The only exception is the right-most simplex plot in figure 4.3(a). The iterates continuously explore the entire simplex, since a new action is randomly chosen at each step. Compared to VoIMix, both SoftMix and GreedyMix perform worse. GreedyMix will sometimes uniformly sample sub-optimal arms during the exploration phase. Its regret for the best-performing policy is thus higher, while the rewards are also reduced compared to the best results from VoIMix and AutoVoIMix. This is highlighted in figures 4.3(b)–(d) for VoIMix in the case where both the parameter and hyperparameter are adjusted across arm pulls. SoftMix also has issues. It has a habit of oversampling sub-optimal arms, which was caused by improperly estimated average rewards. Both the regret and total pay-out are worse, respectively, than VoIMix and AutoVoIMix. This is captured in figures 4.4(b)–(d). Entropy 2018, 20, 155 50. 100. 150. 200. Number of Arm Pulls 250. 1. 0.5 0. 100. 150. 200. Number of Arm Pulls Negligible Exploration: beta=0.01 50. 100. 150. 200. Number of Arm Pulls 250. 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Low Exploration: beta=0.1 250. 1. 0.8 0.6 0.4 0.2 0. 0.8 Cumulative Probability 50. (c) 100. 150. 200. Number of Arm Pulls 50. 100. 150. 200. Number of Arm Pulls 250. Pursuit Exploration, 30-Armed Bandit Average Optimal Arm Selection Prob. 0.6 0.4 0.2 0. 250. Pursuit Exploration, 10-Armed Bandit Average Optimal Arm Selection Prob. 50. Moderate Exploration: beta=0.5 VoIMix Exploration UCB Exploration (b) 250. Pursuit Exploration, 10-Armed Bandit Average Reward Performance Avg. Regret 50. 250. 1.5 Pursuit Exploration, 30-Armed Bandit Average Regret Performance 2. 1.5 1. 0.5 0. 100. 150. 200. Number of Arm Pulls Pursuit Exploration, 3-Armed Bandit Average Optimal Arm Selection Prob. Cumulative Probability 1. 0.5 50. Pursuit Exploration, 10-Armed Bandit Average Reward Performance 1. 0.8 0.6 0.4 0.2 0. Cumulative Probability 250. Avg. Reward 100. 150. 200. Number of Arm Pulls Avg. Reward Avg. Regret 50. 1. 0.75 0.5 0.25 0. Pursuit Exploration, 10-Armed Bandit Average Regret Performance 1.5 0. Pursuit Exploration, 3-Armed Bandit Average Reward Performance Avg. Reward 2. Pursuit Exploration, 3-Armed Bandit Average Regret Performance Avg. Regret 1. 0.8 0.6 0.4 0.2 0. 21 of 33 100. 150. 200. Number of Arm Pulls 250. High Exploration: beta=0.9 (d) Figure 4.5: Results for the pursuit method for the fixed-parameter case. The plots in (a), (b), and (c) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. The red, orange, green, and blue curves correspond to fixed values of the policy learning rate β = 0.01, 0.1, 0.5, and 0.9, respectively. Comparisons against the tuned version of VoIMix (purple curve), where τk−1 and dk change across each arm pull, along with the upper confidence bound method (dark blue curve) are provided. 4.3.2. Stochastic Methods: Pursuit and Reinforcement Comparison The aforementioned stochastic exploration strategies are not the only ones available for addressing the multi-armed bandit problem. There are several others that can be applied, and we evaluate two of these, reinforcement comparison [1] and pursuit algorithms [38,39], both of which are nonparametric. The methods that we have considered thus far are based on choosing arms according to their estimated expected value. Pursuit algorithms operate in a different fashion. Initially, they assign uniform probabilities to each arm. At each turn, more probability mass is given to the arm with the highest expected reward. Mass is removed from other arms, regardless of their estimated average rewards, at a rate determined by a learning factor. It has been demonstrated that such a scheme will converge, in a probably-approximately-correct sense, to the globally optimal policy. No formal regret bounds are currently available, though. Results for the pursuit method are given in figure 4.5. Due to the way that exploration is performed, higher learning rates yielded better results than lower learning rates. Regardless of the learning rate, though, it is apparent that VoIMix produced sequences of arm pulls with better cumulative rewards and hence better regret. Likewise, it can be inferred, from figures 4.3 and 4.4, that both GreedyMix and SoftMix outperformed the pursuit method in the short term. Reinforcement comparison methods are similar to pursuit methods, in that they maintain distributions over actions that are not directly derived from the empirical means. The way that they update these distributions sidesteps the biased-sampling issue. In particular, reinforcement comparison employs a two-step process. First, an estimate of the average pay-out for all slot machines is constructed. Second, more probability mass is given to those machines whose rewards exceed the overall average; machines that underperform have mass removed. The assignment of probability mass is based upon a Gibbs distribution. Previous analyses have revealed that this two-step process is guaranteed to converge to the optimal policy. However, no regret bounds have been made available as of yet. Figure 4.6 presents the findings for reinforcement comparison. The plots show that this type of approach trailed modestly behind the tuned version of VoIMix. The time-averaged regret for reinforcement comparison is relatively high in the beginning and catches up with that from VoIMix. This lag is caused by the need to reliably Entropy 2018, 20, 155 22 of 33 Avg. Regret 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. 2. 1.5 1. 0.5 0. Avg. Regret Rein. Comp. Exploration, 30-Armed Bandit Average Regret Performance 50. 100. 150. 200. Number of Arm Pulls Negligible Exploration: beta=0.01 250. 100. 150. 200. Number of Arm Pulls 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls 250. Rein. Comp. Exploration, 30-Armed Bandit Average Reward Performance 2. 1.5 1. 0.5 0. 50. 100. 150. 200. Number of Arm Pulls Low Exploration: beta=0.1 250. 50. (c) 100. 150. 200. Number of Arm Pulls 250. Rein. Comp. Exploration, 10-Armed Bandit Average Optimal Arm Selection Prob. 1. 0.8 0.6 0.4 0.2 0. 50. 100. 150. 200. Number of Arm Pulls 250. Rein. Comp. Exploration, 30-Armed Bandit Average Optimal Arm Selection Prob. 0.8 0.6 0.4 0.2 0. 50. Moderate Exploration: beta=0.5 VoIMix Exploration UCB Exploration (b) 250. Cumulative Probability Avg. Reward 50. Rein. Comp. Exploration, 10-Armed Bandit Average Reward Performance Cumulative Probability 250. Rein. Comp. Exploration, 3-Armed Bandit Average Optimal Arm Selection Prob. 1. 0.8 0.6 0.4 0.2 0. Cumulative Probability 100. 150. 200. Number of Arm Pulls 1. 0.75 0.5 0.25 0. Avg. Reward 50. Rein. Comp. Exploration, 10-Armed Bandit Average Regret Performance Rein. Comp. Exploration, 3-Armed Bandit Average Reward Performance Avg. Reward Avg. Regret Rein. Comp. Exploration, 3-Armed Bandit Average Regret Performance 1. 0.8 0.6 0.4 0.2 0. 100. 150. 200. Number of Arm Pulls 250. High Exploration: beta=0.9 (d) Figure 4.6: Results for the soft-max-based reinforcement comparison for the fixed-parameter case. The plots in (a), (b), and (c) give the regret, reward, and optimal-arm selection cumulative probability for the three-, ten-, and thirty-armed bandit problem when the distribution variance is σ 2 = 1. A value of α = 0.5 was used for updating the mean reward at each iteration. The red, orange, green, and blue curves correspond to fixed values of the learning rate β = 0.01, 0.1, 0.5, and 0.9, respectively. Comparisons against the tuned version of VoIMix (purple curve), where τk−1 and dk change across each arm pull, along with the upper confidence bound method (dark blue curve) are provided. estimate the expected reward for all machines. Over many episodes, the regret from VoIMix will be almost zero, as we showed in figure 4.2. The regret for reinforcement comparison stalls after a few hundred episodes; it does not appear to reach approximately zero regret on the same time scale as VoIMix. 4.3.3. Deterministic Methods: Upper Confidence Bound One of the most widely studied strategies for addressing multi-armed bandits are the deterministic upper-confidence-bound schemes [6,7]. They operate under the principle of optimism in the face of uncertainty. This entails choosing actions under the assumption that the unknown mean pay-offs of each arm is as large as plausibly possible, based on the previously observed samples. There are many versions of the upper-confidence-bound idea. The simplest of these starts by pulling each arm once, from which it begins to construct an estimate of the arms’ empirical means. It then greedily picks the arm with the highest pay-out, subject to an arm-frequency constraint [13]. This constraint ensures that arms that have not been played often, perhaps due to poorly estimated means, will eventually be selected. A permutation of this idea, called tuned upper confidence bound [40], takes into account both the means and the variance of the arm pay-outs, which purportedly aids in dealing with high-variance slot machines. Most, if not all, upper-confidence-bound approaches are known to achieve logarithmic regret without the need for parameter tuning. The un-tuned upper-confidence-bound method results are presented in figures 4.3–4.6. The tuned variant produced virtually identical results for these problems, so those results are not shown in these plots. Both methods generated reasonably good time-averaged regret, per round, at the beginning of the simulations. In many cases, their initial performance exceeded that of the tuned VoIMix. The upper-confidence-bound methods also outperformed the remaining stochastic exploration approaches. They did converge much more slowly to the optimal arm than VoIMix, though. This led to lower pay-outs over a much larger set of plays. Entropy 2018, 20, 155 23 of 33 4.3.4. Methodological Comparisons Discussions These results indicate that the tuned version of VoIMix outperforms many conventional exploration schemes in the short term. Long-term it does too. We did not compare the results to the tuned version of AutoVoIMix, as its initial exploration period was longer than the number of pulls that we considered in these simulations; its results would be quite poor during this time. Over a greater number of arm pulls, the performance of AutoVoIMix approaches that of VoIMix. It will, consequently, yield better results than some of these alternate schemes. The performance that we witnessed for many of these algorithms is predicated on choosing reasonable parameter or hyperparameter values. The average increase in total regret for improperly tuned algorithms was approximately thirty percent for VoIMix and forty percent for SoftMix and GeedyMix. Reinforcement comparison likewise suffered an increase in regret of about forty percent, as did the pursuit method, which saw a seventy percent raise. Moreover, seemingly optimal parameter values for one multi-armed bandit scenario could suddenly become one of the worst in another. This finding indicates a need for online parameter adjustment, akin to what is done by the information-theoretic scheme that we introduced for adapting the value-of-information hyperparameter. Below, we discuss aspects of the obtained simulation results. -Greedy and Soft-Max Discussions. Our simulations indicated that the performance of SoftMix exceeded that GreedyMix. In the long-term, GreedyMix should improve beyond SoftMix, especially if the currently known regret bounds are tight. This is because an unlucky sampling of arms in SoftMix can bias the expected returns and favor sub-optimal arms. The optimal arm may have a low probability of being sampled, especially after many pulls. In contrast, all arms have the equal chance of being selected during the exploration phase of GreedyMix. Any poorly estimated reward means, especially that of the optimal arm, can hence be made more precise. The optimal arm will therefore be chosen more frequently once this occurs. Despite both methods achieving a logarithmic regret, VoIMix outperformed the fixed-parameter GreedyMix over the first few hundred arm pulls. This was also observed in the case where the parameters for GreedyMix were annealed across arm pulls. This discrepancy is likely due to the constant regret complexity factors, which are typically excluded. Those factors for VoIMix have a lower magnitude than those for GreedyMix. Pursuit and Reinforcement Comparison Discussions. Both VoIMix and AutoVoIMix perform well since they avoid a biased sampling of sub-optimal arms. Pursuit methods, in contrast, are highly susceptible to such issues. These types of algorithms only consider the expected reward associated with the current-best arm when assigning probability mass. The rewards of all other arms are ignored, unlike in soft-max-based selection, which provides little opportunity to recover from a poor arm selection after a few iterations. Likewise, the uniform-exploration components in VoIMix and AutoVoIMix further aid in avoiding a biased sampling, especially early in the learning process where it dominates. We found that low-reward policies were formulated rather frequently, in practice, by pursuit methods. The regret tended to plateau to a sub-optimal value in just a few arm pulls. The optimal arm was rarely identified, even after adjusting the learning-rate parameter. Reinforcement comparison behaved comparably to both GreedyMix and SoftMix for the problems that we considered. In high-variance cases, it sometimes excelled beyond these two approaches. Such behavior is largely due to its mean-discrimination capabilities. That is, reinforcement comparison would typically waste only a few pulls on low-mean arms that had unusually high rewards for a few rounds. Once a better estimate of the expected reward began to form these sub-optimal arms, it would quickly switch to others. Substantial parameter tuning was needed for this shift to happen without greatly impacting regret, though. This contrasts with approaches like VoIMix, where good performance was obtained without significant experimentation. In short, as noted by Cesa-Bianchi, et al. [20,21], and echoed by several other authors in the literature, finding good annealing schedules for stochastic methods can be difficult. Some cooling schedules may consistently draw suboptimal arms during the learning process, even after having estimated all of the means correctly. In some cases, they may focus too early to a suboptimal arm and never recover afterwards. The value of information appears to avoid such issues, due to its mixture-model formulation. That is, there is always a chance that a non-optimal arm can be selected uniformly at random, even if its current reward estimate is incorrect. Entropy 2018, 20, 155 24 of 33 Upper-Confidence-Bound Discussions. Our simulations revealed that while upper-confidence-bound methods achieve superior performance during the first hundred arm pulls, it lags behind VoIMix over a longer number of plays. This behavior likely stems from the greedy arm-selection process of the upper-confidence-bound methods. Initially, only the highest-performing slot machine will be chosen by these methods, as the arm-frequency constraint will do little to sway the selection. This arm may be sub-optimal, yet have an unusually high reward due to the variance. The optimal arm, in contrast, may have had an uncharacteristically low reward the round that it was chosen, causing it to be ignored until later in the learning phase when the arm-frequency constraint will ensure that it is picked. Stochastic approaches have more opportunities to choose optimal arms that, initially, appear to be sub-optimal. Both the tuned and un-tuned upper-confidence-bound methods yielded near-identical regrets and rewards in our simulations. Increasing the arm variance did little to change the results. The pay-outs accrued by each of the algorithms that we consider thus appear to only be affected by two characteristics. These are the number of slot-machine arms and the mean separation of the corresponding machine distributions. This finding has ramifications for the types of regret bounds that investigators can expect to obtain. It also informs about the methodological traits that should be emphasized when developing new bandit algorithms. Such a suggestion runs counter to recent theoretical endeavors that have focused on obtaining improved regret bounds by considering the second-order reward moments of specific distributions. Nevertheless, our results indicate that accounting for high-order moments of the reward distribution will not prove fruitful, as the type of reward distribution had only a marginal effect on the algorithm behaviors and performance. This is a trait exhibited not only by the value of information, but also for the other stochastic and deterministic approaches that we considered here. 5. Conclusions In this paper, we considered the exploration of discrete, stochastic multi-armed bandits. This simplified reinforcement learning problem is important, as it is often difficult to assess certain performance aspects of learning methods for multi-state, multi-action Markov decision processes. We proposed an information-theoretic means of choosing optimal actions in a single-state, multi-action environment. Our approach is based on a value of information criterion, which defines a type of free-energy extremization problem. We have previously empirically analyzed this criterion for multi-action, multi-state reinforcement learning. Here, however, we focused on a more theoretical treatment, which is a contribution of our paper. The value of information has not been analyzed for single-state, multi-action environments before, to our knowledge, so this contribution offers insights into the search capabilities of this criterion. Optimization of the value-of-information criterion gives rise to a soft-max-like policy search. Exploration is therefore driven by weighted randomness. The weights are determined by a parameterized Gibbs distribution, which operates on the rewards associated with pulling various arms. The parameter, a type of inverse temperature, dictates the amount of exploration that is conducted in the policy space. A purely soft-max-based action selection suffers from a well-known flaw. That is, an infinite number adjustments of the inverse temperature parameter are needed to convert from a purely random exploration of the policy space to pure exploration. To resolve this issue, we created a mixture model from the Gibbs distribution that can more effectively transition from one extreme to the other. This model defines the action-selection probabilities to be a mixture of the exponential-based Gibbs-distribution component and a uniform-distribution component. The influence of either of these components is determined by a single mixing parameter. Both mixture-model parameters have a profound impact on the accrued rewards. We considered two possible means of automatically tuning the parameters during the search process. The first approach, VoIMix, is optimal, as it achieves logarithmic regret for the multi-armed bandit problem. It does, however, rely on a user-specified term that is difficult to set since it relies on details about the problem that are not normally available a priori. This limits its practical use. The second approach, AutoVoIMix, is nearly optimal, as it can be arbitrarily close to logarithmic regret. The user-selectable term is much easier to set for this case, though, as it does not depend on any a priori unknown quantities. Entropy 2018, 20, 155 25 of 33 We assessed the search capability of the value of information through a battery of simulations. This is another contribution of our paper. When manually choosing the amount of exploration, VoIMix either performs similarly or outperforms conventional heuristics, such as -greedy and soft-max selection, in terms of regret and overall reward. When annealing the exploration amount, both VoIMix and AutoVoIMix outperformed these criteria. This was expected. -greedy does not account for the reward associated with action choices. It is therefore possible for poor rounds of initial exploration to occur, which limits the short-term obtainable rewards. This occurs whether the amount of exploration is either manually fixed or automatically chosen so as to achieve logarithmic regret. Soft-max selection, in contrast, is not known to exhibit logarithmic regret. Existing implementations of soft-max selection also have the flaw that the consistent sampling some sub-optimal arm may prevent the optimal arm from being sampled enough. In the limit, the value of information is guaranteed to reach zero regret with unit probability. Many other bandit algorithms share this trait. To help our approach reach a near-zero regret more quickly, we relied on a cross-entropy heuristic for monitoring the evolution of the search and updating the model hyperparameters. This heuristic can be applied to more general reinforcement learning problems too. Our application of this heuristic to the multi-armed bandit problem is another contribution of our paper. We also analyzed the performance of the tuned and untuned versions of VoIMix against AutoVoIMix. The former leads to steep drops in regret due to an effective action exploration, provided that the parameter values are in the valid range. The regret for the tuned VoIMix approach is often better than the best fixed-exploration-amount cases after only a few hundred arm pulls. The optimal arms are routinely identified with a probability near one. AutoVoIMix, in contrast, has the tendency to unnecessarily search the action space. A great many arm pulls are needed for the regret to become small, even when its hyperparameters are tuned according to our cross-entropy heuristic. While both VoIMix and AutoVoIMix can achieve the same regret and instantaneous pay-out in the limit, the former would be poorly suited for real-world, time-sensitive bandit problems where few arm pulls are made before learning stops. Our theoretical analyses indicate that an adaptation of the exploration rate is needed for the value of information to achieve logarithmic regret. This was corroborated by our simulation results: fixed amounts of exploration led to poorer results. We have witnessed similar behaviors for the multi-state, multi-action case. In our future work, we will ascertain if any of the theory from this paper can be applied to the multi-state case so that the optimal average cost improvement can be obtained per episode. Certain logarithmic-regret approaches, such as extensions of the upper-confidence-bound algorithm, have explicit constant terms. It can be shown that the constant terms for some of these approaches are superior to that of VoIMix and AutoVoIMix, indicating that the former will achieve better asymptotic performance than our methods. Another area of future research will hence be a refinement of the constant term in the logarithmic regret bound that we obtained for VoIMix. Toward this end, we have already started combining the value of information with the upper confidence bound method. The outcome of this combination is that the number of simulated transitions made to arrive at an optimal policy will be reduced, which supplies a better constant term in the regret bound. While our simulation results here have indicated that VoIMix is competitive against state-of-the-art techniques, the performance will likely improve further over finite numbers of plays due to this algorithmic change. Appendix A In this section, we provide a proof of the logarithmic regret for algorithm 1. We define the (expected) regret after the first k pulls, according to some policy that chooses a sequence of arms i1 , . . . , ik , to be " max1≤j≤|A| E k X s=1 Xsj − Xsis # , where Xsis represents the reward obtained by pulling arm ais at round s. Here, the expectation operator is with respect to the stochastic generation of rewards. For randomized rules, it is also with respect to the internal randomization of the rule. Entropy 2018, 20, 155 26 of 33 In the standard formulation of the stochastic, multi-armed bandit problem, it is assumed that the rewards obtained from pulling arms are independent random variables Xki with stationary means µi , for all i, k. All of the following results hold under this assumption. Our results also are valid under a weaker assumption that E[Xki |Jk−1 ] = µi , for all i, k, where Jk−1 represents the σ-field generated by the random variables. This weaker assumption states that the distribution of each new random reward can depend, in an adversarial way, on the previous pulls and observed rewards, provided the reward mean is fixed. That is, the reward distributions can change in an adversarial way according to some external process [4]. The bounds hence apply to the adversarial bandit algorithm without modification. Our proof of logarithmic regret hinges on showing that we can obtain, for E[πki ], an upper bound of O(1/k) i for any sub-optimal slot-machine arm. Here, πki is the probability that Ik+1 = 1 for some sub-optimal arm. From this result, logarithmic regret easily follows, since the sum of the difference in optimal and sub-optimal reward means for each arm is equal to O(log(k)). It is important to note that the expected value of πki can be obtained after any number k of arm pulls. This is a distinction compared to other regret results in the literature, which are valid only for k going to infinity. We first provide a meaningful intermediate bound that will be useful throughout our subsequent analyses. Proposition A.1. For algorithm 1, we have, for sub-optimal arms ai ∈ A at iteration k, that E[πki ] ≤ exp(τk−1 δi − " k−1 Y kτk−1 δi )E s=1 exp φc (τs−1 ) |A| 2 − δi2 γs !!# + γk . |A| Here, δi is the difference in expected pay-outs, δi = µ∗ −µi , for the optimal a∗ versus non-optimal ai arms. −1 The function φc (τs−1 ) is given by φc (τs−1 ) = (ecτs −cτs−1 −1)/τs−2 . Proof: We introduce a random variable Vpj = Xpj /πpj if Ip = j and zero otherwise. It can be seen that Vpj ≤ 1/πpj and that 1/πpj ≤ |A|/γp . Both of these facts are implicitly used. In what follows, we systematically bound the expected value of the policy. Toward this end, we note that the following relationships hold for E[πki ], " # " # Pk−1 Pk−1 exp( s=1 τs−1 Vsi ) exp( s=1 τs−1 Vsi ) γk γk (1 − γk )E P|A| + ≤ (1 − γk )E + Pk Pk −1 −1 j ∗ |A| |A| exp( s=1 τs Vs ) j=1 exp( s=1 τs Vs ) " !# k−1 X γk −1 i −1 ∗ = (1 − γk )E exp τs Vs − τs Vs + |A| s=1 where the inequality is due to the definition of the random variable Vsj . The equality follows from the fact that the fractional exponential terms inside the expectation can be combined into a single expression. We now refine this bound so that we can eventually show that it is the reciprocal of the number of arm pulls. We begin by factoring out the summation of τs−1 Vsi −τs−1 Vs∗ terms inside the exponential function. Continuing from above, " k−1 " ## Y γk −1 i −1 ∗ = (1 − γk )E E exp(τs Vs − τs Vs ) Js−1 + |A| s=1 " k−1 " ## Y γk −1 −1 −1 i ≤ exp(τk δi − kτk δi )E E exp(τs Zs ) Js−1 + . |A| s=1 In the last step, we multiplied and divided by an exponential quantity exp(kτk−1 (µj −µ∗ ) − τk−1 (µj −µ∗ )). We also dropped the multiplicative factor 1−γk . In this expression, Zsi = δi +Vsi −Vs∗ is another random variable. To further refine the bound for E[πpi ], we need to deal with the factor E[exp(τs−1 Zsi )|Js−1 ]; here, Js−1 represents a σ-algebra. We will rely on a Taylor expansion of the exponential function to do this. This Entropy 2018, 20, 155 27 of 33 results in the expression E[exp(τs−1 Zsi )|Js−1 ] ≤ E[1+τs−1 Zsi + Zsi Zsi φc (τs−1 )|Js−1 ], each term of which can be dealt with independently. We first note that the conditional expectation, for each s, is given by the following expression E[Zsi |Js−1 ] = E[Vsi |Js−1 ] − E[Vs∗ |Js−1 ] + δi , which is zero. Next, we bound the conditional variance, for each s, E[Zsi Zsi |Js−1 ]. It can be seen that E[Zsi Zsi |Js−1 ] = E[(Vsi − Vs∗ )2 |Js−1 ] − δi2 . Expanding the squared term, we find that the conditional variance is equal to the sum of four factors. The factor E[Vs∗ Vs∗ |Js−1 ]−2E[Vs∗ Vsi |Js−1 ] can be dropped. After expanding the remaining expectation terms, we find that " k−1 " ## Y γk −1 −1 i −1 i i i −1 E[πk ] ≤ exp(τk δi − kτk δi )E E 1+τs Zs + Zs Zs φc (τs )) Js−1 + |A| s=1 " !# # # " k−1 " Y Xs∗ Xs∗ ∗ γk Xsi Xsi i −1 −1 2 + ≤ exp(τk δi − kτk δi )E πs Js−1 + E πs Js−1 − δi E i i ∗ ∗ πs πs πs πs |A| s=1 !!# " k−1 Y γk |A| + ≤ exp(τk−1 δi − kτk−1 δi )E − δi2 . exp φc (τs−1 ) 2 γ |A| s s=1 which is the desired bound.  We now show that algorithm 1 achieves logarithmic regret for the first choice of τk−1 . A proof for the second choice of τk−1 in algorithm 1 is similar and therefore omitted. Proposition A.2. The value-of-information update in algorithm 1 yields E[πki ] = O(1/k) for sub-optimal arms ai ∈ A at iteration k. This holds under the assumption that γk = min(1, 5|A|/kd2 ) and τk−1 = log(1+dck /(ck−1))/ck with ck = 2|A|/γk+1. It also holds when using τk−1 = log(1+dck /σk2 )/ck , with σk2 = 2|A|/γk −d2 , to iteratively update the inverse-temperature parameter. Proof: We have that E[πki ] k−1 X ≤ (1 − γk )exp − s=1 τs−1 d − φc (τs−1 )σs2 ! + γk |A| where σs2 = 2|A|/γs−d2 . We now write τs−1 = log(1+ks cs /σs2 )/cs , where ks = d. We apply an elementary logarithmic identity to bound τs−1 : log(1 + ks cs /σs2 )cs ≥ 2ks /(2σs2 + ks cs ). Therefore, E[πki ] ≤ (1 − γk )exp − ≤ exp − k−1 X s=1 k−1 X τs−1 ks s=1 ks2 2σs2 + ks cs ! − + ! ! 2ks γk exp(cs τs−1 − 1) − σ2 + c2s cs (2σs2 + ks cs ) s |A| γk |A| where exp(cs τs−1−1) = ks cs /σs2 due to the fact that τs−1 = log(1+ks cs /σs2 )/cs . Substituting the variables cs , ks , and σs2 , we find that ks2 /(2σs2 + ks cs ) ≥ d2 γs /5|A|. The factor of 5|A| arises as a lower bound for the denominator of ks2 /(2σs2 + ks cs ) since 2σs2 + ks cs = 4|A|+d|A|+γs (d−2d2 ). We therefore obtain that E[πki ] ≤ q exp(−log(k−1))+d2 γs /5|A|, where the constant q represents the regret accumulated for indices s up to a finite point. It is immediate that E[πki ] ≤ q/(k−1)+d2 γs /5|A| after canceling out the logarithmic and exponential functions.  For the second choice of revising the inverse temperature τk−1 in algorithm 1, we can provide non-averaged bounds on the probability πki of choosing a sub-optimal arm ai . This result shows just how much πki can change across iterations. Entropy 2018, 20, 155 28 of 33 Proposition A.3. For sub-optimal arms ai ∈ A at iteration k, of the value-of-information update in algorithm 1 yields γk /|A| ≤ πki ≤ γk /|A|+(1−γk )/k with probability 1−k(ω)k for 0 < ω < 1. This holds under the assumption that γk = min(1, 5|A|/kd2 ) and τk−1 = log(1+dck /(ck −1))/ck , with ck = 2|A|/γk +1, are used to update the mixing coefficient and inverse-temperature parameters. Proof: The bound γk /|A| ≤ πki on the left-hand side is evident. It is simply the exploration probability for arm ai ∈ A when drawn from the uniform distribution term. The bound πki ≤ γk /|A|+(1−γk )/k on the right-hand side follows from our above results and various probabilistic inequalities. We first note that, for πki , the following holds ! !! Pk−1 k−1 X exp( s=1 τs−1 Vsi ) γk γk −1 i −1 ∗ (1 − γk ) P|A| + ≤ (1 − γk ) exp τs Vs − τs Vs + Pk −1 j |A| |A| s=1 j=1 exp( s=1 τs Vs ) where we have defined the random variable Vkj = Xkj /πkj if Ikj = 1 and zero otherwise. Using the Markov inequality, we obtain that (1−γk )p exp k−1 X s=1 τs−1 Vsi −τs−1 Vs∗ > 1 k !! " k−1 " ## X γk γk −1 i + ≤ kE E exp(τs Zs ) Js−1 + |A| |A| s=1 where Zki = Vki −Vk∗ is a random variable used to describe the difference in probabilistically-weighted rewards. Qk−1 We introduce another random variable Qik−1 = s=1 exp(τs−1 Vsi − τs−1 Vs∗ ) to model the product i ∗ i of exponential terms. Observe that Qik−1 = (Vk−1 −Vk−1 )Qik−2 = Zk−1 Qik−2 . Also note that E[Qik−1 ] = i i E[Qk−1 |Jk−2 ], where Jk−1 is σ(Vp , 1 ≤ p ≤ k−2) with k ≥ 3. i i i From what we derived above, we have E[Zk−1 |Jk−2 ] = −δi . We also have E[Zk−1 Zk−1 |Jk−2 ] ≤ i i 2|A|/γk−1 . It can be seen that Zk−1 ≤ |A|/γk−1 and hence that Zk−1 /ck−1 ≤ 1/2. Lastly, i |τk−1 Zk−1 | ≤ 1 since log(1+dck−1 /(ck−1 −1)) = log(1+d+dγk−1 /2|A|) < 1 for small values of d. −1 −2 We thus get that E[Qik−1 ] ≤ (1−τk−1 δi +τk−1 2|A|/γk−1 )Qik−1 and p exp k−1 X s=1 τs−1 Vsi −τs−1 Vs∗ > 1 k !! " k−1 " ## X −1 i −2 i i ≤ kE E 1+τs Zs + τs Zs Zs Js−1 s=1 ≤k 1− −1 τk−1 δi + −2 τk−1 2|A| γk−1 ! k−1 Y s=1 exp(τs−1 Vsi − τs−1 Vs∗ ). −1 −2 The multiplicative factor τk−1 di − τk−1 2|A|/γk−1 can be bounded below as follows −1 −2 −1 −1 τk−1 di − τk−1 2|A|/γk−1 ≥ dτk−1 −dτk−1 /(1 + dck−1 /σk − 12 )1/2 ≥ ω 0 , where ω 0 > 0. This follows −1 2 2 2 from the fact that 2τk−1 |A|/γk−1 is equal to σk−1 log(1+dck−1 /σk−1 )/ck−1 , where σk−1 /ck−1 < 1, 0 along with an application of a logarithmic inequality. Setting ω = 1 − ω , we arrive at E[Qik ] ≤ (ω)k Qik−1 , where (ω)k denotes taking the kth power of ω. Therefore, we obtain that the Pk−1 probability is p(exp( s=1 τs−1 Zsi ) > 1/k) < k(ω)k .  The preceding result can be employed to illustrate the competitiveness of the value of information against other schemes. For example, Auer et al. [13] supplied a probability bound of choosing a non-optimal slot machine arm, after k ≥ c|A|/d pulls, when using only a uniform-exploration component. This upper bound can be approximated by O(c/d2 k) + O(1/k) for k large. We, however, have obtained a bound of O(d2 k/k) + O(1/d2 k), which is strictly less than the one provided by Auer et al. Value-of-information-based search hence has a higher chance of finding an optimal arm much sooner than pure -greedy schemes, which explains the experimental results that we obtained. Entropy 2018, 20, 155 29 of 33 This result additionally indicates that the exponential component in the arm-selection update is important for resolving the exploration-exploitation dilemma. It can be shown that much of the exploration is driven by the uniform-random component of the mixture model. The role of the exponential, Gibbs-based component is to force the switch to exploitation much more quickly than in -greedy-based approaches like [13]. This permits the highest-paying arm to be chosen more consistently earlier during training; this arm has a high chance of being the optimally paying one. As we noted above, a principled guess for the parameter d is needed, for VoIMix in algorithm 1, to adjust the temperature parameter. This guess implicitly requires knowledge of the unknown slot-machine expected values µj , for aj ∈ A\a∗ , let alone the optimal expected value µ∗ for a∗ ∈ A. Neither of these quantities can be reliably obtained a priori for arbitrary problems. For this reason, we introduced an alternative in algorithm 2, which provides a means of adjusting the temperature parameter with an easier-to-set term θ. We now show that AutoVoIMix, given in algorithm 2, can achieve logarithmic regret in the limit. Proposition A.4. For the value-of-information update in algorithm 2, we have that E[πki ] = O(log2θ (k)/k) for sub-optimal arms ai ∈ A at iteration k. This holds under the assumption that γk = min(1, 5|A|log2θ (k)/k) and τk−1 = log(1+ck log−θ (k)/(2ck −2))/ck with ck = |A|/γk +1. Proof: From propositions A.1 and A.2, it can be shown that E[πki ] ≤ (1 − γk )exp − ≤ exp − k−1 X s=1 k−1 X τs−1 ks s=1 ks2 2 2σs + ks cs ! − + φc (τs−1 )σs2 ! + γk |A| γk |A| for ks = log−θ (s) and σs2 = 2|A|/γs . The summation terms ks2 /(2σs2 + ks cs ) can be further bounded by γs log−2θ (s)/5|A|. After substituting the expression for γk in γs log−2θ (s)/5|A|, we find that E[πki ] = O(1/k). Plugging in the form of γk in the exploration term γk /|A| yields E[πki ] = O(log2θ (k)/k).  The expected regret when using this algorithm is O(log(k)1+2θ ). The regret can be made infinitesimally close to logarithmic by choosing a small, non-zero value of θ. Note, however, values of θ have an inverse relationship with the number of arm pulls. For θ to be as small as possible, a great many arm pulls must be made to reach the expected regret bound. The regret bound for AutoVoIMix is important for a few reasons. Foremost, it is valid for both stochastic and adversarial bandit problems. In the latter case, the rewards earned from the slot-machine can be a combination of any previously obtained rewards. This represents a more difficult problem than the stochastic bandit case, where the rewards are independent of each other. Secondly, as we noted above, this regret bound is obtained independently of a hyperparameter that depends on statistics of the rewards. That is, the bound is distribution-free. There are other distribution-free methods in the literature, like Exp3 or Exp4 [24]. However, such methods typically only obtain linear-logarithmic regret: the regret of Exp3 is O((|A|klog(|A|k/κ))1/2 ), while the regret for Exp4 is O((|A|klog(n))1/2 ), with n being the number of expert strategies that are supplied. Both bounds are rather poor, which is due to the fact that no information about the difficulty of the search problem is being conveyed through the hyperparameter that adjusts the exploration amount. Both Exp3 and Exp4 hence require a large amount of exploration regardless of if the optimal-to-suboptimal slot-machine average payout difference is large or small. AutoVoIMix, in contrast, requires less exploration than either Exp3 or Exp4. This marked decrease in exploration is primarily due to the gradual modification of the exploration hyperparameters across each arm pull of a given simulation. For Exp3 and Exp4, this hyperparameter remains fixed throughout a given simulation and is only modified across simulations for certain practical implementations. References 1. Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 1998. Entropy 2018, 20, 155 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. 30 of 33 Thompson, W.R. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika 1933, 25, 285–294. Robbins, H. Some aspects of the sequential design of experiments. Bulletin of the American Mathematical Society 1952, 58, 527–535. Bubeck, S.; Cesa-Bianchi, N. Regret analysis of stochastic and non-stochastic multi-armed bandit problems. Foundations and Trends in Machine Learning 2012, 5, 1–122. Lai, T.L.; Robbins, H. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics 1985, 6, 4–22. Auer, P. Using confidence bounds for exploration-exploitation trade-offs. Journal of Machine Learning Research 2002, 3, 397–422. Auer, P.; Ortner, R. UCB revisited: Improved regret bounds for the stochastic multi-armed bandit problem. Periodica Mathematica Hungarica 2010, 61, 55–65. Garivier, A.; Cappé, O. The KL-UCB algorithm for bounded stochastic bandits and beyond. Proceedings of the Conference on Learning Theory (COLT); , 2011; pp. 359–376. Cappé, R.; Garivier, A.; Maillard, O.A.; Munos, R.; Stoltz, G. Kullback-Leibler upper confidence bounds for optimal sequential allocation. Annals of Statistics 2013, 41, 1516–1541. Agarwal, S.; Goyal, N. Analysis of Thompson sampling for the multi-armed bandit problem. Journal of Machine Learning Research 2012, 23, 1–39. Honda, J.; Takemura, A. An asymptotically optimal policy for finite support models in the multiarmed bandit problem. Machine Learning 2011, 85, 361–391. Honda, J.; Takemura, A. Non-asymptotic analysis if a new bandit algorithm for semi-bounded rewards. Journal of Machine Learning Research 2015, 16, 3721–3756. Auer, P.; Cesa-Bianchi, N.; Fischer, P. Finite-time analysis of the multi-armed bandit problem. Machine Learning 2002, 47, 235–256. McMahan, H.B.; Streeter, M. Tight bounds for multi-armed bandits with expert advice. Proceedings of the Conference on Learning Theory (COLT); , 2009; pp. 1–10. Stratonovich, R.L. On value of information. Izvestiya of USSR Academy of Sciences, Technical Cybernetics 1965, 5, 3–12. Stratonovich, R.L.; Grishanin, B.A. Value of information when an estimated random variable is hidden. Izvestiya of USSR Academy of Sciences, Technical Cybernetics 1966, 6, 3–15. Sledge, I.J.; Príncipe, J.C. Analysis of agent expertise in Ms. Pac-Man using value-of-information-based policies. IEEE Transactions on Computational Intelligence and Artificial Intelligence in Games 2017. (under review). Sledge, I.J.; Príncipe, J.C. Partitioning relational matrices of similarities or dissimilarities using the value of information. Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP); , 2018; pp. 1–5. Sledge, I.J.; Emigh, M.S.; Príncipe, J.C. Guided policy exploration for Markov decision processes using an uncertainty-based value-of-information criterion. IEEE Transactions on Neural Networks and Learning Systems 2017. (under review). Cesa-Bianchi, N.; Fischer, P. Finite-time regret bounds for the multi-armed bandit problem. Proceedings of the International Conference on Machine Learning (ICML); , 1998; pp. 100–108. Cesa-Bianchi, N.; Gentile, C.; Neu, G.; Lugosi, G. Boltzmann exploration done right. In Advances in Neural Information Processing Systems (NIPS); Guyon, I.; Luxburg, U.V.; Bengio, S.; Wallach, H.; Fergus, R.; Vishwanathan, S.; Garnett, R., Eds.; MIT Press: Cambridge, MA, USA, 2017; pp. 6287–6296. Kaelbling, L.P.; Littman, M.L.; Moore, A.W. Reinforcement learning: A survey. Journal of Artificial Intelligence Research 1996, 4, 237–285. Salganicoff, M.; Ungar, L.H. Active exploration and learning in real-valued spaces using multi-armed bandit allocation indices. Proceedings of the International Conference on Machine Learning (ICML); , 1995; pp. 480–487. Auer, P.; Cesa-Bianchi, N.; Freund, Y.; Schapire, R.E. The nonstochastic multi-armed bandit problem. SIAM Journal on Computing 2002, 32, 48–77. Strehl, A.L.; Mesterharm, C.; Littman, M.L.; Hirsh, H. Experience-efficient learning in associative bandit problems. Proceedings of the International Conference on Machine Learning (ICML); , 2006; pp. 889–896. Madani, O.; Lizotte, S.J.; Greiner, R. The budgeted multi-armed bandit problem. Proceedings of the Conference on Learning Theory (COLT); , 2004; pp. 643–645. Entropy 2018, 20, 155 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 31 of 33 Kleinberg, R.D. Nearly tight bounds for the continuum-armed bandit problem. In Advances in Neural Information Processing Systems (NIPS); Saul, L.K.; Weiss, Y.; Bottou, L., Eds.; MIT Press: Cambridge, MA, USA, 2008; pp. 697–704. Wang, Y.; Audibert, J.; Munos, R. Algorithms for infinitely many-armed bandits. In Advances in Neural Information Processing Systems (NIPS); Koller, D.; Schuurmans, D.; Bengio, Y.; Bottou, L., Eds.; MIT Press: Cambridge, MA, USA, 2008; pp. 1729–1736. Bubeck, S.; Munos, R.; Stoltz, G. Pure exploration in finitely-armed and continuous-armed bandits. Theoretical Computer Science 2011, 412, 1876–1902. Vermorel, J.; Mohri, M. Multi-armed bandit algorithms and empirical evaluation. In Machine Learning: ECML; Gama, J.; Camacho, R.; Brazdil, P.B.; Jorge, A.M.; Torgo, L., Eds.; Springer-Verlag: New York City, NY USA, 2005; pp. 437–448. Even-Dar, E.; Mannor, S.; Mansour, Y. PAC bounds for multi-armed bandit and Markov decision processes. Proceedings of the Conference on Learning Theory (COLT); , 2002; pp. 255–270. Mannor, S.; Tsitsiklis, J.N. The sample complexity of exploration in the multi-armed bandit problem. Journal of Machine Learning Research 2004, 5, 623–648. Langford, J.; Zhang, T. The epoch-greedy algorithm for multi-armed bandits. In Advances in Neural Information Processing Systems (NIPS); Platt, J.C.; Koller, D.; Singer, Y.; Roweis, S.T., Eds.; MIT Press: Cambridge, MA, USA, 2008; pp. 817–824. Srinivas, S.; Krause, A.; Seeger, M.; Kakade, S.M. Gaussian process optimization in the bandit setting: No regret and experimental design. Proceedings of the International Conference on Machine Learning (ICML); , 2010; pp. 1015–1022. Krause, A.; Ong, C.S. Contextual Gaussian process bandit optimization. In Advances in Neural Information Processing Systems (NIPS); Shawe-Taylor, J.; Zemel, R.S.; Bartlett, P.L.; Pereira, F.; Weinberger, K.Q., Eds.; MIT Press: Cambridge, MA, USA, 2011; pp. 2447–2455. Beygelzimer, A.; Langford, J.; Li, L.; Reyzin, L.; Schapire, R.E. Contextual bandit algorithms with supervised learning guarantees. Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS); , 2011; pp. 19–26. Sledge, I.J.; Príncipe, J.C. Balancing exploration and exploitation in reinforcement learning using a value of information criterion. Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP); , 2017; pp. 1–5. Thathachar, K.S.N.M.A.L. Learning automata–A survey. IEEE Transactions on Systems, Man, and Cybernetics 1974, 4, 323–334. Thathachar, M.A.L.; Sastry, P.S. A new approach to the design of reinforcement schemes for learning automata. IEEE Transactions on Systems, Man, and Cybernetics 1985, 15, 168–175. Audibert, J.Y.; Munos, R.; Szepesvári, C. Exploration-exploitation tradeoff using variance estimates in multi-armed bandits. Theoretical Computer Science 2009, 410, 1876–1902. Entropy 2018, 20, 155 32 of 33 © 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). Entropy 2018, 20, 155 Symbol R A |A| T s, k ai a∗ aik Xki µi µ∗ σ2 p0 (aik ) p(aik ) p(aj ) πki E· [·] DKL (·k·) ϕinf ϕcost Table 1: Variable Notation Description Symbol i Continuous space of real values qk+1 Discrete space of slot-machine arms Total number of slot-machine arms Iki Total number of arm pulls A given arm pull index in the range [0, T ]; index to a particular iteration or  round A given slot-machine arm, indexed by i; i takes values in the range [1, |A|] τ The slot-machine arm that yields the best expected reward A particular slot machine arm i pulled at round k The real-valued reward obtained by γ pulling arm ai at round k; can also be interpreted as a random variable The expected reward for a non-optimal θ slot machine arm ai The expected reward for the optimal slot machine arm a∗ The variance of all slot machine arms A prior probability distribution that d specifies the chance of choosing arm ai at round k A posterior-like probability distribution that specifies the chance of choosing arm τk , γk , ai at round k θk , dk A probability distribution that specifies δi the chance of choosing arm aj independent of a given round k Vpj Equivalent to p(aik ); represents the arm-selection policy The expected value of random variable according to a probability Zsi distribution, e.g., Eai [Xki ] represents k P i i aik ∈A p(ak )Xk Qik−1 The Kullback-Leibler divergence between two probability distributions, Js e.g., DKL (p(aik )kp0 (aik )) is the φc (τs ) divergence between p(aik ) and p0 (aik ) A positive, real-valued information ω, ω 0 constraint bound ck A positive, real-valued reward constraint bound σk2 33 of 33 Description An estimate of the expected reward for slot machine arm ai at round k + 1 A binary-valued indicator variable that specifies if slot machine arm ai was chosen at round k A non-negative, real-valued parameter that dictates the amount of exploration for the -greedy algorithm (GreedyMix) A non-negative, real-valued parameter that dictates the amount of exploration for soft-max-based selection (SoftMix) and value-of-information-based exploration (VoIMix) A non-negative, real-valued parameter that represents the mixing coefficient for value-of-information-based exploration (VoIMix and AutoVoIMix) A non-negative, real-valued hyperparameter that dictates the exploration duration for value-of-information-based exploration (AutoVoIMix) A positive, real-valued hyperparameter that dictates the exploration duration for value-of-information-based exploration (VoIMix) The values of τ , γ, θ, and d, respectively, at a given round k The mean loss incurred by choosing arm ai instead of arm a∗ : δi = µ∗ −µi A random variable representing the ratio of the reward for a given slot machine arm to its chance of being selected: Xpj /πpj A random variable representing the expression δi + Vsi − Vs∗ A random variable representing the Q i ∗ expression k−1 s=1 exp(τs Vs − τs Vs ) i A σ-algebra: σ(Xs , 1 ≤ s ≤ k), k ≥ 1 A real-valued function parameterized by c: φc (τs ) = (ecτs −cτs −1)/τs2 Real values inside the unit interval A real-valued sequence 1 + 2|A|/γk for VoIMix or 1+|A|/γk for AutoVoIMix A real-valued sequence −d2+2|A|/γk for VoIMix or 2|A|/γk for AutoVoIMix
2cs.AI
arXiv:cs/0310043v3 [cs.CE] 29 Oct 2003 Value-at-Risk and Expected Shortfall for Quadratic Portfolio of Securities with Mixture of Elliptic Distributed Risk Factors Jules SADEFO KAMDEM ∗† Laboratoire de Mathématiques CNRS UMR 6056 Université De Reims December 30, 2017 Abstract Generally, in the financial literature, the notion of quadratic VaR is implicitly confused with the Delta-Gamma VaR, because more authors dealt with portfolios that contained derivatives instruments. In this paper, we postpone to estimate both the expected shortfall and Value-at-Risk of a quadratic portfolio of securities (i.e equities) without the Delta and Gamma Greeks, when the joint log-returns changes with multivariate elliptic distribution. To illustrate our method, we give special attention to mixture of normal distributions, and mixture of Student t-distributions. Key Words: Classical analysis, Computational Finance, Elliptic distributions, Risk Management . 1 Introduction Value-at-Risk is a market risk management tool that permit to measure the maximum loss of the portfolio with certain confidence probability 1 − α, over a certain time horizon such as one day. Formally , if the price of portfolio’s P (t, S(t)) at time t is a random variable where S(t) represents a vector of risk factors at time t, then VaR be implicitly given by the formula P rob{−P (t, S(t)) + P (0, S(0)) > V aRα } = α. Generally, to estimate the V aRα for portfolios depending non-linearly on the return , or portfolios of non-normally distributed assets, one turns to Monte Carlo methods. Monte Carlo methodology has the obvious advantage of being almost universally applicable, but has the disadvantage of being much slower than comparable parametric methods, when the latter are available. In this paper we are concerned with the numerical estimation of the losses that the portfolio of equities faces due to the market, as a function of the future values of S. Following the quadratic Delta-Gamma Portfolio, we introduce the notion of quadratic portfolio of equities due to the analytic approximation of Taylor in 2nd order of log-returns for very small variations of time. Quadratic approximations have also been the subject of a number of papers dedicated to numerical computations for VaR ( but these have been done for portfolio that contains derivatives instruments). We refer the reader to Cardenas and al.(1997) [2] for a numerical method to compute quadratic VaR using fast Fourier transform . Note that in [1], Brummelhuis, ∗ Paper based on the M. Jules SADEFO KAMDEM Université de Reims Phd Thesis. Author address: BP 1039 Moulin de la Housse 51687 Reims Cedex FRANCE. [email protected] † The author is currently temporary lecturer to the Mathematics Department of the ( Université d’evry val d’essonne FRANCE). 1 Cordoba, Quintanilla and Seco have dealt with the similar problem, but their work have been done analytically for Delta-Gamma Portfolio VaR when the joint underlying risk factors follow a normal distribution which is a particular case of elliptic distribution . All our calculus will be done according to the assumption that the joint securities (i.e equities) log-returns follow an elliptic distribution. To illustrate our method, we will take some examples of elliptic distributions as mixture of multivariate t-student and mixture of normal distributions. Note also that, Following RiskMetrics, Sadefo-Kamdem [11](2003) have generalized the notion of ∆-normal VaR by introducing the notion of ∆-Elliptic VaR , with special attention to ∆-Student VaR , but this concerned the linear portfolio. In this paper, we will do the same for nonlinear quadratic portfolios without derivatives instruments. The rest of the paper is organized as follows: In section 2, we introduced the notion of quadratic portfolio of securities(i.e equities) due to the 2nd order Taylor approximation of log returns . Our calculus is made with the more generalized assumptions that the joint underlying log-returns follow an elliptic distribution. That is why in section 3, following [4], we recall the definition of elliptic distribution and we show that under the hypothesis of elliptic distribution the VaR estimation of such portfolios is reduced to a multiple integral equation. Next following the paper of Alan Genz [6] , we recall the notions of symmetric interpolar rules for multiple integrals over hypersphere and we use this method to reduce our problem to one dimensional integral equation. In the same section, we illustrate our method by giving an explicit equation with solution VaR ( Value-at-Risk ) when the joint log-returns follow some particular mixture of elliptic distributions named mixture of multivariate Student t-distributions or the mixture of normal distributions, in these cases the VaR estimation is reduced to finding the zero’s of a certain specials functions. In section 5 we treats the expected shortfall for general elliptic quadratic portfolios of securities without derivatives instruments and we illustrate with the special case of normal distribution. Finally, in section 6 we give a conclusion. 2 Quadratic Portfolio of Securities(i.e Equities) A portfolio of n securities is a vector θ ∈ Rn ; the component θi represents the number of holdings of the ith instruments, which in practise does not need to be an integer. So at time t the price of the portfolio of n securities is given by: n X θi Si (t) (1) P (t) = i=1 where S(t) = (S1 (t), . . . , Sn (t)) such that P (t) − P (0) = n X i=1 θi (Si (t) − Si (0)) = n X Si (0).θi .( i=1 Si (t) − 1) Si (0) For small fluctuations of time and market, we assume that log-return is given by : log(Si (t)/Si (0)) = ηi (t) therefore Si (t) − Si (0) = Si (0)( (2) Si (t) − 1) = Si (0)(exp(ηi (t)) − 1) Si (0) Then we have that S(t) = (S1 (0)exp(η1 ), . . . , Sn (0)exp(ηn )). By using Taylor’s expansion of the exponential’s due to small fluctuations of returns with a time, we have that : ηi (t)2 . (3) exp(ηi (t)) − 1 ≈ ηi (t) + 2 2 If we assume that η = (η1 , . . . , ηn ) is an elliptic distribution note by Nn (µ, Σ, φ) then P (t) − P (0) = n X i=1 Si (0) · θi · (exp(ηi (t)) − 1) ≈ n X 2 Si (0).θi (ηi (t) + i=1 ηi (t) ). 2 (4) By following the usual convention of recording portfolio losses by negative numbers, but stating the Value-at-Risk as a positive quantity of money, The V aRα at confidence level of 1 − α is given by solution of the following equation: P rob{|P (t) − P (0)| ≥ V aRα } = α In the probability space of losses |P (t) − P (0)| = −P (t) + P (0), therefore recalling (4), we have P rob{ n X Si (0).θi (ηi (t) + i=1 ηi (t)2 ) ≤ −V aRα } = α, 2 (5) then an elementary mathematical tool give that : ηi (t) + therefore ηi (t)2 1 = (ηi (t) + 1)2 − 1 2 2 (6) n n X X θi θi 2 · Si (0)} = α. Si (0). (ηi (t) + 1) ) ≤ −V aRα + P rob{ 2 2 i=1 i=1 (7) By posing X = (η1 + 1, ..., ηn + 1), it is straightforward that , X is an elliptic distribution due to the fact that ′ it is a linear combination of elliptic distribution η. We note X ∼ N (µ + 1, Σ, φ ) with a continuous density function h1 (x). Remark that n X 2 αi (ηi (t) + 1) = (x, Λ.x) i=1 with Λ = (αii )i=1..n is a diagonal matrix with diagonal values αii = µ + 1I is the mean vector of X , therefore (7) becomes P rob{(X, Λ.X) ≤ k} = α Si (0).θi 2 ′ ≥ 0 and µ = (µ1 +1, . . . , µn +1) = (8) P with k = −V aRα + ni=1 αii = P (0) 2 − V aRα . We will suppose that k > 0, this means that the Value-atRisk of our portfolio’s is not greater than P(0)/2 . Remark 2.1 We remark that to estimate the Value-at-Risk of a portfolio of securities (i.e equities), the computation of our model need as inputs the quantity θi and the initial security price Si (0) for each i = 1..n as given in (1). Recall that in literature, the computation of Quadratic Delta-Gamma (∆-Γ) VaR need as inputs the sensitivity vector ∆ and the sensitivity matrix Γ, because of the presence of derivatives products in the portfolio. 3 Reduction to an Integral Equation In this section, we will reduce the problem of computation of the Value at Risk for quadratic portfolio of equities to the study of the asymptotic behavior of the density function distribution over the hyper-sphere. 3.1 Notions of Elliptic Distributions The following definitions will be given as in [4](2002) . 3 3.1.1 Spherical Distribution Definition 3.1 A random vector X = (X1 , X2 , ..., Xn )t has a spherical distribution if for every orthogonal map U ∈ Rn×n (i.e. maps satisfying U U t = U t U = In×n ) U X =d X.1 we note that: X ∼ Sn (φ).If X has a density f(x) then this is equivalent to f (x) = g(xt x) = g(kxk2 ) for some function g : R+ −→ R+ , so that the spherical distributions are best interpreted as those distributions whose density is constant on spheres. Elliptical distributions extend the multivariate normal Nn (µ, Σ), for which µ is mean and Σ is the covariance matrix. Mathematically, they are the affine maps of spherical distributions in Rn . 3.1.2 Elliptic Distribution Definition 3.2 Let T : Rn −→ Rn , y 7−→ Ay + µ , A ∈ Rn×n , µ ∈ Rn . X has an elliptical distribution if X = T ( Y ) and Y ∼ Sn (φ). If Y has a density f (y) = g(y t y) and if A is regular (det(A) 6= 0 so that Σ = At A is strictly positive),then X = AY + µ has a density p h(x) = g((x − µ)t Σ−1 (x − µ))/ det(Σ) (9) and the contours of equal density are now ellipsoids. An elliptical distribution is fully described by its mean, its covariance matrix and its characteristic generator. • Any linear combination of an elliptically distributed random vector is also elliptical with the same characteristic generator φ . If Y ∼ Nn (µ, Σ, φ) , b ∈ Rm and B ∈ Rm×n then B.Y + b ∼ Nm (Bµ + b, BΣB t , φ) . 3.2 Integral Equation with solution VaR Since X is an elliptic distribution, its density take the following form: h1 (x) = h((x − 1I)) 1I is the vector of unities and h is the density function of η which take the form : p h(x) = g((x − µ)Σ−1 (x − µ)t )/ det(Σ), therefore we have the following equation P rob{(X, ΛX) ≥ −V aRα + n X 1 αii } = 1 − α = I(k) Pn with V aRα , as solution such that k = −V aRα + 1 αii . In terms of our elliptic distribution parameters we have to solve the following equation: Z I(k) = h1 (x)dx = 1 − α {(x,Λ.x)≥k} with X ∼ En (µ + 1, Σ, φ), AAt = Σ and I(k) given as follow: Z dy g((y − µ − 1I)t Σ−1 (y − µ − 1I)) p I(k) = det(Σ) {(x,Λ.x)≥k} 1= d denote equality in distribution 4 (10) since Λ is a diagonal matrix with all positive diagonal values, we decompose Λ = Λ1/2 · Λ1/2 therefore the equation (10) becomes Z Z g(kzk2)dz. g(kzk2)dz = I(k) = kΛ1/2 (Az+µ+1I)k22 ≤k} {<Λ1/2 (Az+µ+1I),Λ1/2 (Az+µ+1I)>≥k} Cholesky decomposition states that Σ = AAt when Σ is suppose to be positive, therefore if we changing the variable z = A−1 (y − µ − 1I), the precedent integral becomes : Z g(kzk2)dz. I(k) = (Az+µ+1I)t Λ(Az+µ+1I)≥k} If we do the following decomposition (Az + µ + 1I)t Λ(Az + µ + 1I) = (z + v)t D(z + v) + δ, with D = At · Λ · A , v = A−1 (µ + 1I) and δ = 0, after some elementary calculus Z g(kzk2 )dz. I(k) = {(z+v)t D(z+v)≥k−δ} If we suggesting k1 = k − δ = R2 , z + v = u, dz = du, we find that Z I(k) = g(ku − vk2 )dz = 1 − α. {ut .D.u≥R2 } By introducing the variable z = D1/2 u/R, we have that: Z −1 dz n I(R) = R g(kRD 2 z − vk2 ) p det(D) {kzk≥1} next, by using spherical variables z = r.ξ with ξ ∈ Sn−1 and dz = rn−1 drdσ(ξ), where dσ(z) is a elementary surface of z on Sn−1 = {ξ|ξ ∈ Rn , ξ12 + ξ22 + ... + ξn2 = 1} and by introducing the function J(r, R) such that Z −1 (11) g(krRD 2 ξ − vk2 )dσ(ξ) J(r, R) = Sn−1 we obtain R−n · I(R) = Z 1 ∞ rn−1 hZ g(krRD Sn−1 Next By introducing the function −1 2 Z ∞ i dr dr ξ − vk2 )dσ(ξ) p rn−1 J(r, R) p = . det(D) det(D) 1 H(s) = sn Z ∞ rn−1 J(r, s)dr, (12) (13) 1 our goal will be to solve the following equation p H(s) = (1 − α) det(D). (14) In the following section, we propose to approximate J(r,R) by applied the numerical methods giving in the paper of Alan Genz (2003), ( see [6] for more details). 3.3 Numerical approximation of J(r,R) In this section, we estimate the integral J(r,R) by a numerical methods given by Alan Genz in [6] . 5 3.4 Some interpolation rules on Sn−1 The paper [6] of Alan Genz, give the following method. Suppose that we need to estimate the following integral Z f (z)dσ(z) J(f ) = Sn−1 where dσ(z) is an element of surface on Sn−1 = {z|z ∈ Rn , z12 + z22 + ... + zn2 = 1}. In effect, let be the n-1 simplex by Tn−1 = {x|x ∈ Rn−1 , 0 ≤ x1 + x2 + ... + xn−1 ≤ 1} and for any Pn−1 x ∈ Tn−1 , define xn =P 1 − i=1 xi . Also tp P = (tp1 , ..., tpn−1 ) if points t0 , t1 ,. . . , tm are given, satisfying n n the condition : |tp | = i=1 tpi = 1 whenever i=1 pi = m, for non-negative integers p1 ,. . . , pn , then the Lagrange interpolation formula (sylvester [12] for a function g(x) on Tn−1 is given by n pY i −1 X Y x2i − t2j g(tp ) t2 − t2j i=1 j=0 pi L(m,n−1) (g, x) = |p|=m m L(m,n−1) (g, x) is the unique polynomial of degree m which interpolates g(x) at all of the Cm+n−1 points in the set {x|x = (tp1 , ..., tpn−1 ), |p| = m}. Silvester provided families of points, satisfying the condition |tp | = 1 i+µ when |p| = m, in the form ti = m+θn for i=0,1,. . . ,m, and µ real. If 0 ≤ θ ≤ 1 , all interpolation points (m,n−1) for L (g, x) are in Tn−1 . Sylvester derived families of interpolators rules for integration over Tn−1 by integrating L(m,n−1) (g, x) . Fully symmetric interpolar integration rules can be obtained by substitute xi = zi2 , and ti = u2i in L(m,n−1) (g, x), and define n pY i −1 X Y zi2 − u2j f {up } u2pi − u2j i=1 j=0 M (m,n) (f, z) = |p|=m where f {u} is a symmetric sum defined by f {u} = 2−c(u) X f (s1 u1 , s2 u2 , . . . , sn un ) s with c(u) the number of nonzero entries in (u1 , . . . , un ), and the that occur when si = ±1 for those i with ui different to zero. P s taken over all of the signs combinations Lemma 3.3 If n pY i −1 Y zi2 − u2j ) u2pi − u2j i=1 j=0 wp = J( then J(f ) = R(m,n) (f ) = X |p|=m f {u} = 2−c(u) X wp f {up } f (s1 u1 , s2 u2 , ..., sn un ) s , with c(u) the number of nonzero entries in (u1 , ..., un ), and the that occur when si = ±1 for those i with ui different to zero. P s taken over all of the signs combinations The proof is given in [6] by (Alan Genz (2003)) as follow: Let z k = z1k1 z2k2 · znkn . J and R are both linear functionals, so it is sufficient to show that R(m,n) (z k ) = J(z k ) whenever |k| ≤ 2m + 1. If k has any component ki that is odd, then J(z k ) = 0, and R(m,n) (z k ) = 0 because ever term ukq in each of the symmetry sums f {up } has a cancelling term - ukq . Therefore, the only monomials that need to be considered are of the form z 2k , with |k| ≤ m. The uniqueness of L(m,n−1) (g, x) implies 6 L(m,n−1) (xk , x) = xk whenever |k| ≤ m, so M (m,n) (z 2k , z) = z 2k , whenever |k| ≤ m. Combining these results: X wp f {up } = R(m,n) (z k ) J(f ) = M (m,n) (f, z)) = |p|=m whenever f (z) = z k , with |k| ≤ 2m + 1, so R(m,n) (f ) has polynomial degree 2m+1. For more details ( cf. Genz [6]). 3.5 Application to Numerical approximation of J(r, R) Since our goal is to estimate the integral (10), it is straightforward that the theorem (4.2.1) is applicable to the function f such that f (z) = g(krRD −1 2 z − vk2 ). Next, since we have that f {up } = g(krRD −1 2 (s.up )t − vk2 ), by introducing the approximate function Jup that depend to the choice of up , (10) becomes X X −1 J(r, R) ≈ wp g(krRD 2 (s.up )t − vk2 ) = Jup (r, R) |p|=m (15) s t we note s.up = (s1 u1 , ..., sn un ) . Remark 3.4 Jup (r, R) is the numerical approximation of J(r, R) as given in (15), is depend to the choice of interpolation points up on hypersphere. Recall that J(r, R) was a fixed function that depend to R and the density function of our elliptic distribution . By introducing Hup , the approximate function of H as define in (13) that depend of Jup , such that Z ∞ n Hup (s) = s (16) rn−1 Jup (r, s)dr ≈ H(s). 1 By replace H(s) in (14) by Hup (s) we then prove the following result: Theorem 3.5 If we have a quadratic portfolio of securities (i.e equities) such that the Profit & Loss function 2 Pn over the time window of interest is, to good approximation, given by ∆Π ≈ i=1 Si (0) · θi (ηi (t) + ηi (t) 2 ), with portfolio weights θi . Suppose moreover that the joint log-returns is a random vector (η1 , . . . , ηn ) that follows a continuous elliptic distribution, with probability density as in (9),where µ is the vector mean and Σ is the variance-covariance matrix, and where we suppose that g(s2 ) is integrable over R, continuous and g at confidence (1 − α) is given by nowhere 0. Then the approximate portfolio’s quadratic elliptic V aRα,u p g = V aRα,u p P (0) 2 − Rg,u p 2 (17) where Rg,up is the unique solution of the equation v u n Y p (1 − α) u tdet(Σ) θi · Si (0). Hup (s) = (1 − α) · det(D) = 2n/2 i=1 (18) In this case, we assume that our losses will not be greater than half-price of the portfolio at time 0. g ) Remark 3.6 The precedent theorem give to us an approximate Quadratic Portfolio Value-at-Risk (V aRα,u p that depend to our choice of interpolation points on hypersphere ,α and the function g. Therefore it is clear that the best choice of interpolation point will depend to the g function in (9). 7 With some simple calculus we have the following remark Remark 3.7 Jup (r, R) = X wp  X  g a(s, up , R) · r2 − 2 · b(s, up , R, D, v) · r + c(v) (19) s |p|=m −1 for which a(s, up , R, D) = kRD 2 (s.up )k2 , b(s, up , R, D, v) = R < D more simplification we will note a,b,c. −1 2 (s.up ), v >,c = kvk2 . Sometimes, for 2 Since inequality of Schwartz give that b2 −ac < 0 , we use the change of variable by posing b1 = b −ac < 0, a u = r − ab , by using using the binom of Newton, and by introducing the function Gj,g for j = 0, .., n − 1, such that we have the following remark Remark 3.8 J(r, R) = X |p|=m X n − 1 X n−1 (b/a)n−1−j Gj,g wp up ,s (R) j s j=0 with Gj,g up ,s (R) = Z (20) ∞ b 1− a z j · g(az 2 − b1 )dz (21) for which a,b and c are defined in (3.7). By replace d = b/a = Gj,g up ,s (R) = Z −1 2 (s.up ),v> −1 RkD 2 (s.up )k2 <D ∞ −1 <D 2 (s.up ),v> 1− −1 RkD 2 (s.up )k2 by its value in (3.8),we obtain −1   −1 < D 2 (s.up ), v >2 2 + kvk dz z j · g R2 · kD 2 (s.up )k2 z 2 − −1 kD 2 (s.up )k2 (22) we then have the following theorem Theorem 3.9 If we have a quadratic portfolio of securities (i.e equities) for which the joint securities logreturns changes with continuous elliptic distribution with pdf distribution as in (9), then the approximate g at confidence (1 − α) is given by portfolio’s quadratic elliptic V aRα,u p g = V aRα,u p P (0) 2 − Rg,u p 2 (23) where Rg,up is the unique solution of the equation X |p|=m v u n−1−j −1 n X n−1 X n − 1 Y u 2 (s.u ), v > < D (1 − α) p j+1 j,g tdet(Σ) R ·( wp θi · Si (0). (24) ) · Gup ,s (R) = −1 j 2n/2 kD 2 (s.up )k2 s j=0 i=1 In this case, we assume that our losses will not be greater than half-price of the portfolio at time 0. Remark 3.10 We have reduced our problem to one dimensional integral equation. Therefore, to get an explicit equation to solve, we need to estimate Gj,g up ,s (R) that depend to R with parameters g,up ,v and D. Therefore, in the case of normal distribution or t-distribution, it will suffices to replace g in the expression of (21), an to estimate the one dimensional integral (21). 8 3.5.1 The case of normal distribution In the case of normal distribution, the pdf is given by: and specific is given as follow 1 1 f (x) = p exp(− (x − µ)Σ−1 (x − µ)t ) n 2 (2π) |Σ| x n (25) x g(x) = (2π)− 2 e− 2 = C(n).e− 2 therefore it suffices to replace g in (21) then n Gjup ,s (R) = (2π)− 2 e If 1 − b a b1 2 Z ∞ uj e− au2 2 du. (26) b 1− a > 0 ( it is the case when R is sufficiently big such that |v| < RkD Gjup ,s (R) 2 −2 exp(− kvk 2 )(2π) n = exp ( <D −1 2 RkD therefore, since a = (RkD −1 2 (s.up ), v >2 −1 2 (st up )k2 )(2/a) 1+j 2 j + 1 (RkD , Γ( 2 −1 2 −1 2 (s.up )k ). −1 2 < D 2 (s.up ), v > (st up )k)2 (1 − ) ) −1 2 RkD 2 (st up )k2 (27) (s.up )k)2 we have the following theorem Theorem 3.11 If we have a portfolio of securities (i.e equities), such that the Profit & Loss function over 2 P the time window of interest is, to good approximation, given by ∆Π ≈ ni=1 Si (0) · θi (ηi (t) + ηi (t) 2 ), with portfolio weights θi . Suppose moreover that the joint log-returns is a random vector (η1 , . . . , ηn ) that follows a continuous multivariate normal distribution with density function in (25), vector mean µ , and variancecovariance matrix Σ, the Quadratic Value-at-Risk (V aRα,up at confidence 1 − α is given by the following formula P (0) Ru2 p ,α = −V aRα,up + 2 for which Rup ,α is the unique solution of the following transcendental equation. 2(1 − α)  n−1  X (< D −1 X 2 (s.u ), v >)(n−j−1) b1 X det(D) j+1 a n−1 b 2 p 2 e w Γ( = , (1 − ) ) n p −1 j 2 2 a (2π) 2 kD 2 (s.up )k(2n−1−j) s j=0 p for which b1 = (28) |p|=m −1 2 (s.up ),v>)2 −1 kD 2 (s.up )k2 (<D − kvk2 , b a = −1 2 (s.up ),v> −1 RkD 2 (s.up )k2 <D , a = R2 kD −1 2 (s.up )k2 . In this case, we implicitly assume V aRα;up ≤ P (0)/2. Γ is the incomplete gamma function. 3.5.2 Case of t-student distribution If our elliptic distribution is in particular chosen as the multivariate t-student distribution, we will have density function given by g(x) = −ν−n −ν−n   Γ( ν+n x ( 2 ) x ( 2 ) 2 ) = C(n, ν) 1 + 1 + ν ν Γ(ν/2).π n/2 (29) therefore by replacing g in (24), we obtain the equation X |p|=m Z ∞ (  X n−1 X n − 1 au2 − b21  n−1−j (b/a) wp uj 1 + b j ν 1− a s j=0 9 −ν−n ) 2 p (1 − α) det(D) . du = C(n, ν)Rn (30) suggesting c1 = ν − b21 , our equation is reduce to p Z ∞ ( −ν−n  X n−1 X n − 1 X ) (1 − α) det(D) 2 n−1−j 2 j (b/a) wp . u au + c1 du = ν+n b j ν 2 C(n, ν)Rn 1− a s j=0 |p|=m changing variable in this integral according to v = u2 and β = R n X |p|=m a c1 , (31) we find that p Z ∞  ( −ν−n X n−1 X n − 1 −n−ν ) j+1 (1 − α)π n/2 Γ(ν/2) det(D) 2 n−1−j −1 2 (b/a) c1 βv + 1 wp v 2 du = . ν+n b 2 j ν 2 Γ( ν+n ) ) (1− a s j=0 2 (32) For the latter integral equation, we will use the following formula from [7]: Lemma 3.12 (cf. [7], formula 3.194(2)). If |arg( βu )| < π, and Re(ν1 ) > Re(µ) > 0 , then Z +∞ 1 uµ−ν1 β −ν1 ). xµ−1 (1 + βx)−ν1 dx = 2 F 1 (ν1 , ν1 − µ; ν1 − µ + 1; − ν − µ β ·u 1 u (33) Here 2 F1 (α; β, γ; w) is the hypergeometric function. 2 In our case,ν1 = ν+n 2 , u = (1 − b/a) , ν1 − µ = (32), we will obtain the following result. n+ν−j−1 , 2 ν1 − µ + 1 = n+ν−j+1 2 therefore If we replace in Theorem 3.13 If we have a portfolio of securities (i.e equities), such that the Profit & Loss function over 2 Pn the time window of interest is, to good approximation, given by ∆Π ≈ i=1 Si (0) · θi (ηi (t) + ηi (t) 2 ), with portfolio weights θi . Suppose moreover that the joint log-returns is a random vector (η1 , . . . , ηn ) that follows a continuous multivariate t-distribution with density function given by (29), vector mean µ , and variancecovariance matrix Σ, the Quadratic Value-at-Risk (V aRα,up at confidence 1 − α is given by the following formula P (0) Ru2 p ,α = −V aRα,up + 2 for which Rup ,α is the unique solution of the following transcendental equation. h i b21 −ν n+ν n+ν−j−1 n+ν−j+1   n−1 , ; ; n−1−j 2 F 1 n X X X b 2 2 2 2 n (b/a) (π/2)n/2 Γ(ν/2) R a(1− a ) p wp (34) = Qn −n−ν ν+n ν+n j (ν − b2 ) 2 (n + ν − j − 1) det(Σ) i=1 θi · Si (0) (1 − α) 2 Γ( ) ν s j=0 2 |p|=m 1 for which b1 = −1 (<D 2 (s.up ),v>)2 −1 kD 2 (s.up )k2 −kvk2 , b a = −1 2 (s.up ),v> −1 RkD 2 (s.up )k2 <D , a = R2 kD −1 2 (s.up )k2 . In this case, we implicitly assume that V aRα,up ≤ P (0)/2 Remark 3.14 Note that, Hypergeometric 2 F1 ’s have been extensively studies, and numerical software for their evaluation is available in Maple and in Mathematica. 4 Quadratic VaR with mixture of elliptic Distributions Mixture distributions can be used to model situations where the data can be viewed as arising from two or more distinct classes of populations; see also [9]. For example, in the context of Risk Management, if we divide trading days into two sets, quiet days and hectic days, a mixture model will be based on the fact that returns are moderate on quiet days, but can be unusually large or small on hectic days. Practical applications of mixture models to compute VaR can be found in Zangari (1996), who uses a mixture normal to incorporate fat tails in VaR estimation. In this section, we sketch how to generalize the preceding section to the situation where the joint log-returns follow a mixture of elliptic distributions, that is, a convex linear combination of elliptic distributions. 10 Definition 4.1 We say that (X1 , . . . , Xn ) has a joint distribution Pq that is the mixture of q elliptic distributions N (µj , Σj , φj )2 , with weights {βj } (j=1,..,q ; βj > 0 ; j=1 βj = 1), if its cumulative distribution function can be written as q X βj Fj (x1 , . . . , xn ) FX1 ,...,Xn (x1 , . . . , xn ) = j=1 with Fj (x1 , . . . , xn ) the cdf of N (µj , Σj , φj ). Remark 4.2 In practice, one would usually limit oneself to q = 2, due to estimation and identification problems; see [9]. We will suppose that all our elliptic distributions N (µj , Σj , φj ) admit a pdf : fj (x) = |Σj |−1/2 gj ((x − µj )Σj −1 (x − µj )t ) (35) for which each gj is continuous integrable function Pqover R, and that the gj never vanish jointly in a point of Rq . The pdf of the mixture will then simply be j=1 βj fj (x). Let Σj = Atj Aj So, following (12),we introduce Jk (r, R) such that αR−n = q Z X k=1 ∞ 1 rn−1 q Z ∞ i X −1 dr gk (krRDk2 ξ − vk k2 )dσ(ξ) p = rn−1 Jk (r, R)dr det(Dk ) k=1 1 Sn−1 hZ Next following (21), we introduce the function Z n Gj,g (R) = R up ,s,k ∞ b 1− ak with ak = kRD corollary −1 2 (36) z j · gk (ak z 2 − b1k )dz (37) k −1 (s.upk )k2 , bk = R < Dk2 (s.upk ), v >,ck = kvk k2 ,b1k = b2k −ak ck , ak then we have the following Theorem 4.3 If we have a portfolio of securities (i.e equities) such that the Profit & Loss function over 2 Pn the time window of interest is, to good approximation, given by ∆Π ≈ i=1 Si (0) · θi (ηi (t) + ηi (t) 2 ), with portfolio weights θi . Suppose moreover that the joint log-returns is a random vector (η1 , . . . , ηn ) is a mixture of q elliptic distributions, with density h(x) = q X j=1 βj |Σj | −1/2 t gj ((x − µj )Σ−1 j (x − µj ) ) where µj is the vector mean, and Σj the variance-covariance matrix of the j-th component of the mixture. We suppose that each gj is integrable function over R, and that the gj never vanish jointly in a point of Rm . Then the value-at-Risk, or Quadratic mixture-elliptic VaR, at confidence 1 − α is given as the solution of the transcendental equation   P (0) 1/2 g q Gj,g ( ) − V aR X n−1 X n − 1 X X α,u p 2 (1 − α) n−1−j up ,s,k p (bk /ak ) wp = (38) Qn j 2n/2 det(Σk ) i=1 θi · Si (0) s j=0 k=1 |p|=m for which Gj,g up ,s,k is defined in (37). In this case, we assume that our losses will not be greater than half-price of the portfolio at time 0. 2 or N (µj , Σj , gj ) if we parameterize elliptical distributions using gj instead of φj 11 Remark 4.4 One might, in certain situations, try to model with a mixture of elliptic distributions which all have the same variance-covariance and the same mean, and obtain for example a mixture of different tail behaviors by playing with the gj ’s. The preceding can immediately be specialized to a mixture of normal distributions: the details will be left to the reader. 4.1 Application with mixture of Student t-Distributions We will consider a mixture of q Student t-distributions such that, the k th density function i = 1, .., q will be given by −ν −n −ν −n  Γ( νk2+n )  x ( k2 ) x ( k2 ) 1 + gk (x) = = C(n, ν ) 1 + (39) k νk νk Γ(νk /2).π n/2 and Σk = Atk Ak therefore by replacing gk by g in (40) and since integration is a linear operation, we obtain the following theorem Theorem 4.5 If we have a portfolio of securities (i.e equities) such that the Profit & Loss function over 2 Pn the time window of interest is, to good approximation, given by ∆Π ≈ i=1 Si (0) · θi (ηi (t) + ηi (t) 2 ), with portfolio weights θi . Suppose moreover that the joint log-returns is a random vector (η1 , . . . , ηn ) is a mixture of q t-distributions, with density h(x) = q X j=1 βj |Σj | −1/2 ν +n t − (x − µj )Σ−1 Γ( j 2 )  j (x − µj ) 1 + νj Γ(νj /2).π n/2 n+νj 2 where µj is the vector mean, and Σj the variance-covariance matrix of the j-th component of the mixture. We suppose that each gj is integrable function over R, and that the gj never vanish jointly in a point of Rm . Then the value-at-Risk, or Quadratic mixture-student VaR, at confidence 1 − α is given by : Ru2 p = −V aRα + P (0) 2 for which Rup is the unique positive solution of the following equation:   b21k −ν n+νk n+νk −j−1 n+νk −j+1 ; ; q b 2 , 2 2 X X wp Γ( νk +n ) X n−1 X n − 1 Rn (bk /ak )n−1−j 2 F 1 ak (1− ak )2 (1 − α) 2 k p = Qn −n −n−ν Γ(νk /2). s j=0 j 2 2 (n + ν − j − 1) |Σ θ · S (0) | (π/2) 2 k i k ((νk − b1k )/νk ) i=1 i k=1 |p|=m (40) −1 for which b1k = (<Dk 2 (s.upk ),vk >)2 −1 kDk 2 (s.upk )k2 −1 − kvk k2 , bk ak = <Dk 2 (s.upk ),vk > −1 RkDk 2 (s.upk )k2 −1 , ak = R2 kDk2 (s.upk )k2 and det(Σk ) = |Σk | . In this case, we implicitly assume that our losses will not be greater than P (0)/2. 5 Elliptic Quadratic Expected Shortfall for portfolio of securities Expected shortfall is a sub-additive risk statistic that describes how large losses are on average when they exceed the VaR level. Expected shortfall will therefore give an indication of the size of extreme losses when the VaR threshold is breached. We will evaluate the expected shortfall for a quadratic portfolio of securities under the hypothesis of elliptically distributed risk factors. Mathematically, the expected shortfall associated with a given VaR is defined as: Expected Shortfall = E(−∆Π| − ∆Π > V aR), 12 see for example [9]. Assuming again a multivariate elliptic pdf f (x) = |Σ| Expected Shortfall at confidence level 1 − α is given by −ESα −1 g((x − µ)Σ−1 (x − µ)t ), the = E(∆Π | ∆Π ≤ −V aRα )  1 E ∆Π · 1{∆Π≤−V aRα } = αZ 1 = ((x, Λ.x) − P (0)/2) h1 (x) dx α {(x,Λ.x)−P (0)/2≤−V aRα } −1/2 Z |Σ| ((x, Λ.x) − P (0)/2) g((x − µ − 1)Σ−1 (x − µ − 1)t )dx. = α {(x,Λ.x)≤−V aRα +P (0)/2} Using the definition of V aRα and by replace ∆Π = (X, Λ.X) − P (0) 2 , with random vector X define in section 2, −1/2 ESα = P (0) |Σ| − 2 α Z {(x,Λ.x)≤−V aRα +P (0)/2} (x, Λ.x) g((x − µ − 1)Σ−1 (x − µ − 1)t )dx (41) Let Σ = At A, as before.Doing the same linear changes of variables as in section 2 and section 3, we arrive at: ESα = P (0) Rn+2 |D| − 2 α −1/2 |D| α P (0) Rn+2 |D| − 2 α −1/2 ≈ −1/2 = P (0) Rn+2 |D| − 2 α = P (0) R − 2 1 Z 1 Z 1 r n+1 0 −1/2 n+2 Z hZ g(krRD −1 2 Sn−1 i ξ − vk2 )dσ(ξ) dr rn+1 J(r, R)dr 0 rn+1 Jup (r, R)dr 0 X X |p|=m wp 1 Z rn+1 g(krRD 0 s −1 2 (s.up )t − vk2 ) dr , By introducing the function Qgup ,s such that Qgup ,s (R) = Rn+2 Z 1 rn+1 g(krRD −1 2 0 (s.up )t − vk2 ) dr (42) we have the following theorem Theorem 5.1 Suppose that the portfolio is quadratic in the risk-factors X = (X1 , · · · , Xn ): ∆Π = (X, Λ · −1 X) − P (0) and that X ∼ N (µ + 1, Σ, φ), with pdf f (x) = |Σ| g((x − µ − 1)Σ−1 (x − µ − 1)t ). If the V aRα 2 is given, then the expected Shortfall at level α is given by : −1/2 ESα = P (0) |D| − 2 α X X wp |p|=m s  P (0)  − V aRα )1/2 . Qgup ,s ( 2 we introduce I1g and I2g such that R −n−2 Qgup ,s (R) = Z 0 1 r n+1 2 g(ar − 2br + c)dr = Following the Integral (21) 13 Z 0 ∞ − Z 1 ∞ g g = I1,u (R) − I2,u (R) p ,s p ,s (43) g I2,u (R) p ,s = n+1 X  n+1 (b/a)n+1−j · Gj,g up ,s (R) j j=0 for which a,b and c are defined in remark (3.7) and Z ∞ g I1,u (R) = rn+1 g(ar2 − 2br + c)dr p ,s 0 5.1 Expected Shortfall with normal distribution In the case of normal distribution, the pdf is given by (25) and the specific g is given as follow n x x g(x) = (2π)− 2 e− 2 = C(n).e− 2 therefore it suffices to replace g in (21) then n Gjup ,s (R) = (2π)− 2 exp = (2π)− 2 exp n  b2 − ac  Z 2a  b2 − ac  2a ∞ uj exp (− b 1− a (2/a) 1+j 2 Γ au2 )du 2 j + 1 a b  , (1 − )2 . 2 2 a By using the following lemma Lemma 5.2 (cf. [7], formula 3.462(1)). If Re(ν) > 0, and Re(β) > 0 , then Z 0 +∞ −ν/2 xν−1 exp (−βx2 − λx)dx = (2β) Γ(ν) exp  λ   λ2  D−ν √ 8β 2β Here D−ν is the parabolic cylinder function with D−ν (z) = 2 −ν 2 e −z 2 2  ν 1 z 2  √2πz  1 + ν 3 z 2 i h √π − , ; Φ , ; Φ 2 2 2 Γ( ν2 ) 2 2 2 Γ( 1+ν 2 ) where Φ is the confluent hypergeometric function (for more details see [7] page 1018). we next obtain g I2,u (R) p ,s −n 2 = (2π) n+1 X j=0  j + 1 a  b2 − ac  1+j b  n+1 (2/a) 2 Γ , (1 − )2 (b/a)n+1−j · exp 4a 2 2 a j and g (R) = I1,u p ,s = n Z 1  ar2 − 2br  kvk2 dr ) rn+1 exp − 2 2 0  −b   b2  kvk2 n+2 D−n−2 √ )a 2 Γ(n + 2) exp exp(− 2 4a a (2π)− 2 exp(− n (2π)− 2 for which D−n−2 is the parabolic cylinder function. We have therefore prove the following result: 14 (44) Theorem 5.3 Suppose that the portfolio is quadratic in the risk-factors X = (X1 , · · · , Xn ): ∆Π = (X, Λ · X) − P (0) and that X is a multivariate normal distribution, If the V aRα is given, then the 2 expected Shortfall at level α is given by : ESα = for which R = q P (0) 2 P (0) Rn+2 |D| − 2 α −1/2 X X |p|=m s h i g g (R) − I (R) . wp I1,u 2,up ,s p ,s (45) − V aRα The preceding can immediately be specialized to a mixture of normal distributions. The details will be left to the reader. 5.2 Student t-distribution Quadratic Expected Shortfall Following the precedent section 3,4,5, and particularly the lemma (33) , the application can be specialized to a Student t-distribution. The details will be left to the reader. 5.3 How to choose an interpolation points up on hypersphere In order to obtain a good approximation of our integral, one will choose the points of interpolation up of our g function such that our approximation is the best as possible. In the case where the g function decreases quickly with all its derivatives of all order, in inspiring of the classical analysis, one will choose the points which render the maximum function krRD−1/2 (s.up ) − vk. 6 Conclusion By following the notion of Delta-Gamma Portfolio that contains derivatives instruments, we have introduced a Quadratic Portfolios of securities (i.e equities) without the use of Delta and Gamma. By using the assumption that the joint securities log-returns follow a mixture of elliptic distributions, we have reduced the estimation of VaR of such quadratic portfolio, to the resolution of a multiple integral equation, that contain a multiple integral over hypersphere. To approximate a multiple integral over hypersphere, we propose to use a numerical approximation method given by Alan Genz in[6]. Therefore, the estimation of VaR is reduced to the resolution of one dimensional integral equation. To illustrate our method, we give special attention to mixture of normal distribution and mixture of multivariate t-student distribution. In the case of t-distribution, we need the hypergeometric special function. For given VaR, we also show how to estimate the expected shortfall of the Quadratic portfolio without derivatives instruments, when the risk factors follow an elliptic distributions and we illustrate our proposition with normal distribution by using the parabolic cylinder function. Note that this method will be applicable to capital allocation, if we could consider an institution as a portfolio of multi-lines businesses. In the sequel paper, we will dealt with this numerical Quadratic method, when the Portfolio contains derivatives instruments (i.e options). A concrete application need the estimation of wp such that |p| = m, therefore we send the reader to Alan Genz [6]. 15 References [1] R. Brummelhuis, A. Cordoba, M. Quintanilla and L. Seco, Principal Component Value-at-Risk, Mathematical Finance 12, 2002, pp. 23-43. [2] Cardenas, J., E.Fruchard, E.Koehler, C.Michel, and I.Thomaseau(1997): VaR: One Step beyond, RISK 10(10), 72-75. [3] Kevin Dowd,(1998) Beyond Value-at-Risk: the new science of risk Management (Wiley series in Frontiers in Finance). [4] P.Embrechts , A.McNeil and D.Strauman . Correlation and dependance in Risk Management Properties and Pitfalls. In M.A.H. Dempster, editor, Risk Management: Value at Risk and Beyond, pages 176-223. Cambridge University Press, 2002. [5] D.Duffie and J.Pan. An overview of value-at-risk. Journal of Derivatives, 4(3):7-49,1997. [6] A. Genz, Fully Symmetric Interpolatory Rules for Multiple Integrals over Hyper-Spherical Surfaces, J. Comp. Appl. Math. 157 (2003), pp. 187–195. [7] I.S Gradshteyn, I.M. Ryzbik Table of integrals, series, and products ( 2000) Editor Alan Jeffrey [8] J.C. Hull, Options, Future and Other Derivatives, 4th Edition, , Prentice Hall, Englewood Cliffs, NJ. [9] Jorge Mina and Jerry Yi Xiao (2001), Return to Riskmetrics: The Evolution of the standard (www.riskmetrics.com). 2001 RiskMetrics Group Inc. [10] J.P. Morgan/Reuters, RiskMetrics Technical Document, 4th Edition, 1996, J.P. Morgan. [11] J. Sadefo-Kamdem, Value-at-Risk and Expected Shortfall for a Linear Portfolios with Elliptically Distributed Risk Factors (2003), submitted. [12] P.Sylvester, Symmetric quadrature formulae for simplexes, Math. Comp. 24 (1970), pp.95-100. [13] Zangari, P. (1996). An Improved Methodology for Measuring VaR, RiskMetrics Monitor, 2nd quarter pp.7-25. http://www.riskmetrics.com/research/journals 16
5cs.CE
Tracking of a Mobile Target Using Generalized Polarization Tensors∗ arXiv:1212.3544v1 [cs.NA] 14 Dec 2012 Habib Ammari† Thomas Boulier† Josselin Garnier‡ Hyeonbae Kang§ Han Wang† January 26, 2018 Abstract In this paper we apply an extended Kalman filter to track both the location and the orientation of a mobile target from multistatic response measurements. We also analyze the effect of the limited-view aspect on the stability and the efficiency of our tracking approach. Our algorithm is based on the use of the generalized polarization tensors, which can be reconstructed from the multistatic response measurements by solving a linear system. The system has the remarkable property that low order generalized polarization tensors are not affected by the error caused by the instability of higher orders in the presence of measurement noise. Mathematics Subject Classification (MSC2000): 35R30, 35B30 Keywords: generalized polarization tensors, target tracking, extended Kalman filter, position and orientation tracking, limited-view data, instability 1 Introduction With each domain and material parameter, an infinite number of tensors, called the Generalized Polarization Tensors (GPTs), is associated. The concept of GPTs was introduced in [6, 4]. The GPTs contain significant information on the shape of the domain [3, 7, 9]. It occurs in several interesting contexts, in particular, in low-frequency scattering [15, 4], asymptotic models of dilute composites (see [23] and [10]), in invisibility cloaking in the quasi-static regime [8] and in potential theory related to certain questions arising in hydrodynamics [24]. Another important use of this concept is for imaging diametrically small conductivity inclusions from boundary or multistatic response measurements. Multistatic response ∗ This work was supported by ERC Advanced Grant Project MULTIMOD–267184 and NRF grants No. 2009-0090250 and 2010-0017532. † Department of Mathematics and Applications, Ecole Normale Supérieure, 45 Rue d’Ulm, 75005 Paris, France ([email protected], [email protected], [email protected]). ‡ Laboratoire de Probabilités et Modèles Aléatoires & Laboratoire Jacques-Louis Lions, Université Paris VII, 75205 Paris Cedex 13, France ([email protected]). § Department of Mathematics, Inha University, Incheon 402-751, Korea ([email protected]). 1 measurements are obtained using arrays of point source transmitters and receivers. This measurement configuration gives the so-called multistatic response matrix (MSR), which measures the change in potential field due to a conductivity inclusion. In fact, the GPTs are the basic building blocks for the asymptotic expansions of the perturbations of the MSR matrix due to the presence of small conductivity inclusions inside a conductor [17, 12, 6]. They can be reconstructed from the multi-static response (MSR) matrix by solving a linear system. The system has the remarkable property that low order generalized polarization tensors are not affected by the error caused by the instability of higher orders in the presence of measurement noise. Based on the asymptotic expansion, efficient and direct (noniterative) algorithms to determine the location and some geometric features of the inclusions were proposed. We refer to [4, 5] and the references therein for recent developments of this theory. An efficient numerical code for computing the GPTs is described in [11]. In [2], we have analyzed the stability and the resolving order of GPT in a circular full angle of view setting with coincident sources and receivers, and developed efficient algorithms for target identification from a dictionary by matching the contracted GPTs (CGPTs). The CGPTs are particular linear combinations of the GPTs (called harmonic combinations) and were first introduced in [8]. As a consequence, explicit relations between the CGPT of scaled, rotated and translated objects have been established in [2], which suggest strongly that the GPTs can also be used for tracking the location and the orientation of a mobile object. One should have in mind that, in real applications, one would like to localize the target and reconstruct its orientation directly from the MSR data without reconstructing the GPTs. In this paper we apply an extended Kalman filter to track both the location and the orientation of a mobile target directly from MSR measurements. The Extended Kalman Filter (EKF) is a generalization of the Kalman Filter (KF) to nonlinear dynamical systems. It is robust with respect to noise and computationally inexpensive, therefore is well suited for real-time applications such as tracking [26]. Target tracking is an important task in sonar and radar imaging, security technologies, autonomous vehicle, robotics, and bio-robotics, see, for instance, [13, 14, 16, 18, 19, 25]. An example in bio-robotics is the weakly electric fish which has the faculty to probe an exterior target with its electric dipole and multiple sensors distributed on the skin [1]. The fish usually swims around the target to acquire information. The use of Kalman-type filtering for target tracking is quite standard, see, for instance, [13, 14, 16, 18, 19, 25]. However, to the best of our knowledge, this is the first time where tracking of the orientation of a target is provided. Moreover, we analyze the ill-posed character of both the location and orientation tracking in the case of limited-view data. In practice, it is quite realistic to have the sources/receivers cover only a limited angle of view. In this case, the reconstruction of the GPTs becomes more ill-posed than in the full-view case. It is the aim of this paper to provide a fast algorithm for tracking both the location and the orientation of a mobile target, and precisely analyze the stability of the inverse problem in the limited-view setting. The paper is organized as follows. In section 2 we recall the conductivity problem and the linear system relating the CGPTs with the MSR data, and provide a stability result in the full angle of view setting. In section 3 we present a GPT-based location and orientation tracking algorithm using an extended Kalman filter and show the numerical results in the 2 full-view setting. In section 4 we analyze the stability of the CGPT-reconstruction in the limited-view setting and also test the performance of the tracking algorithm. The paper ends with a few concluding remarks. An appendix is for a brief review of the extended Kalman filter. 2 Conductivity problem and reconstruction of CGPTs We consider the two-dimensional conductivity problem. Let B be a bounded C 2 -domain of characteristic size of order 1 and centered at the origin. Then D = z + δB is an inclusion of characteristic size of order δ and centered at z. We denote by 0 < κ 6= 1 < +∞ its conductivity, and λ := (κ + 1)/(2κ − 2) its contrast. In the circular setting, N coincident sources/receivers are evenly spaced on the circle of radius R and centered at the origin O between the angular range (0, γ]. In the full-view case, γ = 2π while γ < 2π in the limited-view configuration. The position of s-th source (and r-th receiver) is denoted by xs (and xr , respectively) for s, r = 1 . . . N , with θs = γs/N the angular position. We require that the circle is large enough to include the inclusion (R > δ). In the following, we set ρ := R/δ > 1. 2.1 CGPTs and the linear system In the presence of D, the electrical potential us resulting from a source at xs is given as the solution to the following conductivity problem [2]: ( ∇ · ((1 + (κ − 1)χD )∇us )(x) = 0, x ∈ R2 , (1) us (x) − Γ(x − xs ) = O(|x|−1 ), |x| → +∞, where Γ(x) = (1/2π) log|x| is the fundamental solution of the Laplacian in R2 : ∆Γ(x) = δ0 (x), with δ0 being the Dirac mass at 0. Using asymptotic expansion of the fundamental solution, the MSR data V = (Vsr )s,r being defined as Vsr = us (xr ) − Γ(xr − xs ), is linearly related to the GPTs of B as [4, 6]: Vsr = K X |α|,|β|=1 δ|α|+|β| α ∂ Γ(z − xs )Mαβ (λ, B)∂ β Γ(z − xr ) + Esr + Wsr , α!β! (2) where K denotes the highest order of GPTs in the expansion, E = (Esr )s,r the truncation error (non-zero if K < ∞), and W = (Wsr )s,r the measurement noise following indepeniid 2 2 dently the same normal distribution: Wsr ∼ N (0, σnoise ), of mean zero and variance σnoise . The contracted GPTs, being defined as a harmonic combination of the GPTs [8], allow us to put (2) into an equivalent form [2]: Vsr K X    cs  Mcc 1 1 cos nθr mn Mmn +Esr + Wsr , cos mθs , sin mθs = sc ss m M M sin nθr 2πnρn 2πmρ m,n=1 | {z } | mn {z mn } | {z } Asm Mmn 3 (Arn )⊤ (3) where ⊤ denotes the transpose and the CGPT matrix M = (Mmn )m,n 1 has dimension 2K × 2K. Recall that A = CD, with C being a N × 2K matrix constructed from the block Crm = (cos mθr , sin mθr ) and D a 2K × 2K diagonal matrix:     I2 /ρ C11 C12 · · · C1K   C21 C22 · · · C2K  I2 /(2ρ2 ) 1      C= ; D =   . (4)  .. .. 2π    ···  . . ··· ··· CN 1 CN 2 · · · I2 /(KρK ) CN K Here, I2 is the 2 × 2 identity matrix. With these notations in hand, we introduce the linear operator L(M) = CDMDC⊤ , (5) V = L(M) + E + W. (6) and rewrite (3) as: In order to reconstruct M, we solve the least-squares problem: min kL(M) − Vk2F , M (7) where k·kF denotes the Frobenius norm. It is well known that (7) admits a unique minimal norm solution Mest = L† (V), with L† being the pseudo-inverse of L provided by the following lemma: Lemma 2.1. Let A, B be two real matrices of arbitrary dimension, and define the linear operator L(X) = AXB⊤ . If A† , B† are the pseudo-inverse of A, B respectively, then the pseudo-inverse of L is given by L† (Y) = A† Y(B† )⊤ . (8) Proof. This is a straightforward verification of the definition of pseudo-inverse, namely: 1) L† L and LL† are self-adjoint; 2) LL† L = L and L† LL† = L† . For the first point: L† (L(X)) = A† AX(B† B)⊤ , which is self-adjoint since the matrices A† A and B† B are symmetric by definition of pseudoinverse; while for the second point, it follows from the definition again that L(L† (L(X))) = AA† AX(BB† B)⊤ = AXB⊤ = L(X). Similarly, one can verify the self-adjointness of LL† and L† LL† = L† . 1 Throughout the paper, we will write Mmn for the m, n-th 2 × 2 building block, and (M)ab for the a, b-th entry in M. 4 2.2 Full-view setting In [2], we have investigated the resolving order of CGPT reconstruction in the full angle of view setting: γ = 2π. Given N ≥ 2K, it has been shown that the matrix C is orthogonal (up to the factor N/2): N C⊤ C = I, 2 and the pseudo-inverse solution takes the form: L† (V) = 4 −1 ⊤ D C VCD−1 . N2 (9) Furthermore, the reconstruction problem is exponentially ill-posed. More precisely, the following result holds. Proposition 2.2. Let eab be the 2K ×2K matrix whose elements are all zero but the (a, b)th element is equal to 1. In the circular and full-view setting with N ≥ 2K, the (a, b)-th singular value of the operator L, for a, b = 1, . . . , 2K, is λab = N/(8π 2 ⌈a/2⌉⌈b/2⌉ρ⌈a/2⌉+⌈b/2⌉ ), (10) with the matrix eab as the right singular vector, and fab = λ−1 ab L(eab ) as the left singular vector. In particular, the condition number of the operator L is K 2 ρ2(K−1) . Proof. Using the fact that C⊤ C = N 2 I, we have, for any square matrices U and V, hL(U), L(V)i = N2 hDUD, DVDi , 4 (11) where h·, ·i is the termwise inner product. Since D is diagonal and invertible, we conclude that the canonical basis {eab }a,b is the singular vector of L, and the associated singular value is kL(eab )kF = kDeab DkF N/2 = N/(8π 2 ⌈a/2⌉⌈b/2⌉ρ⌈a/2⌉+⌈b/2⌉ ). As a simple consequence, we have L† (W)ab = λ−1 ab hW, fab i. When K is sufficiently large, the truncation error E is O(ρ−K−2 ) and can be neglected if compared to W [2], and then by the property of white noise q q  E(((Mest )ab − (M)ab )2 ) . E( L† (W)2ab ) = λ−1 ab σnoise , which is the result already established in [2]. Hence, it follows from (10) that the reconstruction of high order CGPTs is an ill-posed problem. Nonetheless the system has the remarkable property that low order CGPTs are not affected by the error caused by the instability of higher orders as the following proposition shows. Proposition 2.3. Let MK denote the CGPTs of order up to K, and let LK be the corresponding linear operator in (3). Then, for any order K1 ≤ K2 < N/2, the submatrix of L†K2 (V) formed by the first 2K1 columns and rows is identical to the minimal norm solution L†K1 (V). 5 Proof. Let the N × 2K matrix JK be the row concatenation of the 2K × 2K identity matrix † ⊤ I2K and a zero matrix. We have J⊤ K JK = I2K and JK1 LK2 (V)JK1 is the submatrix of L†K2 (V) formed by the first 2K1 columns and rows. Let DK and CK be the matrices defined in (4). Because of (9), we have † J⊤ K1 LK2 (V)JK1 = 4 ⊤ −1 ⊤ J D C VCK2 D−1 K2 JK1 . N 2 K1 K2 K2 One can easily see that −1 CK2 D−1 K2 JK1 = CK1 DK1 . Thus, we have † † J⊤ K1 LK2 (V)JK1 = LK1 (V). Numerically, L† can be implemented through either the formula (9) or the Conjugated Gradient (CG) method using (7). Simulations in [2] confirm that in typical situations, say, with K = 5 and 10% noise, the reconstructed CGPT is sufficiently accurate for the task such as the target identification in a dictionary. In the next section we present a location and orientation tracking algorithm for a mobile target based on the concept of CGPTs. 3 Tracking of a mobile target At the instant t ≥ 0, we denote by zt = [xt , yt ]⊤ ∈ R2 the location and θt ∈ [0, 2π) the orientation of a target Dt . Dt = zt + Rθt D, (12) where Rθt is the rotation by θt . Let Mt be the CGPT of Dt , and MD be the CGPT of D. Then the equation (6) becomes: Vt = L(Mt ) + Et + Wt , (13) where Et is the truncation error, and Wt the measurement noise at time t. The objective of tracking is to estimate the target’s location zt and orientation θt from the MSR data stream Vt . We emphasize that these informations are contained in the first two orders CGPTs as shown in the previous paper [2]. Precisely, let ∆xt = xt − xt−1 , ∆yt = yt − yt−1 and ∆θt = θt − θt−1 , then the following relations (when it is well defined) exist between the CGPT of Dt and Dt−1 [2]: (1) (1) (1) (1) N12 (Dt )/N11 (Dt ) = 2(∆xt + i∆yt ) + ei∆θt N12 (Dt−1 )/N11 (Dt−1 ), (2) (2) N12 (Dt )/N11 (Dt ) i∆θt = 2(∆xt + i∆yt ) + e (2) (2) N12 (Dt−1 )/N11 (Dt−1 ). (14) Hence when the linear system (14) is solvable, one can estimate zt , θt by solving and accumulating ∆xt , ∆yt and ∆θt . However, such an algorithm will propagate the error over time, since the noise presented in data is not properly taken into account here. In the following we develop a CGPT-based tracking algorithm using the Extended Kalman Filter, which handles correctly the noise. We recall first the definition of complex CGPT, with which a simple relation between Mt and MD can be established. 6 3.1 Time relationship between CGPTs Let u = (1, i)⊤ . The complex CGPTs N(1) , N(2) are defined by cc ss cs sc ⊤ N(1) mn = (Mmn − Mmn ) + i(Mmn + Mmn ) = u Mmn u, cc ss cs sc H N(2) mn = (Mmn + Mmn ) + i(Mmn − Mmn ) = u Mmn u, where H denotes the Hermitian transpose. Therefore, we have N(1) = U⊤ MU and N(2) = UH MU, where the matrix U of dimension 2K × K over the  u 0 ... 0 u . . .  U = . ..  .. . 0 ... 0 complex fields is defined by  0 0  ..  . . (15) (16) u It is worth mentioning that N(1) and N(2) are complex matrices of dimension K × K. To recover the CGPT Mmn from the complex CGPTs N(1) , N(2) , we simply use the relations 1 1 cs (2) (2) (1) cc = ℜ(N(1) Mmn mn + Nmn ), Mmn = ℑ(Nmn + Nmn ), 2 2 (17) 1 1 sc (2) ss (2) (1) Mmn = ℑ(N(1) − N ), M = ℜ(N − N ), mn mn mn mn mn 2 2 where ℜ, ℑ are the real and imaginary part of a complex number, respectively. For two targets Dt , D satisfying (12), the following relationships between their complex CGPT hold [2]: N(1) (Dt ) = Ft⊤ N(1) (D)Ft , (18a) N(2) (Dt ) = FtH N(2) (D)Ft , (18b) where Ft is a upper triangle matrix with the (m, n)-th entry given by   n (Ft )mn = (xt + iyt )n−m eimθt . m (19) Linear operator Tt : Now one can find explicitly a linear operator Tt (the underlying scalar field is R) which depends only on zt , θt , such that Mt = Tt (MD ), and the equation (13) becomes Vt = L(Tt (MD )) + Et + Wt . (20) For doing so, we set Jt := UFt , where U is given by (16). Then, a straightforward computation using (15), (17), and (18) shows that M cc (Dt ) = ℜJt⊤ MD ℜJt , M cs (Dt ) = ℜJt⊤ MD ℑJt , M sc (Dt ) = ℑJt⊤ MD ℜJt , M ss (Dt ) = ℑJt⊤ MD ℑJt , 7 (21) where M cc (Dt ), M cs (Dt ), M sc (Dt ), M ss (Dt ) are defined in (3). Therefore, we get the operator Tt : Tt (MD ) = ℜU(ℜJt⊤ MD ℜJt )ℜU⊤ + ℜU(ℜJt⊤ MD ℑJt )ℑU⊤ + ℑU(ℑJt⊤ MD ℜJt )ℜU⊤ + ℑU(ℑJt⊤ MD ℑJt )ℑU⊤ = Mt . 3.2 (22) Tracking by the Extended Kalman Filter The EKF is a generalization of the KF to nonlinear dynamical systems. Unlike KF which is an optimal estimator for linear systems with Gaussian noise, EKF is no longer optimal, but it remains robust with respect to noise and computationally inexpensive, therefore is well suited for real-time applications such as tracking. We establish here the system state and the observation equations which are fundamental to EKF, and refer readers to Appendix B for its algorithmic details. 3.2.1 System state observation equations We assume that the position of the target is subjected to an external driving force that has the form of a white noise. In other words the velocity (V (τ ))τ ∈R+ of the target is given in terms of a two-dimensional Brownian motion (Wa (τ ))τ ∈R+ and its position (Z(τ ))τ ∈R+ is given in terms of the integral of this Brownian motion: Z τ V (s)ds. V (τ ) = V0 + σa Wa (τ ), Z(τ ) = Z0 + 0 The orientation (Θ(τ ))τ ∈R+ of the target is subjected to random fluctuations and its angular velocity is given in terms of an independent white noise, so that the orientation is given in terms of a one-dimensional Brownian motion (Wθ (τ ))τ ∈R+ : Θ(τ ) = Θ0 + σθ Wθ (τ ). We observe the target at discrete times t∆τ , t ∈ N, with time step ∆τ . We denote zt = Z(t∆τ ), vt = V (t∆τ ), and θt = Θ(t∆τ ). They obey the recursive relations  vt = vt−1 + at , at = σa Wa (t∆τ ) − Wa ((t − 1)∆τ ) , Z t∆τ (23) Wa (s) − Wa ((t − 1)∆τ )ds, zt = zt−1 + vt−1 ∆τ + bt , bt = σa (t−1)∆τ  θt = θt−1 + ct , ct = σθ Wθ (t∆τ ) − Wθ ((t − 1)∆τ ) . Since the increments of the Brownian motions are independent from each other, the vectors (Ut )t≥1 given by   at Ut =  bt  ct are independent and identically distributed with the multivariate normal distribution with mean zero and covariance matrix Σ given by   σa2 ∆τ I 0 σa2 I2 2 2   2 2 (24) Σ = ∆τ  σa ∆τ I2 σa ∆τ 2 I2 0  2 3 2 0 0 σθ 8 The evolution of the state vector takes the form   vt Xt = zt  θt   I2 0 0 F = ∆τ I2 I2 0 0 0 1 Xt = FXt−1 + Ut , (25) The observation made at time t is the MSR matrix given by (20), where the system state Xt is implicitly included in the operator Tt . We suppose that the truncation error Et is small compared to the measurement noise so that it can be dropped in (20), and that the Gaussian white noise Wt of different time are mutually independent. We emphasize that the velocity vector vt of the target does not contribute to (20), which can be seen from (12). To highlight the dependence upon zt , θt , we introduce a function h which is nonlinear in zt , θt , and takes MD as a parameter, such that h(Xt ; MD ) = h(zt , θt ; MD ) = L(Tt (MD )). (26) Then together with (25) we get the following system state and observation equations: Xt = FXt−1 + Ut , (27a) Vt = h(Xt ; MD ) + Wt . (27b) Note that (27a) is linear, so in order to apply EKF on (27), we only need to linearize (27b), or in other words, to calculate the partial derivatives of h with respect to xt , yt , θt . 3.2.2 Linearization of the observation equation Clearly, the operator L contains only the information concerning the acquisition system and does not depend on xt , yt , θt . So by (26), we have ∂xt h = L(∂xt Tt (MD )), (28) while the calculation for ∂xt Tt is straightforward using (22). We have ∂xt Tt (MD ) =ℜU∂xt (ℜJt⊤ MD ℜJt )ℜU⊤ + ℜU∂xt (ℜJt⊤ MD ℑJt )ℑU⊤ + ℑU∂xt (ℑJt⊤ MD ℜJt )ℜU⊤ + ℑU∂xt (ℑJt⊤ MD ℑJt )ℑU⊤ , (29) where the derivatives are found by the chain rule: ∂xt (ℜJt⊤ MD ℜJt ) = ℜ(∂xt Jt⊤ )MD ℜJt + ℜJt⊤ MD ℜ(∂xt Jt ), ∂xt (ℜJt⊤ MD ℑJt ) = ℜ(∂xt Jt⊤ )MD ℑJt + ℜJt⊤ MD ℑ(∂xt Jt ), ∂xt (ℑJt⊤ MD ℜJt ) = ℑ(∂xt Jt⊤ )MD ℜJt + ℑJt⊤ MD ℜ(∂xt Jt ), ∂xt (ℑJt⊤ MD ℑJt ) = ℑ(∂xt Jt⊤ )MD ℑJt + ℑJt⊤ MD ℑ(∂xt Jt ), and ∂xt Jt = U∂xt Ft . The (m, n)-th entry of the matrix ∂xt Ft is given by   n (∂xt Ft )m,n = (n − m)ztn−m−1 eimθt . m The derivatives ∂yt Tt (MD ) and ∂θt Tt (MD ) are calculated in the same way. 9 (30) 3.3 Numerical experiments of tracking in the full-view setting Here we show the performance of EKF in a full angle of view setting with the shape ’A’ as target D, which has diameter 10 and is centered at the origin. The path (zt , θt ) is simulated according to the model (23) during a period of 10 seconds (∆τ = 0.01), with parameters σa = 2, σθ = 0.5, and the initial state X0 = (v0 , z0 , θ0 )⊤ = (−1, 1, 5, −5, 3π/2)⊤ . We make sure that the target is always included inside the measurement circle on which N = 20 sources/receivers are fixed, see Fig. 1. The data stream Vt is generated by first calculating the MSR matrix corresponding to each Dt , t ≥ 0 then adding a white noise. Suppose that the CGPT of D is correctly determined (for instance, by identifying the target in a dictionary [2]). Then we use the first two orders CGPT MD of D in (27b), and take (0, 0, 10, −0.5, 0)⊤ as initial guess of X0 for EKF. We add 10% and 20% of noise to data, and show the results of tracking in Fig. 2 (a) (c) and (e). We see that EKF can find the true system state, despite of the poor initial guess, and the tracking precision decays as the measurement noise level gets higher. The same experiment with small target (of same shape) of diameter 1 is repeated in Fig. 2 (b) (d) and (f), where the tracking of position remains correct, on the contrary, that of orientation fails when the noise level is high. Such a result is in accordance with physical intuitions. In fact, the position of a small target can be easily localized in the far field, while its orientation can be correctly determined only in the near field. True trajectory Estimation 40 30 20 10 0 −10 −20 −30 −40 −40 −30 −20 −10 0 10 20 30 40 Figure 1: Trajectory of the letter ’A’ and the estimation by EKF. The initial position is (5, −5) while the initial guess given to EKF is (10, −0.5). The crosses indicate the position of sources/receivers, while the circle and the triangle indicate the starting and the final position of the target, respectively. In blue is the true trajectory and in red the estimated one. 10 20 20 15 15 Coordinate 25 Coordinate 25 10 10 5 5 True position in x−axis Estimation sigman=0.1 True position in x−axis Estimation sigman=0.1 Estimation sigma =0.2 Estimation sigma =0.2 n 0 0 100 200 300 400 500 Time 600 700 800 900 n 0 1000 0 100 200 300 (a) 400 500 Time 600 700 800 900 1000 600 700 800 900 1000 (b) 5 5 0 0 Coordinate 10 Coordinate 10 −5 −5 −10 −10 True position in y−axis Estimation sigman=0.1 True position in y−axis Estimation sigman=0.1 Estimation sigman=0.2 −15 0 100 200 300 Estimation sigman=0.2 400 500 Time 600 700 800 900 −15 1000 0 100 200 300 (c) 400 500 Time (d) 6.5 8.5 True orientation Estimation sigman=0.1 True orientation Estimation sigman=0.1 8 Estimation sigma =0.2 Estimation sigma =0.2 n n 6 7.5 7 5.5 Angle Angle 6.5 5 6 5.5 4.5 5 4.5 4 4 3.5 0 100 200 300 400 500 Time 600 700 800 900 1000 (e) 3.5 0 100 200 300 400 500 Time 600 700 800 900 1000 (f) Figure 2: Results of tracking using the configuration of Fig. 1 at different noise levels. First row: coordinate in x-axis. Second row: coordinate in y-axis. Last row: orientation. In the first column the target has size 10, while in the second column the target has size 1. The solid line always indicates the true system state. 11 4 CGPT reconstruction and tracking problem in the limitedview setting In this section we study the stability of CGPTs reconstruction and tracking problem in the case 0 < γ < 2π, always under the condition that N > 2K, i.e., the number of sources/receivers is two times larger than the highest order of CGPTs to be reconstructed. Unlike in the full-view case, here C is no longer orthogonal in general, nonetheless one can still establish the SVD of L similarly as in Proposition 2.2. Proposition 4.1. Consider the concentric and limited-view setting with N ≥ 2K, and suppose that C is of maximal rank. Let {µn } be the n-th largest eigenvalue of the matrix DC⊤ CD and let {vn } be the associated orthonormal eigenvector. Then the (a, b)-th singular √ value of the operator L is λab = µa µb , with the associated left singular vector the matrix gab = va vb⊤ . In particular, the condition number of the operator L is cond(L) = cond(DC⊤ CD) ≤ cond(C)2 K 2 ρ2(K−1) , (31) with cond(C) being the condition number of the matrix C. Proof. We first note that for any matrices U, V we have: hL(U), L(V)i = hU, (DC⊤ CD)V(DC⊤ CD)i. Taking gab = va vb⊤ , and ga′ b′ = va′ vb⊤′ , we get hL(gab ), L(ga′ b′ )i = µa′ hva vb⊤ , va′ vb⊤′ (DC⊤ CD)i = µa′ µb′ hva vb⊤ , va′ vb⊤′ i = δaa′ δbb′ µa µb , √ where δaa′ is the Kronecker’s symbol, which implies that kL(gab )kF = µa µb is the (a, b)-th singular value of L. We denote by ρmax (·), ρmin (·) the maximal and the minimal singular values of a matrix, then ρmax (DC⊤ CD) = ρmax (CD)2 ≤ ρmax (C)2 ρmax (D)2 , ρmin (DC⊤ CD) = ρmin (CD)2 ≥ ρmin (C)2 ρmin (D)2 , and the condition number of L is therefore bounded by cond(C)2 K 2 ρ2(K−1) . 4.1 Injectivity of C We denote by VK the vector space of functions of the form f (θ) = K X ck eikθ , (32) k=−K with ck ∈ C, and VK0 the subspace of VK such that c0 = 0. Functions of VK0 can be written as f (θ) = K X αk cos(kθ) + βk sin(kθ), k=1 12 (33) with αk , βk ∈ C. Observe that taking discrete samples of (33) at θs = γs/N is nothing but applying the matrix C on a coefficient vector (α1 , β1 . . . αK , βK ). We have the following result. Proposition 4.2. For any N ≥ 2K, the matrix C is of maximal rank. Proof. Multiplying f ∈ VK0 in (32) by eiKθ , and using the fact that c0 = 0, we have iKθ e f (θ) = K−1 X ikθ ck−K e + k=0 = K−1 X 2K X ck−K eikθ k=K+1 ikθ ck−K e + 2K−1 X iθ e ck+1−K e = 2K−1 X c̃k eikθ , (34) k=0 k=K k=0 ikθ where c̃k = ck−K for k = 0, . . . , K − 1, and c̃k = eiθ ck+1−K for k = K, . . . , 2K − 1. The N vectors vs := (eikθs )k=0...2K−1 are linearly independent since they are the first 2K ≤ N rows of a N × N Vandermonde matrix. Therefore, f (θs ) = 0 for s = 1 . . . N implies that c̃k = 0 for all k = 0, . . . , 2K − 1, which means that C is of maximal rank. Consequently, for arbitrary range 0 < γ ≤ 2π, a sufficient condition to uniquely determine the CGPTs of order up to K is to have N ≥ 2K sources/receivers. 4.2 Explicit left inverse of C We denote by DK (θ) the Dirichlet kernel of order K: DK (θ) = K X eikθ = k=−K sin((K + 1/2)θ) . sin(θ/2) (35) We state without proof the following well known result about VK . 2πn Lemma 4.3. The functions {DK (θ − 2K+1 )}n=0,...,2K is an orthogonal basis of VK . For any f, g ∈ VK , the following identity holds: 1 2π where ∗ Z 0 2π 2K+1 X  2πn   2πn  1 f f (θ)g (θ)dθ = g , 2K + 1 2K + 1 2K + 1 ∗ (36) n=1 denotes the complex conjugate. In particular, we have for n = 0, . . . , 2K     Z 2π 2πn 1 2πn f (θ)DK θ − dθ = f . 2π 0 2K + 1 2K + 1 (37) Lemma 4.4. Given a set of N > 2K different points 0 < θ1 < . . . < θN ≤ 2π, there exist interpolation kernels hs ∈ V⌊N/2⌋ for s = 1 . . . N , such that: f (θ) = N X s=1 f (θs )hs (θ) for any f ∈ VK . 13 (38) Proof. When the number of points N is odd, it is well known [27] that hs takes the form N Y hs (θ) = sin t=1,t6=s sin When N is even, by a result established in [22] hs (θ) = cos  θ − θs 2  θ−θt 2 . θs −θt 2  Y N t=1,t6=s sin sin It is easy to see that in both cases hs belongs to V⌊N/2⌋ . (39)  θ−θt 2 . θs −θt 2 (40) Now we can find explicitly a left inverse for C. Proposition 4.5. Under the same condition as in Lemma 4.4, we denote by hs the interpolation kernel and define the matrix C̃ = (C̃ks )k,s as Z Z 1 2π 1 2π C̃2k−1,s = hs (θ) cos(kθ)dθ, C̃2k,s = hs (θ) sin(kθ)dθ. (41) π 0 π 0 Then C̃C = I. In particular, if N is odd, the matrix C̃ can be calculated as C̃2k−1,s         N N 2 X 2πkn 2πkn 2πn 2πn 2 X = hs hs cos , C̃2k,s = sin . (42) N n=1 N N N n=1 N N Proof. Given v = (α1 , β1 . . . αK , βK ) ∈ C2K , and f the associated function defined by (33), we have (Cv)n = f (θn ) for n = 1, . . . , N . Using (38) and (41), we find that Z 1 2π (C̃Cv)2k−1 = f (θ) cos(kθ)dθ = αk , (43) π 0 Z 1 2π (C̃Cv)2k = f (θ) sin(kθ)dθ = βk , (44) π 0 and therefore, C̃Cv = v. Observe that hs (θ), cos(kθ), and sin(kθ) all belong to V⌊N/2⌋ , so when N is odd, we easily deduce (42) using (36). Remark 4.1. In general, the left inverse C̃ in (41) is not the pseudo-inverse of C, and by definition, we have C† = C̃ if CC̃ is symmetric. If PV 0 (hs ) is the orthogonal projection of K hn onto VK0 , i.e., PV 0 (hs )(θ) = K K X C̃2k−1,s cos(kθ) + C̃2k,s sin(kθ), (45) k=1 then, PV 0 (hs )(θt ) = (CC̃)st . Therefore, C̃ is the pseudo-inverse of C if and only if the K interpolation kernel hs satisfies: PV 0 (hs )(θt ) = PV 0 (ht )(θs ), for s, t = 1 . . . N. K K 14 (46) Remark 4.2. Proposition 4.5 can be used in the noiseless limited-view case to reconstruct the CGPT matrix M from the MSR measurements V. In fact, from (5) it immediately follows that M = D−1 C̃VC̃⊤ D−1 . This shows that in the noiseless case, the limited-view aspect has no effect on the reconstruction of the GPTs, and consequently on the location and orientation tracking. In the presence of noise, the effect, as will be shown in the next subsection, is dramatic. A small amount of measurement noise significantly changes the performance of our algorithm unless the arrays of receivers and transmitters offer a directional diversity, see Fig. 6. 4.3 Ill-posedness in the limited-view setting We undertake a numerical study to illustrate the ill-posedness of the linear system (6) in the case of limited-view data. Fig. 3 shows the distribution of eigenvalues of the matrix C⊤ C and DC⊤ CD at different values of γ with N = 101 and K = 50. In Fig. 4, we calculate the condition number of C⊤ C and L (which is equal to that of DC⊤ CD by (31)) for different orders K. From these results, we see clearly the effect of the limited-view aspect. First, the tail of tiny eigenvalues in Fig. 3.(a) suggests that the matrix C⊤ C is numerically singular, despite the fact that C is of maximal rank. Secondly, both C⊤ C and L rapidly become extremely ill-conditioned as K increases, so the maximum resolving order of CGPTs is very limited. Furthermore, this limit is intrinsic to the angle of view and cannot be improved by increasing the number of source/receivers, see Fig. 4 (c) and (d). 4 5 10 10 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 2 10 0 10 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 0 10 −5 10 −2 10 Singular value Singular value −4 10 −6 10 −8 10 −10 10 −10 10 −15 10 −20 10 −12 10 −25 10 −14 10 −16 10 −30 0 10 20 30 Order of CGPT 40 50 60 (a) Eigenvalues of C⊤ C 10 0 10 20 30 Order of CGPT 40 50 60 (b) Eigenvalues of DC⊤ CD Figure 3: Distribution of eigenvalues (in log scale) of the matrix C⊤ C (a) and DC⊤ CD (b). N = 101 sources are equally spaced between [0, γ) on a circle of radius ρ = 1.2, and K = 50. Each curve corresponds to a different value of γ. The matrix C⊤ C and DC⊤ CD are calculated from these parameters and their eigenvalues are sorted in decreasing order. 15 30 30 10 10 25 25 10 10 Condition number of DC CD 20 10 t Condition number of CtC 20 10 15 10 10 10 5 0 10 0 5 10 15 20 25 30 Order of CGPT 35 40 45 10 10 5 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 10 15 10 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 10 0 10 50 0 5 (a) Condition number of C⊤ C 15 20 25 30 Order of CGPT 35 40 45 50 (b) Condition number of L 30 30 10 10 25 25 10 10 Condition number of DC CD 20 10 20 10 t Condition number of CtC 10 15 10 10 10 5 0 10 0 5 10 15 20 25 30 Order of CGPT 35 40 45 10 10 5 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 10 15 10 gamma=2*pi gamma=1.5*pi gamma=pi gamma=0.5*pi gamma=0.25*pi 10 0 50 (c) Condition number of C⊤ C 10 0 5 10 15 20 25 30 Order of CGPT 35 40 45 50 (d) Condition number of L Figure 4: Condition numbers (in log scale) of the matrix C⊤ C (a) and the operator L (b) for different orders K between [1, 50]. As in Fig. 3, N = 101 sources are equally spaced between [0, γ) on a circle of radius ρ = 1.2. Fig.(c) and (d) are the same experiment as Fig.(a) and (b) but with N = 1001. 16 4.4 Reconstruction of CGPTs The analysis above suggests that the least-squares problem (7) is not adapted to the CGPT reconstruction in a limited-view setting. Actually, the truncation error or the noise of measurement will be amplified by the tiny singular values of L, and yields extremely instable reconstruction of high-order CGPTs, e.g., K ≥ 2. Instead, we, in order to reconstruct CGPTs from the MSR data, use Thikhonov regularization and propose to solve min kL(M) − Vk2F + µkMk2F , (47) M with µ > 0 a small regularization constant. It is well known that the effect of the regularization term is to truncate those singular values of L smaller than µ, which consequently stabilizes the solution. The optimal choice of µ depends on the noise level, and here we determine it from the range [10−6 , 10−1 ] by comparing the solution of (47) with the true CGPTs. Here we reconstruct the CGPTs of an ellipse with the parameter N = 101, K = 50, and γ varying between 0 and 2π. The major and minor axis of the ellipse are 1 and 0.5 respectively. In Fig. 5 we show the error of the first 2 order CGPTs reconstructed through (47) and (7) at three different noise levels. It can be seen that, for small γ, the error obtained by (47) is substantially smaller. 0 5 10 10 4 10 3 Reconstruction error Reconstruction error 10 −1 10 1 10 0 10 sigman=1e−3 −1 sigman=1e−3 10 sigman=1e−2 sigman=1e−2 −2 10 sigman=1e−1 −2 10 2 10 sigma =1e−1 n −3 0 1 2 3 4 5 6 10 7 gamma 0 1 2 3 4 5 6 7 gamma (a) (b) Figure 5: Error of reconstructed CGPT of an ellipse compared with true CGPT values at different noise levels. We solve (47) and (7) with N = 101, K = 50, and compare the first two orders with the true CGPT. The x-axis is the angle of view γ. Fig.(a): results of (47), Fig.(b): results of (7). 4.5 Tracking in the limited-view setting The performance of the tracking algorithm can also be affected by the limited angle of view. We repeat the experiment of subsection 3.3 with δ = 10, γ = π, and the same initial guess. In the first configuration, N = 21 sources/receivers are equally distributed between [0, γ), see Fig. 6 (a). The results of tracking by EKF presented in Fig. 7 (a), (c) 17 and (e) show large deviations in the estimation of position, and a totally wrong estimation of orientation. In the second configuration, we divide the sources/receivers into 5 groups placed in a nonuniform way on [0, 2π), and each group covers only an angle range of 0.2π, see Fig. 6 (b). Although the total angular coverages are the same in both configurations, the second one gives much better tracking results, as shown in Fig. 7 (b), (d) and (f). These results clearly demonstrates the importance of a large angle of view (or a directional diversity) for the tracking problem. True trajectory Estimation 40 True trajectory Estimation 50 40 30 30 20 20 10 10 0 0 −10 −10 −20 −20 −30 −30 −40 −40 −50 −40 −30 −20 −10 0 10 20 30 40 −50 −40 −30 −20 −10 0 10 20 30 40 50 Figure 6: Same experiment as in Fig. 1, with a limited angle of view γ = π. In Fig.(a) sources/receivers are equally distributed between [0, γ), while in Fig.(b) they are divided into 5 groups. 5 Conclusion In this paper we have provided a location and orientation tracking of a mobile target from MSR measurements in the full- and limited-view settings. Our algorithm is based on the concept of GPTs. In the limited-view case, the effect of noise is severe on the tracking. However, if the arrays of receivers and transmitters offer a good directional diversity, then satisfactory results can be obtained. It would be interesting to generalize our algorithms for tracking multiple targets. As a first step, a matching pursuit algorithm [21] would be appropriate for recognizing the targets. This will be the subject of a forthcoming work. A Kalman Filter The KF is a recursive method that uses a stream of noisy observations to produce an optimal estimator of the underlying system state [20]. Consider the following time-discrete 18 20 20 15 15 Coordinate 25 Coordinate 25 10 10 5 5 True position in x−axis Estimation sigma =0.1 True position in x−axis Estimation sigma =0.1 n n Estimation sigma =0.2 Estimation sigma =0.2 n 0 0 100 200 300 400 500 Time 600 700 800 900 n 0 1000 0 100 200 300 (a) 400 500 Time 600 700 800 900 1000 600 700 800 900 1000 (b) 5 5 0 0 Coordinate 10 Coordinate 10 −5 −5 −10 −10 True position in y−axis Estimation sigman=0.1 True position in y−axis Estimation sigman=0.1 Estimation sigman=0.2 −15 0 100 200 300 Estimation sigman=0.2 400 500 Time 600 700 800 900 −15 1000 0 100 200 300 (c) 400 500 Time (d) 6.5 6.5 True orientation Estimation sigman=0.1 True orientation Estimation sigman=0.1 Estimation sigma =0.2 Estimation sigma =0.2 n 6 6 5.5 5.5 Angle Angle n 5 5 4.5 4.5 4 4 3.5 0 100 200 300 400 500 Time 600 700 800 900 1000 (e) 3.5 0 100 200 300 400 500 Time 600 700 800 900 1000 (f) Figure 7: Results of tracking using the configuration of Fig. 6 at different noise levels. First row: coordinate in x-axis. Second row: coordinate in y-axis. Last row: orientation. First and second column correspond to the configuration in Fig. 6 (a) and (b), respectively. 19 dynamical system (t ≥ 1): Xt = Ft Xt−1 + Wt , (48) Yt = Ht Xt + Vt . (49) where • Xt is the vector of system state; • Yt is the vector of observation; • Ft is the state transition matrix which is applied to the previous state Xt−1 ; • Ht is the observation matrix which yields the (noise free) observation from a system state Xt ; • Wt ∼ N (0, Qt ) is the process noise and Vt ∼ N (0, Rt ) is the observation noise, with respectively Qt and Rt the covariance matrix. These two noises are independent between them, further, Wt of different time instant are also mutually independent (the same for Vt ). Suppose that X0 is Gaussian. Then it follows that the process (Xt , Yt )t≥0 is Gaussian. The objective is to estimate the system state Xt from the accumulated observations Y1:t := [Y1 . . . Yt ]. The optimal estimator (in the least-squares sense) of the system state Xt given the observations Y1:t is the conditional expectation x̂t|t = E[Xt |Y1:t ]. (50) Since the joint vector (Xt , Y1:t ) is Gaussian, the conditional expectation x̂t|t is a linear combination of Y1:t , which can be written in terms of x̂t−1|t−1 and Yt only. The purpose of the KF is to calculate x̂t|t from x̂t−1|t−1 and Yt . We summarize the algorithm in the following. Initialization: x̂0|0 = E[X0 ], P0|0 = cov(X0 ). (51) Prediction: x̂t|t−1 = Ft x̂t−1|t−1 , Ỹt = Yt − Ht x̂t|t−1 , Pt|t−1 = Ft Pt−1|t−1 FtT (52) (53) + Qt . (54) Update: St = Ht Pt|t−1 HtT + Rt , (55) Pt|t−1 HtT St−1 , (56) x̂t|t = x̂t|t−1 + Kt Ỹt , (57) Pt|t = (I − Kt Ht )Pt−1|t−1 . (58) Kt = To apply the KF algorithm the covariance matrices Qt , Rt must be known. 20 B Extended Kalman Filter Consider now a nonlinear dynamical system: Xt = ft (Xt−1 , Wt ), (59) Yt = ht (Xt , Vt ), (60) where Xt , Yt , Wt , Vt are the same as in the KF, while the functions ft , ht are nonlinear and differentiable. Nothing can be said in general on the conditional distribution Xt |Y1:t due to the nonlinearity. The EKF calculates an approximation of the conditional expectation (50) by an appropriate linearization of the state transition and observation models, which makes the general scheme of KF still applicable [26]. However, the resulting algorithm is no more optimal in the least-squares sense due to the approximation. Let FX = ∂X f (x̂t−1|t−1 , 0), FW = ∂W f (x̂t−1|t−1 , 0), the partial derivatives of f (with respect to the system state and the process noise) evaluated at (x̂t−1|t−1 , 0), and let HX = ∂X h(x̂t|t−1 , 0), HV = ∂V h(x̂t|t−1 , 0) be the partial derivatives of h (with respect to the system state and the observation noise) evaluated at (x̂t|t−1 , 0). The EKF algorithm is summarized below. Initialization: x̂0|0 = E[X0 ], P0|0 = cov(X0 ). (61) Prediction: x̂t|t−1 = f (x̂t−1|t−1 , 0), (62) Ỹt = Yt − h(x̂t|t−1 , 0), Pt|t−1 = FX Pt−1|t−1 FXT + (63) T FW Qt FW . (64) Update: T St = HX Pt|t−1 HX + HV Rt HVT , (65) T −1 Pt|t−1 HX St , (66) x̂t|t = x̂t|t−1 + Kt Ỹt , (67) Pt|t = (I − Kt HX )Pt−1|t−1 . (68) Kt = References [1] H. Ammari, T. Boulier, and J. Garnier, Modeling active electrolocation in weakly electric fish, Arxiv preprint arXiv:1203.0938, 2012. To appear in SIAM J. Imag. Sci., 2012. 2 [2] H. Ammari, T. Boulier, J. Garnier, W. Jing, H. Kang, and H. Wang, Target identification using dictionary matching of generalized polarization tensors, Arxiv preprint arXiv:1204.3035, 2012. 2, 3, 5, 6, 7, 10 [3] H. Ammari, J. Garnier, H. Kang, M. Lim, and S. Yu, Generalized polarization tensors for shape description, submitted, 2011. 1 21 [4] H. Ammari and H. Kang, Reconstruction of small inhomogeneities from boundary measurements, Vol. 1846, Lecture Notes in Mathematics, Springer-Verlag, Berlin, 2004. 1, 2, 3 [5] H. Ammari and H. Kang, Polarization and moment tensors: with applications to inverse problems and effective medium theory, Vol. 162, Springer-Verlag, 2007. 2 [6] H. Ammari and H. Kang, High-order terms in the asymptotic expansions of the steadystate voltage potentials in the presence of conductivity inhomogeneities of small diameter, SIAM J. Math. Anal., 34 (2003), 1152–1166. 1, 2, 3 [7] H. Ammari and H. Kang, Properties of generalized polarization tensors, SIAM Multiscale Model. Simul., 1 (2003), 335–348. 1 [8] H. Ammari, H. Kang, M. Lim, and H. Lee, Enhancement of near cloaking using generalized polarization tensors vanishing structures. Part I: The conductivity problem, Comm. Math. Phys., to appear. 1, 2, 3 [9] H. Ammari, H. Kang, M. Lim, and H. Zribi, The generalized polarization tensors for resolved imaging. Part I: Shape reconstruction of a conductivity inclusion, Math. Comp., 81 (2012), 367–386. 1 [10] H. Ammari, H. Kang, and K. Touibi, Boundary layer techniques for deriving the effective properties of composite materials, Asymp. Anal., 41 (2005), 119–140. 1 [11] Y. Capdeboscq, A. B. Karrman, and J.-C. Nédélec, Numerical computation of approximate generalized polarization tensors, Appl. Anal., to appear. 2 [12] D.J. Cedio-Fengya, S. Moskow, and M.S. Vogelius, Identification of conductivity imperfections of small diameter by boundary measurements: Continuous dependence and computational reconstruction, Inverse Problems, 14 (1998), 553–595. 2 [13] M. Cheney and B. Borden, Imaging moving targets from scattered waves, Inverse Problems, 24 (2008), 035005. 2 [14] D. Clark, I.T. Ruiz, Y. Petillot, and J. Bell, Particle PHD filter multiple target tracking in sonar images, IEEE Trans. Aerospace Electr. Sys., 43 (2007), 409–416. 2 [15] G. Dassios and R. Kleinman, Low frequency scattering, Oxford Mathematical Monographs, Oxford University Press, New York, 2000. 1 [16] D. Daviesy, P. Palmery, and M. Mirmehdi, Detection and tracking of very small low contrast objects, British Machine Vision Conference, 1998, 599–608. 2 [17] A. Friedman and M.S. Vogelius, Identification of small inhomogeneities of extreme conductivity by boundary measurements: a theorem on continuous dependence, Arch. Rat. Mech. Anal., 105 (1989), 299–326. 2 [18] C.D. Haworth, Y. De Saint-Pern, D. Clark, E. Trucco, and Y.R. Petillot, Detection and tracking of multiple metallic objects in millimetre-wave images, Inter. J. Comput. Vision, 71 (2007), 183–196. 2 22 [19] J.S. Jaffe, Target localization for a three-dimensional multibeam sonar imaging system, J. Acoust. Soc. Am., 105 (1999), 3168–3175. 2 [20] R.E. Kalman, A new approach to linear filtering and prediction problems, Transaction of the ASME–Journal of basic Engineering 82 (1960), 35–45. 18 [21] S. Mallat, A Wavelet Tour of Signal Processing, Academic Press, San Diego, 1998. 18 [22] E. Margolis and Y.C. Eldar, Nonuniform sampling of periodic bandlimited signals, IEEE Trans. Sig. Process., 56 (2008), 2728–2745. 14 [23] G.W. Milton, The Theory of Composites, Cambridge Monographs on Applied and Computational Mathematics, Cambridge University Press, 2001. 1 [24] G. Pólya and G. Szegö, Isoperimetric Inequalities in Mathematical Physics, Annals of Mathematical Studies, Number 27, Princeton University Press, Princeton, NJ, 1951. 1 [25] L. Wang, M. Cheney, and B. Borden, Multistatic radar imaging of moving targets, IEEE Radar Conference, 391–396. 2 [26] G. Welch and G. Bishop, An introduction to the Kalman filter, Technical Report 95041, University of North Carolina at Chapel Hill, 2001 & SIGGRAPH 2001, Los Angeles, CA, August 12–17, ACM. 2, 21 [27] A. Zygmund, Trigonometric series, Cambridge Univ Press, Cambridge, 1988. 14 23 True trajectory Estimation 40 30 20 10 0 −10 −20 −30 −40 −40 −30 −20 −10 0 10 20 30 40
5cs.CE
Flag-Based Big-Step Semantics Casper Bach Poulsen1,∗, Peter D. Mosses∗ arXiv:1605.02935v1 [cs.PL] 10 May 2016 Department of Computer Science Swansea University Singleton Park, Swansea SA2 8PP, UK Abstract Structural operational semantic specifications come in different styles: small-step and big-step. A problem with the big-step style is that specifying divergence and abrupt termination gives rise to annoying duplication. We present a novel approach to representing divergence and abrupt termination in big-step semantics using status flags. This avoids the duplication problem, and uses fewer rules and premises for representing divergence than previous approaches in the literature. Keywords: structural operational semantics, SOS, coinduction, big-step semantics, natural semantics, small-step semantics 1. Introduction Formal specifications concisely capture the meaning of programs and programming languages and provide a valuable tool for reasoning about them. A particularly attractive trait of structural specifications is that one can prove properties of programs and programming languages using well-known reasoning techniques, such as induction for finite structures, and coinduction for possibly-infinite ones. In this article we consider the well-known variant of structural specifications called structural operational semantics (SOS) [1]. SOS rules are generally formulated in one of two styles: small-step, relating intermediate states in a transition system; and big-step (also known as natural semantics [2]), relating states directly to final outcomes, such as values, stores, traces, etc. Each style has its merits and drawbacks. For example, small-step is regarded as superior for specifying interleaving, whereas big-step is regarded as superior for compiler correctness proofs [3; 4; 5] and for efficient interpreters [6; 7]. Different styles can also be used for specifying different fragments of the same language. Big-step SOS rules, however, suffer from a serious duplication problem [8]. Consider, for example, the following rule for sequential composition: (c1 , σ) ⇒ σ 0 (c2 , σ 0 ) ⇒ σ 00 B-Seq (c1 ; c2 , σ) ⇒ σ 00 This rule is inductively defined and covers the sequential composition of all finite computations for c1 and c2 . But what if either c1 or c2 is an infinite computation, i.e., diverges? The traditional approach to ∞ representing this in big-step SOS is to introduce a separate, coinductively defined, relation ⇒: ∞ (c1 , σ) ⇒ B-∞-Seq1 ∞ (c1 ; c2 , σ) ⇒ (c1 , σ) ⇒ σ 0 ∞ (c2 , σ 0 ) ⇒ ∞ B-∞-Seq2 (c1 ; c2 , σ) ⇒ ∗ Corresponding 1 Present author address: Programming Languages Group, Delft University of Technology, Mekelweg 4, 2628 CD Delft, Netherlands Preprint submitted to Journal of Logical and Algebraic Methods in Programming March 19, 2018 Here, the first premise in B-∞-Seq2 and B-Seq is duplicated. If the language can throw exceptions we need even more (inductive) rules in order to correctly propagate such abrupt termination, which further increases duplication:2 (c1 , σ) ⇒ exc(v) B-Exc-Seq1 (c1 ; c2 , σ) ⇒ exc(v) (c1 , σ) ⇒ σ 0 (c2 , σ 0 ) ⇒ exc(v) B-Exc-Seq2 (c1 ; c2 , σ) ⇒ exc(v) The semantics of sequential composition is now given by five rules with eight premises, where two of these premises are duplicates (i.e., the first premise in B-∞-Seq2, and B-Exc-Seq2). Charguéraud [8] introduced the novel pretty-big-step style of big-step SOS. Pretty-big-step rules avoid the duplication problem by breaking big-step rules into smaller rules such that each rule fully evaluates a single sub-term and then continues the evaluation. The pretty-big-step rules introduce an intermediate expression constructor, seq2, and use outcomes o to range over either convergence at a store σ (conv σ), divergence (div), or abrupt termination (exc(v)): (c1 , σ) ⇓ o1 (seq2 o1 c2 , σ2) ⇓ o P-Seq1 (c1 ; c2 , σ) ⇓ o (c, σ) ⇓ o P-Seq2 (seq2 (conv σ) c, σ0 ) ⇓ o abort(o) P-Seq-Abort (seq2 o c2 , σ) ⇓ o Following Charguéraud, these rules have a dual interpretation: inductive and coinductive. They use an abort predicate to propagate either exceptions or abrupt termination. This predicate is specified once-and-for-all and not on a construct-by-construct basis: abort(div) Abort-Div abort(exc(v)) Abort-Exc Using pretty-big-step, the semantics for sequential composition has three rules with three premises, and two generic rules for the abort predicate. It avoids duplication by breaking the original inductive bigstep rule B-Seq into smaller rules. But it also increases the number of rules compared with the original inductive big-step rule B-Seq. For semantics with rules with more premises but without abrupt termination, pretty-big-step semantics sometimes increases the number of rules and premises compared with traditional inductive big-step rules. In this paper we reuse the idea from pretty-big-step semantics of interpreting the same set of rules both inductively and coinductively, and adopt and adapt the technique (due to Klin [9, p. 216]) for modular specification of abrupt termination in small-step Modular SOS [9]. The idea is to make program states and result states record an additional status flag (ranged over by δ) which indicates that the current state is either convergent (), divergent (), or abruptly terminated (‘exc(v)’): (c1 , σ, ) ⇒ σ 0 , δ (c2 , σ 0 , δ) ⇒ σ 00 , δ 0 F-Seq (c1 ; c2 , σ, ) ⇒ σ 00 , δ 0 Here, derivations continue only so long as they are in a convergent state, indicated by . In order to propagate divergence or abrupt termination, we use pretty-big-step inspired abort rules: (c, σ, ) ⇒ σ 0 ,  F-Div (c, σ, exc(v)) ⇒ σ 0 , exc(v) F-Exc The abort rules say that all parts of the state except for the status flag are computationally irrelevant, hence the use of the free variables σ 0 in F-Div and F-Exc. Using these status flags, we can prove that terms diverge similarly to using either traditional big-step divergence rules or pretty-big-step semantics. For example, using pretty-big-step, the proposition (c, σ) ⇓ div is coinductively proved when (c, σ) has an infinite derivation tree; similarly, using the  status flag, the proposition, for any σ 0 , (c, σ, ) ⇒ σ 0 ,  is coinductively proved when (c, σ, ) has an infinite derivation tree. We call this style of rules flag-based big-step semantics. Flag-based big-step semantics: 2 It is also possible to propagate exceptions automatically when they occur in tail-positions in big-step rules. This would make rule B-Exc-Seq2 redundant and eliminate some of the redundancy for the sequential composition construct. It would, however, require extra restrictions in the standard inductive rule for sequential composition. The duplication problem occurs in any case for constructs with more than two premises. 2 • supports propagating exceptions without the intermediate expression forms found in pretty-big-step rules (such as seq2);3 • uses fewer rules and premises than both the traditional and the pretty-big-step approach; • supports reasoning about possibly-infinite computations on a par with traditional big-step approaches as well as small-step semantics; and • eliminates the big-step duplication problem for diverging and abruptly terminating computations. The rest of this paper is structured as follows. We first introduce a simple While-language and recall how possibly-diverging computations in small-step semantics are traditionally expressed (Sect. 2). Next, we recall traditional approaches to representing possibly-diverging computations in big-step semantics, and how to prove equivalence between semantics for these approaches (Sect. 3). Thus equipped, we make the following contributions: • We present a novel approach to representing divergence and abrupt termination (Sect. 4) which alleviates the duplication problem in big-step semantics. For all examples considered by the authors, including applicative and imperative languages, our approach straightforwardly allows expressing divergence and abrupt termination in a way that does not involve introducing or modifying rules. Our approach uses fewer rules and premises than both small-step semantics and pretty-big-step semantics. • We consider how the approach scales to more interesting language features (Sect. 5), including nondeterministic interactive input. A problem in this connection is that the traditional proof method for relating diverging computations in small-step and big-step SOS works only for deterministic semantics. We provide a generalised proof method which suffices to relate small-step and big-step semantics with non-deterministic interactive input. • The explicit use of flags in our approach makes the rules somewhat tedious to read and write. We suggest leaving the flag arguments implicit in almost all rules (Sect. 6). The way we specify this is similar to Implicitly-Modular SOS (I-MSOS) [10]. Our experiments show that flag-based big-step SOS with divergence and abrupt termination uses fewer rules than previous approaches. The conciseness comes at the cost of states recording irrelevant information (such as the structure of the store) in abruptly terminated or divergent result states. We discuss and compare previous approaches in Sect. 7 and conclude in Sect. 8. 2. The While-Language and its Small-Step Semantics We use a simple While-language as a running example. Its abstract syntax is: Var 3 x ::= x | y | . . . Variables N 3 n ::= 0 | 1 | . . . Natural numbers Cmd 3 c ::= skip | alloc x | x := e | c; c | if e c c | while e c Val 3 v ::= null | n Commands Values Expr 3 e ::= v | x | e ⊕ e Expressions Binary operations on natural numbers ⊕ ∈ {+, −, ∗} 3 There is, however, nothing to prevent us from using the flag-based approach for propagating divergence in pretty-big-step rules. Section 5 discusses why this could be attractive for certain applications. 3 (e, σ) ⇒e v (v, σ) ⇒e v E-Val x ∈ dom(σ) E-Var (x, σ) ⇒e σ(x) (e1 , σ) ⇒e n1 (e2 , σ) ⇒e n2 E-Bop (e1 ⊕ e2 , σ) ⇒e ⊕(n1 , n2 ) Figure 1: Big-step semantics for expressions (c, σ) → (c0 , σ 0 ) x 6∈ dom(σ) S-Alloc (alloc x, σ) → (skip, σ[x 7→ null]) x ∈ dom(σ) (e, σ) ⇒e v S-Assign (x := e, σ) → (skip, σ[x 7→ v]) (c1 , σ) → (c01 , σ 0 ) S-Seq (c1 ; c2 , σ) → (c01 ; c2 , σ 0 ) (skip; c2 , σ) → (c2 , σ) S-SeqSkip (e, σ) ⇒e 0 S-IfZ (if e c1 c2 , σ) → (c2 , σ) (e, σ) ⇒e v v 6= 0 S-If (if e c1 c2 , σ) → (c1 , σ) (e, σ) ⇒e v v 6= 0 S-While (while e c, σ) → (c; while e c, σ) (e, σ) ⇒e 0 S-WhileZ (while e c, σ) → (skip, σ) Figure 2: Small-step semantics for commands Here, null is a special value used for uninitialised locations, and is assumed not to occur in source programs. fin Let stores σ ∈ Var −→ Val be finite maps from variables to values. We use σ(x) to denote the value to which variable x is mapped (if any) in the store σ. The notation σ[x 7→ v] denotes the update of store σ with value v at variable x. We use dom(σ) to denote the domain of a map, and {x1 7→ v1 , x2 7→ v2 , . . .} to denote the map from x1 to v1 , x2 to v2 , etc. We write ⊕(n1 , n2 ) for the result of applying the primitive binary operation ⊕ to n1 and n2 . The remainder of this section introduces a mixed big-step and small-step semantics for this language, and introduces conventions. 2.1. Big-Step Expression Evaluation Relation Expressions in our language do not affect the store and cannot diverge, although they can fail to produce a value. Big-step rules for evaluating expressions and the signature of the evaluation relation are given in Fig. 1.4 A judgment (e, σ) ⇒e v says that evaluating e in the store σ results in value v, and does not affect the store. 2.2. Small-Step Command Transition Relation Commands have side-effects and can diverge. Figure 2 defines a small-step transition relation for commands, using the previously defined big-step semantics for expressions. The transition relation is defined for states consisting of pairs of a command c and a store σ. A judgment (c, σ) → (c0 , σ 0 ) asserts the possibility of a transition from the state (c, σ) to the state (c0 , σ 0 ). 4 Following Reynolds [11], this relation is trivial, and expression evaluation could have been given in terms of an auxiliary function instead. It is useful to model it as a relation for the purpose of our approach to abrupt termination. We discuss this further in Sect.5. 4 2.3. Finite Computations In small-step semantics, computations are given by sequences of transitions. The →∗ relation is the reflexive-transitive closure of the transition relation for commands, which contains the set of all computations with finite transition sequences: (c, σ) →∗ (c0 , σ 0 ) (c, σ) →∗ (c, σ) Refl∗ (c, σ) → (c0 , σ 0 ) (c0 , σ 0 ) →∗ (c00 , σ 00 ) Trans∗ (c, σ) →∗ (c00 , σ 00 ) The following factorial function is an example of a program with a finite sequence of transitions for any natural number n: fac n ≡ alloc c; c := n; alloc r; r := 1; while c (r := (r ∗ c); c := (c − 1)) Here, ‘fac n ≡ . . .’ defines a function fac that, given a natural number n, produces a program calculating the factorial of n. Using ‘·’ to denote the empty map, we can use →∗ to calculate: (fac 4, ·) →∗ (skip, {c 7→ 0, r 7→ 24}) This calculation is performed by constructing the finite derivation tree whose conclusion is the judgment above. 2.4. Infinite Computations ∞ The following rule for → is coinductively defined, and can be used to reason about infinite sequences of transitions: ∞ (c, σ) → co ∞ (c, σ) → (c0 , σ 0 ) (c0 , σ 0 ) → ∞ Trans∞ (c, σ) → Here and throughout this article, we use ‘co’ on the left of rules to indicate that the relation is coinductively defined by that set of rules.5 We assume that the reader is familiar with the basics of coinduction (for introductions see, e.g., [3; 13; 14]). Usually, coinductively defined rules describe both finite and infinite derivation trees. However, since ∞ there are no axioms for →, and since the rule Trans∞ cannot be used to construct finite derivation trees, the relation contains exactly the set of all states with infinite sequences of transitions. Using the coinduction proof principle allows us to construct infinite derivation trees. For example, we can ∞ prove that while 1 skip diverges by using (while 1 skip, ·) → as our coinduction hypothesis. In the following derivation tree, that hypothesis is applied at the point in the derivation tree marked CIH. This constructs an infinite branch of the derivation tree: (1, ·) ⇒e 1 1 6= 0 (while 1 skip, ·) → (skip; while 1 skip, ·) (skip; while 1 skip, ·) → (while 1 skip, ·) .. . CIH ∞ (while 1 skip, ·) → ∞ (skip; while 1 skip, ·) → ∞ (while 1 skip, ·) → 5 This notation for coinductively defined relations is a variation of Cousot and Cousot’s [12] notation for distinguishing inductively and coinductively (or positively and negatively) defined relations. 5 There also exists an infinite derivation tree whose conclusion is: ∞ (alloc x; x := 0; while 1 (x := x + 1), ·) → Proving this is slightly more involved: after two applications of Trans∞, the goal to prove is: ∞ (while 1 (x := x + 1), {x 7→ 0}) → We might try to use this goal as the coinduction hypothesis. But after three additional applications of Trans∞, we get a goal with a store {x 7→ 1} that does not match this coinduction hypothesis: ∞ (while 1 (x := x + 1), {x 7→ 1}) → The problem here is that the store changes with each step. Instead, we first prove the following straightforward lemma by coinduction: ∞ for any n, (while 1 (x := x + 1), {x 7→ n}) → Now, by four applications of Trans∞ in the original proof statement, we get a goal that matches our lemma, which completes the proof. 2.5. Proof Conventions The formal results we prove in this article about our example language are formalised in Coq and are available online at: http://www.plancomps.org/flag-based-big-step/. Coq is based on the Calculus of Constructions [15; 16], which embodies a variant of constructive logic. Working within this framework, classical proof arguments, such as the law of excluded middle, are not provable for arbitrary propositions. In spite of embodying a constructive logic, Coq allows us to assert classical arguments as axioms, which are known to be consistent [17] with Coq’s logic. Some of the proofs in this article rely on the law of excluded middle. For the reader concerned with implementing proofs in Coq, or other proof assistants or logics based on constructive reasoning, we follow the convention of Leroy and Grall [3] and explicitly mark proofs that rely on the law of excluded middle “(classical)”. 3. Big-Step Semantics and Their Variants We recall different variants of big-step semantics from the literature, and illustrate their use on the While-language defined in the previous section (always extending the big-step semantics for expressions defined in Fig. 1). 3.1. Inductive Big-Step Semantics The big-step rules in Fig. 3 inductively define a big-step relation, where judgments of the form (c, σ) ⇒b σ 0 assert that a command c evaluated in store σ terminates with a final store σ 0 . This corresponds to arriving at a state (skip, σ) by analogy with the small-step semantics in Sect. 2. Being inductively defined, the relation does not contain diverging programs. Example 1. ¬ ∃σ. (while 1 skip, ·) ⇒b σ Proof. We prove that ∃σ. (while 1 skip, ·) ⇒b σ implies falsity. The proof proceeds by eliminating the existential in the premise, and by induction on the structure of ⇒b . We can, however, construct a finite derivation tree for our factorial program: (fac 4, ·) ⇒b {c 7→ 0, r 7→ 24} The following theorem proves the correspondence between inductive big-step derivation trees and derivation trees for sequences of small-step transitions for the While-language: 6 (c, σ) ⇒b σ 0 (skip, σ) ⇒b σ x 6∈ dom(σ) B-Alloc (alloc x, σ) ⇒b σ[x 7→ null] B-Skip (c1 , σ) ⇒b σ 0 (c2 , σ 0 ) ⇒b σ 00 B-Seq (c1 ; c2 , σ) ⇒b σ 00 x ∈ dom(σ) (e, σ) ⇒e v B-Assign (x := e, σ) ⇒b σ[x 7→ v] (e, σ) ⇒e 0 (c2 , σ) ⇒b σ 0 B-IfZ (if e c1 c2 , σ) ⇒b σ 0 (e, σ) ⇒e v v 6= 0 (c1 , σ) ⇒b σ 0 B-If (if e c1 c2 , σ) ⇒b σ 0 (e, σ) ⇒e v v 6= 0 (c, σ) ⇒b σ 0 (while e c, σ 0 ) ⇒b σ 00 B-While (while e c, σ) ⇒b σ 00 (e, σ) ⇒e 0 B-WhileZ (while e c, σ) ⇒b σ Figure 3: Big-step semantics for commands ∞ (c, σ) ⇒ ∞ co (c1 , σ) ⇒ D-Seq1 ∞ co (c1 , σ) ⇒b σ 0 ∞ (c1 ; c2 , σ) ⇒ co (e, σ) ⇒e v v 6= 0 (e, σ) ⇒e v ∞ (c1 , σ) ⇒ ∞ D-If co (e, σ) ⇒e 0 (c, σ) ⇒ ∞ ∞ (c2 , σ) ⇒ ∞ D-IfZ (if e c1 c2 , σ) ⇒ ∞ v 6= 0 D-Seq2 (c1 ; c2 , σ) ⇒ (if e c1 c2 , σ) ⇒ co ∞ (c2 , σ 0 ) ⇒ D-WhileBody co (e, σ) ⇒e v v 6= 0 (c, σ) ⇒b σ 0 ∞ (while e c, σ 0 ) ⇒ (while e c, σ) ⇒ ∞ D-While (while e c, σ) ⇒ Figure 4: Big-step semantics for diverging commands (extending Figure 3) Theorem 2. (c, σ) →∗ (skip, σ 0 ) iff (c, σ) ⇒b σ 0 . Proof. The small-to-big direction follows by induction on →∗ using Lemma 3. The big-to-small direction follows by induction on ⇒b , using the transitivity of →∗ and Lemma 4. Lemma 3. If (c, σ) → (c0 , σ 0 ) and (c0 , σ 0 ) ⇒b σ 00 then (c, σ) ⇒b σ 00 . Proof. Straightforward proof by induction on →. Lemma 4. (c1 , σ) →∗ (c01 , σ 0 ) implies (c1 ; c2 , σ) →∗ (c01 ; c2 , σ 0 ) Proof. Straightforward proof by induction on →∗ . 7 3.2. Coinductive Big-Step Divergence Predicate ∞ ∞ The rules in Fig. 4 coinductively define a big-step divergence predicate. Like ‘→’, the ‘⇒’ predicate has no axioms, so the rules describe exactly the set of all diverging computations. Divergence arises in a single branch of a derivation tree, while other branches may converge. Recalling our program from Sect. 2: alloc x; x := 0; while 1 (x := x + 1) Here, alloc x and x := 0 converge, but the while command diverges. The big-step divergence predicate uses the standard inductive big-step relation for converging branches. Consequently, we need the rules in both Figures 3 and 4 to express divergence. This increases the number of rules for each construct, and leads to duplication of premises between the rules. For example, the set of finite and infinite derivation trees whose conclusion is a sequential composition requires three rules: B-Seq, D-Seq1, and D-Seq2. Here, the premise (c1 , σ) ⇒b σ 0 is duplicated between the rules, giving rise to the so-called duplication problem with big-step ∞ ∞ semantics. Theorem 5 proves the correspondence between → and ⇒. ∞ ∞ Theorem 5. (c, σ) → iff (c, σ) ⇒ Proof (classical). The small-to-big direction follows by coinduction using Lemma 6 and Lemma 7 (which relies on classical arguments) for case analysis. The other direction follows by coinduction and Lemma 8. ∞ Lemma 6. Either (∃σ 0 . (c, σ) →∗ (skip, σ 0 )) or (c, σ) →. Proof (classical). By the law of excluded middle and classical reasoning. ∞ ∞ Lemma 7. If (c1 , σ) →∗ (c01 , σ 0 ) and (c1 ; c2 , σ) →, then (c01 ; c2 , σ 0 ) →. Proof. Straightforward proof by induction on →∗ , using the fact that → is deterministic. ∞ Lemma 8. If (c, σ) ⇒ then ∃c0 , σ 0 .   ∞ (c, σ) → (c0 , σ 0 ) ∧ (c0 , σ 0 ) ⇒ . Proof. Straightforward proof by structural induction on the command c, using Theorem 2 in the sequential composition case. 3.3. Pretty-Big-Step Semantics The idea behind pretty-big-step semantics is to break big-step rules into intermediate rules, so that each rule fully evaluates a single sub-term and then continues the evaluation. Continuing evaluation may involve either further computation, or propagation of divergence or abrupt termination that arose during evaluation of a sub-term. Following Charguéraud [8], we introduce so-called semantic constructors for commands and outcomes for indicating convergence or divergence: SemCmd 3 C ::= c | assign2 x v | seq2 o c | if2 v c c | while2 v e c | while3 o e c Outcome 3 o ::= conv σ | div The added constructors are used to distinguish whether evaluation should continue. For example, the following rules define sequential composition for a pretty-big-step relation with the signature ‘(C, σ) ⇓ o’, using the semantic constructor seq2: (c1 , σ) ⇓ o1 (seq2 o1 c2 , σ) ⇓ o P-Seq1 (c1 ; c2 , σ) ⇓ o (c2 , σ) ⇓ o P-Seq2 (seq2 (conv σ) c2 , σ0 ) ⇓ o Each of these two rules is a pretty-big-step rule: reading the rules in a bottom-up manner, P-Seq1 evaluates a single sub-term c1 , plugs the result of evaluation into the semantic constructor seq2, and evaluates that 8 term. The rule P-Seq2 in turn checks that the result of evaluating the first sub-term was convergence with some store σ, and goes on to evaluate c2 under that store. An additional so-called abort rule is required for propagating divergence if it occurs in the first branch of a sequential composition: (seq2 div c2 , σ) ⇓ div P-Seq-Abort Such abort rules are required for all semantic constructors. As Charguéraud [8] remarks, these are tedious both to read and write, but are straightforward to generate automatically. The pretty-big-step rules in Fig. 5 have a dual interpretation: such rules define two separate relations, one inductive, the other coinductive. We use ‘du’ on the left of rules to indicate relations with dual interpretations. We use ⇓ to refer to the inductive interpretation, and ⇓co to refer to the coinductive interpretation. We refer to the union of the two interpretations of the relation defined by a set of pretty-big-step rules by ⇓du . Crucially, these relations are based on the same set of rules. In practice, this means that the coinductively defined relation subsumes the inductively defined relation, as shown by Lemma 9. Lemma 9. If (C, σ) ⇓ o then (C, σ) ⇓co o. Proof. Straightforward proof by induction on ⇓. However, the coinductive interpretation is less useful for proving properties about converging programs, since converging and diverging programs cannot be syntactically distinguished in the coinductive interpretation. For example, we can prove that while 1 skip coevaluates to anything: Example 10. For any o, (while 1 skip, ·) ⇓co o. Proof. Straightforward proof by coinduction. An important property of the rules in Fig. 5 is that divergence is only derivable under the coinductive interpretation. Lemma 11. (c, σ) ⇓ o implies o 6= div. Proof. Straightforward proof by induction on ⇓. Pretty-big-step semantics can be used to reason about terminating programs on a par with traditional big-step relations, as shown by Theorem 12. Theorem 12. (c, σ) ⇒b σ 0 iff (c, σ) ⇓ conv σ 0 . Proof. Each direction is proved by straightforward induction on ⇒b and ⇓ respectively. The ⇓-to-⇒b direction uses Lemma 11. Pretty-big-step semantics can be used to reason about diverging programs on a par with traditional big-step divergence predicates, as shown by Theorem 13. ∞ Theorem 13. (c, σ) ⇒ iff (c, σ) ⇓co div. ∞ Proof (classical). Each direction is proved by coinduction. The ⇒-to-⇓co direction uses Lemma 12. The other direction uses Lemma 14 (which relies on classical arguments) and Lemma 15. Lemma 14. If (c, σ) ⇓co o and ¬ ((c, σ) ⇓ o) then (c, σ) ⇓co div Proof (classical). By coinduction, using Lemma 9 and the law of excluded middle for case analysis on (c, σ) ⇓ (o, σ 0 ). 9 (C, σ) ⇓ o du du (skip, σ) ⇓ conv σ P-Skip du x 6∈ dom(σ) P-Alloc (alloc x, σ) ⇓ (conv σ[x 7→ null]) (e, σ) ⇒e v (assign2 x v, σ) ⇓ o P-Assign1 (x := e, σ) ⇓ o du du (c1 , σ) ⇓ o1 (seq2 o1 c2 , σ) ⇓ o P-Seq1 (c1 ; c2 , σ) ⇓ o (e, σ) ⇒e v (if2 v c1 c2 , σ) ⇓ o du P-If (if e c1 c2 , σ) ⇓ o du (while2 0 e c, σ) ⇓ conv σ du (seq2 div c2 , σ) ⇓ div du (c, σ) ⇓ o P-Seq2 (seq2 (conv σ) c, σ0 ) ⇓ o v 6= 0 (c1 , σ) ⇓ o1 P-If2 (if2 v c1 c2 , σ) ⇓ o1 P-WhileZ2 P-Seq-Abort du (c2 , σ) ⇓ o2 P-IfZ2 (if2 0 c1 c2 , σ) ⇓ o2 v 6= 0 (c, σ) ⇓ o (while3 o e c, σ) ⇓ o0 du P-While2 (while2 v e c, σ) ⇓ o0 (e, σ) ⇒e v (while2 v e c, σ) ⇓ o P-While du (while e c, σ) ⇓ o du x ∈ dom(σ) P-Assign2 (assign2 x v, σ) ⇓ conv σ[x 7→ v] du du (while e c, σ) ⇓ o P-While3 while3 (conv σ) e c, σ0 ) ⇓ o (while3 div e c, σ) ⇓ div P-While-Abort Figure 5: Pretty-big-step semantics for commands Lemma 15. If (c, σ) ⇓ conv σ 0 and (c, σ) ⇓co conv σ 00 then σ 0 = σ 00 . Proof. Straightforward proof by induction on ⇓. Our pretty-big-step semantics uses 18 rules (including rules for ⇒e ) with 16 premises (counting judgments about both ⇒e and ⇓du ), none of which are duplicates. In contrast, the union of the rules for inductive standard big-step rules in Sect. 3.1 and the divergence predicate in Sect. 3.2 uses 17 rules with 25 premises of which 6 are duplicates. Pretty-big-step semantics solves the duplication problem, albeit at the cost of introducing 5 extra semantic constructors and breaking the rules in the inductive interpretation up into multiple rules, which in this case adds an extra rule compared to the original big-step rules with duplication. 4. Flag-Based Big-Step Semantics In this section we present a novel approach to representing divergence and abrupt termination in bigstep semantics, which does not require introducing new relations, and relies on fewer, simpler rules for propagation of divergence and/or abrupt termination. The approach can be used to augment standard inductively defined rules to allow them to express divergence on a par with standard divergence predicates or pretty-big-step rules. 4.1. The While-Language and its Flag-Based Big-Step Semantics We show how augmenting the standard inductive big-step rules from Figures 1 and 3 with status flags allows us to express and reason about divergence on a par with traditional big-step divergence predicates. Status flags indicate either convergence () or divergence (), ranged over by: Status 3 δ ::=  |  10 (e, σ, δ) ⇒fe v, δ 0 du (v, σ, ) ⇒fe v,  FE-Val (e1 , σ, ) ⇒fe n1 , δ (e2 , σ, δ) ⇒fe n2 , δ 0 du FE-Bop (e1 ⊕ e2 , σ, ) ⇒fe ⊕(n1 , n2 ), δ 0 x ∈ dom(σ) du FE-Var (x, σ, ) ⇒fe σ(x),  du (e, σ, ) ⇒fe v,  FE-Div (c, σ, δ) ⇒f σ 0 , δ 0 du du (skip, σ, ) ⇒f σ,  F-Skip x ∈ dom(σ) (e, σ, ) ⇒fe v, δ F-Assign (x := e, σ, ) ⇒f σ[x 7→ v], δ du x 6∈ dom(σ) F-Alloc (alloc x, σ, ) ⇒f σ[x 7→ null],  du v 6= 0 (e, σ, ) ⇒fe v, δ (c1 , σ, δ) ⇒f σ 0 , δ 0 du F-If (if e c1 c2 , σ, ) ⇒f σ 0 , δ 0 (c1 , σ, ) ⇒f σ 0 , δ (c2 , σ 0 , δ) ⇒f σ 00 , δ 0 F-Seq (c1 ; c2 , σ, ) ⇒f σ 00 , δ 0 du (e, σ, ) ⇒fe 0, δ (c2 , σ, δ) ⇒f σ 0 , δ 0 F-IfZ (if e c1 c2 , σ, ) ⇒f σ 0 , δ 0 (e, σ, ) ⇒fe v, δ v 6= 0 (c, σ, δ) ⇒f σ 0 , δ 0 (while e c, σ 0 , δ 0 ) ⇒f σ 00 , δ 00 du F-While (while e c, σ, ) ⇒f σ 00 , δ 00 du (c, σ, ) ⇒f σ 0 ,  du (e, σ, ) ⇒fe 0, δ F-WhileZ (while e c, σ, ) ⇒f σ, δ F-Div Figure 6: Flag-based big-step semantics for commands and expressions with divergence Threading status flags through the conclusion and premises of the standard big-step rules in left-to-right order gives the rules in Fig. 6. In all rules, the status flag is threaded through rules such that the conclusion source always starts in a  state. Like pretty-big-step semantics, the rules in Fig. 6 have a dual interpretation: both inductive and coinco ductive. We use ⇒f to refer to the relation given by the inductive interpretation of the rules, and ⇒f to refer to the relation given by the coinductive interpretation. When needed, we refer to the union of these du interpretations by ⇒f . Figure 6 threads status flags through the rules for the ⇒e relation as well as the standard big-step relation for commands, ⇒f . But expressions cannot actually diverge. Our motivation for threading the flag through the rules for expression evaluation is that it anticipates future language extensions which may permit expressions to diverge, such as allowing user-defined functions to be called. It also allows us to correctly propagate divergence in rules where evaluation of expressions does not necessarily occur as the first premise in rules. How do these rules support reasoning about divergence? In the F-Seq rule in Fig. 6, the first premise may diverge to produce  in place of δ in the first premise. If this is the case, any subsequent computation is irrelevant. To inhibit subsequent computation we introduce divergence rules FE-Div and F-Div, also in Fig. 6. The divergence rules serve a similar purpose to abort rules in pretty-big-step semantics: they propagate divergence as it arises and inhibit further evaluation. A technical curiosity of the divergence rule F-Div is that it allows evaluation to return an arbitrary store. In other words, states record and propagate irrelevant information. This is a somewhat unusual way of propagating semantic information in big-step semantics; however, the intuition behind it follows how divergence and abrupt termination are traditionally propagated in big-step SOS. Recall that big-step and 11 pretty-big-step rules discard the structure of the current program term, and only record that divergence occurs. Witness, for example, the big-step and pretty-big-step rules for propagating exceptions from Sect. 1: ∞ (c1 , σ) ⇒ B-∞-Seq1 (c1 ; c2 , σ) ⇒ σ 00 abort(o) P-Seq-Abort (seq2 o c2 , σ) ⇓ o These rules “forget” the structure of whatever other effects a diverging computation produces. Similarly, flagbased big-step semantics retains the relevant structure of configurations, but allows us to choose arbitrary values for the irrelevant parts: for converging computations, all parts of the configuration are relevant, whereas for divergent or abruptly terminated configurations, only the fact that we are abruptly terminating is important. A key property of flag-based divergence is that the conclusions of rules always start in a state with the convergent flag . It follows that, under an inductive interpretation, we cannot construct derivations that result in a divergent state . Lemma 16 proves that we cannot use the inductively defined relation to prove divergence. Lemma 16. (c, σ, ) ⇒f σ 0 , δ implies δ 6= . Proof. Straightforward proof by induction on ⇒f . Theorem 17 proves that adding status flags and the divergence rule does not change the inductive meaning of the standard inductive big-step relation. Theorem 17. (c, σ) ⇒b σ 0 iff (c, σ, ) ⇒f σ 0 , . Proof. The ⇒b -to-⇒f follows by straightforward induction. The ⇒f -to-⇒b direction follows by straightforward induction and Lemma 16. As for the coinductive interpretation of ⇒f , Theorem 18 proves that adding status flags allows us to prove divergence on a par with traditional big-step divergence predicates. ∞ co Theorem 18. For any σ 0 , (c, σ) ⇒ iff (c, σ, ) ⇒f σ 0 , . ∞ co Proof (classical). The ⇒-to-⇒f direction follows by straightforward coinduction, using Theorem 17. The other direction follows from Lemma 19, Lemma 20, and the law of excluded middle for case analysis on whether branches converge or not. co co Lemma 19. If (c, σ, ) ⇒f σ 0 , δ and ¬ ((c, σ, ) ⇒f σ 0 , δ) then (c, σ, ) ⇒f σ 0 , . Proof (classical). By coinduction and the law of excluded middle for case analysis on ⇒f . The relationship between the inductive and coinductive interpretation of the rules for ⇒f is similar to the relationships observed in connection with pretty-big-step semantics. The coinductive interpretation also subsumes the inductive interpretation, as proved in Lemma 20. co Lemma 20. If (c, σ, ) ⇒f σ 0 ,  then (c, σ, ) ⇒f σ 0 , . Proof. Straightforward proof by induction on ⇒f . Theorem 17 proves that we can choose any store σ 0 when constructing a proof of divergence for some c and σ. Lemma 21 summarises this observation, by proving that the choice of σ 0 is, in fact, irrelevant. co co Lemma 21. For any c and any store σ, (∀σ 0 .(c, σ, ) ⇒f (σ 0 , )) iff (∃σ 0 . (c, σ, ) ⇒f (σ 0 , )). 12 Proof. The ∀-to-∃ direction is trivial. The other direction follows by straightforward coinduction. As with pretty-big-step semantics (Sect. 3.3), the coinductive interpretation is less useful for proving properties about converging programs, since converging and diverging programs cannot be distinguished in the coinductive interpretation. For example, we can prove that while 1 skip coevaluates to anything: co Example 22. For any σ 0 and δ, (while 1 skip, ·, ) ⇒f σ 0 , δ. Proof. Straightforward proof by coinduction. Comparing flag-based divergence (Fig. 6) with pretty-big-step (Fig. 5), we see that our rules contain no duplication, and use just 13 rules with 13 premises, whereas pretty-big-step semantics uses 18 rules with 16 premises. While we use fewer rules than pretty-big-step, and introducing divergence does not introduce duplicate premises, the flag-based big-step rules in Fig. 6 actually do contain some duplicate premises in the rules F-If, F-IfZ, F-While, and F-WhileZ: each of these rules evaluate the same expression e. This duplication could have been avoided by introducing a constructor for intermediate expressions for ‘if’ and ‘while’, similar to pretty-big-step. Flag-based big-step SOS is equivalent to but more concise than traditional big-step and pretty-big-step. For the simple While-language, it is no more involved to work with flag-based divergence than with traditional approaches, as illustrated by examples in our Coq proofs available online at: http://www.plancomps.org/flag-based-big-ste 4.2. Divergence Rules are Necessary From Example 22 we know that some diverging programs result in a  state. But do we really need the  flag and divergence rule? Here, we answer this question affirmatively. Consider the following program: (while 1 skip); alloc x; x := x + 0 Proving that this program diverges depends crucially on F-Div allowing us to propagate divergence. The while-command diverges whereas the last sub-commands of the program contain a stuck computation: the variable x has the null value when it is dereferenced, so this program will attempt to add null and 0, which is meaningless. The derivation trees we can construct must use the F-Div rule as follows: co (while 1 skip, ·, ) ⇒f (·, ) co (alloc x; x := x + 0, ·, ) ⇒f (·, ) co F-Div F-Seq ((while 1 skip); alloc x; x := x + 0, ·, ) ⇒f (·, ) co Example 23. For any σ, ((while 1 skip); alloc x; x := x + 0, ·, ) ⇒ (σ, ). In contrast, co ¬ ∃σ. ((while 1 skip); alloc x; x := x + 0, ·, ) ⇒ (σ, ) Leroy and Grall [3] observed a similar point about the coinductive interpretation of the rules for the λ-calculus with constants, i.e., that it is non-deterministic, and that it does not contain computations that diverge and then get stuck, nor computations that diverge towards infinite values. Here, we have shown (Theorem 17 and 18) that coevaluation of flag-based big-step semantics is equally expressive as traditional divergence predicates and, transitively (by Theorem 2 and 5), small-step semantics. 5. Beyond the While-Language Flag-based big-step semantics supports reasoning about divergence on a par with small-step semantics for the simple While-language. In this section we illustrate that the approach also scales to deal with other language features, such as exceptions and non-deterministic input. To this end, we present a novel proof method for relating small-step and big-step semantics with sources of non-determinism. Finally, we discuss potential pitfalls and limitations. 13 5.1. Non-deterministic input Previous approaches to relating big-step and small-step SOS focus mainly on relating finite computations [4; 18; 19]. The main counter-example appears to be Leroy and Grall’s study of coinductive big-step semantics [3], which considers a deterministic language. Their proof (which is analogous to Theorem 5 in Sect. 3.2 of this article) for relating diverging computations in small-step and big-step semantics relies crucially on determinism. We consider the extension of our language with an expression form for non-deterministic interactive input, and prove that the extension preserves the equivalence of small-step semantics and flagbased big-step semantics. Our proof provides a novel approach to relating small-step and big-step SOS for divergent computations involving non-determinism at the leaves of derivation trees. Consider the extension of our language with the following expression form which models interactive input: Expr 3 e ::= . . . | input Its single expression evaluation rule is: (input, σ, ) ⇒fe v,  Adding this construct clearly makes our language non-deterministic, since the value v to the right of ⇒fe is arbitrary. If we extend expression evaluation for small-step correspondingly, is the big-step flag-based semantics still equivalent to the small-step semantics? The answer to this question should intuitively be “yes”: we have not changed the semantics of commands, so most of the proofs of the properties about the relationship between small-step and big-step semantics from Sect. 2 carry over unchanged, since they rely on the expression evaluation relation being equivalent between the two semantics. But the proof of Theorem 5 crucially relies on Lemma 7, which in turn holds only for deterministic transition relations and expression evaluation relations. The violated property is the following: ∞ ∞ If (c1 , σ) →∗ (c01 , σ 0 ) and (c1 ; c2 , σ) →, then (c01 ; c2 , σ 0 ) →. Here, if → is non-deterministic, it may be that c1 can make a sequence of transition steps to a c01 which is stuck, whereas there may exist some alternative sequence of transition steps for c1 such that c1 ; c2 diverges. Example 24. Consider the program state where x is an unbound variable: c1 c 2 z }| { z }| { (if input (x := 0) skip; while 1 skip, ·) If input returns a non-zero value, evaluation gets stuck, since the command ‘x := 0’ is meaningless in the ∞ empty store (‘·’). Otherwise, evaluation diverges. Thus it holds that (c1 , ·) →∗ (x := 0, ·) and (c1 ; c2 , ·) →, ∞ but not (x := 0; c2 , ·) →. What we can prove instead about possibly-terminating computations that rely on sequential composition is the following: ∞ ∞ Lemma 25. If (c1 ; c2 , σ) → and ¬(∃σ 0 . (c1 , σ) →∗ (skip, σ 0 )), then it must be the case that (c1 , σ) →. Proof. The proof is by coinduction, using the goal as coinduction hypothesis. The proof follows by inversion on the first hypothesis, from which we derive that either c1 = skip, which leads to a contradiction, or there exists a configuration (c01 , σ1 ) for which (c1 , σ) → (c01 , σ1 ). By the second hypothesis, it must also hold that there is no σ 0 such that (c01 , σ1 ) →∗ (skip, σ 0 ). From these facts, the goal follows by applying Trans∞, the small-step rule S-Seq, and the coinduction hypothesis. Using Lemma 25, we can relate infinite sequences of small-step transitions to infinite flag-based big-step derivations as follows. 14 ∞ co Lemma 26. For any σ 0 , if (c, σ) → then (c, σ, ) ⇒f σ 0 , . Proof (classical). The proof is by guarded coinduction, using the goal as the coinduction hypothesis. The critical cases are those for sequential composition and ‘while’: these cases use the law of excluded middle for case analysis on whether c converges or not. If it does, the goal follows by Lemma 20 (which carries over unchanged). If it does not, the goal follows by Lemma 25 above. The proof of the other direction, i.e., relating infinite big-step derivations to infinite sequences of smallstep transitions is proved using Lemma 28: ∞ co Theorem 27. (c, σ) → iff for any σ 0 , (c, σ, ) ⇒f σ 0 , . Proof (classical). The small-to-big direction is proved in Lemma 25 above. The other direction follows by coinduction and Lemma 28 below. co Lemma 28. For any σ 00 , if (c, σ) ⇒f σ 00 , , then ∃c0 , σ 0 .   co (c, σ) → (c0 , σ 0 ) ∧ (c0 , σ 0 ) ⇒f σ 00 ,  . Proof. The proof carries over from Lemma 8, and relies on Theorem 29 below. Theorem 29. (c, σ) →∗ (skip, σ 0 ) iff (c, σ) ⇒b σ 0 . Proof. The proof straightforwardly carries over from Theorem 2. 5.2. Exceptions We extend our language with exceptions. We add exceptions to our language by augmenting the syntactic sort for status flags: Status 3 δ ::= . . . | exc(v, σ) We let exceptions record both a thrown value and the state of the store when the exception occurs. We also augment the syntactic sort for commands with a ‘throw v’ construct for throwing a value v as an exception, and a ‘catch c c’ construct for handling exceptions: Cmd 3 c ::= . . . | throw v | catch c c The rules for these constructs are given by a single rule for throwing an exception, and two rules for propagating exceptions for command and expression evaluation: (throw v, σ, ) ⇒f σ 0 , exc(v, σ) (c, σ, exc(v, σ0 )) ⇒f σ 0 , exc(v, σ0 ) F-Exc F-Throw (e, σ, exc(v, σ0 )) ⇒fe v 0 , exc(v, σ0 ) FE-Exc Using these rules, exceptions are propagated similarly to divergence. The following rules specify the semantics of ‘catch c c’: δ 6= exc( , ) (c1 , σ, ) ⇒f σ 0 , δ F-Catch (catch c1 c2 , σ, ) ⇒f σ 0 , δ (c1 , σ, ) ⇒f σ 0 , exc(v, σ0 ) (c2 , σ0 , ) ⇒f σ 00 , δ F-Catch-Some (catch c1 c2 , σ, ) ⇒f σ 00 , δ Here, F-Catch handles the case where no exception arises during evaluation of c1 . F-Catch-Some detects that an exception has occurred and proceeds to evaluate the handler, c2 , in the store recorded in the exception.6 6 The handler c here discards the value of the exception. It is straightforward to give flag-based semantics for handlers with 2 patterns that match thrown exception values, e.g., by adapting rules from [20, Sect. 3.3] or [21, Fig. 2]. 15 5.3. The Necessity of Choosing Arbitrary Stores The F-Throw and F-Exc rules above admit arbitrary σ 0 s on the right-hand side of the arrow. Admitting arbitrary stores to be propagated in connection with divergence was motivated in part by the fact that divergent computations are non-deterministic anyway (see, e.g., Example 22). But computations that throw exceptions are guaranteed to converge, so do we really need it here? For the simple language considered here, we do not strictly need to relate exceptional states to arbitrary other states. But consider a variant of the While-language where exceptions can arise during expression evaluation, where expression evaluation may affect the store, and where we allow variables to be passed around as first-class values similarly to references in Standard ML [22]. The signature of expression evaluation and the assignment rule in such a language could be: (e, σ, δ) ⇒fe v, σ, δ 0 (e1 , σ, ) ⇒fe x, σ 0 , δ (e2 , σ 0 , δ) ⇒fe v, σ 00 , δ 0 x ∈ dom(σ 00 ) F-RefAsgn 00 0 (e1 := e2 , σ, ) ⇒fe v, σ [x 7→ v], δ Given the rule and language described above, if e1 or e2 abruptly terminates the rule still insists that x ∈ dom(σ 00 ). Thus, it becomes essential that abrupt termination allows us to return an arbitrary store, such that we can synthesise a store σ 00 for which x ∈ dom(σ 00 ). If we did not, evaluation might get stuck instead of propagating abrupt termination. A further consequence of a rule like F-RefAsgn above is that the property summarised in Lemma 21 no longer holds: we can no longer prove that a program that diverges has an arbitrary store. For some applications this is unimportant; for others, this state of affairs is unfortunate. For example, a proof assistant like Coq does not support coinductive reasoning about existentially quantified goals in a satisfactory manner: Coq’s support for coinductive proofs is limited to guarded coinduction, which makes many otherwise simple proofs unnecessarily involved. For example, proving a goal of the following form is not possible by guarded coinduction alone: co If P then ∃σ 0 . (c, σ, ) ⇒ (σ 0 , ) where P is some proposition. While the need to synthesise semantic information that is not the result of any actual computation may be unattractive for certain applications, flag-based big-step rules do allow abrupt termination and divergence to be propagated correctly. Furthermore, the flag-based approach is also applicable to the more flexible pretty-big-step style: applying a flag-based propagation strategy to pretty-big-step rules would alleviate the need for abort-rules for each semantic expression constructor, since propagation is handled by a single flag-based abort rule instead.7 6. Implicit Flag-Based Divergence As illustrated in the previous sections, the flag-based approach can reduce the number of rules and premises required for specifying divergence or abrupt termination in big-step semantics. However, explicit threading of the flag arguments δ and δ 0 through the evaluation formulae in all rules is somewhat tedious, and might discourage adoption of the approach. In this section, we introduce new notation for signatures. Using such signatures, the flag arguments can be left implicit in almost all rules. For instance, we can specify the While language with the signatures specified below simply by adding the divergence rules FE-Div and F-Div from Fig. 6 to the original big-step rules given in Figs. 1 and 3. Recall the original signatures used for the big-step semantics of While: (c, σ) ⇒b σ 0 (e, σ) ⇒e v 7 This approach was explored in previous work [23, Sect. 3.1] by the authors. 16 Our new signatures for the flag-based semantics of While are as follows: (e, σ , δ:− ) ⇒fe v , δ 0 (c, σ , δ:− ) ⇒f σ 0 , δ 0 The highlighting of the arguments δ and δ 0 specifies formally that they can either be omitted or made explicit (uniformly) when the evaluation relation concerned is used in a rule. The notation ‘δ:−’ indicates that  is the default value of the flag δ.8 Rules written using just the non-highlighted parts of the signatures abbreviate flag-based rules as follows: • When a rule without explicit flags has no evaluation premises, it abbreviates the flag-based rule where the flags of both the source and target of the conclusion are . For example, (skip, σ) ⇒f σ F-Skip abbreviates du (skip, σ, ) ⇒f σ,  F-Skip. • When a rule without explicit flags has n evaluation premises, it abbreviates the flag-based rule where the flags of the source of the first evaluation premise and of the source of the conclusion are ; the flags of the target of evaluation premise i and of the source of evaluation premise i + 1 are δi (for 1 ≤ i < n); and the flags of the target of evaluation premise n and the conclusion are δ 0 . For example, (c1 , σ, ) ⇒f σ 0 , δ1 (c2 , σ 0 , δ1 ) ⇒f σ 00 , δ 0 (c1 , σ) ⇒f σ 0 (c2 , σ 0 ) ⇒f σ 00 F-Seq abbreviates du F-Seq. (c1 ; c2 , σ) ⇒f σ 00 (c1 ; c2 , σ, ) ⇒f σ 00 , δ 0 Replacing the signatures in Figs. 1 and 3 by those given above, the big-step rules there abbreviate all the flag-based rules given in Fig. 6 (up to renaming of flag variables), so all that is needed is to add the two explicit divergence rules (FE-Div and F-Div). The Definition of Standard ML [22] introduced the technique of letting arguments of evaluation relations remain implicit in big-step rules, calling it “the store convention”. I-MSOS [10] proposed the use of highlighting to specify formally which arguments can be omitted, and defined I-MSOS by translation to MSOS [9], but the notation provided there does not support the intended use of the default  in flag-based big-step rules. It should however be possible to generalise I-MSOS to support flags, and thereby allow further arguments to be omitted. For instance, the I-MSOS signature ( c , σ) ⇒f ( σ 0 ) allows the σ and σ 0 arguments to be omitted as follows: skip ⇒f ( ) F-Skip c1 ⇒f ( ) c2 ⇒ f ( ) F-Seq c1 ; c2 ⇒f ( ) The highlighting in the following signature could therefore specify that the above rules abbreviate flag-based MSOS rules: ( c , σ, δ:−) ⇒f ( σ 0 , δ 0 ) Further development of the details of implicit flag-based I-MSOS is out of the scope of this paper, and left to future work. 7. Related Work Several papers have explored how to represent divergence in big-step semantics. Leroy and Grall [3] survey different approaches to representing divergence in coinductive big-step semantics, including divergence predicates, trace-based semantics, and taking the coinductive interpretation of standard big-step rules. 8 ‘δ:−’ is reminiscent of Prolog: it indicates that  is the condition for δ to allow evaluation to proceed normally. 17 They conclude that traditional divergence predicates are the most well-behaved, but increase the size of specifications by around 40%. The trace-based semantics of Leroy and Grall relies on concatenating infinite traces for accumulating the full trace of rules with multiple premises. Nakata and Uustalu [24] propose a more elegant approach to accumulating traces based on ‘peel’ rules. Their approach is closely related to the partiality monad, introduced by Capretta, and used by several authors to give functional representations of big-step semantics, including Danielsson [25] and Abel and Chapman [26] (who call it the delay monad ). In the partiality monad, functions either return a finitely delayed result or an infinite trace of delays. Piróg and Gibbons [27] study the category theoretic foundations of the resumption monad. Related to the resumption monad is the interactive I/O monad by Hancock and Setzer [28] for modeling the behaviour of possibly-diverging interactive programs. While it is possible to specify and reason about operational semantics by means of the partiality monad, it relies on the ability to express mixed recursive/corecursive functions in order to use it in proof assistants. Agda [29] provides native support for such function definitions, while Coq does not. Nakata and Uustalu [24; 30] show that it is possible to express and reason about a functional representation of a trace-based semantics in Coq using a purely coinductive style. This works well for the simple While-language, but preliminary experiments suggest that such guarded coinductive functions can be subtle to implement in Coq. Propagating divergence between premises in trace-based big-step semantics is also slightly more involved than the approach taken in pretty-big-step semantics and by us: propagating divergence between premises in trace-based semantics entails a coinductive proof for each premise (proving that the trace is infinite). In contrast, propagation in both pretty-big-step semantics and our approach relies on simple case analysis (i.e., via abort rules or inspecting the status flag). Trace-based semantics provides a strong foundation for constructively reasoning about possibly-diverging programs, but unfortunately, as discussed earlier, a modern proof assistant like Coq is not up to the task of expressing and reasoning about these in a fully satisfactory manner: Coq’s support for coinductive proofs is limited to guarded coinduction, which makes many otherwise simple proofs involving existentials unnecessarily involved. For example, proving a goal of the following form is not possible by guarded coinduction alone: co If P then ∃τ. (c, σ) ⇒ τ Here, P is some proposition, and τ is a trace. Proving such propositions can be done by manually constructing a witness function for τ , which is not always trivial. Charguéraud [8] directs a similar criticism at Coq’s lack of support for coinduction. Hur et al. [31] present a novel means of doing coinductive proofs. The idea is to use a parameterised greatest fixed-point for proofs by coinduction. Their Coq library, Paco, provides an implementation of the method, which supports proofs by coinduction using a more flexible notion of guardedness than the naive syntactic guardedness check which Coq implements. This line of work provides a promising direction for more tractable coinductive proofs. Looking beyond Coq, the support for features pertaining to coinduction seems more progressive in the Agda proof assistant. Indeed, Danielsson [25] leverages some of this support by using mutually recursive/corecursive functions (which Coq does not support) in his big-step functional operational semantics for the λ-calculus. Also working in Agda, Abel and Chapman [26] use sized types [32] for their proofs by coinduction. Nakata and Uustalu also give coinductive big-step semantics for resumptions [30] (denoting the external behaviour of a communicating agent in concurrency theory [33]) as well as interleaving and concurrency [34]. These lines of work provide a more general way of giving and reasoning about all possible outcomes of a program than the committed-choice non-determinism that we considered in Sect. 5.1. It is, however, also somewhat more involved to specify and work with. Owens et al. [35] argue that step-indexed semantics, i.e., using a counter which is decremented with each recursive call, is an under-utilised technique for representing big-step semantics with possible divergence. By augmenting a big-step semantics with counters, it becomes possible to represent it as a function in logic such that it is guaranteed to terminate: when the clock runs out, a special “time-out” value is produced. This permits reasoning about divergence, since the set of diverging programs is exactly the set of programs for 18 which there does not exist a finitely-valued counter such that the program successfully terminates without timing out. This provides an alternative that avoids the duplication problem with big-step semantics but still supports reasoning about diverging computations, albeit somewhat more indirectly than representing infinite computations as infinite derivation trees. Moggi [36] suggested monads as a means to obtain modularity in denotational semantics [37]. In a similar vein, Modular SOS [9] provides a means to obtain modularity in operational semantics. The flagbased approach to divergence presented here is a variant of the abrupt termination technique used in [9]. That article represents abrupt termination as emitted signals. In a small-step semantics, this enables the encoding of abrupt termination by introducing a top-level handler that matches on emitted signals: if the handler observes an emitted signal, the program abruptly terminates. Exceptions as emitted signals could also be used for expressing abrupt termination in big-step semantics. However, this would entail wrapping each premise in a handler, thereby cluttering rules. Subsequent work [23] observed that encoding abrupt termination as a stateful flag instead scales better to big-step rules by avoiding such explicit handlers. Flagbased divergence was used in [38] for giving a semantics for the untyped λ-calculus. The first author’s thesis [39, Cpt. 4 and 5] describes a rule format for which small-step and pretty-big-step rules are provably equivalent using flag-based abrupt termination and divergence. Our work differs from [23; 38; 39] in several ways: unlike [23] it considers both inductive and coinductive big-step semantics and it is based on SOS. In our work with Torrini [38], we proposed the flag-based approach as a straightforward way of augmenting a semantics such that it is useful for reasoning about divergence, but did not provide proofs of the equivalence with traditional big-step semantics nor small-step semantics. Another difference from this paper is that both [23; 39] mainly considers pretty-big-step, whereas the flagbased big-step style considered here has a more traditional big-step flavour. The first author’s thesis [39] also uses the generalised coinductive proof technique described in Sect. 5.1 for relating divergent small-step and pretty-big-step semantics with limited non-determinism. Whereas [39] applies the technique to a variant of MSOS in pretty-big-step style, this paper shows that the technique also scales to flag-based big-step SOS. The question of which semantic style (small-step or big-step) is better for proofs is a moot point. Bigstep semantics are held to be more convenient for certain proofs, such as compiler correctness proofs. Leroy and Grall [3] cite compiler correctness proofs as a main motivation for using coinductive big-step semantics as opposed to small-step semantics: using small-step semantics complicates the correctness proof. Indeed, Hutton and Wright [5] and Hutton and Bahr [40] also use big-step semantics for their compiler correctness proofs. However, in CompCert, Leroy [41] uses a small-step semantics and sophisticated notions of bisimulation for its compiler correctness proofs. Wright and Felleisen introduce the syntactic approach to type safety in [42]. They survey type safety proofs based on denotational and big-step semantics, and conclude that small-step semantics is a better fit for proving type safety by progress and preservation lemmas. Harper and Stone [43] direct a similar criticism at the big-step style. Big-step semantics can, however, be used for strong type safety on a par with smallstep semantics. Leroy and Grall [3] show how to coinductively prove progress using coinductive divergence predicates, whereby type safety can be proved, provided one also proves a big-step preservation lemma, which is usually unproblematic. Another approach to big-step type safety consists in making the big-step semantics total by providing explicit error rules for cases where the semantics goes wrong. Type safety is then proved by showing that well-typed programs cannot go wrong. A non-exhaustive list of examples that use explicit error rules includes: Cousot’s work on types as abstract interpretations [44]; Danielsson’s work on operational semantics using the partiality monad [25]; and Charguéraud’s work on pretty-big-step semantics [8], which provides a nice technique for encoding explicit error rules more conveniently. A third option for proving type safety using a big-step relation is to encode the big-step semantics as a small-step abstract machine [45; 46; 47], whereby the standard small-step type safety proof technique applies. A preliminary study [38] of a variant of Cousot’s types as abstract interpretations suggests that abstract interpretation can be used to prove big-step type safety without the explicit error rules Cousot uses in his original presentation [44]. 19 8. Conclusion We presented a novel approach to augmenting standard big-step semantics to express divergence on a par with small-step and traditional big-step semantics. Our approach to representing divergence uses fewer rules than existing approaches of similar expressiveness (e.g., traditional big-step and pretty-big-step), and the flag arguments of the evaluation relations can be generated automatically. We also considered how to extend our semantics with interactive input, and provided a generalisation of the traditional proof method for relating diverging small-step and big-step semantics. Our experiments show that flag-based semantics provides a novel, lightweight, and promising approach to concise big-step SOS specification of programming languages involving divergence and abrupt termination. Acknowledgements. We thank the anonymous reviewers for their constructive suggestions for improving this paper. Thanks also to Neil Sculthorpe, Paolo Torrini, and Ulrich Berger for their helpful comments on a previous version of this article. This work was supported by an EPSRC grant (EP/I032495/1) to Swansea University in connection with the PLanCompS project (www.plancomps.org). References References [1] G. D. Plotkin, A structural approach to operational semantics, J. Log. Algebr. Program. 60-61 (2004) 17–139. doi:10.1016/j.jlap.2004.05.001. [2] G. Kahn, Natural semantics, in: STACS 87, Vol. 247 of LNCS, Springer, 1987, pp. 22–39. doi:10.1007/BFb0039592. [3] X. Leroy, H. Grall, Coinductive big-step operational semantics, Inf. Comput. 207 (2) (2009) 284–304. doi:10.1016/j.ic.2007.12.004. [4] T. Nipkow, G. Klein, Concrete Semantics: With Isabelle/HOL, Springer, 2014. [5] G. Hutton, J. Wright, What is the meaning of these constant interruptions?, J. Functional Program. 17 (2007) 777–792. doi:10.1017/S0956796807006363. [6] O. Danvy, L. R. Nielsen, Refocusing in reduction semantics, BRICS Research Series RS-04-26, Dept. of Comp. Sci., Aarhus University (2004). [7] C. Bach Poulsen, P. D. Mosses, Generating specialized interpreters for modular structural operational semantics, in: LOPSTR’13, Vol. 8901 of LNCS, Springer, 2014, pp. 220–236. doi:10.1007/978-3-319-14125-1\_13. [8] A. Charguéraud, Pretty-big-step semantics, in: ESOP’14, Vol. 7792 of LNCS, Springer, 2013, pp. 41–60. doi:10.1007/978-3-642-37036-6_3. [9] P. D. Mosses, Modular structural operational semantics, J. Log. Algebr. Program. 60-61 (2004) 195–228. doi:10.1016/j.jlap.2004.03.008. [10] P. D. Mosses, M. J. New, Implicit propagation in structural operational semantics, ENTCS 229 (4) (2009) 49–66. doi:10.1016/j.entcs.2009.07.073. [11] J. C. Reynolds, Definitional interpreters for higher-order programming languages, in: ACM ’72, ACM Annual Conference, ACM, New York, NY, USA, 1972, pp. 717–740. doi:10.1145/800194.805852. [12] P. Cousot, R. Cousot, Inductive definitions, semantics and abstract interpretations, in: POPL’92, ACM, New York, NY, USA, 1992, pp. 83–94. doi:10.1145/143165.143184. [13] B. C. Pierce, Types and Programming Languages, MIT Press, Cambridge, MA, USA, 2002. [14] D. Sangiorgi, Introduction to Bisimulation and Coinduction, Cambridge University Press, New York, NY, USA, 2011. [15] T. Coquand, G. Huet, The calculus of constructions, Inf. Comput. 76 (23) (1988) 95–120. doi:10.1016/0890-5401(88)90005-3. [16] B. C. Pierce, Advanced Topics in Types and Programming Languages, The MIT Press, Cambridge, MA, USA, 2004. [17] J. P. Seldin, On the proof theory of Coquand’s calculus of constructions, Annals of Pure and Applied Logic 83 (1) (1997) 23–101. doi:10.1016/S0168-0072(96)00008-5. [18] B. C. Pierce, C. Casinghino, M. Greenberg, C. Hriţcu, V. Sjöberg, B. Yorgey, Software Foundations, 2013, electronic textbook. URL http://cis.upenn.edu/~bcpierce/sf [19] S, . Ciobâcă, From small-step semantics to big-step semantics, automatically, in: IFM’13, Vol. 7940 of LNCS, Springer, 2013, pp. 347–361. doi:10.1007/978-3-642-38613-8_24. [20] M. Churchill, P. D. Mosses, N. Sculthorpe, P. Torrini, Reusable components of semantic specifications, in: Trans. AspectOriented Software Development XII, Vol. 8989 of LNCS, Springer, 2015, pp. 132–179. doi:10.1007/978-3-662-46734-3_4. [21] M. Churchill, P. D. Mosses, Modular bisimulation theory for computations and values, in: FoSSaCS’13, Vol. 7794 of LNCS, Springer, 2013, pp. 97–112. doi:10.1007/978-3-642-37075-5_7. [22] R. Milner, M. Tofte, R. Harper, D. MacQueen, The Definition of Standard ML, MIT Press, Cambridge, MA, USA, 1997. [23] C. Bach Poulsen, P. D. Mosses, Deriving pretty-big-step semantics from small-step semantics, in: ESOP 2014, Vol. 8410 of LNCS, Springer, 2014, pp. 270–289. doi:10.1007/978-3-642-54833-8_15. 20 [24] K. Nakata, T. Uustalu, Trace-based coinductive operational semantics for While, in: TPHOLs’09, Vol. 5674 of LNCS, Springer, 2009, pp. 375–390. doi:10.1007/978-3-642-03359-9_26. [25] N. A. Danielsson, Operational semantics using the partiality monad, in: ICFP’12, ACM, New York, NY, USA, 2012, pp. 127–138. doi:10.1145/2364527.2364546. [26] A. Abel, J. Chapman, Normalization by evaluation in the delay monad: A case study for coinduction via copatterns and sized types, in: MSFP’14, Vol. 153 of ENTCS, Open Publishing Association, 2014, pp. 51–67. doi:10.4204/EPTCS.153.4. [27] M. Piróg, J. Gibbons, The coinductive resumption monad, ENTCS 308 (2014) 273–288. doi:10.1016/j.entcs.2014.10.015. [28] P. Hancock, A. Setzer, Interactive programs in dependent type theory, in: CSL’00, Vol. 1862 of LNCS, Springer, 2000, pp. 317–331. doi:10.1007/3-540-44622-2_21. [29] A. Bove, P. Dybjer, U. Norell, A brief overview of Agda – a functional language with dependent types, in: TPHOLs’09, Springer, 2009, pp. 73–78. doi:10.1007/978-3-642-03359-9_6. [30] K. Nakata, T. Uustalu, Resumptions, weak bisimilarity and big-step semantics for While with interactive I/O: An exercise in mixed induction-coinduction, in: SOS’10, Vol. 32 of EPTCS, 2010, pp. 57–75. doi:10.4204/EPTCS.32.5. [31] C. Hur, G. Neis, D. Dreyer, V. Vafeiadis, The power of parameterization in coinductive proof, in: POPL’13, ACM, New York, NY, USA, 2013, pp. 193–206. doi:10.1145/2429069.2429093. [32] A. Abel, MiniAgda: Integrating sized and dependent types, in: PAR’10, Vol. 43 of EPTCS, 2010, pp. 14–28. doi:10.4204/EPTCS.43.2. [33] R. Milner, Processes: A mathematical model of computing agents, in: Logic Colloquium ’73, Studies in Logic and the Foundations of Mathematics, North-Holland Pub. Co., 1975, pp. 157–153. [34] T. Uustalu, Coinductive big-step semantics for concurrency, in: PLACES’13, Vol. 137 of EPTCS, 2013, pp. 63–78. doi:10.4204/EPTCS.137.6. [35] S. Owens, M. O. Myreen, R. Kumar, Y. K. Tan, Functional big-step semantics, in: ESOP’16, Vol. 9632 of LNCS, Springer, 2016, to appear. [36] E. Moggi, Notions of computation and monads, Inf. Comput. 93 (1) (1991) 55–92. doi:10.1016/0890-5401(91)90052-4. [37] P. Cenciarelli, E. Moggi, A syntactic approach to modularity in denotational semantics, in: Category Theory and Computer Science, Proc. 5th Intl. Conf., 1993. [38] C. Bach Poulsen, P. D. Mosses, P. Torrini, Imperative polymorphism by store-based types as abstract interpretations, in: PEPM’15, ACM, New York, NY, USA, 2015, pp. 3–8. doi:10.1145/2678015.2682545. [39] C. Bach Poulsen, Extensible transition system semantics, Ph.D. thesis, Swansea University, to appear (2016). [40] P. Bahr, G. Hutton, Calculating correct compilers, J. Functional Program. 25 (2015) e14 (47 pages). doi:10.1017/S0956796815000180. [41] X. Leroy, Formal certification of a compiler back-end or: Programming a compiler with a proof assistant, in: POPL’06, ACM, New York, NY, USA, 2006, pp. 42–54. doi:10.1145/1111037.1111042. [42] A. K. Wright, M. Felleisen, A syntactic approach to type soundness, Inf. Comput. 115 (1) (1994) 38–94. doi:10.1006/inco.1994.1093. [43] R. Harper, C. Stone, A type-theoretic interpretation of Standard ML, in: G. Plotkin, C. Stirling, M. Tofte (Eds.), Proof, Language, and Interaction, MIT Press, Cambridge, MA, USA, 2000, pp. 341–387. [44] P. Cousot, Types as abstract interpretations, in: POPL’97, ACM, New York, NY, USA, 1997, pp. 316–331. doi:10.1145/263699.263744. [45] M. S. Ager, D. Biernacki, O. Danvy, J. Midtgaard, A functional correspondence between evaluators and abstract machines, in: PPDP’03, ACM, New York, NY, USA, 2003, pp. 8–19. doi:10.1145/888251.888254. [46] O. Danvy, K. Millikin, On the equivalence between small-step and big-step abstract machines: A simple application of lightweight fusion, Inf. Process. Lett. 106 (3) (2008) 100–109. doi:10.1016/j.ipl.2007.10.010. [47] R. J. Simmons, I. Zerny, A logical correspondence between natural semantics and abstract machines, in: PPDP’13, ACM, New York, NY, USA, 2013, pp. 109–119. doi:10.1145/2505879.2505899. 21
6cs.PL
(IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 Security Assessment of Software Design using Neural Network A. Adebiyi, Johnnes Arreymbi and Chris Imafidon School of Architecture, Computing and Engineering University of East London, London, UK Abstract— Security flaws in software applications today has been attributed mostly to design flaws. With limited budget and time to release software into the market, many developers often consider security as an afterthought. Previous research shows that integrating security into software applications at a later stage of software development lifecycle (SDLC) has been found to be more costly than when it is integrated during the early stages. To assist in the integration of security early in the SDLC stages, a new approach for assessing security during the design phase by neural network is investigated in this paper. Our findings show that by training a back propagation neural network to identify attack patterns, possible attacks can be identified from design scenarios presented to it. The result of performance of the neural network is presented in this paper. Keywords- Neural Networks; Software security; Attack Patterns. I. INTRODUCTION The role software applications play in today’s hostile computer environment is very important. It is not uncommon to find software applications running our transportation systems, communication systems, medical equipment, banking systems, domestic appliances and other technologies that we depend on. Since many of these software applications are missions critical, the need to ensure the security of their data and other resources cannot be overlooked. The increase of attacks aimed directly at software applications in the past decades calls for software applications to be able to defend itself and continue functioning. However, when software applications are developed without security in mind, attackers take advantage of the security flaws in them to mount multiple attacks when they are deployed. To address this problem a new research field called software security emerged in the last decade with the aim of building security into software application during development. This approach views security as an emergent property of the software and much effort is dedicated into weaving security into the software all through SDLC One of the critical areas in this approach is the area of software design and security which proactively deals with attacking security problems at the design phase of SDLC. Reportedly, 50% of security problems in software products today have been found to be design flaws [17]. Design-level vulnerability has been described as the hardest category of software defect to contend with. Moreover, it requires great expertise to ascertain whether or not a software application has design-level flaws which makes it difficult to find and automate [9]. Many authors also argue that it is much better to find and fix flaws during the early phase of software development because it is more costly to fix the problem at a late stage of development and much more costly when the software has been deployed [6][29][30]. Therefore, taking security into consideration at the design phase of SDLC will help greatly in producing secured software applications. There are different approaches and tools currently used for integrating security during the phases of SDLC. However, software design security tools and technologies for automated security analysis at the design phase have been slow in coming. This is still an area where many researches are currently being undertaken. Neural Networks has been one of the technologies used during software implementation and testing phase of SDLC for software defect detection in order to intensify software reliability and it has also been used in area of application security and network security in technologies such as authentication system, cryptography, virus detection system, misuse detection system and intrusion detection systems (IDS) [2] [4] [14] [20] [31][32]. This research takes a further step by using neural networks as a tool for assessing security of software design at the design phase of SDLC. II. RELATED WORKS ON SECURITY ASSESSMENT OF SOFTWARE DESIGN In order to design software more securely many approaches have been adopted for assessing the security in software designs during the design phase of SDLC. Some of these approaches are discussed below. Threat modeling is an important activity carried out at the design phase to describe threats to the software application in order to provide a more accurate sense of its security [1]. Threat modeling is a technique that can be used to identify vulnerabilities, threats, attacks and countermeasures which could influence a software system [18]. This allows for the anticipation of attacks by understanding how a malicious attacker chooses targets, locates entry points and conducts attacks [24]. Threat modeling addresses threats that have the ability to cause maximum damage to a software application. Architectural risk analysis is also used to identify vulnerabilities and threats at the design phase of SDLC which may be malicious or non-malicious in nature due to a software system. It examines the preconditions that must be present for the vulnerabilities to be exploited by various threats and assess the states the system may enter after a successful attack on the 1|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 system. One of the advantages of architectural risk analysis is that it enables developers to analysis software system from its component level to its environmental level in order to evaluate the vulnerabilities, threats and impacts at each level [17]. Attack trees is another approach used to characterize system security by modeling the decision making process of attackers. In this technique, attack against a system is represented in a tree structure in which the root of the tree represents the goal of an attacker. The nodes in the tree represent the different types of actions the attacker can take to accomplish his goal on the software system or outside the software system which may be in the form of bribe or threat [6],[23]. “Attack trees are used for risk analysis, to answer questions about the system’s security, to capture security knowledge in a reusable way, and to design, implement, and test countermeasures to attacks” [24]. Attack nets is a similar approach which include “places” analogous to the nodes in an attack tree to indicate the state of an attack. Events required to move from one place to the other are captured in the transitions and arcs connecting places and transitions indicate the path an attacker takes. Therefore just as attack trees, attack nets also show possible attack scenarios to a software system and they are used for vulnerability assessment in software designs [6]. Another related approach is the vulnerability tree which is a hierarchy tree constructed based on how one vulnerability relates to another and the steps an attacker has to take to reach the top of the tree [23]. Vulnerability trees also help in the analysis of different possible attack scenarios that an attacker can undertake to exploit a vulnerability. Gegick and Williams [6] also proposed a regular expression-based attack patterns which helps in indicating the sequential events that occur during an attack. The attack patterns are based on the software components involved in an attack and are used for identifying vulnerabilities in software designs. It comprises of attack library of abstraction which can be used by software engineers conducting Security Analysis For Existing Threats (SAFE-T) to match their system design. An occurrence of a match indicates that the vulnerability may exist in the system being analyzed and therefore helps in integrating effective countermeasures before coding starts. Another advantage about this approach is that it can be easily adapted by developers who are novices on security. Mouratidis and Giorgini [19] also propose a scenario based approach called Security Attack Testing (SAT) for testing the security of a software system during design time. To achieve this, two sets of scenarios (dependency and security attack) are identified and constructed. Security test cases are then defined from the scenarios to test the software design against potential attacks to the software system. Essentially SAT is used to identify the goals and intention of possible attackers based on possible attack scenarios to the system. Software engineers are able to evaluate their software design when the attack scenarios identified are applied to investigate how the system developed will behave when under such attacks. From this, software engineers better understand how the system can be attacked and also why an attacker may want to attack the system. Armed with this knowledge, necessary steps can be taken to secure the software with capabilities that will help in mitigating such attacks For most of the approaches discussed above, the need to involve security experts is required in order to help in identifying the threats to the software technology, review the software for any security issues, investigate how easy it is to compromise the software’s security, analysis the impact on assets and business goals should the security of the software be compromised and recommend mitigating measures to either eliminate the risk identified or reduce it to a minimum. The need for security experts arises because there is an existing gap between security professionals and software developers. The disconnection between this two has led to software development efforts lacking critical understanding of current technical security risks [22]. In a different approach, Kim T. et.al [12] introduced the notion of dynamic software architecture slicing (DSAS) through which software architecture can be analyzed. “A dynamic software architecture slice represents the run-time behavior of those parts of the software architecture that are selected according to a particular slicing criterion such as a set of resources and events” [12] DSAS is used to decompose software architecture based on a slicing criterion. “A slicing criterion provides the basic information such as the initial values and conditions for the ADL (Architecture description language) executable, an event to be observed, and occurrence counter of the event” [12] While software engineers are able to examine the behavior of parts of their software architecture during run time using the DSAS approach, the trade-off is that it requires the software to be implemented first. The events examined to compute the architecture slice dynamically are generated when the Forward Dynamic Slicer executes the ADL executable. This is a drawback because fixing the vulnerability after implementation can be more costly [6]. Howe [10] also argues that the industry needs to invest in solutions that apply formal methods in analyzing software specification and design in order to reduce the number of defects before implementation starts. “Formal methods are mathematically based techniques for the specification development and verification of software and hardware systems” [7] Recent advances in formal methods have also made verification of memory safety of concurrent systems possible [7]. As a result, formal methods are being used to detect design errors relating to concurrency [10]. A software development process incorporating formal methods into the overall process of early verification and defects removal through all SDLC is Correct by Construction (CbyC) [24]. CbyC has proved to be very cost effective in developing software because errors are eliminated early during SDLC or not introduced in the first place. This subsequently reduces the amount of rework that would be needed later during software development. However, many software development organizations have been reluctant in using formal methods because they are not used to its rigorous mathematical approach in resolving security issues in software design. Model checkers also come with their own modeling language which makes no provision for automatically translating informal requirements to this language. Therefore, 2|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 the translation has to be done manually and it may be difficult to check whether the model represent the target system [21] III. THE NUERAL NETWORK APPROACH Our proposed Neural Network approach in analysing software design for security flaws is based on the abstract and match technique through which software flaws in a software design can be identified when an attack pattern is matched to the design. Using the regularly expressed attack patterns proposed by Williams and Gegick [6], the actors and software components in each attack pattern are identified. To generate the attack scenarios linking the software components and actors identified in the attack pattern, online vulnerability databases were used to identify attack scenarios corresponding to the attack pattern. Data of attack scenarios from online vulnerability databases such as CVE Details, Security Tracker, Secunia, Security Focus and The Open Source Vulnerability Database were used. A. The Neural Network Architecture A three-layered feed-forward back-propagation was chosen for the architecture of neural network in this research. The back-propagation neural network is a well-known type of neural network commonly used in pattern recognition problems [25]. A back-propagation network has been used because of its simplicity and reasonable speed. The architecture of the neural network consists of the input layer, the hidden layer and the output layer. Each of the hidden nodes and output nodes apply a tan-sigmoid transfer function (2/(1+exp(-2*n))-1) to the various connection weights. The weights and parameters are computed by calculating the error between the actual and expected output data of the neural network when the training data is presented to it. The error is then used to modify the weights and parameters to enable the neural network to a have better chance of giving a correct output when it is next presented with same input B. Data Collection From the online vulnerability databases mentioned above, a total of 715 attack scenarios relating to 51 regularly expressed attack patterns by Williams and Gegick’s were analysed. This consisted of 260 attack scenarios which were unique in terms of their impact, mode of attack, software component and actors involved in the attack and 455 attack scenarios which are repetition of the same type of exploit in different applications they have been reported in the vulnerability databases. The attacks were analysed to identify the actors, goals and resources under attack. Once these were identified the attack attributes below were used to abstract the data capturing the attack scenario for training the neural network. The attack attributes includes the following. 1. The Attacker: This attribute captures the capability of the attacker. It examines what level of access possessed when carrying out the attack. 2. Source of attack: This attributes captures the location of the attack during the attack. 3. Target of the attack: This captures the system component that is targeted by the attacker 4. Attack vector: This attributes captures the mechanism (i.e. software component) adopted by the attacker to carry out the attack 5. Attack type: The security property of the application being attacked is captured under this attribute. This could be confidentiality, integrity or availability. 6. Input Validation: This attributes examines whether any validation is done on the input passed to the targeted software application before it is processed 7. Dependencies: The interaction of the targeted software application with the users and other systems is analysed under this attributes. 8. Output encoding to external applications/services: Software design scenarios are examined under this attributes to identify attacks associated with flaws due to failure of the targeted software application in properly verifying and encoding its outputs to other software systems 9. Authentication: This attribute checks for failure of the targeted software application to properly handle account credentials safely or when the authentication is not enforced in the software design scenarios. 10. Access Control: Failure in enforcing access control by the targeted software application is examined in the design scenarios with this attribute. 11. HTTP Security: Attack Scenarios are examined for security flaws related to HTTP requests, headers, responses, cookies, logging and sessions with this attribute 12. Error handling and logging: Attack scenarios are examined under this attributes for failure of the targeted application in safely handling error and security flaws in log management. C. Data Encoding The training data samples each consist of 12 input units for the neural network. This corresponds to the values of the attributes abstracted from the attack scenarios. The training data was generated from the attack scenarios using the attributes. For instance training data for the attack on webmail (CVE 2003-1192) was generated by looking at the online vulnerability databases to get its details on the attributes we are interested in. This attack corresponds to regularly expressed attack pattern 3. Williams and Gegick [6] describe the attack scenario in this attack pattern as a user submitting an excessively long HTTP GET request to a web server, thereby causing a buffer. This attack pattern is represented as: (User)(HTTPServer)(GetMethod) (GetMethodBufferWrite)(Buffer) 3|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 TABLE I. SAMPLE OF PRE-PROCESSED TRAINING DATA FROM ATTACK SCENARIO S Attribute Observed data 1 Attacker No Access 2 Source External 3 Target Buffer 4 Attack Vector Long Get Request 5 Attack Type Availability 6 Input Validation Partial Validation 7 Dependencies 8 Output Encoding None 9 Authentication None 10 Access Control URL Access 11 HTTP Security Input Validation 12 Error None \N D. The Neural Network Training To train the neural network the training data set is divided into two sets. The first set of data is the training data sets (260 samples) that were presented to the neural network during training. TABLE III. SAMPLE OF TRAINING DATA AFTER ENCODING S\ N Attribute Value 1 Attacker 0 2 Source 1 3 Target 9 4 Attack Vector 39 5 Attack Type 5 6 Input Validation 2 7 Dependencies 6 8 Output Encoding 0 9 Authentication 0 10 Access Control 2 11 HTTP Security 3 12 Error 0 TRAINING AND TEST DATA SETS Number of Samples Data Set 1 Data set 2 Total Authentication & Input Validation In this example, the data generated from the attack scenario using the attribute list is shown in Table I. Using the corresponding values for the attributes; the data is then encoded as shown in the TABLE II. sample data on Webmail attack which corresponds to regularly expressed attack pattern 3, the neural network is trained to identify the expected attack pattern as 3. Training Data Test Data 143 117 260 26 25 51 The second set (51 Samples) is the data that were used to test the performance of the neural network after it had been trained. At the initial stage of the training, it was discovered that the neural network had too many categories to classify the input data into (i.e. 51 categories) because the neural network was not able to converge. To overcome the problem, the training data was further divided into two sets. The first set contained 143 samples and the second set contained 117 samples. These were then used for training two neural networks. Mat lab Neural Network tool box is used to perform the training. The training performance is measured by Mean Squared Error (MSE) and the training stops when the generalization stops improving or when the 1000th iteration is reached. E. Result and Discussion It took the system about one minute to complete the training for each the back-propagation neural network. For the first neural network, the training stopped when the MSE of 0.0016138 was reached at the 26th iteration. The training of the second neural network stopped when the MSE of 0.00012841 was reached at the 435th iteration. TABLE IV. COMPARISION OF ACTUAL AND EXPECTED OUTPUT FROM NEURAL NETWORK s\n Attack Pattern Investigated Actual Output Expected Output Results from Neural Network 1 The second stage of the data processing involves converting the value of the attributes in Table II into ASCII comma delimited format before it is used in training the neural network. For the expected output from the neural network, the data used in training network is derived from the attack pattern which has been identified in each of the attack scenarios. Each attack pattern is given a unique ID which the neural network is expected to produce as an output for each of the input data samples. The output data sample consists of output units corresponding to the attack pattern IDs. For instance, the above 1 Attack Pattern 1 1.0000 1 2 Attack Pattern 2 2.0000 2 3 Attack Pattern 3 2.9761 3 4 Attack Pattern 4 4.0000 4 5 Attack Pattern 5 4.9997 5 6 Attack Pattern 6 5.9998 6 7 Attack Pattern 7 7.0000 7 8 Attack Pattern 8 8.0000 8 9 Attack Pattern 9 9.0000 9 4|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 10 Attack Pattern 10 7.0000 10 11 Attack Pattern 11 11.0000 11 12 Attack Pattern 12 12.0000 12 13 Attack Pattern 13 12.9974 13 14 Attack Pattern 14 13.772 14 15 Attack Pattern 15 15.0000 15 16 Attack Pattern 16 16.0000 16 17 Attack Pattern 17 16.9999 17 18 Attack Pattern 20 19.9984 20 19 Attack Pattern 21 21.0000 21 20 Attack Pattern 22 22.0000 22 21 Attack Pattern 23 23.0000 23 22 Attack Pattern 24 23.9907 24 23 Attack Pattern 25 25.0000 25 24 Attack Pattern 26 26.0000 26 25 Attack Pattern 27 27.0000 27 26 Attack Pattern 28 28.0000 28 Results from Network 2 27 Attack Pattern 29 28.999 29 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 29.9983 31.0000 31.998 32.8828 33.9984 32.8828 35.9945 36.6393 37.9999 37.9951 39.1652 40.9669 41.9998 42.998 43.9979 44.9991 45.8992 46.9956 47.9997 48.9999 49.8649 50.9629 50.6745 52.7173 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 Attack Pattern 30 Attack Pattern 31 Attack Pattern 32 Attack Pattern 33 Attack Pattern 34 Attack Pattern 35 Attack Pattern 36 Attack Pattern 37 Attack Pattern 38 Attack Pattern 39 Attack Pattern 40 Attack Pattern 41 Attack Pattern 42 Attack Pattern 43 Attack Pattern 44 Attack Pattern 45 Attack Pattern 46 Attack Pattern 47 Attack Pattern 48 Attack Pattern 49 Attack Pattern 50 Attack Pattern 51 Attack Pattern 52 Attack Pattern 53 behind this, it was seen that the data observed for these attack patterns were not much. With more information on these attack patterns for training the neural network, it is predicted that the network will give a better performance. During the study of the results from the neural networks, it was found that the first neural network had 96.51% correct results while the second neural network had 92% accuracy. The accuracy for both neural networks had an average of 94.1%. Given the accuracy of the neural networks, it shows that neural networks can be used to assess the security in software designs. Figure 1. Actual vs. Expected output of Neural Network IV. FUTURE WORK To further improve the performance of the neural network system as a tool for assessing security in software designs, we are currently looking into the possibility of the system suggesting solutions that can help to prevent the identified attacks. Current research on solutions to software design security flaws gives a good insight in this area. Suggested solutions such as the use security patterns [11] and introduction of security capabilities into design in the SAT approach [19] are currently investigated. Furthermore, the performance of the neural network tool would be compared to current approaches used in assessing security in software designs in a case study on the design of an online shopping portal. The regularly expressed attack pattern used in training the neural network is a generic classification of attack patterns Therefore; any unknown attack introduced to the neural network will be classified to the nearest regularly expressed attack pattern. Nevertheless the success of the neural network in analysing software design for security flaws is largely dependent upon the input capturing the features of the software design presented to it. As this requires a human endeavour, further work is required in this area to ensure that correct input data is retrieved for analysis. In addition, the neural network needs to be thoroughly tested before it can gain acceptance as a tool for assessing software design for security flaws. V. To test the performance of the network, the second data sets were used to test the neural network. It was observed that the trained neural network gave an output as close as possible to the anticipated output. The actual and anticipated outputs are compared in the Table IV. The test samples in which the neural network gave a different output from the predicted output when testing the network includes tests for attack patterns 10, 35, 39, 40 and 52. While looking into the reason CONCLUSION Previous research works have shown that the cost of fixing security flaws in software applications when they are deployed is 4–8 times more than when they are discovered early in the SDLC and fixed. For instance, it is cheaper and less disruptive to discover design-level vulnerabilities in the design, than during implementation or testing, forcing a pricey redesign of pieces of the application. Therefore, integrating security into a software design will help tremendously in saving time and money during software development 5|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 Therefore, by using the proposed neural networks approach in this paper to analyse software design for security flaws the efforts of software designers in identifying areas of security weakness in their software design will be reinforced. Subsequently, this will enhance the development of secured software applications in the software industry especially as software designers often lack the required security expertise. Thus, neural networks given the right information for its training will also contribute in equipping software developers to develop software more securely especially in the area of software design. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Agarwal, A. 2006), “How to integrate security into your SDLC”, Available at: http://searchsoftwarequality.techtarget.com/tip/0,289483,sid92_gci1174 897,00.html, (Accessed 24/10/2010) Ahmad, I., Swati, S.U. and Mohsin, S. (2007) “Intrusion detection mechanism by resilient bpck Propagation (RPROP)”, European Journal of Scientific Research, Vol. 17(4), pp523-530 Arkin B, (2006), “Build security into the SDLC and Keep the bad guys out”, Available at, http://searchsoftwarequality.techtarget.com/qna/0,289202,sid92_gci1160 406,00.html,(Accessed 24/10/2010) Liu, G., Hu, F. and Chen, W.(2010), “A neural network emsemble based method for detecting computer virus”, In proceedings of 2010 International conference on computer, mechatronics, control and electronic engineering, Vol. 1, pp391-393 Croxford, M. (2005), “The challenge of low defect, secure software- too difficult and too expensive”, Secure Software Engineering, Available at: http://journal.thedacs.com/issue/2/33 (Accessed 25/02/2012) Gegick, M. and Williams, L. (2006), “On the design of more secure software-intensive systems by use of attack patterns”, Information and Software Technology, Vol. 49, pp 381-397 Hinchey, M et al, (2008), “Software engineering and formal methods”, Communications of the ACM, Vol.51(9), pp54-59 Ho, S. L.; Xie, M. and Goh, T. N. (2003), “A Study of the connectionist model for software reliability prediction”, Computer and Mathematics with Applications, Vol. 46, pp1037 -1045 Hoglung, G and McGraw G. (2004), “Exploiting software: The Achilles’ heel of cyberDefense”, Citigal, Available at: http://citigal.com/papers/download/cd-Exploiting_Software.pdf (Accessed 02/12/2011) Howe (2005), “Crisis, What Crisis?” IEEE Review, Vol. 51(2), p39 Kienzle, D. M and Elder, M. C. (2002) “Final Technical Report: Security Patterns for Web Application Development”, Available at http://www.scrypt.net/~celer/securitypatterns/final%20report.pdf, (Accessed 26/01/2012) Kim, T., Song, Y. Chung, L and Huynh, D.T (2007) “Software architecture analysis: A dynamic slicing approach, ACIS International Journal of Computer & Information Science, Vol. 1 (2), p91-p103 Lindqvist, U, Cheung, S. and Valdez, R (2003) “Correlated attack Modelling (CAM)”, Air Force Research Laboratory, New York, AFRLIF-RS-TR-2003-249 Lyu, M. R, (2006), “Software reliability engineering: A roadmap”, Available at: http://csse.usc.edu/classes/cs589_2007/Reliability.pdf (Accessed 21/09/2011) Mohan, K. K. Verma, A. K. and Srividya, A. (2009) “Early software reliability prediction using ANN process oriented development at prototype level”, In proceedings of 20th International symposium on software reliablity engineering (ISSRE), India, Available at: http://www.issre2009.org/papers/issre2009_181.pdf (Accessed 12/05/2012) McAvinney, A. and Turner, B. (2005), “Building a neural network for misuse detection”, Proceedings of the Class of 2006 Senior Conference, pp27-33 [17] McGraw, G. (2006), “Software security: building security in”, AddisonWesley, Boston, MA [18] Meier, J. D., Mackman, A. And Wastell, B. (2005), “Threat modelling web applications”, Available at: http://msdn.microsoft.com/enus/library/ms978516.aspx (Accessed 24/10/2010) [19] Mouratidis, H. and Giorgini, P (2007), “Security attack testing (SAT)testing the security of information systems at design time”, Information Systems, Vol. 32, p1166- p1183 [20] Pan, Z, Chen, S., Hu, G. and Zhang, D. (2003), “Hybrid neural network and c4.5 for misuse detection”, In proceedings of 2003 International conference on machine learning and cybernetics, Vol.4, pp2463-2467 [21] Palshikar, G. K. (2004), “An Introduction to model checking”, Embbedd.com, Available at http://www.embedded.com/columns/technicalinsights/17603352?_reque stid=12219,(Accessed 20/02/2012) [22] Pemmaraju, K., Lord, E. and McGraw, G.(2000), “Software risk management. The importance of building quality and reliability into the full development lifecycle”, Available at: http://www.cigital.com/whitepapers/dl/wp-qandr.pdf, (Accessed 07/06/2011) [23] Ralston, P.A.S; Graham, J.H and Hieb, J. L. (2007), “Cyber security risk assessment for SCADA and DCS networks”, ISA Transaction, Vol.46(4), pp583-594 [24] Redwine, S. T. Jr and Davis, N.; et al, (2004), “Process to produce secure software: Towards more secure software”, National Cyber Security Summit, Vol. 1 [25] Srinivasa, K.D. and Sattipalli, A. R, (2009), “Hand written character recognition using back propagation network”, Journal of Theoretical and Applied Information Technology, Vol. 5(3), pp 257-269 [26] Tamura, Y.; Yamada, S. and Kimura, M. (2003), “A software Reliability assessment method based on neural networks for distributed development environment”, Electronics & Communications in Japan, Part 3: Fundamental Electronic Science, Vol. 86(11), pp13-20. [27] Telang, R. and Wattal, S.(2004), “Impact of software vulnerability announcement on market value of software vendors- an empirical investigation”, The Third Workshop, University of Minnesota, 13-14 May, Minnesota. [28] Threat Risk Modelling (2010) Available at: http://www.owasp.org/index.php/Threat_Risk_Modeling, (Accessed 24/10/201) [29] Mockel C and Abdallah, A.E (2011) ‘Threat Modelling Approaches and Tools for Securing Architectural Designs of E-Banking Application’, Journal of Information Assurance and Security’, Vol. 6(5), pp 346-356 [30] Spampinato, D. G. (2008), ‘SeaMonster: Providing Tool Support for Security Modelling’, NISK Conference, Available at: http://www.shieldsproject.eu/files/docs/seamonster_nisk2008.pdf (Last Accessed: November 2011) [31] Joseph, A., Bong, D.B.L. and Mat, D.A.A (2009) ‘Application of Neural Network in User Authentication for Smart Home Systems’ World Academy of Science, Engineering and Technology, Vol. 53, pp12931300. [32] Zhang B.J.Y, and Wang, J.H.S.(2007), ‘Computer Viruses Detection Based on Ensemble Neural Network’, Computer Engineering and Applications, Vol. 43(13), pp 26-29. AUTHORS PROFILE Adetunji Adebiyi Doctoral student with the University of East London UK. His research focuses on integrating security into software design during SDLC. His research has led him to give talks and presentations in conferences and seminars he has attended. Johnnes Arreymbi is a Senior Lecturer at the School of Computing, Information Technology and Engineering, University of East London. He has also taught Computing at London South Bank University, and University of Greenwich, London. He leads as Executive Director and co-founder of eGLobalSOFT, USA; an innovative Patented Software (ProTrack™) Company. Chris Imafidon is a Senior Lecturer at the School of Computing, Information Technology and Engineering, University of East London. Chris is a multi-award winning researcher and scientific pioneer. He is a member of the 6|P age www.ijacsa.thesai.org (IJARAI) International Journal of Advanced Research in Artificial Intelligence, Vol. 1, No. 4, 2012 Information Age Executive Round-table forum. He is a consultant to the government and industry leaders worldwide. 7|P age www.ijacsa.thesai.org
9cs.NE
Under review as a conference paper at ICLR 2016 M ULTILINGUAL I MAGE D ESCRIPTION WITH N EURAL S EQUENCE M ODELS arXiv:1510.04709v2 [cs.CL] 18 Nov 2015 Desmond Elliott∗ ILLC, University of Amsterdam; Centrum Wiskunde & Informatica [email protected] Stella Frank∗ ILLC, University of Amsterdam [email protected] Eva Hasler Department of Engineering, University of Cambridge [email protected] A BSTRACT We introduce multilingual image description, the task of generating descriptions of images given data in multiple languages. This can be viewed as visuallygrounded machine translation, allowing the image to play a role in disambiguating language. We present models for this task that are inspired by neural models for image description and machine translation. Our multilingual image description models generate target-language sentences using features transferred from separate models: multimodal features from a monolingual source-language image description model and visual features from an object recognition model. In experiments on a dataset of images paired with English and German sentences, using BLEU and Meteor as a metric, our models substantially improve upon existing monolingual image description models. 1 I NTRODUCTION Automatic image description — the task of generating natural language sentences for an image — has thus far been exclusively performed in English, due to the availability of English datasets. However, the applications of automatic image description, such as text-based image search or providing image alt-texts on the Web for the visually impaired, are also relevant for other languages. Current image description models are not inherently English-language specific, so a simple approach to generating descriptions in another language would be to collect new annotations and then train a model for that language. Nonetheless, the wealth of image description resources for English suggest a cross-language resource transfer approach, which is what we explore here. In other words: How can we best use resources for Language A when generating descriptions for Language B? We introduce multilingual image description and present a multilingual multimodal image description model for this task. Multilingual image description is a form of visually-grounded machine translation, in which parallel sentences are grounded against features from an image. This grounding can be particularly useful when the source sentence contains ambiguities that need to be resolved in the target sentence. For example, in the German sentence “Ein Rad steht neben dem Haus”, “Rad” could refer to either “bicycle” or “wheel”, but with visual context the intended meaning can be more easily translated into English. In other cases, source language features can be more precise than noisy image features, e.g. in identifying the difference between a river and a harbour. Our multilingual image description model adds source language features to a monolingual neural image description model (Karpathy & Fei-Fei, 2015; Vinyals et al., 2015, inter-alia). Figure 1 de∗ Authors contributed equally to this paper. 1 Under review as a conference paper at ICLR 2016 Schulkinder sitzen in einem Klassenzimmer CNN RNN + RNN children sitting in a classroom Figure 1: An illustration of the multilingual multimodal language model. Descriptions are generated by combining features from source- and target-language multimodal language models. The dashed lines denote variants of the model: removing the CNN features from a source model would create language-only conditioning vectors; whereas removing the CNN input in the decoder assumes the source feature vectors know enough about the image to generate a good description. picts the overall approach, illustrating the way we transfer feature representations between models. Image description models generally use a fixed representation of the visual input taken from a object detection model (e.g., a CNN). In this work we add fixed features extracted from a source language model (which may itself be a multimodal image description model) to our image description model. This is distinct from neural machine translation models which train source language feature representations specifically for target decoding in a joint model (Cho et al., 2014; Sutskever et al., 2014). Our composite model pipeline is more flexible than a joint model, allowing the reuse of models for other tasks (e.g., monolingual image description, object recognition) and not requiring retraining for each different language pair. We show that the representations extracted from source language models, despite not being trained to translate between languages, are nevertheless highly successful in transferring additional informative features to the target language image description model. In a series of experiments on the IAPR-TC12 dataset of images described in English and German, we find that models that incorporate source language features substantially outperform target monolingual image description models. The best English-language model improves upon the state-of-theart by 2.3 BLEU 4 points for this dataset. In the first results reported on German image description, our model achieves a 8.8 Meteor point improvement compared to a monolingual image description baseline. The implication is that linguistic and visual features offer orthogonal improvements in multimodal modelling (a point also made by Silberer & Lapata (2014) and Kiela & Bottou (2014)). The models that include visual features also improve over our translation baselines, although to a lesser extent; we attribute this to the dataset being exact translations rather than independently elicited descriptions, leading to high performance for the translation baseline. Our analyses show that the additional features improve mainly lower-quality sentences, indicating that our best models successfully combine multiple noisy input modalities. 2 MODELS Our multilingual image description models are neural sequence generation models, with additional inputs from either visual or linguistic modalities, or both. We present a family of models in sequence of increasing complexity to make their compositional character clear, beginning with a neural sequence model over words and concluding with the full model using both image and source features. See Figure 2 for a depiction of the model architecture. 2.1 R ECURRENT L ANGUAGE M ODEL (LM) The core of our model is a Recurrent Neural Network model over word sequences, i.e., a neural language model (LM) (Mikolov et al., 2010). The model is trained to predict the next word in the sequence, given the current sequence seen so far. At each timestep i for input sequence w0...n , the input word wi , represented as a one-hot vector over the vocabulary, is embedded into a highdimensional continuous vector using the learned embedding matrix Weh (Eqn 1). A nonlinear function f is applied to the embedding combined with the previous hidden state to generate the hidden state hi (Eqn 2). At the output layer, the next word oi is predicted via the softmax function over the 2 Under review as a conference paper at ICLR 2016 sn o1 o2 EOS Output Layer Source Encoding Wsh Who ... Whh Image Features Wvh Weh Word Vectors CNN BOS w1 wn Figure 2: Our multilingual multimodal model predicts the next word in the description on given the current word xi and the hidden state hi . Source language and image features can be additional input to the model (signified by dashed arrows). The source features, shown rolled-up to save space, are transferred from a multimodal language model or a language model; see Section 2 for more details. vocabulary (Eqn 3). ei = Weh wi hi = f (Whh hi−1 + Whe ei ) oi = softmax(Who hi ) (1) (2) (3) In simple RNNs, f in Eqn 2 can be the tanh or sigmoid function. Here, we use an LSTM1 to avoid problems with longer sequences (Hochreiter & Schmidhuber, 1997). Sentences are buffered at timestep 0 with a special beginning-of-sentence marker and with an end-of-sequence marker at timestep n. The initial hidden state values h−1 are learned, together with the weight matrices W . 2.2 M ULTIMODAL L ANGUAGE M ODEL ( MLM ) The Recurrent Language Model (LM) generates sequences of words conditioned only on the previously seen words (and the hidden layer), and thus cannot use visual input for image description. In the multimodal language model (MLM), however, sequence generation is additionally conditioned on image features, resulting in a model that generates word sequences corresponding to the image. The image features v (for visual) are input to the model at h0 at the first timestep2 : h0 = f (Whh h−1 + Whe e0 + Wvh v) 2.3 (4) T RANSLATION M ODEL ( SOURCE - LM → TARGET- LM ) Our translation model is analogous to the multimodal language model above: instead of adding image features to our target language model, we add features from a source language model. This feature vector s is the final hidden state extracted from a sequence model over the source language, the SOURCE - LM. The initial state for the TARGET- LM is thus defined as: h0 = f (Whh h−1 + Whe e0 + Whs s) (5) We follow recent work on sequence-to-sequence architectures for neural machine translation (Cho et al., 2014; Sutskever et al., 2014) in calling the source language model the ‘encoder’ and the target language model the ‘decoder’. However, it is important to note that the source encoder is 1 The LSTM produced better validation performance than a Gated Recurrent Unit (Cho et al., 2014). Adding the image features at every timestep reportedly results in overfitting (Karpathy & Fei-Fei, 2015; Vinyals et al., 2015), with exception of the m-RNN (Mao et al., 2015). 2 3 Under review as a conference paper at ICLR 2016 a yellow building with white columns in the background ein gelbes Gebäude mit weißen Säulen im Hintergrund Figure 3: Image 00/25 from the IAPR-TC12 dataset with its English and German description. a viable model in its own right, rather than only learning features for the target decoder. We suspect this is what allows our translation model to learn on a very small dataset: instead of learning based on long distance gradients pushed from target to source (as in the sequence-to-sequence architecture), the source model weights are updated based on very local LM gradients. Despite not being optimised for translation, the source features turn out to be very effective for initialising the target language model, indicating that useful semantic information is captured in the final hidden state. 2.4 M ULTILINGUAL M ULTIMODAL M ODEL ( SOURCE - MLM → TARGET- MLM ) Finally, we can use both the image and the source language features in a combined multimodal translation model. If the image features are input on both the source and the target side, this results in a doubly multimodal multilingual model (SOURCE - MLM → TARGET- MLM). There are two alternative formulations: image features are input only to the source (SOURCE - MLM → TARGET- LM) or only the target model (SOURCE - LM → TARGET- MLM). The initial state of the TARGET- MLM, regardless of source model type, is: h0 = f (Whh h−1 + Whe e0 + Whs s + Whv v) 2.5 (6) G ENERATING S ENTENCES We use the same description generation process for each model. First, a model is initialised with the special beginning-of-sentence token and any image or source features. At each timestep, the generated output is the maximum probability word at the softmax layer, oi , which is subsequently used as the input token at timestep i+1. This process continues until the model generates the endof-sentence token, or a pre-defined number of timesteps (30, in our experiments, which is slightly more than the average sentence length in the training data). 3 M ETHODOLOGY 3.1 DATA We use the IAPR-TC12 dataset, originally introduced in the ImageCLEF shared task for object segmentation and later expanded with complete image descriptions (Grubinger et al., 2006). This dataset contains 20,000 images with multiple descriptions in both English and German. Each sentence corresponds to a different aspect of the image, with the most salient objects likely being described in the first description (annotators were asked to describe parts of the image that hadn’t been covered in previous descriptions). We use only the first description of each image. Note that the English descriptions are the originals; the German data was professionally translated from English. Figure 3 shows an example image-bitext tuple from the dataset. We perform experiments using the standard splits of 17,665 images for training, from which we reserve 10% for hyperparameter estimation, and 1,962 for evaluation. The descriptions are lowercased and tokenised using the ptbtokenizer.py script from the MS COCO evaluation tools3 . We discarded words in the training data observed fewer than 3 times. This 3 https://github.com/tylin/coco-caption 4 Under review as a conference paper at ICLR 2016 leaves a total of 272,172 training tokens for English over a vocabulary of 1,763 types; and 223,137 tokens for German over 2,374 types. Compared to the Flickr8K, Flickr30K, or MS COCO datasets, the English descriptions in the IAPR-TC12 dataset are long, with an average length of 23 words.4 We extract the image features from the pre-trained VGG-16 CNN object recognition model (Simonyan & Zisserman, 2015). Specifically, our image features are extracted as fixed representations from the penultimate layer of the CNN, in line with recent work in this area. 3.2 BASELINES MLM: the first baseline is a monolingual image description model, i.e. a multimodal language model for the target language with no source language features, but with image features. SOURCE - LM → TARGET- LM: the second baseline is our translation model trained on only source and target descriptions without visual features. The final hidden state of the SOURCE - LM, after it has generated the source sentence, is input to the TARGET- LM. 3.3 M ULTILINGUAL M ULTIMODAL M ODEL VARIANTS SOURCE - MLM → TARGET- MLM: In this model, both of LMs in the translation baseline are replaced with multimodal language models. The source features input to the target model are thus multimodal, i.e. they are word and image features captured over the source-language sentence. The target decoder is also conditioned on the image features directly. Note that the source and target Wvh matrices are parameterised separately. SOURCE - LM → TARGET- MLM: The source language features are generated by a LM; visual features are input only in the target model. SOURCE - MLM → TARGET- LM: Visual input is given only to the SOURCE - MLM and the TARGET- LM uses a single input vector from the SOURCE - MLM. This source encoder combines both linguistic and visual cues, to the extent that the visual features are represented in the SOURCE - MLM feature vector. 3.4 H YPERPARAMETERS We use an LSTM (Hochreiter & Schmidhuber, 1997) as f in the recurrent language model. The hidden layer size |h| is set to 256 dimensions. The word embeddings are 256-dimensional and learned along with other model parameters. We also experimented with larger hidden layers (as well as with deeper architectures), and while that did result in improvements, they also took longer to train. The image features v are the 4096-dimension penultimate layer of the VGG-16 object recognition network (Simonyan & Zisserman, 2015) applied to the image. 3.5 T RAINING AND OPTIMISATION The models are trained with mini-batches of 100 examples towards the objective function (crossentropy of the predicted words) using the ADAM optimiser (Kingma & Ba, 2014). We do early stopping for model selection based on BLEU 4: if validation BLEU 4 has not increased for 10 epochs, and validation language model perplexity has stopped decreasing, training is halted. We apply dropout over the image features, source features, and word representations with p = 0.5 to discourage overfitting (Srivastava et al., 2014). The objective function includes an L2 regularisation term with λ=1e−8 . All results reported are averages over three runs with different Glorot-style uniform weight initialisations (Glorot & Bengio, 2010). We report image description quality using BLEU 4 (Papineni et al., 2002), Meteor (Denkowski & Lavie, 2014), and language-model perplexity. Meteor has been shown to correlate better with human judgements than BLEU 4 for image description (Elliott & Keller, 2014). The BLEU 4 and Meteor scores are calculated using MultEval (Clark et al., 2011). 4 This difference in length resulted in difficulties in initial experiments with pre- or co-training using other datasets. We plan on pursuing this further in future work, since the independence of the source encoder in our model makes this kind of transfer learning very natural. 5 Under review as a conference paper at ICLR 2016 BLEU 4 Meteor PPLX En MLM De LM → En LM Mao et al. (2015) 14.2 ± 0.3 21.3 ± 0.5 20.8 15.4 ± 0.2 19.6 ± 0.2 — 6.7 ± 0.0 6.0 ± 0.1 6.92 De MLM → En MLM De LM → En MLM De MLM → En LM 18.0 ± 0.3 17.3 ± 0.5 23.1 ± 0.1 18.0 ± 0.2 17.6 ± 0.5 20.9 ± 0.0 6.3 ± 0.1 6.3 ± 0.0 5.7 ± 0.1 Table 1: English image description performance BLEU 4 Meteor PPLX De MLM En LM → De LM 9.5 ± 0.2 17.8 ± 0.7 20.4 ± 0.2 29.9 ± 0.5 10.35 ± 0.1 8.95 ± 0.4 En MLM → De MLM En LM → De MLM En MLM → De LM 11.4 ± 0.7 12.1 ± 0.5 17.0 ± 0.3 23.2 ± 0.9 24.0 ± 0.3 29.2 ± 0.2 9.69 ± 0.1 10.2 ± 0.7 8.84 ± 0.3 Table 2: German image description performance 4 R ESULTS The results for image description in both German and English are presented in Tables 1 and 2; generation examples can be seen in Figures 6, 7, 8 in Appendix B5 . To our knowledge, these are the first published results for German image description. Overall, we found that English image description is easier than German description, as measured by BLEU 4 and Meteor scores. This may be caused by the more complex German morphology, which results in a larger vocabulary and hence more model parameters. The English monolingual image description model (En-MLM) is comparable with state-of-the-art models, which typically report results on the Flickr8K / Flickr30K dataset. En-MLM achieves a BLEU 4 score of 15.8 on the Flickr8K dataset, nearly matching the score from Karpathy & Fei-Fei (2015) (16.0), which uses an ensemble of models and beam search decoding. On the IAPR-TC12 dataset, the En-MLM baseline outperforms Kiros et al. (2014)6 . Mao et al. (2015) report higher performance, but evaluate on all reference descriptions, making the figures incomparable. All multilingual models beat the monolingual image description baseline, by up to 8.9 BLEU 4 and 8.8 Meteor points for the best models. Clearly the features transferred from the source models are useful for the TARGET- LM or TARGET- MLM description generator, despite the switch in languages. The translation baseline without visual features performs very well7 . This indicates the effectiveness of our translation model, even without joint training, but is also an artifact of the dataset. A different dataset with independently elicited descriptions (rather than translations of English descriptions) may result in worse performance for a translation system that is not visually grounded, because the target descriptions would only be comparable to the source descriptions. Overall, the multilingual models that encode the source using an MLM outperform the SOURCE - LM models. On the target side, simple LM decoders perform better than MLM decoders. This can be explained to some extent by the smaller number of parameters in models that do not input the visual features twice. Incorporating the image features on the source side seems to be more effective, possibly because the source is constrained to the gold description at test time, leading to a more 5 Visit https://staff.fnwi.uva.nl/d.elliott/GroundedTranslation/ to see 1,766 examples generated by each model for the validation data. 6 Kiros et al. (2014) report BLEU 1-2-3, their best model is reported at 9.8 BLEU 3. 7 The BLEU 4 and Meteor scores in Table 2 for En LM → De LM and En MLM → De LM are not significantly different according to the MultEval approximate randomization significance test. 6 Under review as a conference paper at ICLR 2016 (a) En MLM (b) De MLM → En MLM Figure 4: t-SNE embeddings illustrate the positive effect of conditioning image description models on multiple language data. In the De MLM → En MLM model, the image of people climbing up a snowy cliff are closer to other images depicting people in snow fields. coherent match between visual and linguistic features. Conversely, the TARGET- MLM variants tend to be worse sentence generators than the LM models, indicating that while visual features lead to useful hidden state values, there is room for improving their role during generation. 5 DISCUSSION What do source features add beyond image features? Source features are most useful when the baseline MLM does not successfully separate related images. The image description models have to compress the image feature vector into the same number of dimensions as the hidden layer in the recurrent network, effectively distilling the image down to the features that correspond to the words in the description. If this step of the model is prone to mistakes, the resulting descriptions will be of poor quality. However, our best multilingual models are initialised with features transferred from image description models in a different language. In these cases, the source language features have already compressed the image features for the source language image description task. Qualitatively, we can illustrate this effect using Barnes-Hut t-SNE projections of the initial hidden representations of our models (van der Maaten, 2014). Figure 4 shows the t-SNE projection of the example from Figure 7 using the initial hidden state of an En MLM (left) and the target side of the De MLM → En MLM (right). In the monolingual example, the nearest neighbours of the target image are desert scenes with groups of people. Adding the transferred source features results in a representation that places importance on the background, due to the fact that it is consistently mentioned in the descriptions. Now the nearest neighbours are images of mountainous snow regions with groups of people. Which descriptions are improved by source or image features? Figure 5 shows the distribution of sentence-level Meteor scores of the baseline models (monolingual MLM and monomodal LM → LM) and the average per-sentence change when moving to our best performing multilingual multimodal model (SOURCE - MLM→ TARGET- LM). The additional source language features (compared to MLM) or additional modality (compared to LM→ LM) result in similar patterns: low quality descriptions are improved, while the (far less common) high quality descriptions deteriorate. Adding image features seems to be riskier than adding source language features, which is unsurprising given the larger distance between visual and linguistic space, versus moving from one language to another. This is also consistent with the lower performance of MLM baseline models compared to LM→LM models. 7 Under review as a conference paper at ICLR 2016 1000 1000 944 900 900 800 800 700 700 No. sentences No. sentences 829 600 500 414 400 300 278 600 500 458 400 300 200 202 200 139 100 0 71 0 0.1 0.2 0.3 0.4 100 25 17 8 3 0.5 0.6 0.7 0.8 1 0.9 60 0 1 0 28 25 10 11 4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 5 10 5 0 −5 0 ∆ Meteor ∆ Meteor 5 −5 −10 −15 −10 −20 −15 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 −25 1 (a) En MLM compared to De MLM → En LM 0 (b) De LM → En LM compared to De MLM → En LM Figure 5: The effect of adding multimodal source features to (a) a monolingual English image description model and (b) a German-English translation model (validation data, averaged over 3 runs). The top plots show the baseline sentence-level Meteor score distributions, while the bottom plots show the difference in score as compared to multilingual multimodal De MLM → En LM. For most sentences, a low baseline score is improved by adding multimodal source features. An analysis of the LM→MLM model (not shown here) shows similar behaviour to the MLM→LM model above. However, for this model the decreasing performance starts earlier: the LM→MLM model improves over the LM→LM baseline only in the lowest score bin. Adding the image features at the source side, rather than the target side, seems to filter out some of the noise and complexity of the image features, while the essential source language features are retained. Conversely, merging the source language features with image features on the target side, in the TARGET- MLM models, leads to a less helpful entangling of linguistic and noisier image input, maybe because too many sources of information are combined at the same time (see Eqn 6). 6 RELATED WORK The past few years have seen numerous results showing how relatively standard neural network model architectures can be applied to a variety of tasks. The flexibility of the application of these architectures can be seen as a strong point, indicating that the representations learned in these general models are sufficiently powerful to lead to good performance. Another advantage, which we have exploited in the work presented here, is that it becomes relatively straightforward to make connections between models for different tasks, in this case image description and machine translation. Automatic image description has received a great deal of attention in recent years (see Bernardi et al. (2016) for a more detailed overview of the task, datasets, models, and evaluation issues). Deep neural networks for image description typically estimate a joint image-sentence representation in a multimodal recurrent neural network (RNN) (Kiros et al., 2014; Donahue et al., 2014; Vinyals et al., 2015; Karpathy & Fei-Fei, 2015; Mao et al., 2015). The main difference between these models and discrete tuple-based representations for image description (Farhadi et al., 2010; Yang et al., 2011; Li et al., 2011; Mitchell et al., 2012; Elliott & Keller, 2013; Yatskar et al., 2014; Elliott & de Vries, 2015) is that it is not necessary to explicitly define the joint representation; the structure of the neural network can be used to estimate the optimal joint representation for the description task. As in our MLM, the image–sentence representation in the multimodal RNN is initialised with image features from the final fully-connected layer of a convolutional neural network trained for multi-class object recognition (Krizhevsky et al., 2012). Alternative formulations input the image features into the model at each timestep (Mao et al., 2015), or first detect words in an image and generate sentences using a maximum-entropy language model (Fang et al., 2015). 8 Under review as a conference paper at ICLR 2016 In the domain of machine translation, a greater variety of neural models have been used for subtasks within the MT pipeline, such as neural network language models (Schwenk, 2012) and joint translation and language models for re-ranking in phrase-based translation models (Le et al., 2012; Auli et al., 2013) or directly during decoding (Devlin et al., 2014). More recently, end-to-end neural MT systems using Long Short-Term Memory Networks and Gated Recurrent Units have been proposed as Encoder-Decoder models for translation (Sutskever et al., 2014; Bahdanau et al., 2015), and have proven to be highly effective (Bojar et al., 2015; Jean et al., 2015). In the multimodal modelling literature, there are related approaches using visual and textual information to build representations for word similarity and categorization tasks (Silberer & Lapata, 2014; Kiela & Bottou, 2014; Kiela et al., 2015). Silberer & Lapata combine textual and visual modalities by jointly training stacked autoencoders, while Kiela & Bottou construct multi-modal representations by concatenating distributed linguistic and visual feature vectors. More recently, Kiela et al. (2015) induced a bilingual lexicon by grounding the lexical entries in CNN features. In all cases, the results show that the bimodal representations are superior to their unimodal counterparts. 7 CONCLUSIONS We introduced multilingual image description, the task of generating descriptions of an image given a corpus of descriptions in multiple languages. This new task not only expands the range of output languages for image description, but also raises new questions about how to integrate features from multiple languages, as well as multiple modalities, into an effective generation model. Our multilingual multimodal model is loosely inspired by the encoder-decoder approach to neural machine translation. Our encoder captures a multimodal representation of the image and the sourcelanguage words, which is used as an additional conditioning vector for the decoder, which produces descriptions in the target language. Each conditioning vector is originally trained towards its own objective: the CNN image features are transferred from an object recognition model, and the source features are transferred from a source-language image description model. Our model substantially improves the quality of the descriptions in both directions compared to monolingual baselines. The dataset used in this paper consists of translated descriptions, leading to high performance for the translation baseline. However, we believe that multilingual image description should be based on independently elicited descriptions in multiple languages, rather than literal translations. Linguistic and cultural differences may lead to very different descriptions being appropriate for different languages (For example, a polder is highly salient to a Dutch speaker, but not to an English speaker; an image of a polder would likely lead to different descriptions, beyond simply lexical choice.) In such cases image features will be essential. A further open question is whether the benefits of multiple monolingual references extend to multiple multilingual references. Image description datasets typically include multiple reference sentences, which are essential for capturing linguistic diversity within a single language (Rashtchian et al., 2010; Elliott & Keller, 2013; Hodosh et al., 2013; Chen et al., 2015). In our experiments, we found that useful image description diversity can also be found in other languages instead of in multiple monolingual references. In the future, we would like to explore attention-based recurrent neural networks, which have been used for machine translation (Bahdanau et al., 2015; Jean et al., 2015) and image description (Xu et al., 2015). We also plan to apply these models to other language pairs, such as the recently released PASCAL 1K Japanese Translations dataset (Funaki & Nakayama, 2015). Lastly, we aim to apply these types of models to a multilingual video description dataset (Chen & Dolan, 2011). ACKNOWLEDGMENTS D. Elliott was supported by an Alain Bensoussain Career Development Fellowship. S. Frank is supported by funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement Nr. 645452. We thank Philip Schulz, Khalil Sima’an, Arjen P. de Vries, Lynda Hardman, Richard Glassey, Wilker Aziz, Joost Bastings, and Ákos Kádár for discussions and feedback on the work. We built the 9 Under review as a conference paper at ICLR 2016 models using the Keras library, which is built on-top of Theano. We are grateful to the Database Architectures Group at CWI for access to their K20x GPUs. R EFERENCES Auli, Michael, Galley, Michel, Quirk, Chris, and Zweig, Geoffrey. Joint language and translation modeling with recurrent neural networks. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1044–1054. Association for Computational Linguistics, 2013. Bahdanau, Dzmitry, Cho, Kyunghyun, and Bengio, Yoshua. Neural machine translation by jointly learning to align and translate. In Proceedings of ICLR, 2015. Bernardi, Raffaella, Cakici, Ruken, Elliott, Desmond, Erdem, Aykut, Erdem, Erkut, Ikizler-Cinbis, Nazli, Keller, Frank, Muscat, Adrian, and Plank, Barbara. Automatic description generation from images: A survey of models, datasets, and evaluation measures. To appear in JAIR, 2016. Bojar, Ondřej, Chatterjee, Rajen, Federmann, Christian, Haddow, Barry, Huck, Matthias, Hokamp, Chris, Koehn, Philipp, Logacheva, Varvara, Monz, Christof, Negri, Matteo, Post, Matt, Scarton, Carolina, Specia, Lucia, and Turchi, Marco. Findings of the 2015 workshop on statistical machine translation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 1–46, Lisbon, Portugal, September 2015. Association for Computational Linguistics. Chen, David L. and Dolan, William B. Building a persistent workforce on Mechanical Turk for multilingual data collection. In Proceedings of The 3rd Human Computation Workshop (HCOMP 2011), August 2011. Chen, Xinlei, Fang, Hao, Lin, Tsung-Yi, Vedantam, Ramakrishna, Gupta, Saurabh, Dollár, Piotr, and Zitnick, C. Lawrence. Microsoft COCO captions: Data collection and evaluation server. CoRR, abs/1504.00325, 2015. Cho, Kyunghyun, van Merrienboer, Bart, Gulcehre, Caglar, Bahdanau, Dzmitry, Bougares, Fethi, Schwenk, Holger, and Bengio, Yoshua. Learning phrase representations using RNN encoder– decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734. Association for Computational Linguistics, 2014. Clark, Jonathan H., Dyer, Chris, Lavie, Alon, and Smith, Noah A. Better hypothesis testing for statistical machine translation: Controlling for optimizer instability. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies: Short Papers - Volume 2, pp. 176–181, 2011. Denkowski, M. and Lavie, A. Meteor Universal: Language Specific Translation Evaluation for Any Target Language. In EACL Workshop on Statistical Machine Translation, 2014. Devlin, Jacob, Zbib, Rabih, Huang, Zhongqiang, Lamar, Thomas, Schwartz, Richard, and Makhoul, John. Fast and robust neural network joint models for statistical machine translation. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1370–1380. Association for Computational Linguistics, 2014. Donahue, J., Hendricks, L. A., Guadarrama, S., Rohrbach, M., Venugopalan, S., Saenko, K., and Darrell, T. Long-term recurrent convolutional networks for visual recognition and description. CoRR, abs/1411.4389, 2014. Elliott, Desmond and de Vries, Arjen P. Describing images using inferred visual dependency representations. In ACL, pp. 42–52, 2015. Elliott, Desmond and Keller, Frank. Image Description using Visual Dependency Representations. In EMNLP, pp. 1292–1302, 2013. Elliott, Desmond and Keller, Frank. Comparing Automatic Evaluation Measures for Image Description. In ACL, pp. 452–457, 2014. 10 Under review as a conference paper at ICLR 2016 Fang, Hao, Gupta, Saurabh, Iandola, Forrest, Srivastava, Rupesh K., Deng, Li, Dollar, Piotr, Gao, Jianfeng, He, Xiaodong, Mitchell, Margaret, Platt, John C., Lawrence Zitnick, C., and Zweig, Geoffrey. From captions to visual concepts and back. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. Farhadi, Ali, Hejrati, M, Sadeghi, Mohammad Amin, Young, P, Rashtchian, C, Hockenmaier, J, and Forsyth, David. Every picture tells a story: Generating sentences from images. In ECCV, 2010. Funaki, Ruka and Nakayama, Hideki. Image-mediated learning for zero-shot cross-lingual document retrieval. In Empirical Methods in Natural Language Processing 2015, pp. 585–590, 2015. Glorot, Xavier and Bengio, Yoshua. Understanding the difficulty of training deep feedforward neural networks. In International Conference on Artificial Intelligence and Statistics, pp. 249–256, 2010. Grubinger, M., Clough, P. D., Muller, H., and Thomas, D. The IAPR TC-12 benchmark: A new evaluation resource for visual information systems. In LREC, 2006. Hochreiter, Sepp and Schmidhuber, Jürgen. Long short-term memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. Hodosh, Micah, Young, P, and Hockenmaier, J. Framing Image Description as a Ranking Task: Data, Models and Evaluation Metrics. Journal of Artificial Intelligence Research, 47:853–899, 2013. Jean, Sébastien, Firat, Orhan, Cho, Kyunghyun, Memisevic, Roland, and Bengio, Yoshua. Montreal neural machine translation systems for wmt’15. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 134–140, Lisbon, Portugal, September 2015. Association for Computational Linguistics. Karpathy, Andrej and Fei-Fei, Li. Deep visual-semantic alignments for generating image descriptions. arXiv, 2015. Kiela, Douwe and Bottou, Léon. Learning Image Embeddings using Convolutional Neural Networks for Improved Multi-Modal Semantics. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP-14), 2014. Kiela, Douwe, Vulić, Ivan, and Clark, Stephen. Visual bilingual lexicon induction with transferred convnet features. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 148–158, 2015. Kingma, Diederik P. and Ba, Jimmy. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. Kiros, Ryan, Salakhutdinov, Ruslan, and Zemel, Rich. Multimodal neural language models. In ICML, pp. 595–603, 2014. Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. Imagenet classification with deep convolutional neural networks. In Pereira, F., Burges, C.J.C., Bottou, L., and Weinberger, K.Q. (eds.), Advances in Neural Information Processing Systems 25, pp. 1097–1105. Curran Associates, Inc., 2012. Le, Hai-Son, Allauzen, Alexandre, and Yvon, Francois. Continuous space translation models with neural networks. In Proceedings of NAACL HLT, pages 39–48, 2012. Li, S, Kulkarni, G, Berg, T L, Berg, A C, and Choi, Y Young. Composing simple image descriptions using web-scale n-grams. In CoNLL, 2011. Mao, Junhua, Xu, Wei, Yang, Yi, Wang, Jiang, Huang, Zhiheng, and Yuille, Alan. Deep captioning with multimodal recurrent neural networks (m-RNN). ICLR, 2015. Mikolov, Tomas, Karafiát, Martin, Burget, Lukas, Cernocký, Jan, and Khudanpur, Sanjeev. Recurrent neural network based language model. In Proceedings of INTERSPEECH, 2010. 11 Under review as a conference paper at ICLR 2016 Mitchell, Margaret, Han, Xufeng, Dodge, Jesse, Mensch, Alyssa, Goyal, Amit, Berg, A C, Yamaguchi, Kota, Berg, T L, Stratos, Karl, Daume, III, Hal, and III. Midge: generating image descriptions from computer vision detections. In EACL, 2012. Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. BLEU: A method for automatic evaluation of machine translation. In ACL, 2002. Rashtchian, C., Young, P., Hodosh, M., and Hockenmaier, J. Collecting image annotations using Amazon’s Mechanical Turk. In NAACLHLT Workshop on Creating Speech and Language Data with Amazon’s Mechanical Turk, 2010. Schwenk, Holger. Continuous space translation models for phrase-based statistical machine translation. In In Proceedings of COLING (Posters), pages 1071–1080, 2012. Silberer, Carina and Lapata, Mirella. Learning grounded meaning representations with autoencoders. In Proceedings of ACL, 2014. Simonyan, Karen and Zisserman, Andrew. Very deep convolutional networks for large-scale image recognition. In ICLR ’15, 2015. Srivastava, Nitish, Hinton, Geoffrey, Krizhevsky, Alex, Sutskever, Ilya, and Salakhutdinov, Ruslan. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. Sutskever, Ilya, Vinyals, Oriol, and Le, Quoc V. V. Sequence to sequence learning with neural networks. In Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N.D., and Weinberger, K.Q. (eds.), Advances in Neural Information Processing Systems 27, pp. 3104–3112. Curran Associates, Inc., 2014. van der Maaten, L.J.P. Accelerating t-sne using tree-based algorithms. Journal of Machine Learning Research, pp. 3221–3245, 2014. Vinyals, Oriol, Toshev, Alexander, Bengio, Samy, and Erhan, Dumitru. Show and tell: A neural image caption generator. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. Xu, Kelvin, Ba, Jimmy, Kiros, Ryan, Cho, Kyunghyun, Courville, Aaron C., Salakhutdinov, Ruslan, Zemel, Richard S., and Bengio, Yoshua. Show, attend and tell: Neural image caption generation with visual attention. CoRR, abs/1502.03044, 2015. Yang, Y, Teo, C L, Daume, III, Hal, and Aloimonos, Y. Corpus-guided sentence generation of natural images. In EMNLP, 2011. Yatskar, M, Vanderwende, L, and Zettlemoyer, L. See no evil, say no evil: Description generation from densely labeled images. SEM, 2014. 12 Under review as a conference paper at ICLR 2016 A VALIDATION RESULTS English |h| = 256 BLEU4 En MLM De MLM→ En MLM De MLM→ En LM De LM→ En MLM 15.99 ± 0.38 20.63 ± 0.07 27.55 ± 0.41 19.44 ± 0.65 De LM→ En LM 23.78 ± 0.71 German |h| = 256 De MLM En MLM→ De MLM En MLM→ De LM En LM→ De MLM 11.87 ± 0.37 16.03 ± 0.35 21.88 ± 0.13 15.42 ± 0.26 En LM→ De LM 21.22 ± 0.74 Table 3: Image description performance in the validation data set. It always helps to condition on features from a different language, in both English → German and German → English. See Sections 3.2 and 3.3 for detailed explanations of the model variants. We report the mean and standard deviation calculated over three runs with random weight initialisation. 13 Under review as a conference paper at ICLR 2016 B E XAMPLE D ESCRIPTIONS We present examples of the descriptions generated by the models studied in this paper. In Figure 6, the monolingual MLM generates the best descriptions. However, in Figures 7 and 8, the best descriptions are generated by transferring source MLM features into a target MLM or a target LM. English German Ref: three adults and a child are sitting at a brown sandy beach with a few grey stones in the foreground Ref: drei erwachsene und ein kind sitzen an einem braunen sandstrand mit einigen grauen steinen im vordergrund MLM: tourists are sitting at a sandy beach with the sea in the background MLM: touristen posieren auf einem aussichtsplatz mit einem see und einem see im hintergrund MLM→MLM: a group of people is standing and sitting on a brown sandy beach with the sea in the background MLM→MLM: drei männer und zwei frauen sitzen auf einem braunen sandstrand mit dem meer im hintergrund MLM→LM: two women are standing and sitting on a brown slope with green grass in the foreground MLM→LM: zwei männer und zwei frauen stehen auf einem hellbraunen sandstrand mit einem braunen ufer im vordergrund LM→LM: two men and two women are standing on a brown hill with a few trees in the foreground LM→LM: sieben personen stehen und sitzen an einem braunen ufer eines sees im vordergrund Figure 6: The monolingual MLM models are sufficient to generate accurate descriptions. 14 Under review as a conference paper at ICLR 2016 English German Ref: mountaineers are climbing a very steep icy slope Ref: bergsteiger klettern auf einen sehr steilen eishang MLM: a man is standing on a grey rock in the foreground MLM: ein snowboarder springt über eine schanze an einem schneebedeckten hang MLM→MLM: tourists are climbing up a snowy slope MLM→MLM: touristen stehen vor einem steilen felsigen berg MLM→LM: tourists are riding on horses on a gravel road MLM→LM: touristen posieren in einem steilen hang eines berges LM→LM: tourists are walking on a gravel road LM→LM: touristen posieren auf einem weg vor einem steilen hang Figure 7: The best English descriptions are generated by transferring features from a German MLM model. 15 Under review as a conference paper at ICLR 2016 English German Ref: view of the houses of a city at a broad river Ref: blick auf die häuser einer stadt an einem breiten fluss MLM: a bay with a wooded shore and a bridge in the foreground MLM: blick auf eine stadt mit vielen grauen hochhäusern und dunkelgrünen bäumen MLM→MLM: view of a city with many boats and boats MLM→MLM: blick von oben auf die häuser und bäume einer stadt MLM→LM: view of a river at the edge of a city MLM→LM: blick von oben auf die häuser einer stadt an einem hafen LM→LM: view from above of the houses and streets of a city at a river LM→LM: blick von oben auf eine stadt an einem hafen Figure 8: The best English and German descriptions are generated by TARGET- LM decoders with language (SOURCE - LM) or multimodal (SOURCE - MLM) source features. 16
9cs.NE
arXiv:1406.3224v2 [math.DS] 24 Nov 2015 Relaxed ISS Small-Gain Theorems for Discrete-Time Systems Roman Geiselhart∗ Fabian R. Wirth† March 19, 2018 Abstract In this paper ISS small-gain theorems for discrete-time systems are stated, which do not require input-to-state stability (ISS) of each subsystem. This approach weakens conservatism in ISS small-gain theory, and for the class of exponentially ISS systems we are able to prove that the proposed relaxed small-gain theorems are non-conservative in a sense to be made precise. The proofs of the small-gain theorems rely on the construction of a dissipative finite-step ISS Lyapunov function which is introduced in this work. Furthermore, dissipative finite-step ISS Lyapunov functions, as relaxations of ISS Lyapunov functions, are shown to be sufficient and necessary to conclude ISS of the overall system. Keywords: input-to-state stability, Lyapunov methods, small-gain conditions, discrete-time nonlinear systems, large-scale interconnections 1 Introduction Large-scale systems form an important class of systems with various applications such as formation control, logistics, consensus dynamics, networked control systems to name a few. While stability conditions for such large-scale systems have already been studied in the 1970s and early 1980s cf. [30, 33, 36] based on linear gains and Lyapunov techniques, nonlinear approaches are more recent. An efficient tool in the analysis of large-scale nonlinear control systems is the concept of input-to-state stability (ISS) as introduced in [34], and the introduction of ISS Lyapunov functions in [34, 35]. The concept of ISS was originally formulated for continuous-time systems, but has also been established for discrete-time control systems ([22, 20]) of the form x(k + 1) = G(x(k), u(k)), as considered in this work. As ISS Lyapunov functions are assumed to decrease at each step (while neglecting the input) the search for ISS Lyapunov functions is a hard task, in general. To relax this assumption we introduce the concept of dissipative finite-step ISS Lyapunov functions, where the function is assumed to decrease after a finite time, rather than at each time step. This approach originates from [1] and was recently used in [28, 9, 8] for the stability analysis of discrete-time systems without inputs. We provide, in a first step, an equivalent characterization of input-to-state stability in terms of the existence of a dissipative finite-step ISS Lyapunov function. The sufficiency ∗ R. Geiselhart is with the Faculty of Computer Science and Mathematics, University of Passau, Innstrasse 33, 94032 Passau, Germany; Email: [email protected]. † F. Wirth is with the Faculty of Computer Science and Mathematics, University of Passau, Innstrasse 33, 94032 Passau, Germany; Email: fabian.(lastname)@uni-passau.de. 1 part follows the lines of [20, Lemma 3.5], which shows that the existence of a continuous (dissipative) ISS Lyapunov function implies ISS of the system. Necessity is shown using a converse ISS Lyapunov theorem [20, 26]. Moreover, for the case of exponential ISS systems, we show that any norm is a dissipative finite-step ISS Lyapunov function. In this paper, we follow the nomenclature of [33] and say that a large-scale system is defined through the interconnection of a number of smaller components. For such systems there exist small-gain type conditions guaranteeing the ISS property for the interconnected system. Whereas small-gain theorems have a long history, the first ISS versions in a trajectorybased formulation and in a Lyapunov-based formulation are given in [19] and [18], respectively. In both cases the results are stated for systems consisting of two subsystems. These results have been extended to large-scale interconnections in [5] and [6]. The first ISS small-gain theorems for discrete-time systems were presented in [20], which parallel the results of [19] and [18] for continuous-time systems. For interconnections consisting of more than two subsystems, small-gain theorems are presented in [17] and in [5], whereas in [17] ISS was defined in a maximum formulation and in [5] the results are given in a summation formulation. Further extensions to the formulation via maximization or summation are ISS formulations via monotone aggregation functions. In this formulation, the ISS small-gain results are shown to hold in a more general form, see [31]. In [6] the authors present an ISS small-gain theorem in a Lyapunov-based formulation that allows to construct an overall ISS Lyapunov function. This paper also discusses various examples showing that depending on the system class different formulations of the ISS property are natural. In [29] a discrete-time version in a maximum formulation is shown and ISS Lyapunov functions for the overall system are constructed. The classical idea of ISS small-gain theory is that the interconnection of ISS subsystems is ISS if the influence of the subsystems on each other is small enough. This is a sufficient criterion, but the requirement of all systems being ISS is not necessary, even for linear systems as we recall in Section 5. Hence, classical small-gain theorems come with a certain conservatism. The main purpose of this work to reduce conservatism in ISS small-gain theory. This is achieved in the sense that we will not require each subsystem to be ISS. Indeed, each subsystem may be unstable when decoupled from the other subsystems. This is a crucial difference to classical ISS small-gain results, where it is implicitly assumed that the other subsystems act as perturbations. Here the subsystems may have a stabilizing effect on each other. The requirement imposed is that Lyapunov-type functions for the subsystems have to decrease after a finite time. This relaxation also includes previous ISS small-gain theorems and applies to a larger class of interconnected systems. Furthermore, if the overall system is expISS, i.e., solutions of the unperturbed system are decaying exponentially, the ISS smallgain theorems are indeed non-conservative, i.e., they are also necessary. The proof of the ISS small-gain theorems presented give further insight in the systems behavior. For the sufficiency part a dissipative finite-step ISS Lyapunov function is constructed from the Lyapunov-type functions and the gain functions involved. On the other hand, for expISS systems suitable Lyapunov-type and gain functions are derived. This in particular implies a constructive methodology for applications. However, if the overall system is ISS but not expISS the application of the results is challenging to implement. To illustrate this methodology we consider a nonlinear discrete-time system consisting of two subsystems that are not both ISS. To the best of the authors’ knowledge previous ISS small-gain theorems do not apply in this situation. Following the proposed methodology we 2 derive a dissipative finite-step ISS Lyapunov function to show ISS of the overall system. The outline of this work is as follows. The preliminaries are given in Section 2, followed by the problem statement including the definition of a dissipative finite-step ISS Lyapunov function, in Section 3. The sufficiency of the existence of dissipative finite-step ISS Lyapunov functions to conclude ISS is stated in Section 4. In this section we also state a particular converse finite-step ISS Lyapunov theorem that shows that for any expISS system any norm is a dissipative finite-step ISS Lyapunov function. Section 5 contains the main results. First, in Section 5.1 ISS small-gain theorems are presented that do not require each system to admit an ISS Lyapunov function. In Section 5.2, we show the non-conservativeness of the relaxed ISS small-gain theorems for the class of expISS systems, by stating a converse of the presented ISS small-gain theorems. We close the paper in Section 6 with an illustrative example. 2 2.1 Preliminaries Notation and conventions By N we denote the natural numbers and we assume 0 ∈ N. Let R denote the field of real numbers, R+ the set of nonnegative real numbers and Rn the vector space of real column vectors of length n; further Rn+ := (R+ )n denotes the positive orthant. For any vector v ∈ Rn we denote by [v]i its ith component. Then Rn induces a partial order for vectors v, w ∈ Rn as follows: We define v ≥ w : ⇐⇒ [v]i ≥ [w]i and v > w : ⇐⇒ [v]i > [w]i , each for all i ∈ {1, . . . , n}. Further; v 6≥ w : ⇐⇒ there exists an index i ∈ {1, . . . , n} such that [v]i < [w]i . By | · | we denote an arbitrary fixed monotonic norm on Rn , i.e., if v, w ∈ Rn+ with w ≥ v ⊤ ⊤ then |w| ≥ |v|. For xi ∈ Rni , i ∈ {1, . . . , N } let (x1 , . . . , xN ) := (x⊤ 1 , . . . , xN ) . For a m sequence {u(k)}k∈N with u(k) ∈ R , we define kuk∞ := supk∈N {|u(k)|} ∈ R+ ∪ {∞}. If u(·) is bounded, i.e., kuk∞ < ∞, then u(·) ∈ l∞ (Rm ). We will make use of the following consequence of the equivalence of norms in Rn : For any norm | · | on Rn there exists a constant κ ≥ 1 such that for all x = (x1 , . . . , xN ) ∈ Rn with P xi ∈ Rni and n = N i=1 ni , it holds |x| ≤ κ max i∈{1,...,N } |xi |, (1) where |xi | := |(0, . . . , 0, xi , 0 . . . , 0)|. In particular, if | · | is a p-norm then κ = N 1/p is the smallest constant satisfying (1). 2.2 Comparison functions and induced monotone maps It has become standard to use comparison functions to state stability properties of nonlinear systems. Here we use functions of class K, K∞ , L, KL. For a definition see [23]. A K∞ -function α is called sub-additive, if for any s1 , s2 ∈ R+ it holds α(s1 + s2 ) ≤ α(s1 ) + α(s2 ). In the following lemma we collect some facts about K∞ -functions, which are useful not only in the particular proofs of this work. Note that the symbol ◦ denotes the composition of two functions. Lemma 2.1 (i) [10, Prop. 3] The pair (K∞ , ◦) is a non-commutative group. In particular, for α, α1 , α2 ∈ K∞ the inverse α−1 ∈ K∞ exists, and α1 ◦ α2 ∈ K∞ . 3 (ii) For α1 , α2 , α3 ∈ K∞ we have α1 (max{α2 , α3 }) = max{α1 ◦ α2 , α1 ◦ α3 }. For any two functions α1 , α2 : R+ → R+ we write α1 < α2 (resp. α1 ≤ α2 ) if α1 (s) < α2 (s) (resp. α1 (s) ≤ α2 (s)) for all s > 0. A continuous function η : R+ → R+ is called positive definite, if η(0) = 0 and η(s) > 0 for all s > 0. By id we denote the identity function id(s) = s for all s ∈ R+ , and by 0 : R+ 7→ 0 we denote the zero function. Given γij ∈ K∞ ∪ {0} for i, j ∈ {1, . . . , n}, we define the map Γ⊕ : Rn+ → Rn+ by   max {γ11 ([s]1 ), . . . , γ1n ([s]n )}   .. Γ⊕ (s) :=  (2) . . max {γn1 ([s]1 ), . . . , γnn ([s]n )} For the kth iteration of this map we write Γk⊕ . Note that Γ⊕ is monotone, i.e., Γ⊕ (s1 ) ≤ Γ⊕ (s2 ) for all s1 , s2 ∈ Rn+ with s1 ≤ s2 , also Γ⊕ (0) = 0. 2.3 Small-gain conditions Consider the map Γ⊕ from (2), let δi ∈ K∞ , Di = (id +δi ), i ∈ {1, . . . , n}, and define the diagonal operator D : Rn+ → Rn+ by D(s) := (D1 ([s]1 ), . . . , Dn ([s]n ))⊤ . (3) Definition 2.2 The map Γ⊕ from (2) satisfies the small-gain condition if Γ⊕ (s) 6≥ s for all s ∈ Rn+ \{0}. (4) The map Γ⊕ satisfies the strong small-gain condition if there exists a diagonal operator D as in (3) such that (D ◦ Γ⊕ )(s) 6≥ s for all s ∈ Rn+ \{0}. (5) The condition Γ⊕ (s) 6≥ s for all s ∈ Rn+ \{0}, or for short Γ⊕ 6≥ id, means that for any s > 0 the the image Γ⊕ (s) is decreasing in at least one component i∗ ∈ {1, . . . , n}, i.e., [Γ⊕ (s)]i∗ < [s]i∗ . Furthermore, we can assume that all functions δi ∈ K∞ of the diagonal operator D are identical, by setting δ(s) := mini δi (s). We will then write D = diag(id +δ). For any factorization D = DII ◦ DI with diagonal operators DI , DII : Rn+ → Rn+ as defined above, it holds that D ◦ Γ⊕ 6≥ id ⇐⇒ DI ◦ Γ⊕ ◦ DII 6≥ id, and, in particular, D ◦ Γ⊕ 6≥ id ⇐⇒ Γ⊕ ◦ D 6≥ id. As shown in [6, Theorem 5.2] the (strong) small-gain condition (4) (resp. (5)) implies the existence of a so-called Ω-path σ̃ with respect to Γ⊕ (resp. D ◦ Γ⊕ ) ([6, Definition 5.1]). The n , and satisfies essential property of Ω-paths used in this work is that σ̃ = (σ̃1 , . . . , σ̃n ) ∈ K∞ Γ⊕ (σ̃(r)) < σ̃(r) (resp. (D ◦ Γ⊕ )(σ̃(r)) < σ̃(r)) for all r > 0. The numerical construction of Ω-paths can be performed using the algorithm proposed in [11]. A simple calculation shows −1 ◦ σ̃ is an Ω-path with respect that if σ̃ is an Ω-path with respect to D ◦ Γ⊕ if and only if DII to DI ◦ Γ⊕ ◦ DII , where D = DII ◦ DI is split as above. 4 Remark 2.3 Condition (4) originates from [5] and is in fact equivalent to the equilibrium s∗ = 0 of the system s(k + 1) = Γ⊕ (s(k)) being globally asymptotically stable (GAS1 ), see [32, n×n , where the following is Theorem 6.4]. The idea comes from the linear case with Γ ∈ R+ equivalent (see [32, Lemma 1.1] and [5, Section 4.5]): (i) for the spectral radius it holds ρ(Γ) < 1; (ii) Γs 6≥ s for all s ∈ Rn+ \{0}; (iii) Γk → 0 for k → ∞; (iv) the origin of the system s(k + 1) = Γ(s(k)) is GAS. For the map Γ⊕ defined in (2) we have the following equivalent condition, which gives the possibility to check the small-gain condition (see [32, Theorem 6.4]). Proposition 2.4 The map Γ⊕ : Rn+ → Rn+ defined in (2) satisfies the small-gain condition (4) if and only if all cycles in the corresponding graph of Γ⊕ are weakly contracting, i.e., γi0 i1 ◦ γi1 i2 ◦ . . . ◦ γik i0 < id for k ∈ N, ij 6= il for j 6= l. Note that it is sufficient that all minimal cycles of the graph of Γ⊕ are weakly contracting, which means that ij 6= il for all j, l ∈ {0, . . . , k}. Thus, k < n. 3 Problem statement We consider discrete-time systems of the form x(k + 1) = G(x(k), u(k)), k ∈ N. (6) Here u(k) ∈ Rm denotes the input at time k ∈ N. Note that an input is a function u : N → Rm . By x(k, ξ, u(·)) ∈ Rn we denote the solution of (6) at time k ∈ N, starting in x(0) = ξ ∈ Rn with input u(·). Throughout this work the map G : Rn × Rm → Rn satisfies the following standing assumption. Assumption 3.1 The function G in (6) is globally K-bounded, i.e., there exist functions ω1 , ω2 ∈ K such that for all ξ ∈ Rn and µ ∈ Rm we have |G(ξ, µ)| ≤ ω1 (|ξ|) + ω2 (|µ|). (7) Assumption 3.1 implies continuity of G in (0, 0), but it does not require the map G to be continuous elsewhere (as assumed e.g. in [20, 21, 29]) or (locally) Lipschitz (as assumed e.g. in [2, 1]). For further remarks on Assumption 3.1 see Remark 3.3 and Appendix A.2. Definition 3.2 We call system (6) input-to-state stable if there exist β ∈ KL and γ ∈ K such that for all initial states ξ ∈ Rn , all inputs u(·) ∈ l∞ (Rm ) and all k ∈ N |x(k, ξ, u(·))| ≤ β(|ξ|, k) + γ(kuk∞ ). 1 see Remark 3.5 for a definition 5 (8) If the KL-function β in (8) can be chosen as β(r, t) = Cκt r (9) with C ≥ 1 and κ ∈ [0, 1), then system (6) is called exponentially input-to-state stable (expISS). An alternative definition of ISS replaces the sum in (8) by the maximum. Indeed, both definitions are equivalent, and the equivalence even holds for more general definitions of ISS using monotone aggregation functions, see [12, Proposition 2.5]. Remark 3.3 Since we are interested in checking the ISS property of system (6), it is clear that the existence of functions ω1 , ω2 ∈ K satisfying (7) in Assumption 3.1 is no restriction, since every ISS system necessarily satisfies (7). In particular, by (8), we have |G(ξ, µ)| = |x(1, ξ, µ)| ≤ β(|ξ|, 1) + γ(|µ|) and we may choose ω1 (·) = β(·, 1) and ω2 (·) = γ(·) to obtain (7). Moreover, for expISS systems we can take ω1 (s) = Cκs where C ≥ 1 and κ ∈ [0, 1) stem from (9). In other words, any expISS system is globally K-bounded with a linear function ω1 ∈ K. The following lemma shows that by a suitable change of coordinates, i.e., a homeomorphism T : Rn → Rn with T (0) = 0 (see e.g. [24]), we can always assume that ω1 ∈ K in (7) is linear. Lemma 3.4 Consider system (6) and let Assumption 3.1 hold. Then there exists a change of coordinates T such that for z(k) := T (x(k)) the system z(k + 1) = G̃(z(k), u(k)), ∀k ∈ N (10) satisfies (7) with linear ω1 ∈ K. Proof. Consider a change of coordinates T : Rn → Rn , and define z(k) := T (x(k)), where x(k) comes from (6). Then z satisfies (10) with G̃(z, u) = T (G(T −1 (z), u)). Note that G̃(0, 0) = 0 since T and its inverse fix the origin. Furthermore, let ω1 , ω2 ∈ K satisfy (7) for the map G. Without loss of generality, we assume that (2ω1 − id) ∈ K∞ , else increase ω1 . Take any λ > 1. By [25, Lemma 19] there exists a K∞ -function ϕ satisfying ϕ(2ω1 (s)) = λϕ(s) ∀s ≥ 0. (11) x for x 6= 0, and T (0) = 0. Clearly, T is continuous for x 6= 0. On Define T (x) := ϕ(|x|) |x| the other hand, |T (x)| = ϕ(|x|), so continuity of T in zero is implied by continuity of ϕ and ϕ(0) = 0. With z = T (x) a direct computation, using again that |z| = ϕ(|x|) and that x and z for z 6= 0 and T −1 (0) = 0. By the same z are on the same ray, yields T −1 (z) := ϕ−1 (|z|) |z| 6 arguments as above also T −1 is continuous. Hence, T is a homeomorphism. Moreover, we obtain the following estimate     (7)   ξ̃ |G̃(ξ̃, µ̃)| = ϕ |G ϕ−1 (|ξ̃|) |ξ̃| , µ̃ | ≤ ϕ ω1 (ϕ−1 (|ξ̃|)) + ω2 (|µ̃|)   (11) ≤ ϕ 2ω1 (ϕ−1 (|ξ̃|)) + ϕ (2ω2 (|µ̃|)) = λ|ξ̃| + ϕ (2ω2 (|µ̃|)) . So, G̃ satisfies (7) with the linear function ω1 (s) = λs, s ∈ R+ , which concludes the proof.  Remark 3.5 We further note that ISS implies global asymptotic stability of the origin with 0 input (0-GAS), i.e., the existence of a class-KL function β such that for all ξ ∈ Rn and all k ∈ N, |x(k, ξ, 0)| ≤ β(|ξ|, k). In [3] the author shows that for discrete-time systems (6) with continuous dynamics integral input-to-state stability (iISS) is equivalent to 0-GAS. Note that this is not true in continuous time. To prove ISS of system (6) the concept of ISS Lyapunov functions is widely used (see e.g. [20]). Note that in the following definition we do not require continuity of the ISS Lyapunov function. To shorten notation, we call a function W : Rn → R+ proper and positive definite if there exist α1 , α2 ∈ K∞ such that for all ξ ∈ Rn α1 (|ξ|) ≤ W (ξ) ≤ α2 (|ξ|). Definition 3.6 A proper and positive definite function W : Rn → R+ is called a dissipative ISS Lyapunov function for system (6) if there exist σ ∈ K and a positive definite function ρ with (id −ρ) ∈ K∞ such that for any ξ ∈ Rn , µ ∈ Rm W (G(ξ, µ)) ≤ ρ(W (ξ)) + σ(|µ|). (12) Remark 3.7 (i) In many prior works (e.g. [20, 29]) the definition of a dissipative ISS Lyapunov function requires the existence of a function α3 ∈ K∞ and a function σ ∈ K such that W (G(ξ, µ)) − W (ξ) ≤ −α3 (|ξ|) + σ(|µ|) (13) holds for all ξ ∈ Rn , µ ∈ Rm . Let us briefly explain, that this requirement is equivalent to Definition 3.6. First, from (13) and the positive definiteness of W we get 0 ≤ W (G(ξ, µ)) ≤ W (ξ) − α3 (|ξ|) + σ(|µ|) ≤ (id −α3 ◦ α−1 2 )(W (ξ)) + σ(|µ|) = ρ(W (ξ)) + σ(|µ|) with ρ := (id −α3 ◦ α−1 ) positive definite, and (id −ρ) = α3 ◦ α−1 2 2 ∈ K∞ . So (13) implies (12). To show the other implication, note that since 0 ≤ W (G(ξ, µ)) ≤ (α2 − α3 )(|ξ|) + σ(|µ|) holds it follows that α2 (s) ≥ α3 (s) for all s ∈ R+ by taking µ = 0. Let (12) hold with positive definite function ρ satisfying (id −ρ) ∈ K∞ , then we get W (G(ξ, µ)) − W (ξ) ≤ −α3 (|ξ|) + σ(|µ|) for α3 := (id −ρ) ◦ α1 ∈ K∞ , which is (13). (ii) For systems with external inputs u there are usually two forms of ISS Lyapunov functions. The first one is the dissipative form of Definition 3.6. The other type are frequently called 7 implication-form ISS Lyapunov functions. These are proper and positive definite function W : Rn → R+ satisfying |ξ| ≥ χ(|µ|) ⇒ W (G(ξ, µ)) ≤ ρ̄(W (ξ)). (14) for all ξ ∈ Rn , µ ∈ Rm , and some positive definite function ρ̄ < id and χ ∈ K. If the function G in (6) is continuous then conditions (12) and (14) are equivalent, see [20, Remark 3.3] and [14, Proposition 3.3 and 3.6]. So the existence of a dissipative or implicationform ISS Lyapunov function implies ISS of the system if the dynamics are continuous. If G is discontinuous then the equivalence between the existence of dissipative and implicationform ISS Lyapunov functions is no longer satisfied. Indeed, any dissipative ISS Lyapunov function is an implication-form ISS Lyapunov function, but the converse does not hold in general, see [14]. In particular, for discontinuous dynamics, an implication-form ISS Lyapunov function is not sufficient to conclude ISS, see also [27, Remark 2.1] and [14, Example 3.7]. (iii) To prove ISS of system (6), the authors in [14, Proposition 2.4] have shown that the assumption (id −ρ) ∈ K∞ in Definition 3.6 can be weakened to the condition (id −ρ) ∈ K and sup(id −ρ) > sup σ. Moreover, for any ISS system (6) there exists a dissipative ISS Lyapunov function W with linear decrease function ρ, see [14, Theorem 2.6]. We relax the condition (12) in Definition 3.6 by replacing the solution after one time step G(ξ, µ) = x(1, ξ, µ) by the solution after a finite number of time steps. This relaxation was recently introduced in [28, 9, 8] for systems without inputs. In the context of ISS, i.e., for systems with inputs, this concept appears to be new. Definition 3.8 A proper and positive definite function V : Rn → R+ is called a dissipative finite-step ISS Lyapunov function for system (6) if there exist an M ∈ N, σ ∈ K, a positive definite function ρ with (id −ρ) ∈ K∞ such that for any ξ ∈ Rn , u(·) ∈ l∞ (Rm ) V (x(M, ξ, u(·))) ≤ ρ(V (ξ)) + σ(kuk∞ ). (15) At first glance the task of finding an ISS Lyapunov function appears to have become easier, as we are only required to satisfy a condition after a finite number of steps. We will show later that there is some truth to this point of view, in that it is possible to show that a simple class of functions always yields a dissipative finite-step ISS Lyapunov function. Unfortunately, there is now a new general question: It is not sufficient to know a dissipative finite-step ISS Lyapunov function, but we also require to know the constant M , which may be hard to characterize. In the next section we study properties of dissipative finite-step ISS Lyapunov functions. 4 Dissipative Finite-Step ISS Lyapunov Theorems We start this section by proving that the existence of a dissipative finite-step ISS Lyapunov function is sufficient to conclude ISS of system (6). As any dissipative ISS Lyapunov function is a particular dissipative finite-step ISS Lyapunov function, this result is closely related to [20, Lemma 3.5]. Furthermore, the class of dissipative ISS Lyapunov functions is a strict subset of the class of dissipative finite-step ISS Lyapunov functions. Hence, this result is more general than showing that the existence of a dissipative ISS Lyapunov function implies ISS of the underlying system. The proof requires a comparison lemma and an additional lemma, which are given in the appendix. 8 Theorem 4.1 If there exists a dissipative finite-step ISS Lyapunov function for system (6) then system (6) is ISS. The proof follows the lines of [20, Lemma 3.5], which establishes that for continuous dynamics the existence of a continuous dissipative ISS Lyapunov function implies ISS of the system. Note that in this work we consider global K-boundedness of the system dynamics instead of continuity such as in [20]. Proof. Let V be a dissipative finite-step ISS Lyapunov function satisfying Definition 3.8 for system (6) with suitable α1 , α2 ∈ K∞ , M ∈ N, σ ∈ K, and a positive definite function ρ with (id −ρ) ∈ K∞ . Let ξ ∈ Rn and fix any input u(·) ∈ l∞ (Rm ). We abbreviate the state x(k) := x(k, ξ, u(·)). Let ν ∈ K∞ be such that id −ν ∈ K∞ and consider the set  ∆ := ξ ∈ Rn : V (ξ) ≤ δ := (id −ρ)−1 ◦ ν −1 ◦ σ(kuk∞ ) . We will now show that for any k ∈ N with x(k) ∈ ∆ we have x(k + lM ) ∈ ∆ for all l ∈ N. Using (15), a direct computation yields V (x(k + M )) ≤ ρ(V (x(k))) + σ(kuk∞ ) ≤ ρ(δ) + σ(kuk∞ ) = −(id −ν) ◦ (id −ρ)(δ) + δ − ν ◦ (id −ρ)(δ) + σ(kuk∞ ) = −(id −ν) ◦ (id −ρ)(δ) + δ ≤ δ. Hence, x(k + M ) ∈ ∆ and by induction we get x(k + lM ) ∈ ∆ for all l ∈ N. Let j0 ∈ N ∪ {∞} satisfy j0 := min{k ∈ N : x(k), . . . , x(k + M − 1) ∈ ∆}. By definition of j0 and by the above consideration, we see that x(k) ∈ ∆ for all k ≥ j0 . Thus, we have V (x(k)) ≤ (id −ρ)−1 ◦ ν −1 ◦ σ(kuk∞ ) =: γ̃(kuk∞ ). (16) For k < j0 , we have to consider two cases. First, if x(k) ∈ ∆ then by definition of ∆ we have V (x(k)) ≤ γ̃(kuk∞ ). Secondly, if x(k) 6∈ ∆ let l ∈ N and k0 ∈ {0, . . . , M − 1} satisfy k = lM + k0 . Since x(k0 ) ∈ ∆ implies x(lM + k0 ) ∈ ∆, we conclude x(k0 ) 6∈ ∆. Hence, by definition of ∆, V (x(k0 )) > (id −ρ)−1 ◦ ν −1 ◦ σ(kuk∞ ), or, equivalently, σ(kuk∞ ) < ν ◦ (id −ρ) ◦ V (x(k0 )), which implies V (x(k0 + M )) ≤ ρ(V (x(k0 ))) + σ(kuk∞ ) < ρ(V (x(k0 ))) + ν ◦ (id −ρ) ◦ V (x(k0 )) = (ρ + ν ◦ (id −ρ)) ◦ V (x(k0 )). Note that the function χ := (ρ + ν ◦ (id −ρ)) satisfies χ = id −(id −ν) ◦ (id −ρ) < id. Let L := sup{l ∈ N : V (x(lM + k0 )) 6∈ ∆}. Then we have for all l ∈ {0, . . . , L} V (x((l + 1)M + k0 )) ≤ χ(V (x(lM + k0 ))). Note that the function χ = ρ + ν ◦ (id −ρ) is continuous, positive definite and unbounded as ν, (id −ρ) ∈ K∞ , and it satisfies χ(0) = 0. Hence, we can without loss of generality assume that χ ∈ K∞ , else pick χ̃ ∈ K∞ satisfying χ ≤ χ̃ < id. Applying Lemma A.1 there exists a KL-function βk0 satisfying V (x(lM + k0 )) ≤ βk0 (V (x(k0 )), lM + k0 ) 9 for all l ∈ {0, . . . , L}. Moreover, for all l > L, we have V (x(lM + k0 )) ∈ ∆ implying V (x(lM + k0 )) ≤ γ̃(kuk∞ ). Thus, for all l ∈ N, we have V (x(lM + k0 )) ≤ max {βk0 (V (x(k0 )), lM + k0 ) , γ̃(kuk∞ )} . (17) It is important to note that both γ̃ and χ are independent on the choice of ξ ∈ Rn and u(·) ∈ l∞ (Rm ). In addition, by the proof of Lemma A.1, also βk0 ∈ KL does not depend on ξ ∈ Rn and u(·) ∈ l∞ (Rm ). Hence, (17) holds for all solutions x(k). Define the KL-function β̃(s, r) := max k0 ∈{0,...,M −1} βk0 (s, r) max (ξ, u(·)) := max n and VM j∈{0,...,M −1} V (x(j, ξ, u(·))). Then for all k ∈ N, all ξ ∈ R and all ∞ m u(·) ∈ l (R ) we have n o max V (x(k)) ≤ max β̃(VM (ξ, u(·)), k), γ̃(kuk∞ ) . Consider ϑj , ζj ∈ K from Lemma A.3 and define ϑ̃ := maxj∈{0,...,M −1} α2 (2ϑj ) and ζ̃ := maxj∈{0,...,M −1} α2 (2ζj ). Then for all ξ ∈ Rn and u(·) ∈ l∞ (Rm ) we get max VM (ξ, u(·)) ≤ max j∈{0,...,M −1} α2 (|x(j)|) ≤ ϑ̃(|ξ|) + ζ̃(kuk∞ ). So all in all we have for all k ∈ N, all ξ ∈ Rn and all u(·) ∈ l∞ , n o V (x(k)) ≤ max β̃(ϑ̃(|ξ|) + ζ̃(kuk∞ ), k), γ̃(kuk∞ ) n o ≤ max β̃(2ϑ̃(|ξ|), k) + β̃(2ζ̃(kuk∞ ), 0), γ̃(kuk∞ )   ≤ β̃(2ϑ̃(|ξ|), k) + β̃(2ζ̃(kuk∞ ), 0) + γ̃(kuk∞ ) . we get (8) by defining β(s, r) := α−1 and 1 (2β̃(2ϑ̃(s), r))   −1 γ(s) := α1 2(β̃(2ζ̃(kuk∞ ), 0) + γ̃(kuk∞ )) . Note that for fixed r ≥ 0, β(·, r) is a K-function as the composition of K-functions, and for fixed s > 0, β(s, ·) ∈ L, since the composition of Kand L-functions is of class L (see [15, Section 24], [23, Section 2]), so really β ∈ KL. Further note that the summation of class-K functions yields a class-K function, so γ ∈ K.  Hence, Remark 4.2 To clarify the concept of dissipative finite-step ISS Lyapunov functions we now discuss the connection to higher order iterates of system (6). Let G : Rn × Rm → Rn from (6) be given. Then, for any i ∈ N with i ≥ 1, we define the ith iterate of G, denoted by Gi : Rn × (Rm )i → Rn , as follows: ξ ∈ Rn , w1 = u1 ∈ Rm 7→ G1 (ξ, w1 ) := G(ξ, u1 ), ξ ∈ Rn , wi := (u1 , . . . , ui ) ∈ (Rm )i 7→ Gi (ξ, wi ) := G(Gi−1 (ξ, wi−1 ), ui ) with i ∈ N, i ≥ 2. Now fix any M ∈ N, and consider the system x̄(k + 1) = GM (x̄(k), wM (k)) 10 (18) with state x̄ ∈ Rn and input function wM (·) = (u1 (·), . . . , uM (·)) taking values in (Rm )M . Firstly, for any k ∈ N there exist unique l ∈ N and i ∈ {1, . . . , M } such that k = lM + i. For u : N → Rm define ui , i ∈ {1, .., M }, by ui (l) := u(lM + i), l ∈ N, we call (18) the M -iteration corresponding to system (6). Note that kwM k∞ := max{ku1 k∞ , . . . , kuM k∞ } = kuk∞ . It is not difficult to see that for all j ∈ N and all ξ ∈ Rn we have x(jM, ξ, u(·)) = x̄(j, ξ, wM (·)). (19) Thus, if system (6) is ISS, i.e., it satisfies (8), then also the M -iteration (18) is ISS and satisfies (19) |x̄(j, ξ, wM (·))| = |x(jM, ξ, u(·))| ≤ β(|ξ|, jM ) + γ(kuk∞ ) =: β̄(|ξ|, j) + γ(kwM k∞ ). Moreover, a dissipative finite-step ISS Lyapunov function for system (6) with suitable M ∈ N is also a dissipative ISS Lyapunov function for the M -iteration (18). Conversely, let system (18) be ISS then there exists a dissipative ISS Lyapunov function V for system (18) (see e.g. [20, Theorem 1] for continuous GM or [14, Lemma 2.3] for discontinuous GM ). From (19) we see that V is also a dissipative finite-step ISS Lyapunov function for system (6), and by Theorem 4.1 we conclude that system (6) is ISS. Summarizing, we obtain the following corollary. Corollary 4.3 System (6) is ISS if and only if the M -iteration (18) is ISS. In particular, a function V : Rn → R+ is a dissipative Lyapunov function for system (18) if and only if it is a dissipative finite-step Lyapunov function for system (6). As finding a (dissipative) ISS Lyapunov function is a hard task, we will see in the remainder of this work that finding a dissipative finite-step ISS Lyapunov function (or, equivalently, a dissipative Lyapunov function for a corresponding M -iteration) is sometimes easier. Furthermore, if we impose stronger conditions on the dissipative finite-step ISS Lyapunov function and the dynamics, then we can conclude an exponential decay of the bound on the system’s state. Theorem 4.4 Let system (6) be globally K-bounded with linear ω1 ∈ K∞ . If there exists a dissipative finite-step ISS Lyapunov function V for system (6) satisfying for any ξ ∈ Rn and u(·) ∈ l∞ (Rm ) a|ξ|λ ≤ V (ξ) ≤ b|ξ|λ , V (x(M, ξ, u(·))) ≤ cV (ξ) + d kuk∞ with b ≥ a > 0, c ∈ [0, 1) and d, λ > 0, then system (6) is expISS. Proof. The proof follows the lines of the proof of Theorem 4.1. Hence, we will omit the detailed proof, and only give a sketch. Consider the linear global K-bound ω1 ∈ K∞ . We assume that ω2 ∈ K is a linear function, too. This assumption is only for simplifying the proof, but does not change the result. First 11 note that in the proof of Theorem 4.1 we can choose ν(s) = hs with h ∈ (0, 1), and since ρ d and σ are linear K∞ -functions, we obtain that γ̃(s) := (id −ρ)−1 ◦ ν −1 ◦ σ(s) = h(1−c) s is a linear function. Furthermore, in the case that x(k) 6∈ ∆, we see that V (x(k + M, ξ, u(·))) ≤ (c + h(1 − c))V (x(k, ξ, u(·))). Define κ̃ := (c + h(1 − c)) < 1. In this case using the comparison Lemma A.2 we obtain the estimate k (κ̃1/M ) max V (x(k, ξ, u(·))) ≤ VM (ξ, u(·)), κ̃ max (ξ, u(·)) := max where VM j∈{0,...,M −1} V (x(j, ξ, u(·))). Let ω1 (s) := w1 s and ω2 (s) := w2 s for s ∈ R+ and w1 , w2 > 0. Using Lemma A.4, the estimate (39) is satisfied for ϑj (s) = w1j s Pj−1 i and ζj (s) = w2 i=0 w1 s. Thus, λ V (x(j, ξ, u(·))) ≤ b (|x(j, ξ, u(·))|) ≤ b w1j |ξ|+w2 j−1 X i=0 !λ w1i kuk∞ = b (w̃1 |ξ|+ w̃2 kuk∞ )λ with w̃1 := maxj∈{0,...,M −1} w1j , and w̃2 := maxj∈{0,...,M −1} w2 Pj−1 i=0 j−1 w1i , and hence, X κ̃k/M b w1j |ξ| + w2 w1i kuk∞ V (x(k, ξ, u(·))) ≤ max κ̃ j∈{0,...,M −1} i=0 ≤ b k/M κ̃ κ̃ !λ λ (w̃1 |ξ| + w̃2 kuk∞ ) . This implies that for all ξ ∈ Rn and all u(·) ∈ l∞ (Rm ) we have  1/λ  b k/M 1/λ (w̃1 |ξ| + w̃2 kuk∞ ) |x(k, ξ, u(·))| ≤ a−1 V (x(k, ξ, u(·))) ≤ aκ̃ κ̃ ! ! 1/λ λ 1/λ λ bω̃2 bω̃1 k κ |ξ| + kuk∞ , ≤ aκ̃ aκ̃ with κ := κ̃1/λM < 1. So, system (6) satisfies (8) with β as in (9), where C = κ < 1 as defined above. Hence, system (6) is expISS.  1/λ bω̃1 aκ̃ λ and  While Theorem 4.1 shows the sufficiency of the existence of dissipative finite-step ISS Lyapunov functions to conclude ISS of system (6), we are now interested in the necessity. At this stage we can exploit the fact that any dissipative ISS Lyapunov function as defined in Definition 3.6 is a particular dissipative finite-step ISS Lyapunov function satisfying Definition 3.8 with M = 1. Proposition 4.5 If system (6) is ISS then there exists a dissipative finite-step ISS Lyapunov function for system (6). Proof. If the right-hand side G : Rn × Rm → Rn of system (6) is continuous, then [20, Theorem 1] implies the existence of a smooth function V : Rn → R+ satisfying α1 (|ξ|) ≤ V (ξ) ≤ α2 (|ξ|) and V (G(ξ, µ)) − V (ξ) ≤ −α3 (|ξ|) + σ(|µ|) for all ξ ∈ Rn , µ ∈ Rm , and 12 suitable α1 , α2 , α3 ∈ K∞ , σ ∈ K. Then with Remark 3.7 and M = 1 it is easy to see that V is a dissipative finite-step ISS Lyapunov function. This result also applies to discontinuous dynamics, see [14, Lemma 2.3].  Obviously, Proposition 4.5 makes use of the converse ISS Lyapunov theorem in [20, 14] to guarantee the existence of a dissipative (finite-step) ISS Lyapunov function. For the case of expISS systems of the form (6), it turns out that norms are dissipative finite-step ISS Lyapunov functions. Theorem 4.6 If system (6) is expISS then the function V : Rn → R+ defined by V (ξ) := |ξ|, ξ ∈ Rn (20) is a dissipative finite-step ISS Lyapunov function for system (6). Proof. System (6) is expISS if it satisfies (8) with (9) for constants C ≥ 1 and κ ∈ [0, 1). Take M ∈ N such that CκM < 1, and V as defined in (20). Clearly, V is proper and positive definite with α1 = α2 = id ∈ K∞ . On the other hand, for any ξ ∈ Rn , we have V (x(M, ξ, u(·))) = |x(M, ξ, u(·))| ≤ CκM |ξ| + γ(kuk∞ ) = CκM V (ξ) + γ(kuk∞ ) =: ρ(V (ξ)) + σ(kuk∞ ) where ρ(s) := CκM s < s for all s > 0, since CκM < 1. Note that (id −ρ)(s) = (1 − CκM )s ∈ K∞ and σ := γ ∈ K∞ , which shows (15). So V defined in (20) is a dissipative finite-step ISS Lyapunov function for system (6).  We emphasize that the hard task in Theorem 4.6 is finding a sufficiently large M ∈ N. However, Theorem 4.6 suggests to take the norm as a candidate for a dissipative finite-step ISS Lyapunov function. Verification for this candidate function to be a dissipative finite-step ISS Lyapunov function can be done as outlined in the following procedure. Procedure 4.7 Consider system (6) and assume that Assumption 3.1 holds. [1] Set k = 1. [2] Check |x(k, ξ, u(·))| ≤ c|ξ| + σ(|u|[0,k] ) for all ξ ∈ Rn , u(·) ∈ l∞ (Rm ) with suitable c ∈ [0, 1) and σ ∈ K∞ . If the inequality holds set M = k; else set k = k + 1 and repeat. If this procedure is successful, then V (ξ) := |ξ| is a dissipative finite-step ISS Lyapunov function for system (6). By Theorem 4.4 system (6) is expISS. At this point we should mention that the procedure just described is far from being an algorithm. The question how to really perform item [2], which should result in global bounds, would depend on the existence of suitable analytic or numerical bounds which may or may not exist depending on the system class at hand. For easy examples this can surely be done by hand. How to address this question systematically would depend on specific situations and we will not discuss this issue here. It is clear that in general this is a very hard task. 13 5 Relaxed ISS Small-Gain Theorems In this section we consider system (6) split into N subsystems of the form xi (k + 1) = gi (x1 (k), . . . , xN (k), u(k)), k ∈ N, (21) with P xi (0) ∈ Rni and gi : Rn1 × . . . × RnN × Rm → Rni for i ∈ {1, . . . , N }. We further let N n n = i=1 ni , x = (x1 , . . . , xN ) ∈ R , then with G = (g1 , . . . , gN ) we call (6) the overall system of the subsystems (21). In this sense (21) is what we call a large-scale system. A typical assumption of classical (Lyapunov-based) small-gain theorems is the requirement that each subsystem (21) has to admit an ISS Lyapunov function (see e.g. [16, 6, 29]). This assumption comes from the fact that in small-gain theory the influence of the other subsystems is considered as disturbance. This is quite conservative as can be seen from the following linear system   1.5 1 x(k + 1) = x(k), k ∈ N. −2 −1 √ As the spectral radius of the matrix is equal to 2/2 the origin is GAS. But the first decoupled subsystem x1 (k + 1) = 1.5x1 (k) is unstable. So classical small-gain theorems cannot be applied. The aim of this section is to derive an ISS small-gain theorem which relaxes the assumption of classical (Lyapunov-based) ISS small-gain theorems. We assume that each system has to admit a Lyapunov-type function that decreases after a finite number of time steps rather than at each time step. Here it is important to note that these decrease conditions are formulated for the interconnected system, not for the decoupled system. The latter is a standard feature of the classical approach. So the Lyapunov-type functions proposed here do not require 0-GAS of the origin of the subsystems. The results in this section are based on the small-gain theorems presented in [13, 9] for systems without inputs, and the construction of (finite-step) ISS Lyapunov functions presented in [6]. The section is divided in two parts. In Section 5.1, we prove ISS of system (6) by constructing an overall dissipative finite-step ISS Lyapunov function. In Section 5.2, we show that the relaxed small-gain theorems derived are necessary at least for expISS systems. 5.1 Dissipative ISS small-gain theorems We start with the case that the effect of the external input u can be captured via maximization. Theorem 5.1 Let (6) be given by the interconnection of the subsystems in (21). Assume that there exist an M ∈ N, M ≥ 1, functions Vi : Rni → R+ , γij ∈ K∞ ∪ {0}, γiu ∈ K ∪ {0}, and positive definite functions δi , with di := (id +δi ) ∈ K∞ , for i, j ∈ {1, . . . , N } such that with Γ⊕ defined in (2), and the diagonal operator D defined by D = diag(di ) the following conditions hold. (i) For all i ∈ {1, . . . , N }, the functions Vi are proper and positive definite. (ii) For all ξ = (ξ1 , . . . , ξN ) ∈ Rn with ξi ∈ Rni , i ∈ {1, . . . , N } and u(·) ∈ l∞ (Rm ) it holds that        V1 (x1 (M, ξ, u(·))) V1 (ξ1 ) γ1u (kuk∞ )           .. .. .. ≤ max , Γ .         ⊕ . . .     VN (xN (M, ξ, u(·))) VN (ξN ) γN u (kuk∞ ) 14 (iii) The small-gain condition2 Γ⊕ ◦ D 6≥ id holds. N for Γ ◦ D. Moreover, if for all i ∈ {1, . . . , N } there Then there exists an Ω-path σ̃ ∈ K∞ ⊕ exists a K∞ -function α̂i satisfying −1 −1 σ̃i−1 ◦ d−1 ◦ σ̃i = id −α̂i i ◦ σ̃i = σ̃i ◦ (id +δi ) (22) then the function V : Rn → R+ defined by V (ξ) := max(σ̃i−1 ◦ d−1 i )(Vi (ξi )). i (23) is a dissipative finite-step ISS Lyapunov function for system (6). In particular, system (6) is ISS. Let us briefly discuss the differences in the assumptions of Theorem 5.1 when compared to the small-gain theorem for the maximization case e.g. from [6]. First there is of course the finite-step condition (ii), but this is not surprising. What is conceptually new is that a strong small-gain condition Γ⊕ ◦ D 6≥ id is required and in addition we need the existence of the functions α̂i satisfying (22). This is by no means automatic. If ISS of all subsystems is assumed as in [6] then in the maximization case the condition Γ⊕ 6≥ id is sufficient. In our proof we use the stronger condition and we suspect that this extra robustness required is not merely a result of our technique of proof. Rather, it is essential to deal with possibly unstable subsystems. We explicitly point out the step where the new condition (22) is needed in the proof. Proof. Assume that Vi and γij , γiu satisfy the hypothesis of the theorem. Denote γu (·) := (γ1u (·), . . . , γN u (·))⊤ . Then from condition (iii) and [6, Theorem 5.2-(iii)] it follows N such that that there exists an Ω-path σ̃ ∈ K∞ (Γ⊕ ◦ D)(σ̃(s)) < σ̃(s) holds for all s > 0. In particular, max i,j∈{1,...,N } σ̃i−1 ◦ γij ◦ dj ◦ σ̃j < id . (24) In the following let i, j ∈ {1, . . . , N }. Let V : Rn → R+ be defined as in (23). The aim is to show that V is a dissipative finite-step ISS Lyapunov function for the overall system (6). Recall that condition (i) implies the existence of α1i , α2i ∈ K∞ such that for all ξi ∈ Rni we have α1i (|ξi |) ≤ Vi (ξi ) ≤ α2i (|ξi |). Thus, V (ξ) ≥ max(σ̃i−1 ◦ d−1 i )(α1i (|ξi |)) ≥ α1 (|ξ|) i 1 with α1 := minj σ̃j−1 ◦ d−1 j ◦ α1j ◦ κ id ∈ K∞ , where κ ≥ 1 comes from (1). On the other hand we have V (ξ) ≤ max(σ̃i−1 ◦ d−1 i )(α2i (|ξi |)) ≤ α2 (|ξ|) i 2 Note that the strong small-gain condition in Definition 2.2 requires the functions δi in the diagonal operator to be of class K∞ , whereas here we only require δi to be positive definite. 15 with α2 := maxi σ̃i−1 ◦ d−1 i ◦ α2i ∈ K∞ , which shows V defined in (23) is proper and positive definite. To show the decay of V , i.e., an inequality of the form (15), we define σ := maxi σ̃i−1 ◦ d−1 i ◦ γiu , and obtain V (x(M, ξ, u(·))) = max(σ̃i−1 ◦ d−1 i )(Vi (xi (M, ξ, u(·)))) i    cond. (ii) ≤ max(σ̃i−1 ◦ d−1 ) max max γ (V (ξ )), γ (kuk ) ij j j iu i ∞ i j   −1 −1 −1 −1 = max max σ̃i ◦ di ◦ γij (Vj (ξj )), max σ̃i ◦ di ◦ γiu (kuk∞ ) i,j i       −1 −1 −1 ◦ σ̃ ≤ max max σ̃i−1 ◦d−1 , σ(kuk ) ◦ σ̃ ◦γ ◦d ◦ σ̃ ◦ σ̃ ◦d ◦V (ξ ) i ij j j j j ∞ j i,j | {zi } | i {z } | j {z } =id −α̂i by (22) <id by (24) ≤V (ξ)   < max max(id −α̂i )(V (ξ)), σ(kuk∞ ) . i Define ρ := maxi (id −α̂i ), then ρ ∈ K∞ by (22), and satisfies id −ρ = mini α̂i ∈ K∞ . Noticing that the maximum can be upper bounded by summation, this shows that V is a dissipative finite-step ISS Lyapunov function as defined in Definition 3.8. Then from Theorem 4.1 we conclude that system (6) is ISS.  Remark 5.2 (i) To understand the assumptions imposed in Theorem 5.1 consider the case that M = 1 and δi ∈ K∞ , i ∈ {1, . . . , N }. First, by condition (ii), we have for any i ∈ {1, . . . , N }   Vi (xi (1, ξ, u(·))) ≤ max max γij (Vj (ξj )), γiu kuk∞ . (25) j∈{1,...,N } From the small-gain condition (iii) we conclude that γii ◦ (id +δi ) < id by considering the ith unit vector. Hence, since δi ∈ K∞ , we have γii < (id +δi )−1 = id −δ̂i with δ̂i ∈ K∞ , where the last equality follows from [32, Lemma 2.4]. Thus, we can write (25) as Vi (xi (1, ξ, u(·))) ≤ (id −δ̂i )(Vi (ξi )) + | {z } =:ρi N X j=1 j6=i γij (Vj (ξj )) + γiu kuk∞ . Together with condition (i) this implies that the functions Vi are dissipative ISS Lyapunov functions for the subsystem (21) with respect to both internal and external inputs. Therefore, if M = 1 and δi ∈ K∞ then Theorem 5.1 is a dissipative small-gain theorem for discrete-time systems in the classical sense, see also Remark 5.5. (ii) If M = 1 and the functions δi are only positive definite then the functions Vi are not necessarily dissipative ISS Lyapunov functions, as we cannot ensure that the decay of Vi in terms of the function ρi satisfies id −ρi ∈ K∞ . Thus, in Theorem 5.1, even in the case M = 1, we do not necessarily assume that the subsystems are ISS. (iii) Now consider the case M > 1. In Theorem 5.1, the internal inputs xj may have an stabilizing effect on system xi in the first M time steps, whereas the external input u is considered as a disturbance. Thus, the subsystems do not have to be ISS, while the overall system is ISS. This observation is essential as it extends the classical idea of small-gain theory. In particular, the subsystems (21) can be 0-input unstable, i.e., the origin of the 16 system xi (k + 1) = gi (0, . . . , 0, xi (k), 0, . . . , 0) can be unstable. See also Section 6 devoted to the discussion of an example. In the following example we show that condition (22), which quantifies the robustness given by the scaling matrix D, is not trivially satisfied, even if δi ∈ K∞ . Example 5.3 Consider the functions σ̃(s) := es − 1, σ̃ −1 (s) = log(s + 1),  δ̂(s) = (s + 1) 1 −  1 s+1  1 s+1  . It is not hard to see that σ̃, σ̃ −1 ∈ K∞ . Moreover, by [7, Appendix A.3], also δ̂ ∈ K∞ and (id −δ̂) ∈ K∞ . Similarly as in [32, Lemma 2.4], there exists3 a function δ ∈ K∞ such that (id +δ)−1 = id −δ̂. Hence, we have for all s ∈ R+ σ̃ −1 ◦ (id +δ)−1 ◦ σ̃(s) = σ̃ −1 ◦ (id −δ̂) ◦ σ̃(s) = s(1 − e−s ). As lims→∞ s(1 − e−s ) − s = 0, there cannot exist a K∞ -function α̂ satisfying (22). In condition (ii) of Theorem 5.1 the effect of internal and external inputs is captured via maximization. Next, we replace the maximum in condition (ii) of Theorem 5.1 by a sum. Note that in the case of summation, the small-gain condition invoked in Theorem 5.1 is not strong enough to ensure that V defined in (23) is a dissipative finite-step ISS Lyapunov function (see [6]), so we also have to change condition (iii) of Theorem 5.1. In particular, we assume that the functions δi are of class K∞ , and not only positive definite. We recall from Section 2.3 that if the diagonal operator D = diag(id +δi ) is factorized into D = D2 ◦ D1 , Dj = diag(id +δij ), δij ∈ K∞ , i ∈ {1, . . . , N }, j ∈ {1, 2} (26) then D ◦ Γ⊕ 6≥ id is equivalent to D1 ◦ Γ⊕ ◦ D2 6≥ id. Theorem 5.4 Let (6) be given by the interconnection of the subsystems in (21). Let δi , δi1 , δi2 ∈ K∞ for i ∈ {1, . . . , N } and D := diag(di ) := diag(id +δi ) satisfy (26). Assume that there exist an M ∈ N, M ≥ 1, functions Vi : Rni → R+ , γij ∈ K∞ ∪ {0}, and γiu ∈ K ∪ {0} for i, j ∈ {1, . . . , N } such that with Γ⊕ defined in (2) the following conditions hold. (i) For all i ∈ {1, . . . , N }, the functions Vi are proper and positive definite. (ii) For all ξ ∈ Rn and u(·) ∈ l∞ (Rm ) it holds that       V1 (x1 (M, ξ, u(·))) V1 (ξ1 ) γ1u (kuk∞ )       .. .. ..   ≤ Γ⊕    +  . . . . VN (xN (M, ξ, u(·))) VN (ξN ) γN u (kuk∞ ) (iii) The strong small-gain condition D ◦ Γ⊕ 6≥ id is satisfied. 3 Note that [32, Lemma 2.4] argues that if δ ∈ K∞ is given, there exists a suitable δ̂ ∈ K∞ satisfying (id +δ)−1 = id −δ̂. Conversely, for any δ̂ ∈ K∞ with (id −δ̂) ∈ K∞ the existence of a δ ∈ K∞ satisfying (id −δ)−1 = id −δ̂ follows by defining δ = δ̂ ◦ (id −δ̂)−1 ∈ K∞ . 17 N for D ◦ Γ ◦ D . Moreover, if for all i ∈ {1, . . . , N } Then there exists an Ω-path σ̃ ∈ K∞ 1 ⊕ 2 there exists a K∞ -function α̂i satisfying σ̃i−1 ◦ d−1 i2 ◦ σ̃i = id −α̂i (27) then the function V : Rn → R+ defined by V (ξ) := max(σ̃i−1 ◦ d−1 i2 )(Vi (ξi )) (28) i is a dissipative finite-step ISS Lyapunov function for system (6). In particular, system (6) is ISS. Again note the difference in the assumptions when compared to the small-gain theorem for the summation case e.g. from [6]. Now a factorization property for the operator D is required. This imposes extra conditions as discussed in Remark 5.6. Again these extra conditions appear to be necessary to treat the potential instability of subsystems. Proof. In Section 2.3 we have shown that D ◦ Γ⊕ 6≥ id if and only if D1 ◦ Γ⊕ ◦ D2 6≥ id. N for D ◦ Γ ◦ D By [6, Theorem 5.2-(iii)] it follows that there exists an Ω-path σ̃ ∈ K∞ 1 ⊕ 2 satisfying (D1 ◦ Γ⊕ ◦ D2 )(σ̃(r)) < σ̃(r) ∀r > 0, or, equivalently, for all i ∈ {1, . . . , N }, max j∈{1,...,N } di1 ◦ γij ◦ dj2 ◦ σ̃j (r) < σ̃i (r) ∀r > 0. (29) We show that this inequality implies the existence of a function ϕ ∈ K∞ such that for all r > 0, we have (30) max σ̃i−1 ◦ (γij ◦ dj2 ◦ σ̃j (r) + γiu ◦ ϕ(r)) < r. i,j To do this, we assume, without loss of generality4 , that γiu ∈ K∞ . Since di1 = id +δi1 with δi1 ∈ K∞ for all i ∈ {1, . . . , N }, we can write (29) as max j∈{1,...,N } γij ◦ dj2 ◦ σ̃j (r) + max j∈{1,...,N } δi1 ◦ γij ◦ dj2 ◦ σ̃j (r) < σ̃i (r). (31) Let i ∈ {1, . . . , N }. We consider two cases: (i) If γij = 0 for all j ∈ {1, . . . , N }, define −1 ϕi := 12 γiu ◦ σ̃i ∈ K∞ . (ii) If γij ∈ K∞ for at least one j ∈ {1, . . . , N }, define ϕi := max j∈{1,...,N } −1 γiu ◦ δi1 ◦ γij ◦ dj2 ◦ σ̃j ∈ K∞ . Note that we need δi1 ∈ K∞ for ϕi to be of class K∞ , as opposed to proof of Theorem 5.1, where we only needed positive definiteness. 4 If γiu ∈ K\K∞ take any K∞ -function upper bounding γiu . If γiu = 0, take e.g. γiu = id. 18 For both cases, the definition of ϕi ∈ K∞ together with (31) implies max j∈{1,...,N } γij ◦ dj2 ◦ σ̃j (r) + γiu ◦ ϕi (r) < σ̃i (r). for all r > 0. Then it is not hard to see that ϕ := mini∈{1,...,N } ϕi ∈ K∞ satisfies (30) for all r > 0. In the following let i, j ∈ {1, . . . , N }. Consider the function V from (28). First note that V is proper and positive definite, which follows directly from the proof of Theorem 5.1. To show the decay of V , i.e., an inequality of the form (15), we use (30), and obtain V (x(M, ξ, u(·))) = max(σ̃i−1 ◦ d−1 i2 )(Vi (xi (M, ξ, u(·)))) i   cond. (ii) −1 −1 ≤ max(σ̃i ◦ di2 ) max γij (Vj (ξj )) + γiu (kuk∞ ) i j (27) = max(id −α̂i ) ◦ σ̃i−1 (γij (Vj (ξj )) + γiu (kuk∞ )) i,j       −1 −1 ′ ) γ ◦d ◦ σ̃ ◦ σ̃ ◦d ◦ V (ξ = max(id −α̂i )◦ σ̃i−1 +γiu ◦ϕ◦ϕ−1 (kuk∞ ) ij j2 j j j j j2   i,j | {z } ≤V (ξ) (30)  < max(id −α̂i ) max{V (ξ), ϕ−1 (kuk∞ )} i ≤ max(id −α̂i )(V (ξ)) + max(id −α̂i )(ϕ−1 (kuk∞ )). i i Define ρ := maxi (id −α̂i ) and σ := maxi (id −α̂i ) ◦ ϕ−1 , then id −ρ = mini α̂i ∈ K∞ . Hence, (15) is satisfied. Again, as in the proof of Theorem 5.1, this shows that V is a dissipative finite-step ISS Lyapunov function as defined in Definition 3.8. From Theorem 4.1 we conclude that system (6) is ISS.  Remark 5.5 If Theorem 5.1 (resp. Theorem 5.4) is satisfied with M = 1, then the dissipative finite-step ISS Lyapunov function V in (23) (resp. (28)) is a dissipative ISS Lyapunov function. In particular, we obtain the following special cases: If Theorem 5.4 is satisfied for M = 1 then this gives a dissipative-form discrete-time version of [6, Corollary 5.6]. On the other hand, for M = 1, Theorem 5.1 includes the ISS variant of [17, Theorem 3] as a special case. Remark 5.6 Whether or not condition (27) in Theorem 5.1 is satisfied depends on the factorization (26). Let D1 , D2 as well as D̂1 , D̂2 be two compositions of D as in (26), i.e., N is an Ω-path for D2 ◦ D1 = D = D̂2 ◦ D̂1 . A direct computation shows that if σ̃ ∈ K∞ −1 N is an Ω-path for D̂ ◦ Γ ◦ D̂ . Moreover, if we D1 ◦ Γ⊕ ◦ D2 then σ̂ := D̂1 ◦ D1 ◦ σ̃ ∈ K∞ 1 ⊕ 2 assume that (27) holds for D1 , D2 , then we have −1 −1 −1 −1 ˆ σ̂i−1 ◦ dˆ−1 i2 ◦ σ̂i = (σ̃i ◦ di2 ◦ σ̃i ) ◦ (σ̃i ◦ di1 ◦ di1 ◦ σ̃i ) = (id −α̂i ) ◦ (σ̃ −1 ◦ dˆi1 ◦ d−1 ◦ σ̃i ) i i1 with α̂i ∈ K∞ , i ∈ {1, . . . , N }. Unfortunately, from this equation we cannot conclude that a condition of the form (27) holds for the decomposition D̂1 , D̂2 and the Ω-path σ̂ as defined above. 19 An approach for finding a suitable decomposition is the following. Consider the special N case of the decomposition (26) with D2 = diag(id) and D1 = D = diag(di ). Let σ̃ ∈ K∞ be an Ω-path for D1 ◦ Γ⊕ ◦ D2 = D ◦ Γ⊕ . Following the same steps as above, we see that N is an Ω-path for D̂ ◦ Γ ◦ D̂ . Moreover, as D = D̂ ◦ D̂ implies σ̂ = D̂1 ◦ D −1 ◦ σ̃ ∈ K∞ 1 ⊕ 2 2 1 −1 −1 −1 ˆ ˆ di = di1 ◦ di2 , we see that −1 −1 −1 ˆ−1 ˆ ˆ σ̂i−1 ◦ dˆ−1 i2 ◦ σ̂i = (σ̃i ◦ di ◦ di1 ) ◦ (di1 ◦ di ) ◦ (di1 ◦ di ◦ σ̃i ) = (σ̃ −1 dˆi1 ◦ d−1 ◦ σ̃i ) = i −1 ˆ−1 σ̃i di2 i ◦ σ̃i . N Hence, a condition of the form (27) holds for the decomposition D̂1 , D̂2 with Ω-path σ̂ ∈ K∞ if and only there exist K∞ -functions α̂i , i ∈ {1, . . . , N } satisfying σ̃i−1 ◦ dˆ−1 i2 ◦ σ̃i = id −α̂i . (32) Hence, to find a “good” decomposition D̂1 , D̂2 of D, i.e., a decomposition for which (27) holds, −1 we can try to find K∞ -functions dˆ−1 i2 = (id +δ̂i2 ) , i ∈ {1, . . . , N } that satisfy (i) equation (32) for suitable α̂i ∈ K∞ ; (ii) dˆi2 ◦ dˆi1 = di = id +δi with suitable dˆi1 = id +δ̂i1 . It is an open question, how to characterize the cases in which there exists a decomposition satisfying these two conditions. In Theorem 5.1 we introduced the diagonal operator D and assumed (22). In the following corollary we impose further assumptions such that we do not need the diagonal operator D. Under these stronger assumptions, system (6) is shown to be expISS. Corollary 5.7 Let (6) be given by the interconnection of the subsystems in (21). Assume there exist an M ∈ N, M ≥ 1, linear functions γij ∈ K∞ , and functions Vi : Rni → R+ satisfying condition (i) of Theorem 5.1 with linear functions α1i , α2i . Let condition (ii) of Theorem 5.1 hold, and instead of condition (iii) of Theorem 5.1 let the small-gain condition (4) hold. Furthermore, assume that the K-function ω1 in Assumption 3.1 is linear. Then system (6) is expISS. Proof. We follow the proof of Theorem 5.1. By the small-gain condition (4) there exists N satisfying Γ (σ̃)(r) < σ̃(r) for all r > 0, see [6]. Moreover, as the functions an Ω-path σ̃ ∈ K∞ ⊕ γij ∈ K∞ are linear for all i, j ∈ {1, . . . , N }, we can also assume the Ω-path functions σ̃i ∈ K∞ to be linear, see [11]. Thus, the function V (ξ) := max σ̃i−1 (Vi (ξi )) i (33) has linear bounds α1 and α2 . Furthermore, since σ̃i and γij are linear functions, we obtain (15) with the linear function ρ := maxi,j σ̃i−1 ◦ γij ◦ σ̃j < id, and σ := maxi σ̃i−1 ◦ γiu . Clearly, (id −ρ) ∈ K∞ by linearity of ρ. Thus, V is a dissipative finite-step ISS Lyapunov function for system (6). Since ω1 in Assumption 3.1 is linear, we can apply Theorem 4.4 to show that system (6) is expISS.  By Remark 3.3, the requirement that ω1 is linear is necessary for the system to be expISS. A similar reasoning as in Corollary 5.7 applies in the case, where the external input enters additively. 20 Corollary 5.8 Let (6) be given by the interconnection of the subsystems in (21). Assume there exist an M ∈ N, M ≥ 1, linear functions γij ∈ K∞ , and functions Vi : Rni → R+ satisfying condition (i) of Theorem 5.4 with linear functions α1i , α2i . Let condition (ii) of Theorem 5.4 and the small-gain condition (4) hold. Furthermore, assume that ω1 in Assumption 3.1 is linear. Then system (6) is expISS. Proof. We omit the details as the proof follows the lines of the proof of Theorem 5.4 combined with the argumentation of the proof of Corollary 5.7. N , which is linear First, the small-gain condition implies the existence of an Ω-path σ̃ ∈ K∞ as the functions γij are linear. In particular, Γ⊕ (σ̃(r)) < σ(r) for all r > 0. Next, note that the function V defined in (33) has linear bounds as shown in the proof of Corollary 5.7. It satisfies V (x(M, ξ, u(·))) ≤ ρ(V (ξ)) + σ(kuk∞ ) with ρ := maxi,j σ̃i−1 ◦ γij ◦ σ̃j and σ := maxi σ̃i−1 ◦ γiu , which can be seen by a straightforward calculation, invoking condition (ii) of Theorem 5.4 and the linearity of the Ω-path σ̃. Again as in the proof of Corollary 5.7, (id −ρ) ∈ K∞ by linearity of ρ. Thus, V defined in (33) is a dissipative finite-step ISS Lyapunov function for system (6). Since ω1 in Assumption 3.1 is linear, we can apply Theorem 4.4, and the result follows.  In this section we have presented sufficient criteria to conclude ISS, whereas in the next section we will study the necessity of these relaxed small-gain results. 5.2 Non-conservative expISS Small-Gain Theorems In the remainder of this section we show that the relaxation of classical small-gain theorems given in Theorems 5.1 and 5.4 is non-conservative at least for expISS systems. Theorem 5.9 Let system (6) be given by the interconnection of the subsystems in (21). Then system (6) is expISS if and only if (i) Assumption 3.1 holds with linear ω1 , and (ii) there exist an M ∈ N, M ≥ 1, linear functions γij ∈ K∞ , proper and positive definite functions Vi : Rni → R+ with linear bounds α1i , α2i ∈ K∞ such that the following holds: (a) condition (ii) of Theorem 5.1 (and thus also condition (ii) of Theorem 5.4); (b) the small-gain condition (4). Proof. Sufficiency is shown in Corollary 5.7 and Corollary 5.8, so we only have to prove necessity. Since system (6) is expISS, global K-boundedness holds with linear ω1 , see Remark 3.3. Furthermore, the function V (ξ) := |ξ|, ξ ∈ Rn is a dissipative finite-step ISS Lyapunov function for system (6) by Theorem 4.6. Hence, there exist M̃ ∈ N, σ ∈ K and c < 1 such that for all ξ ∈ Rn and all u(·) ∈ l∞ (Rm ) we have |x(M̃ , ξ, u(·))| ≤ c|ξ| + σ(kuk∞ ). (34) Define Vi (ξi ) := |ξi | for i ∈ {1, . . . , N }, where the norm for ξi ∈ Rni is defined in the preliminaries. Then Vi is proper and positive definite with α1i = α2i = id for all i ∈ {1, . . . , N }. Take κ ≥ 1 from (1), and define l := min{ℓ ∈ N : cℓ κ < 21 }, 21 which exists as c ∈ [0, 1). Then we have Vi (xi (lM̃ , ξ, u(·))) = |xi (lM̃ , ξ, u(·))| ≤ |x(lM̃ , ξ, u(·))| (34) ≤ c|x((l − 1)M̃ , ξ, u(·))| + σ(kuk∞ ) (34) ≤ cl |ξ| + l X ′ cj −1 σ(kuk∞ ) j ′ =1 (1) ≤ max cl κ|ξj | + j l X ′ cj −1 σ(kuk∞ ) j ′ =1   ≤ max max γij (ξj ), γiu (kuk∞ ) j ≤ max γij (ξj ) + γiu (kuk∞ ) j P with γiu (·) := 2 lj=1 cj−1 σ(·), and γij := 2cl κ id. The last inequality shows condition (ii) of Theorem 5.4, while the second last inequality shows condition (ii) of Theorem 5.1 for M = lM̃ . Finally, by definition of l ∈ N, we have γij < id for all i, j ∈ {1, . . . , N }. Hence, Proposition 2.4 implies the small-gain condition (4). This proves the theorem.  Theorem 5.9 is proved in a constructive way, i.e., it is shown that under the assumption that system (6) is expISS we can choose the Lyapunov-type functions Vi : Rni → R+ as norms, i.e., Vi (·) = | · |. Then there exist an M ∈ N and linear gains γij ∈ K∞ satisfying condition (ii) of Theorem 5.1, and thus also condition (ii) of Theorem 5.4, as well as the small-gain condition (4). This suggests the following procedure. Procedure 5.10 Consider (6) as the overall system of the subsystems (21). Check that Assumption 3.1 is satisfied with a linear ω1 (else the origin of system (6) cannot be expISS, see Remark 3.3). Define Vi (ξi ) := |ξi | for ξi ∈ Rni , and set k = 1. [1] Compute γiu ∈ K∞ and linear functions γij ∈ K∞ ∪ {0} satisfying Vi (xi (k, ξ, u(·))) = |xi (k, ξ, u(·))| ≤ max j∈{1,...,N } γij |ξj | + γiu (kuk∞ ). [2] Check the small-gain condition (4) with Γ⊕ defined in (2). If (4) is violated set k = k+1 and repeat with [1]. If this procedure is successful, then expISS of the overall system (6) is shown by Theorem 5.9. Moreover, a dissipative finite-step ISS Lyapunov function can be constructed via (33). Remark 5.11 Although Procedure 5.10 is straightforward, even for simple classes of systems, finding a suitable M ∈ N may be computationally intractable, as it was shown in [4]. A systematic way to find a suitable number M ∈ N for certain classes of systems is discussed in [8]. In the next section we consider a nonlinear system and show how Procedure 5.10 can be applied. 22 6 Example In Section 5 the conservatism of classical small-gain theorems was illustrated by a linear example without external inputs, where the origin is GAS, but where the decoupled subsystems’ origin are not 0-GAS. In this section we consider a nonlinear example with external inputs and show how the relaxed small-gain theorem from Section 5 can be applied. Consider the nonlinear system x1 (k + 1) = x1 (k) − 0.3x2 (k) + u(k) x2 (k + 1) = x1 (k) + 0.3 x22 (k) 1 + x22 (k) (35) with x1 (·), x2 (·), u(·) ∈ l∞ (R). We will show that this system is ISS by constructing a suitable dissipative finite-step ISS Lyapunov function following Procedure 5.10. Note that the origin of the first subsystem decoupled from the second subsystem with zero input is not 0-GAS,5 hence not ISS. So we cannot find an ISS Lyapunov function for this subsystem. The converse small-gain results in Section 5.2 suggest to prove ISS by a search for suitable functions Vi and γij ∈ K∞ that satisfy the conditions of one of the small-gains theorems of this section (eg. Theorem 5.1 or Corollary 5.7). Here we follow Procedure 5.10. First, the right-hand side G of (35) is globally K-bounded, since ξ2 kG(ξ, µ)k∞ ≤ max{|ξ1 | + 0.3|ξ2 | + |µ|, |ξ1 | + 0.3 1+ξ2 2 } ≤ 1.3 kξk∞ + |µ|, 2 where we used that for all x ∈ R we have x2 1+x2 ≤ |x| 2 . (36) Let Vi (ξi ) := |ξi |, i ∈ {1, 2}. Then we compute for all ξ ∈ R2 , V1 (x1 (1, ξ, u(·))) = |ξ1 − 0.3ξ2 + u(0)| ≤ max {2V1 (ξ1 ), 0.6V2 (ξ2 )} + kuk∞ , o n ξ2 V 2 (ξ ) V2 (x2 (1, ξ, u(·))) = |ξ1 + 0.3 1+ξ2 2 | ≤ max 2V1 (ξ1 ), 0.6 1+V2 2 (ξ2 ) . 2 2 2 Since γ11 (s) = 2s, the small-gain condition is violated and we cannot conclude stability. Intuitively, this was expected from the above observation that the origin of the first subsystem is not ISS. Computing solutions x(k, ξ, u(·)) with initial condition ξ ∈ R2 and input u(·) ∈ l∞ (R) we see that for k = 3 we have   2 (ξ1 +0.3 2 ξ2 2 2) 1+ξ2 ξ   +0.7u(0)+u(1)+u(2) 0.4ξ1 −0.21ξ2 −0.09 2 2 −0.09   ξ22 2 1+ξ2   ) 1+(ξ1 +0.3 1+ξ22    2   ξ22 2   (ξ1 +0.3 2)   1+ξ   2 ξ1 −0.3ξ2 +0.3  x(3, ξ, u(·)) =  . 2   ξ2 2   1+(ξ1 +0.3 )   ξ22 1+ξ22 0.7ξ1 −0.3ξ2 −0.09 1+ξ 2+0.3  2 +u(0)+u(1) 2 ξ   2 (ξ1 +0.3 2 2 )2     1+ξ 2    1+ 2  ξ1 −0.3ξ2 +0.3 1+(ξ1 +0.3 5 ξ2 2 ) 1+ξ22 We could also make the first system 0-input unstable by letting x1 (k + 1) = (1 + ǫ)x1 (k) − 0.3x2 (k) + u(k) and ǫ > 0 small enough, and obtain the same conclusion, see also [9]. But here we let ǫ = 0 to simplify computations. 23 Using (36) we compute V1 (x1 (3, ξ, u(·))) ≤ 0.4|ξ1 | + 0.21|ξ2 | + 0.09 0.09 2 |ξ2 | + 2 + 0.7|u(0)| + |u(1)| + |u(2)| |ξ1 | +  0.3 2 |ξ2 | = max{0.89V1 (ξ1 ), 0.5235V2 (ξ2 )} + 2.7 kuk∞ , V2 (x2 (3, ξ, u(·))) ≤ 0.7|ξ1 | + 0.3|ξ2 | + + |u(0)| + |u(1)| 0.09 2 |ξ2 | + 0.3 2 |ξ1 | + 0.3|ξ2 | +  0.3 0.3 2 (|ξ1 |+ 2 |ξ2 |) = max{1.745V1 (ξ1 ), 0.78675V2 (ξ2 )} + 2 kuk∞ . From this we derive the linear functions γ11 (s) = 0.89s, γ12 (s) = 0.5235s, γ1u (s) = 2.7s, γ21 (s) = 1.745s, γ22 (s) = 0.78675s, γ2u (s) = 2s. This yields the map Γ⊕ : R2+ → R2+ from (2) as Γ⊕ ((s1 , s2 )) =  max{0.89s1 , 0.5235s2 } max{1.745s1 , 0.78675s2 }  . (37) Since γ11 < id, γ22 < id and γ12 ◦ γ21 < id, we conclude from the cycle condition, Proposition 2.4, that the small-gain condition (4) is satisfied. Hence, from Corollary 5.8 we can now conclude that the origin of system (35) is expISS. Remark 6.1 The small-gain results in Section 5, and in particular Corollary 5.8, prove the ISS property of the interconnected system (6) by constructing a dissipative finite-step ISS Lyapunov function. The following shows that this construction is straightforward to implement. Consider system (35) and the map Γ⊕ derived in (37). We use the method proposed in 0.5r ) that satisfies [11] to compute an Ω-path σ̃(r) := ( 0.9r     0.47115r 0.5r Γ⊕ (σ̃(r)) = < = σ̃(r) 0.8725r 0.9r for all r > 0. From the proof of Corollary 5.8 we can now conclude that V (ξ) := max σ̃i−1 (Vi (ξi )) = max{2|ξ1 |, 10 9 |ξ2 |} i is a dissipative finite-step ISS Lyapunov function for the overall system (35). In particular, following the proof of Corollary 5.8, we compute ρ(s) := max σ̃i−1 ◦ γij ◦ σ̃j (s) = 0.9695s, i,j∈{1,2} and, σ(s) := max σ̃i−1 ◦ γiu = 5.4s i∈{1,2} for which V satisfies V (x(3, ξ, u(·)) ≤ ρ(V (ξ)) + σ(kuk∞ ) for all ξ ∈ R2 . 24 Remark 6.2 Although the construction of the dissipative finite-step ISS Lyapunov function via the small-gain approach (Procedure 5.10) requires the computation of an Ω-path, we believe that for large-scale interconnections the small-gain approach is still more advisable than a direct search for a dissipative finite-step ISS Lyapunov function (e.g. following Procedure 4.7). The reason for this belief is that the choice of a suitable natural number M in Procedure 4.7 might be, in general, much higher than the choice for a suitable natural number M in Procedure 5.10. For instance, consider system (35). As shown above, Procedure 5.10 can be applied for M = 3. On the other hand, to make computations of norm estimates simpler, consider the 1-norm | · |1 . Then we obtain |x(3, ξ, u(·))| ≤ 1.2225|ξ1 | + 0.655125|ξ2 | + 4.7 kuk∞ by following similar computations as above using (36). Hence, V (·) := | · |1 cannot be a dissipative finite-step ISS Lyapunov function with M = 3. Similar estimates also show that V is not a dissipative finite-step ISS Lyapunov function for M < 3. Thus, Procedure 4.7 for V (·) := | · |1 requires that M > 3. 7 Conclusion In this work we introduced the notion of dissipative finite-step ISS Lyapunov functions as a relaxation of ISS Lyapunov functions. These finite-step ISS Lyapunov functions were shown to be necessary and sufficient to conclude ISS of the underlying discrete-time system. In particular, for expISS system, norms are always dissipative finite-step ISS Lyapunov functions. Furthermore, we stated relaxed ISS small-gain theorems that drop the common assumption of small-gain theorems that the subsystems are ISS. ISS of the overall systems was then proven by constructing a dissipative finite-step ISS Lyapunov function. For the class of expISS systems, these small-gain theorems are shown to be non-conservative, i.e., necessary and sufficient to conclude ISS of the overall system. An example showed how the results can be applied. A The proofs in Section 4 require the following lemmas. A.1 A comparison lemma The following lemma is a particular comparison lemma for finite-step dynamics. Lemma A.1 Let M ∈ N\{0}, L ∈ N ∪ {∞}, k0 ∈ {0, . . . , M − 1}, and y : N → R+ be a function satisfying y ((l + 1)M + k0 ) ≤ χ (y(lM + k0 )) , ∀ l ∈ {0, . . . , L}, (38) where χ ∈ K∞ satisfies χ < id. Then there exists a KL-function βk0 such that the function y also satisfies y(lM + k0 ) ≤ βk0 (y(k0 ), lM + k0 ), ∀ l ∈ {0, . . . , L}. 25 In addition, if (38) is satisfied for all k0 ∈ {0, . . . , M − 1} then there exists a KL-function max := max{y(0), . . . , y(M − 1)} we have β such that with yM max y(k) ≤ β(yM , k), ∀k ∈ {0, . . . , (L + 1)M − 1}. Proof. Let M ∈ N\{0}, L ∈ N ∪ {∞} and k0 ∈ {0, . . . , M − 1}. From (38) and the monotonicity property of χ ∈ K∞ , we obtain y ((l + 1)M + k0 ) ≤ χ (y(lM + k0 )) ≤ . . . ≤ χl+1 (y(k0 )) for all l ∈ {0, . . . , L}. Note that since χ < id we have χl > χl+1 , and χl (s) → 0 as l → ∞ for any s ∈ R+ . Define tk0 ,l := lM + k0 and t+ k0 ,l := (l + 1)M + k0 for all l ∈ N. Let βk0 : R+ × R+ → R+ be defined by ( 1  −1 (s) + (r + M − k ) id(s) (t − r)χ 0 k ,0 0 M   r ∈ [0, tk0 ,0 ), s ≥ 0 βk0 (s, r) := + 1 l l+1 (s) r ∈ [tk0 ,l , t+ k0 ,l ), s ≥ 0. M (tk0 ,l − r)χ (s) + (r − tk0 ,l )χ Note that this construction is similar to the one proposed in [21, Lemma 4.3]. Clearly, βk0 is continuous and βk0 (·, r) is a K-function for any fixed r ≥ 0. On the other hand, for any fixed s ≥ 0, βk0 (s, ·) is an L-function, as it is linear affine on any interval [tk0 ,l , t+ k0 ,l ] and strictly decreasing by βk0 (s, tk0 ,l ) = χl (s) > χl+1 (s) = βk0 (s, t+ k0 ,l ). Hence, βk0 ∈ KL. Moreover, for all l ∈ {0, . . . , L} we have y(lM + k0 ) ≤ χl (y(k0 )) = βk0 (y(k0 ), lM + k0 ) , which shows the first assertion of the lemma. Now let (38) be satisfied for all k0 ∈ {0, . . . , M − 1}. Define β(s, r) := max k0 ∈{0,...,M −1} βk0 (s, r), which is again a function of class KL. For any k ∈ {0, . . . , (L + 1)M − 1} there exist unique l ∈ {0, . . . , L} and k0 ∈ {0, . . . , M − 1} such that k = lM + k0 , and we have max max y(k) = y(lM + k0 ) ≤ χl (y(k0 )) = βk0 (y(k0 ), lM + k0 ) ≤ βk0 (yM , k) ≤ β(yM , k) max := max{y(0), . . . , y(M − 1)}. This concludes the proof. with yM  If the function χ in Lemma A.1 is linear, then the KL-function β has a simpler form as we will see in the next lemma. Lemma A.2 Let the assumptions of Lemma A.1 be satisfied for all k0 ∈ {0, . . . , M − 1} max := max{y(0), . . . , y(M − 1)}, then for all k ∈ with χ(s) = θs and θ ∈ (0, 1). Let yM {0, . . . , (L + 1)M − 1} we have y max y(k) ≤ M θ k/M . θ Proof. A direct computation yields that for any k0 ∈ {0, . . . , M − 1}, and any l ∈ {0, . . . , L} we have y(lM + k0 ) ≤ χ(y((l − 1)M + k0 )) ≤ χl (y(k0 )) = θ l y(k0 ). Hence, for any k = lM + k0 ≤ (L + 1)M − 1, with l ∈ {0, . . . , L} and k0 ∈ {0, . . . , M − 1} we have y(k) ≤ max max k/M −1 {y(k0 )θ l } ≤ yM θ . k0 ∈{0,...,M −1} This proves the lemma.  26 A.2 Bounds on trajectories As noted in Remark 3.3 the requirement on the existence of K-functions ω1 , ω2 satisfying (7) in Assumption 3.1 is a necessary condition for system (6) to be ISS. The following lemma states that under the assumption of global K-boundedness any trajectory of system (6) has a global K-bound for any time step. This result is needed in Theorem 4.1 to show that the existence of a dissipative finite-step ISS Lyapunov function implies ISS of system (6). Lemma A.3 Let system (6) satisfy Assumption 3.1. Then for any j ∈ N there exist Kfunctions ϑj , ζj such that for all ξ ∈ Rn , and all u(·) ∈ l∞ (Rm ) we have |x(j, ξ, u(·))| ≤ ϑj (|ξ|) + ζj (kuk∞ ). (39) Before we prove this lemma we note that, as shown in Remark 3.3, any trajectory of an ISS system has a uniform global K-bound, i.e., (39) is satisfied by taking ϑj (·) = β(·, 1) and ζj (·) = γ(·). On the other hand, if the system is not globally stable then we cannot find uniform global K-bounds upper bounding the functions ϑj ∈ K, j ∈ N, and ζj ∈ K, j ∈ N, in (39). Proof. We prove the result by induction. Take any ξ ∈ Rn and any input u(·) ∈ l∞ (Rm ). For j = 0 we have |x(0, ξ, u(·))| = |ξ| satisfying (39) with ϑ0 = id and arbitrary ζ0 ∈ K. For j = 1 it follows by Assumption 3.1 that |x(1, ξ, u(·))| ≤ ω1 (|ξ|) + ω2 (kuk∞ ). So we can take ϑ1 := ω1 and ζ1 := ω2 . Now assume that there exist ϑj , ζj ∈ K satisfying (39) for some j ∈ N. Then |x(j + 1, ξ, u(·))| = |G(x(j, ξ, u(·)), u(j))| ≤ ω1 (|x(j, ξ, u(·))|) + ω2 (kuk∞ ) ≤ ω1 (ϑj (|ξ|) + ζj (kuk∞ )) + ω2 (kuk∞ ) ≤ ω1 (2ϑj (|ξ|)) + ω1 (2ζj (kuk∞ )) + ω2 (kuk∞ ) =: ϑj+1 (|ξ|) + ζj+1 (kuk∞ ). By induction, the assertion holds for all j ∈ N.  If the functions ω1 , ω2 in (7) are linear then the functions ϑj , ζj in Lemma A.3 are also linear, and have an explicit construction in terms of ω1 , ω2 . Lemma A.4 Let system (6) satisfy Assumption 3.1 with linear functions ω1 (s) := w1 s and ω2 (s) = w2 s, where w1 , w2 > 0. Then (39) is satisfied with ϑj (s) = w1j s and ζj = Pj−1 i w2 i=0 w1 s. Proof. The proof follows using the variation of constants formula.  References [1] D. Aeyels and J. Peuteman. A new asymptotic stability criterion for nonlinear time-variant differential equations. IEEE Trans. Autom. Control, 43(7):968–971, 1998. [2] R. P. Agarwal. Difference equations and inequalities, volume 155 of Monographs and Textbooks in Pure and Applied Mathematics. Marcel Dekker Inc., New York, 1992. [3] D. Angeli. Intrinsic robustness of global asymptotic stability. Systems Control Lett., 38(4):297– 307, 1999. 27 [4] V. D. Blondel and J. N. Tsitsiklis. Complexity of stability and controllability of elementary hybrid systems. Automatica J. IFAC, 35(3):479–489, 1999. [5] S. N. Dashkovskiy, B. S. Rüffer, and F. R. Wirth. An ISS small gain theorem for general networks. Math. Control Signals Systems, 19:93–122, 2007. [6] S. N. Dashkovskiy, B. S. Rüffer, and F. R. Wirth. Small gain theorems for large scale systems and construction of ISS Lyapunov functions. SIAM J. Control Optim., 48:4089–4118, 2010. [7] R. Geiselhart. Advances in the stability analysis of large-scale discrete-time systems. PhD thesis, Julius-Maximilians-Universität, Würzburg, Germany, 2015. https://opus.bibliothek.uniwuerzburg.de/files/11296/Geiselhart thesis.pdf [8] R. Geiselhart, R. H. Gielen, M. Lazar, and F. R. Wirth. An alternative converse Lyapunov theorem for discrete-time systems. Systems Control Lett., 70:49–59, August 2014. [9] R. Geiselhart, M. Lazar, and F. R. Wirth. A Relaxed Small-Gain Theorem for Interconnected Discrete-Time Systems. IEEE Trans. Autom. Control, 60(3):812-817, 2015. [10] R. Geiselhart and F. Wirth. Solving iterative functional equations for a class of piecewise linear K∞ -functions. J. Math. Anal. Appl., 411(2):652–664, 2014. [11] R. Geiselhart and F. R. Wirth. Numerical construction of LISS Lyapunov functions under a small-gain condition. Math. Control Signals Systems, 24:3–32, 2012. [12] R. Geiselhart and F. R. Wirth. On maximal gains guaranteeing a small-gain condition. SIAM J. Control Optim., 53(1):262–286, 2015. [13] R. Gielen and M. Lazar. Non-conservative dissipativity and small-gain conditions for stability analysis of interconnected systems. In Proc. 51th IEEE Conf. Decis. Control, pages 4187–4192, Maui, HI, Dec.10-13 2012. [14] L. Grüne and C. M. Kellett. ISS-Lyapunov functions for discontinuous discrete-time systems. IEEE Trans. Autom. Control, 59(11), May 2014. [15] W. Hahn. Stability of Motion., volume 138. Springer, Berlin, xii edition, 1967. [16] Z.-P. Jiang, Y. Lin, and Y. Wang. Nonlinear small-gain theorems for discrete-time feedback systems and applications. Automatica J. IFAC, 40(12):2129–2136, 2004. [17] Z.-P. Jiang, Y. Lin, and Y. Wang. Nonlinear small-gain theorems for discrete-time large-scale systems. In Proc. 27th Chinese Control Conf., pages 704–708, Kumming, Yunnan, China, July 16-18 2008. [18] Z.-P. Jiang, I. M. Y. Mareels, and Y. Wang. A Lyapunov formulation of the nonlinear small-gain theorem for interconnected ISS systems. Automatica J. IFAC, 32(8):1211–1215, 1996. [19] Z.-P. Jiang, A. R. Teel, and L. Praly. Small-gain theorem for ISS systems and applications. Math. Control Signals Systems, 7(2):95–120, 1994. [20] Z.-P. Jiang and Y. Wang. Input-to-state stability for discrete-time nonlinear systems. Automatica J. IFAC, 37(6):857–869, 2001. [21] Z.-P. Jiang and Y. Wang. A converse Lyapunov theorem for discrete-time systems with disturbances. Systems Control Lett., 45(1):49–58, 2002. [22] D. Kazakos and J. Tsinias. The input to state stability condition and global stabilization of discrete-time systems. IEEE Trans. Automat. Control, 39(10):2111–2113, 1994. [23] C. M. Kellett. A compendium of comparison function results. Math. Control Signals Syst., 26(3):339–374, 2014. 28 [24] C. M. Kellett and P. M. Dower. Stability of (integral) Input-to-State Stable Interconnected Nonlinear Systems via Qualitative Equivalences. In Control Conference (AUCC), 2013 3rd Australian, pages 41–46, November 2013. [25] C. M. Kellett and A. R. Teel. Discrete-time asymptotic controllability implies smooth controlLyapunov function. Systems Control Lett., 52(5):349–359, 2004. [26] D. S. Laila and A. Astolfi. Input-to-state stability for discrete-time time-varying systems with applications to robust stabilization of systems in power form. Automatica J. IFAC, 41(11):1891– 1903, 2005. [27] D. S. Laila and D. Nešić. Discrete-time Lyapunov-based small-gain theorem for parameterized interconnected ISS systems. IEEE Trans. Autom. Control, 48(10):1783–1788, 2003. [28] M. Lazar, A. I. Doban, and N. Athanasopoulos. On stability analysis of discrete–time homogeneous dynamics. In In Proc. of the 17th IEEE International Conference on Systems Theory, Control and Computing, pages 297 – 305, Sinaia, Romania, October 11-13 2013. [29] T. Liu, D. J. Hill, and Z.-P. Jiang. Lyapunov formulation of the large-scale, ISS cyclic-small-gain theorem: The discrete-time case. Systems Control Lett., 61(1):266–272, 2012. [30] P. Moylan and D. Hill. Stability criteria for large-scale systems. IEEE Trans. Autom. Control, 23(2):143–149, 1978. [31] B. S. Rüffer. Monotone dynamical systems, graphs, and stability of large-scale interconnected systems. PhD thesis, Universität Bremen, Germany, August 2007. [32] B. S. Rüffer. Monotone inequalities, dynamical systems, and paths in the positive orthant of Euclidean n-space. Positivity, 14(2):257–283, 2010. [33] D. D. Šiljak. Large-Scale Dynamic Systems, volume 3 of North-Holland Series in System Science and Engineering. North-Holland Publishing Co., New York, 1979. [34] E. D. Sontag. Smooth stabilization implies coprime factorization. IEEE Trans. Autom. Control, 34(4):435–443, 1989. [35] E. D. Sontag and Y. Wang. On characterizations of the input-to-state stability property. Systems Control Lett., 24(5):351–359, 1995. [36] M. Vidyasagar. Input-Output Analysis of Large-Scale Interconnected Systems, volume 29 of Lecture Notes in Control and Information Sciences. Springer, Berlin, 1981. 29
3cs.SY
arXiv:1709.02062v1 [math.ST] 7 Sep 2017 On the quasi-Latin hypercube property of some lattice-based designs Xu He Academy of Mathematics and System Sciences, Chinese Academy of Sciences September 8, 2017 Abstract Recently, two types of space-filling designs are proposed for computer experiments: rotated sphere packing designs and interleaved lattice-based minimax distance designs. Both types of designs are lattice-based designs that consist of the points of a lattice that are located in the design space. Designs based on a lattice L are called quasi-Latin hypercube designs if there exist positive constants c1 and c2 such that any one-dimensional projection of any n-point L-based design has separation distance no less than c1 /n and fill distance no more than c2 /n. In this paper, we show that thinnest covering, integer lattice and interleaved lattice-based designs, after suitable rotation, are quasi-Latin hypercube designs for two, three, four, six and eight dimensions. These results indicate that excellent distance properties and good projective properties can be achieved simultaneously by several types of lattice-based designs. Keywords: Design of experiment; Geometry of numbers; Maximin distance design; Minkowski’s first theorem. 1 Introduction Computer experiments have become powerful tools to simulate real systems (Sacks et al., 1989; Santner et al., 2003). It is commonly believed that design points of computer experiments shall be space-filling, i.e., in some sense “uniformly” scattered in the design space. A design with n points in the p-dimensional design space [0, 1]p is called a Latin hypercube design if one-dimensional projections of the design consist of {1/(2n), 3/(2n), . . . , (2n − 1)/(2n)} (McKay et al., 1979). Such designs hold optimal one-dimensional projective uniformity. 1 Given specific p and n, there are many different Latin hypercube designs. It is a common practice to further select one design among them by following another uniformity criterion. Two popular uniformity measures are separation distance and fill distance. The L2 separation distance of a design D is the minimal L2 distance among a pair of design points, minx1 ,x2 ∈D kx1 − x2 k2 ; and the L2 fill distance of a design D is the supreme predictive distance of any position in the design space, supy∈[0,1]p (minx∈D ky − xk2 ). As discussed in Haaland et al. (2017), designs with high separation distance or low fill distance are desirable for Gaussian process emulation of computer experiments. Designs with maximum separation distance and minimum fill distance are called maximin and minimax distance designs, respectively (Johnson et al., 1990). Designs with near-optimal separation and fill distance among the class of Latin hypercube designs are called maximin and minimax distance Latin hypercube designs, respectively (Morris and Mitchell, 1995; van Dam, 2008). The Latin hypercube property has been combined with other uniformity properties which produces maximum projection Latin hypercube designs (Joseph et al., 2015), orthogonal arrays based Latin hypercube designs (Tang, 1993), orthogonal Latin hypercube designs (Steinberg and Lin, 2006; Sun et al., 2009), among others. Designs with optimal separation or fill distance are seldom Latin hypercube designs. Therefore, there is a trade-off between unprojected distance property and one-dimensional projective uniformity. Remark that the Latin hypercube constraint not only ensures projective uniformity but also reduces computation for numerical optimization algorithms, e.g., the simulated annealing algorithm used in generating maximin distance Latin hypercube designs (Morris and Mitchell, 1995). Latin hypercube designs are popular partially because of this. However, more often than not unprojected distance properties are more important than one-dimensional projective uniformity, and it is reasonable to consider designs which hold good one-dimensional projective uniformity but are not so good as Latin hypercube designs (van Dam et al., 2007). An infinite sequence of space-filling designs with the same p and increasing n are called quasi-Latin hypercube designs if there exist positive constants c1 , c2 > 0 such that one-dimensional projections of any n-point design have separation distance no less than c1 /n and fill distance no more than c2 /n (He, 2016). Remark that c1 = c2 = 1 for Latin hypercube designs. Although inferior to Latin hypercube designs, 2 quasi-Latin hypercube designs hold good one-dimensional projective uniformity. Recently, two types of lattice-based designs were proposed. A lattice in Rp is a set of points that form a group. A lattice-based design consists of the lattice points that are located in the design space. The first type of lattice-based designs, rotated sphere packing designs (He, 2016), are constructed by rescaling, rotating, translating and extracting the points of a lattice. By using thinnest coverings which are lattices with optimal asymptotic fill distance, such designs hold excellent distance-based uniformity. Numerical results suggest that such designs achieve good projective uniformity as well. In particular, rotated sphere packing designs with one given rotation angle were proved to be quasi-Latin hypercube designs when p = 2. Another type of lattice-based designs is interleaved lattice-based minimax distance designs (He, 2017a) which are constructed by heterogeneously rescaling, translating and exacting points of standard interleaved lattices. Such designs hold by far best fill distance for medium to large n but poor one-dimensional projective uniformity. It was unknown if interleaved lattices can be rotated into designs with good projective uniformity. In this paper, we propose a theoretical framework to verify the quasi-Latin hypercube property of lattice-based designs. Using this framework, we show many types of lattices can be rotated into quasi-Latin hypercube designs when p = 2, 3, 4, 6 or 8. Such lattices include thinnest coverings, integer lattices, interleaved lattices and sublattices of them. These results corroborate the good projective uniformity of rotated sphere packing designs, provide hints on how should we rotate them, and show the potential of rotating interleaved lattice-based designs. The rest of the paper is organized as follows: We first give some definitions in Section 2. Section 3 gives a sufficient condition for the quasi-Latin hypercube property. Sections 4-6 provide our arguments for integer lattices and thinnest coverings with p being power of two, three and six, respectively. Section 7 extends our results to broader types of lattices including interleaved lattices. Section 8 concludes with some brief discussion. Some proofs are provided in the appendix. 3 2 Notation and background In this section, we provide the definition and some background of lattice-based designs. A set of points L ⊂ Rp is called a lattice in p dimensions with full rank and G a generator matrix of L if G is a nonsingular p × p matrix and  L = aT G : a ∈ Zp . For instance, Zp is called the p-dimensional integer lattice and Ip , the p-dimensional identity matrix, is one generator matrix of Zp . Throughout this paper, assume L is generated from G and write a = (a1 , . . . , ap )T . The Voronoi cell of a point x ∈ L is the set of points closer to x than other lattice points. The volume of any Voronoi cell is | det(G)|. Let ρs (L) and ρc (L) denote the minimum and maximum distance from points on the boundary of a Voronoi cell to its center, respectively. The density and thickness of L is the volume of a unit sphere in p dimensions with radius ρs (L) and ρc (L) divided by | det(G)|, respectively. The lattice in p dimensions with highest density and lowest thickness among known lattices is called the p-dimensional densest packing and thinnest covering, respectively. In particular, for 2 ≤ p ≤ 22, the p-dimensional thinnest covering can be generated by Gp = [{(p + 1) − p p p + 1}Ip − Jp ]( p + 1 − 1)−1 (p + 1)−(p−1)/(2p) , (1) where Jp is the p × p matrix with all entries being one. Here | det(Gp )| = 1. Refer to Conway and Sloane (1998) or Zong (1999) for a comprehensive review of lattices. Suppose L1 and L2 are two lattices in p dimensions with full rank. If L1 is a subset of L2 , we call L1 a sublattice of L2 and L2 a superlattice of L1 . Suppose G1 and G2 are generator matrices of L1 and L2 , respectively, then there exists an integer matrix H such that G1 = HG2 (Siegel, 1989). Asymptotically L2 ∩ [−m, m]p has | det(H)| = | det(G1 )|/| det(G2 )| times as many points as L1 ∩ [−m, m]p . A lattice is called a standard layered lattice if there exists a positive integer s such that it is a sublattice of Zp and a superlattice of {sx : x ∈ Z}p . A standard layered lattice with s = 2 is called a standard interleaved lattice (He, 2017a). Interleaved lattices used in He (2017a) are rationally rescaled standard interleaved lattices. 4 A p×p matrix R is called a rotation matrix if it is an orthogonal matrix and det(R) = 1. Clearly, a rotated lattice retain the same distance properties as the original lattice but may hold dramatically different projective uniformity. A set D is called an L-based design if there exists a δ ∈ Rp such that   D = (n| det(G)|)−1/p {(L ⊗ R) ⊕ δ} ∩ [0, 1]p , (2) where (L ⊗ R) ⊕ δ is the lattice generated by GR and translated by δ. Clearly, L has infinitely many points but D has finitely many points. It was shown in He (2016) that D has roughly n points and for any G, R and n, proper δ exists such that D has exactly n points. Lattice-based designs generated from densest packing and thinnest covering have asymptotically optimal separation and fill distances, respectively. As a result, He (2016) recommended to use thinnest coverings to construct lattice-based designs. A lattice L⊗R is said to hold the quasi-Latin hypercube property if there exists c1 , c2 > 0 such that for any δ ∈ Rp , 1 ≤ k ≤ p and m, the lattice (L ⊗ R) ⊕ δ meets the following conditions: (i) suppose x1 , x2 ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p and x1 6= x2 , then kx1,k − x2,k k ≥ c1 | det(G)|m−p+1 ; (ii) suppose m ≥ c2 | det(G)|m−p+1 and z ∈ [−m, m], then there exists an x ∈ {(L⊗R)⊕δ}∩[−m, m]p such that z −c2 | det(G)|m−p+1 ≤ xk ≤ z +c2 | det(G)|m−p+1 . If L ⊗ R holds the quasi-Latin hypercube property, then any single-dimensional projection of any n-point (L⊗R)-based design has separation distance no less than c1 /n and fill distance no more than c2 /n. 3 A sufficient condition We first give a sufficient condition for the last dimensional projection of L ⊗ R having high separation distance. Clearly, such L⊗R should in the first place has nonidentical values for the projection. Let P1 (a) denote the last entry of aT GR. Then P1 (a) should be nonzero for any nonzero a ∈ Zp . Treat P1 (a) as a first-degree homogeneous polynomial of a. Clearly, the condition cannot be satisfied if all coefficients of P1 (a) are rational. Usually, we can find a real number w1 6= 0 and a set γ ⊂ {1} ∪ (R \ Q) such that any coefficient of w1 P1 (a) can be expressed as a linear combination of elements of γ with integer coefficients and any element of γ cannot be expressed as a linear combination of other elements with rational 5 coefficients. Then we can express P1 (a) as P1 (a) = aT Br/w1, where r is a vector consisting of the elements of γ and B is a matrix with integer entries. Then P1 (a) 6= 0 for any nonzero a ∈ Zp if and only if B has full row rank p. Proposition 3.1. Suppose P1 (a) 6= 0 for any nonzero a ∈ Zp and there exists a homogeneous p-degree polynomial P (a) such that P1 (a) divides P (a) and |P (a)| ≥ 1 for any nonzero a ∈ Zp . Then there exists a c1 > 0 such that for any x1 , x2 ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p and x1 6= x2 , we have kx1,p − x2,p k ≥ c1 | det(G)|m−p+1. Proof. Without lose of generality assume | det(G)| = 1. Clearly, we can write P (a)/P1 (a) as P (a)/P1 (a) = M X i=1 bi p Y d aj i,j j=1 with an M ∈ N, b1 , . . . , bm ∈ R, di,j ∈ N ∪ {0} and P j ! di,j = p − 1 for any i. Let b = max(|bi |), u be the maximum absolute value of entries of (GR)−1 , and c1 = {bM(2up)p−1 }−1 . Let x = x1 −x2 , then we can write x = aT GR ∈ L with an a ∈ Zp . Because x ∈ [−2m, 2m]p , p−1 a ∈ [−2pum, 2pum]p and |P (a)/P1(a)| ≤ Mb(2pum)p−1 = c−1 . Because |P (a)| ≥ 1, 1 m |P1 (a)| ≥ c1 m−p+1 . The next result shows the connection between high projective separation distance and low projective fill distance for lattice-based designs. Proposition 3.2. Suppose there exists a c1 ≥ 0 such that for any x1 , x2 ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p and x1 6= x2 , kx1,p − x2,p k ≥ c1 | det(G)|m−p+1. (3) Then there exists a c2 > 0 such that for any m ≥ c2 | det(G)|m−p+1 and z ∈ [−m, m], there exists an x ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p such that z − c2 | det(G)|m−p+1 ≤ xp ≤ z + c2 | det(G)|m−p+1. Proof of Proposition 3.2 uses Minkowski’s first theorem (Siegel, 1989), a fundamental result of the branch of number theory called the geometry of numbers. The proof of Proposition 3.2 is deferred to the appendix. 6 Lemma 3.3 (Minkowski’s first theorem). Suppose L is a lattice generated from G with | det(G)| = 1. Then any convex set in Rp which is symmetric with respect to the origin and with volume greater than 2p contains a non-zero lattice point of L. From above propositions, our general strategy is to first define proper R and P (a) and then verify the property of P1 (a) and P (a) for each dimension. In sections to follow, we provide proper definition of R and P (a) for a number of lattices. 4 Two, four and eight dimensions For p = 2z , we define R = Rp as follows: Firstly, let   √ p q1 1  / q1 + 1, R2 =  √ −1 q1 √ where q1 is a positive integer such that q1 is irrational. Secondly, let    √ p ql Iy Iy Ry 0  / ql + 1,  R2y =  √ ql Iy −Iy 0 Ry √ where 2y = 2l , ql is an integer coprime to q1 , . . . , ql−1 and ql is irrational. Clearly, such defined Rp ’s are rotation matrices. For instance, when q1 = 2 and q2 = 3,  √  √ √ 6 3 2 1  √ √   − 3 √6 √ −1 2    R4 =  √ √ √  /(2 3).  − 2 −1 6 3    √ √ √ 1 − 2 − 3 6 √ √ √ √ Let r = (1, q1 , q2 , q1 q2 , . . . , q1 · · · qz )T . If there exists a w > 0 such that the entries of wG can be expressed as linear combinations of entries of r with integer coefficients, we can express P1 (a) as P1 (a) = X Qi (a) i∈{0,1}z z Y i /2 qjj j=1 ! / w z Y p j=1 ! qj + 1 , where Qi (a) are polynomials of a with integer coefficients. For any k ∈ {0, 1}z , let ) ( z   X Y ij /2 k j ij P̃k (a) = qj (−1) . Qi (a) j=1 i∈{0,1}z 7 Let P (a) = Q k∈{0,1}z P̃k (a). It is not hard to see that P (a) is a homogeneous p-degree polynomial of a with integer coefficients and P1 (a) divides P (a). Clearly, we can express P̃k (a) as P̃k (a) = aT B̃k r with an integer matrix B̃k for any k. If we verify that B̃k has full rank p for any k, we have P̃k (a) 6= 0 for any nonzero a ∈ Zp . Thus, P (a) 6= 0 for any nonzero a ∈ Zp . Because P (a) has integer coefficients, |P (a)| ≥ 1 for any nonzero a ∈ Zp . √ √ √ √ For G = Ip , we have P1 = aT Br/w1 with r = (1, q1 , q2 , q1 q2 , . . ., q1 · · · qz )T , Q p w1 = zj=1 qj + 1, B = Ip and B has full rank. Similarly, any B̃k has full rank. As a result, P1 (a) 6= 0 for any nonzero a ∈ Zp and |P (a)| ≥ 1 for any nonzero a ∈ Zp . The quasi-Latin hypercube property of the two-dimensional thinnest covering was ob√ tained in He (2016). For the four-dimensional thinnest covering, G = G4 = {(5 − 5)I4 − √ J4 }/w in (1) with w = ( 5−1)53/8 . We set q1 = 5 and q2 = 2, which yields P1 = aT Br/w1 , √ √ √ √ r = {1, 5, 2, 10}, w1 = 3 2w and   4 −2 −1 −1    −6 4 −1 −1    B= .  −1 −1 4 −2    −1 −1 −6 4 Clearly, B has full rank. We can similarly verify that B̃k has full rank for any k. As a result, P1 (a) 6= 0 for any nonzero a ∈ Zp and |P (a)| ≥ 1 for any nonzero a ∈ Zp . For the eight-dimensional thinnest covering, G = G8 = (6I8 − J8 )/w in (1) with w = √ √ √ √ √ √ √ 2 · 97/16 . Clearly, P1 = aT Br/w1, r = {1, q1 , q2 , q1 q2 , q3 , q1 q3 , q2 q3 , q1 q2 q3 }, Q p w1 = w 3j=1 qj + 1, B = 6I8 − J8 and B has full rank. We can similarly verify that B̃k has full rank for any k. As a result, P1 (a) 6= 0 for any nonzero a ∈ Zp and |P (a)| ≥ 1 for any nonzero a ∈ Zp . We have verified the sufficient condition proposed in Section 3 for the last dimension. Similarly verify the condition for other dimensions, we obtain the following theorem: Theorem 4.1. (i) Suppose G = Ip , p = 2z , z ∈ N, R = Rp with coprime q1 , . . . , qz and √ qi is irrational for any i = 1, . . . , z. Then the lattice L ⊗ R generated from GR holds 8 the quasi-Latin hypercube property. (ii) Suppose G = G4 in (1), R = Rp with q1 = 5 and q2 = 2. Then the lattice L⊗R generated from GR holds the quasi-Latin hypercube property. √ (iii) Suppose G = G8 in (1), R = Rp with coprime q1 , q2 , q3 and qi is irrational for any i = 1, 2, 3. Then the lattice L ⊗ R generated from GR holds the quasi-Latin hypercube property. 5 Three dimensions For three dimensions, let  1−q q − q 1/3 (1 − q)(q 1/3 + q 2/3 )   R3 =  q − q 1/3 (1 − q)(q 1/3 + q 2/3 ) 1−q  (1 − q)(q 1/3 + q 2/3 ) 1−q q − q 1/3     /w̄,  where w̄ = (q 10/3 + 2q 3 + q 8/3 − 2q 7/3 − 2q 2 − 2q 5/3 − q 4/3 + 2q 2/3 + 1)1/2 . It is easy to check that R3 is a rotation matrix. Assume q is an integer and q 1/3 is an irrational number. For G = I3 , we have P1 (a) = [{a2 (1 − q) + a3 q} + {a1 (1 − q) − a3 }q 1/3 + {a1 (1 − q)}q 2/3 ]/w̄, Here P1 = aT Br/w1 , r = {1, q 1/3 , q 2/3 }, w1 = w̄ and  0 1−q 1−q   B = 1−q 0 0  q −1 0 Clearly, B has full rank. Let α0 = a2 (1 − q) + a3 q,    .  α1 = a1 (1 − q) − a3 , α2 = a1 (1 − q), P2 (a) = (α1 α2 q − α02 ) + (α0 α1 − α22 q)q 1/3 + (α0 α2 − α12 )q 2/3 , and P (a) = w1 P1 (a)P2 (a). Then P (a) = 3α0 α1 α2 q − α03 − α13 q − α23 q 2 . Clearly, P (a) is a homogeneous 3-degree polynomial with integer coefficients. 9 Next, we show P (a) 6= 0 unless α0 = α1 = α2 = 0. Suppose α0 , α1 , α2 are not all zero, then there exists an integer z such that q z divides α0 , α1 and α2 and q z+1 does not divide at least one of them. We consider three cases. Firstly, assume q z+1 does not divide α0 . Then q 3z+1 divides 3α0 α1 α2 q, α13 q and α23 q 2 but not α03 . Thus P (a) 6= 0. Secondly, assume q z+1 divides α0 but not α1 . Then q 3z+2 divides 3α0 α1 α2 q, α03 and α23 q 2 but not α13 q. Thus P (a) 6= 0. Thirdly, assume q z+1 divides α0 and α1 but not α2 . Then q 3z+3 divides 3α0 α1 α2 q, α03 and α13 q but not α23 q 2 . Thus P (a) 6= 0. Combining the three cases, P (a) = 0 if and only if α0 = α1 = α2 = 0. Because B has full rank, α0 = α1 = α2 = 0 if and only if a0 = a1 = a2 = 0. Therefore, P (a) 6= 0 for any a 6= 0. Because P (a) has integer coefficients, |P (a)| ≥ 1 for any nonzero a ∈ Zp . For G = G3 = (2Ip − Jp )2−2/3 in (1), let α0 = −a1 + (2 − q)a2 + (1 − q)a3 , α1 = (1 − 2q)a1 + qa2 + (q − 1)a3 , α2 = (2q − 1)a1 + (q − 2)a2 + (q − 1)a3 , P1 (a) = (α0 + α1 q 1/3 + α2 q 2/3 )/(22/3 w̄), P2 (a) = (α1 α2 q − α02 ) + (α0 α1 − α22 q)q 1/3 + (α0 α2 − α12 )q 2/3 , and P (a) = 22/3 w̄P1 (a)P2 (a). Clearly, P1 (a) = aT Br/w1 with r = {1, q 1/3 , q 2/3 }, w = 22/3 w̄,  −1 2−q 1−q   B =  1 − 2q q q−1  2q − 1 q − 2 q − 1    ,  and B has full rank for any integer q such that q 1/3 is irrational. It follows similarly that P (a) is a homogeneous 3-degree polynomial with integer coefficients and that |P (a)| ≥ 1 for any nonzero a ∈ Zp . From above arguments, we obtain the following theorem: Theorem 5.1. Suppose G = I3 or G = G3 in (1), R = Rp with integer q and irrational q 1/3 . Then the lattice L ⊗ R generated from GR holds the quasi-Latin hypercube property. 10 6 Six dimensions For six dimensions, let         R6 =   (q − q R2 R2 (q − q 1/3 )I2 (1 − q)I2 1/3  R2 )I2 (1 − q)(q 1/3 + q 2/3 )I2 (1 − q)(q 1/3 +q (1 − q)I2 2/3     (1 − q)(q 1/3 + q 2/3 )I2 )I2 (1 − q)I2 (q − q 1/3 )I2     /w̄.  where w̄ = (q 10/3 + 2q 3 + q 8/3 − 2q 7/3 − 2q 2 − 2q 5/3 − q 4/3 + 2q 2/3 + 1)1/2 . Clearly, R6 is a rotation matrix. For G = I6 , we have √ P1 (a) = [{a3 (1 − q) + a5 q} + {a4 (1 − q) + a6 q} q1 √ +{a1 (1 − q) − a5 }q 1/3 + {a2 (1 − q) − a6 } q1 q 1/3 √ +{a1 (1 − q)}q 2/3 + {a2 (1 − q)} q1 q 2/3 ]/w1 , p q1 + 1w̄, w1 = √ √ √ r = {1, q1 , q 1/3 , q1 q 1/3 , q 2/3 , q1 q 2/3 },   0 (1 − q)I2 (1 − q)I2     B =  (1 − q)I2  , 0 0   qI2 −I2 0 6×6 √ and P1 (a) = aT Br/w1 . Clearly, B has full rank. Let P̃1 (a) be aT Br with q1 replaced by √ − q1 . Then for any a 6= 0, P1 (a) 6= 0, P̃1 (a) 6= 0 and P1 (a)P̃1 (a) 6= 0. We can express w1 P1 (a)P̃1 (a) = α0 + α1 q 1/3 + α2 q 2/3 where α0 , α1 and α2 are homogeneous 2-degree polynomials of a with integer coefficients. Let P2 (a) = (α1 α2 q − α02 ) + (α0 α1 − α22 q)q 1/3 + (α0 α2 − α12 )q 2/3 , Then P (a) = w1 P1 (a)P̃1 (a)P2 (a) = 3α0 α1 α2 q − α03 − α13 q − α23 q 2 . 11 Clearly, P (a) is a homogeneous 6-degree polynomial with integer coefficients. From the arguments in the last section, P (a) = 0 only if P1 (a)P̃1 (a) = 0, which only occurs when a = 0. Thus, |P (a)| ≥ 1 for any nonzero a ∈ Zp . √ √ For G = G6 = {(7 − 7)I6 − J6 }/{( 7 − 1)75/12 } in (1), let q1 = 7, we √ √ √ √ aT Br/w1 with r = {1, 7, q 1/3 , 7q 1/3 , q 2/3 , 7q 2/3 }, w1 = 8w̄ and  −1 −1 −6q + 7 2q − 1 −6q + 6 2q − 2   −1 −1 8q − 7 −6q + 7 8q − 8 −6q + 6    −7q + 6 q − 2 q q q−1 q−1  B=  7q − 8 −7q + 6 q q q−1 q−1    7q − 1 −q − 1 q−7 q+1 q−1 q−1  −7q − 1 7q − 1 q+7 q−7 q−1 q−1 have P1 (a) =        .      We verify that B has full rank when q = 2. Define P̃1 (a), P2 (a) and P (a) similarly to the G = I6 case. Again, P (a) is a homogeneous 6-degree polynomial with integer coefficients and that P (a) = 0 only if a = 0. Thus, |P (a)| ≥ 1 for any nonzero a ∈ Zp . From above arguments, we obtain the following theorem: Theorem 6.1. (i) Suppose G = I6 , R = R6 with coprime q1 , q and √ q1 and q 1/3 are irra- tional numbers. Then the lattice L ⊗ R generated from GR holds the quasi-Latin hypercube property. (ii) Suppose G = G6 in (1), R = R6 with q1 = 7 and q = 2. Then the lattice L ⊗ R generated from GR holds the quasi-Latin hypercube property. 7 Extensions Results obtained in Sections 4-6 can be extended to broader classes of lattices. If one lattice holds the quasi-Latin hypercube property, then many of its related lattices hold the quasi-Latin hypercube property as well. Proposition 7.1 below gives such results. Proposition 7.1. Suppose L ⊗ R is a lattice generated by GR that holds the quasi-Latin hypercube property. Then (i) for any v 6= 0, the lattice generated by vGR holds the quasiLatin hypercube property; (ii) suppose H is a diagonal matrix with rational entries, then the lattice generated by GHR holds the quasi-Latin hypercube property; (iii) suppose K is a sublattice or superlattice of L, then K ⊗ R holds the quasi-Latin hypercube property. 12 The proof of Proposition 7.1 is provided in the appendix. Proposition 7.1(i) and (ii) show that if one lattice holds the quasi-Latin hypercube property after certain rotation, then it still holds the property after it is homogeneously or rationally rescaled and then rotated with the same angle. Remark that homogeneous (and in most cases irrational) rescaling is used in constructing rotated sphere packing designs (He, 2016) and rationally rescaling is used in constructing interleaved lattice-based designs (He, 2017a). From Proposition 7.1(i) and (ii), we can use the same rotation matrix for different rescalings without breaking the quasi-Latin hypercube property. Proposition 7.1(iii) shows that if one lattice holds the quasi-Latin hypercube property after certain rotation, then its sublattices and superlattices hold the property after the same rotation. Because interleaved lattices are rationally rescaled sublattices of integer lattices, our results for integer lattices apply to interleaved lattices. In other words, interleaved lattices can be rotated into quasi-Latin hypercube designs for p = 2z , 3, 6. Besides, sublattices of thinnest coverings are useful in constructing sliced rotated sphere packing designs (He, 2017b). From our results on thinnest coverings, these lattices can be rotated into quasi-Latin hypercube designs for p = 2, 3, 4, 6, 8. 8 Conclusions and discussion In this paper, we obtain the quasi-Latin hypercube property of several types of latticebased designs. These results cover integer and interleaved lattice-based designs for p = 2z , 3, 6 and thinnest covering-based designs for p = 3, 4, 6, 8. Our arguments are quite different from that used in He (2016) to prove the quasi-Latin hypercube property of two-dimensional thinnest covering-based designs. Because thinnest covering-based designs are mostly appealing for 2 ≤ p ≤ 6 (He, 2016) and interleaved lattice-based designs are mostly appealing for 2 ≤ p ≤ 8 (He, 2017a), our results cover the majority of lattices in use. Because thinnest covering or interleaved lattice-based designs have excellent distance properties for low p and that asymptotic distance properties of lattice-based designs are invariant to rotations, we conclude that in many cases excellent distance-based uniformity and good projective uniformity can be achieved simultaneously by lattice-based designs, at least for high n. In general the rotation step is necessary. For example, one-dimensional 13 projections of unrotated integer lattice has asymptotically 0 separation distance and n−1/p fill distance, which can be dramatically improved for p = 2z , 3, 6 cases. Unfortunately our theoretical framework is not general to arbitrary lattice or p. It is possible to apply our framework to other types of lattices, but separate derivations are required. We find the p = 5 and p = 7 cases very challenging. It is interesting to know if any lattice in p = 5 or 7 holds the quasi-Latin hypercube property. So far we have no counter example of a lattice that definitely cannot be rotated into quasi-Latin hypercube designs. One unsolved problem is the optimal choice of rotation matrix given certain lattice and n. Because distance properties of lattice-based designs are largely irrelevant to the rotation matrix, it makes sense to choose the rotation matrix that yields optimal projective uniformity. It was recommend in He (2016) to generate a number of random rotation matrices and choose the one with empirically the best projective uniformity. Our results may be useful for developing new strategies. This is a direction of future research. A Proofs Proof of Proposition 3.2. Without lose of generality assume c1 < 1, z ≤ 0 and | det(G)| = 1. Let ỹ = (ỹ1 , . . . , ỹp ) be the lattice point with highest pth dimensional value among points in {(L⊗R) ⊕δ} ∩([−m, m]p−1 ×(−∞, z)). Clearly such ỹ exists. Without lose of generality assume ỹj ≤ 0 for j = 1, . . . , p−1. If there is a point y ∈ (L⊗R)∩([0, m]p−1 ×(0, c2 m−p+1 ]), then ỹ + y ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p and z < ỹp + yp ≤ z + c2 m−p+1 . In the rest of the proof we show the existence of such y. When p = 2, from Minkowski’s first theorem, there exists an x̃1 such that x̃1 ∈ (L ⊗ R) ∩ ([−c1 m, c1 m] × [−1/(c1 m), 1/(c1 m)]) and x̃1 6= 0. Consider x̃1 and −x̃1 , there exists an x1 such that x1 ∈ (L ⊗ R) ∩ ([−c1 m, c1 m] × (0, 1/(c1m)]). From (3), there does not exist any lattice point in [−c1 m, c1 m] × [0, 1/m]. Therefore, 14 there exists an x1 such that x1 ∈ (L ⊗ R) ∩ ([−c1 m, c1 m] × (1/m, 1/(c1m)]). From Minkowski’s first theorem, there exists an x̃2 such that x̃2 ∈ (L ⊗ R) ∩ ([−m, m] × [−1/m, 1/m]). Consider x̃2 and −x̃2 , there exists an x2 such that x2 ∈ (L ⊗ R) ∩ ([−m, m] × [0, 1/m]). From (3), x2 ∈ (L ⊗ R) ∩ ([−m, m] × (0, 1/m]). Consider x1 , x2 and x1 − x2 . Let c2 = 1/c1 , there exists an x3 such that x3 ∈ (L ⊗ R) ∩ ([0, m] × (0, c2 m−1 ]). When p > 2, let b2 = [1 + cp1 {2(p − 2)}−p(p−2) ]−1 m, 2 b3 = cp1 {2(p − 2)}−(p−1) b2 , −(p−1)(p−2) b2 , b1 = cp−1 1 {2(p − 2)} ǫ1 = c−p 1 2 +p+1 ǫ2 = c−p 1 2 +2p −(p−1) {2(p − 2)}p(p−1)(p−2) b2 2 (p−2) {2(p − 2)}(p−1) −(p−1) b2 , . Then b3 < 2(p − 2)b3 ≤ b1 < b2 , ǫ1 > ǫ2 , (2ǫ1 )(2b1 )(2b3 )p−2 = 2p , −(p−1) ǫ2 = c1 b1 , (4) (5) (2ǫ2 )(2b2 )(2b3 )p−2 = 2p , (6) ǫ1 = c1 {2(p − 2)b3 }−(p−1) . (7) From Minkowski’s first theorem and (4), there exists an x̃1 such that x̃1 ∈ (L ⊗ R) ∩ ([−b1 , b1 ] × [−b3 , b3 ]p−2 × [−ǫ1 , ǫ1 ]) 15 and x̃1 6= 0. Consider x̃1 and −x̃1 , there exists an x1 such that x1 ∈ (L ⊗ R) ∩ ([−b1 , b1 ] × [−b3 , b3 ]p−2 × (0, ǫ1 ]). From (3) and (5), there does not exist any lattice point in [−b1 , b1 ]p−1 ×[0, ǫ2 ]. Therefore, there exists an x1 such that x1 ∈ (L ⊗ R) ∩ ([−b1 , b1 ] × [−b3 , b3 ]p−2 × (ǫ2 , ǫ1 ]). From Minkowski’s first theorem and (6), there exists an x̃2 such that x̃2 ∈ (L ⊗ R) ∩ ([−b2 , b2 ] × [−b3 , b3 ]p−2 × [−ǫ2 , ǫ2 ]). Consider x̃2 and −x̃2 , there exists an x2 such that x2 ∈ (L ⊗ R) ∩ ([−b2 , b2 ] × [−b3 , b3 ]p−2 × [0, ǫ2 ]). From (3), x2 ∈ (L ⊗ R) ∩ ([−b2 , b2 ] × [−b3 , b3 ]p−2 × (0, ǫ2 ]). Consider x1 , x2 and x1 − x2 . Then there exists an x3 such that x3 ∈ (L ⊗ R) ∩ ([0, b2 ] × [−2b3 , 2b3 ]p−2 × (0, ǫ1 ]). From (3) and (7), there does not exist any lattice point in [−2(p − 2)b3 , 2(p − 2)b3 ]p−1 × [0, ǫ1 ]. Therefore, there exists an x3 such that x3 ∈ (L ⊗ R) ∩ ((2(p − 2)b3 , b2 ] × [−2b3 , 2b3 ]p−2 × (0, ǫ1 ]). Let y1 = x3 . Similarly, for any k = 2, . . . , p − 1, there exists a yk ∈ (L ⊗ R) such that yk,p ∈ (0, ǫ1 ], yk,k ∈ (2(p − 2)b3 , b2 ] and yk,j ∈ [−2b3 , 2b3 ] for any j 6= p, j 6= k. Let P y = p−1 j=1 yj . Then y ∈ (L ⊗ R) ∩ ((0, b2 + 2(p − 2)b3 ]p−1 × (0, (p − 1)ǫ1 ]). Let c2 = (p − 1)c−p 1 2 +p+1 {2(p − 2)}p(p−1)(p−2) [1 + cp1 {2(p − 2)}−p(p−2) ]p−1 . Because b2 + 2(p − 2)b3 = m, we have y ∈ (L ⊗ R) ∩ ((0, m]p−1 × (0, c2 m−(p−1) ]). Combining the two cases of p completes the proof. 16 Proof of Proposition 7.1. Suppose kx1,k − x2,k k ≥ c1 | det(G)|m−p+1 for any δ ∈ Rp , k, m and x1 , x2 ∈ {(L ⊗ R) ⊕ δ} ∩ [−m, m]p . (i) Let K denote the lattice generated by vGR. Clearly, for any δ ∈ Rp , k, m and x1 , x2 ∈ {(K ⊗ R) ⊕ (vδ)} ∩ [−vm, vm]p , kx1,k − x2,k k ≥ vc1 | det(G)|m−p+1 . Therefore, for any δ ∈ Rp , k, m and x1 , x2 ∈ {(K ⊗ R) ⊕ δ} ∩ [−m, m]p , kx1,k − x2,k k ≥ c1 | det(vG)|m−p+1 . From Proposition 3.2, K holds the quasi-Latin hypercube property. (iii) Suppose K is a sublattice of L. Clearly, for any δ ∈ Rp , k, m and x1 , x2 ∈ {(K⊗R)⊕ δ} ∩ [−m, m]p , kx1,k − x2,k k ≥ c1 | det(G)|m−p+1 . Suppose HG is a generator matrix of K where H is an integer matrix. Let c̃1 = c1 / det(H), then kx1,k −x2,k k ≥ c̃1 | det(HG)|m−p+1 . From Proposition 3.2, K holds the quasi-Latin hypercube property. Suppose K is a superlattice of L. Assume F is a generator matrix of K, H is an integer matrix and G = HF . Because | det(H)| > 0, H is invertible. Clearly, H −1 is a rational matrix. Let M be the least common multiple of the denominators of entries of H −1 . Then MH −1 is an integer matrix and the lattice generated by MH −1 GR is a sublattice of L ⊗ R. From (i), the lattice generated by F R = H −1 GR holds the quasi-Latin hypercube property. (ii) Let M be the least common multiple of the denominators of entries of H. Then MH is a diagonal integer matrix and the lattice generated by MGH is a sublattice of L. From (iii) and (i), the lattice generated by GHR holds the quasi-Latin hypercube property. References Conway, J. H. and N. J. A. Sloane (1998). Sphere Packings, Lattices and Groups. New York: Springer. Haaland, B., W. Wang, and V. Maheshwari (2017). A framework for controlling sources of inaccuracy in gaussian process emulation of deterministic computer experiments. SIAM/ASA Journal on Uncertainty Quantification. Under review, arXiv:1411.7049v3. He, X. (2016). Rotated sphere packing designs. Journal of the American Statistical Association, to appear, DOI: 10.1080/01621459.2016.1222289. 17 He, X. (2017a). Interleaved lattice-based minimax distance designs. Biometrika 104, 713– 725. He, X. (2017b). Sliced rotated sphere packing designs. Technometrics. Under review, arXiv:1708.01414v1. Johnson, M. E., L. M. Moore, and D. Ylvisaker (1990). Minimax and maximin distance designs. Journal of Statistical Planning and Inference 26, 131–148. Joseph, V. R., E. Gul, and S. Ba (2015). Maximum projection designs for computer experiments. Biometrika 102 (2), 371–380. McKay, M. D., W. J. Conover, and R. J. Beckman (1979). A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics 21, 239–245. Morris, M. D. and T. J. Mitchell (1995). Exploratory designs for computational experiments. Journal of Statistical Planning and Inference 43 (3), 381–402. Sacks, J., W. J. Welch, T. J. Mitchell, and H. Wynn (1989). Design and analysis of computer experiments. Statistical Science 4, 409–423. Santner, T. J., B. J. Williams, and W. I. Notz (2003). The Design and Analysis of Computer Experiments. New York: Springer. Siegel, C. L. (1989). Lectures on the Geometry of Numbers. New York: Springer. Steinberg, D. M. and D. K. Lin (2006). A construction method for orthogonal Latin hypercube designs. Biometrika 93, 279–288. Sun, F., M. Liu, and D. K. J. Lin (2009). Construction of orthogonal Latin hypercube designs. Biometrika 96, 971–974. Tang, B. (1993). Orthogonal array-based Latin hypercubes. Journal of the American Statistical Association 88, 1392–1397. van Dam, E. R. (2008). Two-dimensional minimax Latin hypercube designs. Discrete Applied Mathematics 156 (18), 3483–3493. 18 van Dam, E. R., B. Husslage, D. den Hertog, and H. Melissen (2007). Maximin Latin hypercube designs in two dimensions. Operations Research 55, 158–169. Zong, C. (1999). Sphere Packings. New York: Springer. 19
10math.ST
Shape Complementarity Analysis for Objects of Arbitrary Shape1 Morad Behandish , Horea T. Ilieş Departments of Mechanical Engineering and Computer Science and Engineering, University of Connecticut, CT 06269 Technical Report No. CDL-TR-14-01, January 2014 arXiv:1712.00238v1 [cs.CG] 1 Dec 2017 Abstract The basic problem of shape complementarity analysis appears fundamental to applications as diverse as mechanical design, assembly automation, robot motion planning, micro- and nanofabrication, protein-ligand binding, and rational drug design. However, the current challenge lies in the lack of a general mathematical formulation that applies to objects of arbitrary shape. We propose that a measure of shape complementarity can be obtained from the extent of approximate overlap between shape skeletons. A space-continuous implicit generalization of the skeleton, called the skeletal density function (SDF) is defined over the Euclidean space that contains the individual assembly partners. The SDF shape descriptors capture the essential features that are relevant to proper contact alignment, and are considerably more robust than the conventional explicit skeletal representations. We express the shape complementarity score as a convolution of the individual SDFs. The problem then breaks down to a global optimization of the score over the configuration space of spatial relations, which can be efficiently implemented using fast Fourier transforms (FFTs) on nonequispaced samples. We demonstrate the effectiveness of the scoring approach for several examples from 2D peg-in-hole alignment to more complex 3D examples in mechanical assembly and protein docking. We show that the proposed method is reliable, inherently robust against small perturbations, and effective in steering gradient-based optimization. Keywords: shape complementarity, shape descriptors, shape skeletons, skeletal density, cross-correlation, convolution, Fourier transform, automated assembly, protein docking. 1 Figure 1: Automatic identification of spatial relations and assembly sequence is governed by shape complementarity - figure reproduced from [32] with minor modifications. Figure 2: The binding site of HIV protease in complex with Saquinavir (PDB Code: 1FB7) [22]; the shape complementarity is visually obvious, yet difficult to quantify. pointsets, complementary geometrical features are indisputably critical determinants of proper assembly and function. However, in spite of its ubiquity and versatility, obtaining a general measure of shape complementarity for objects of arbitrary shape remains an open problem. A particularly important application that can benefit from such an analysis is assembly automation. Figure 1 shows the assembly sequence of 3 simple mechanical components. An automatic identification of proper mating features without user interference turns out to be quite challenging, which reduces to an optimization of geometric complementarity. Once determined, the corresponding sequence of spatial relations between the properly assembled parts can be transferred to a description of robot motions for automatic assembly [32]. Among other macro-scale applications are feature recognition for manufacturing [21], motion planning in crowded or narrow environments [32], fixture design [56], metal stamping die design [9], and design of garment products [52]. However, shape complementarity is also central to the fabrication of micro-assemblies, including automated assembly of micro-mirrors [40] and optical manipulation of micro-puzzles [45]. The impacts are realized even further in nano-fabrication where self-assembly is more critical. More recent studies on the placement of DNA origami structures [55], and other DNA modular assemblies composed of tetrahedra [20], nano-tubes [2], and tensegrities [36], further pronounce the demands for a fundamental study of the subject. The significance of shape complementarity has been Motivation Research in computational shape analysis has impacted a wide range of disciplines from engineering to medicine, archeology, art, and entertainment. A quantitative description of shape complementarity, in particular, is critical to numerous applications, including: • CAD/CAM, design and assembly automation, from industrial scale to micro- and nano-structures; • robotics, motion and path planning, obstacle avoidance, direct and inverse configuration space problems; • systematic garment design systems, optimizing piecewise design and fabrication of apparel products; • modeling biological processes involving molecular recognition, from gene expression to protein-ligand binding and drug design. More generally, in almost every problem where a physical system is modeled by an arrangement of interacting 1 This technical report was never published as a journal article. For citation, please use: Behandish, Morad and Ilieş, Horea T., 2014. “Shape Complementarity Analysis for Objects of Arbitrary Shape.” Technical Report No. CDL-TR-14-01, University of Connecticut. A short presentation of this work will appear in the proceedings of the FWCG’2014 workshop [6]. 1 known to the molecular biologists since the earliest days of protein structure determination in 1950s [27]. Proteins are the cellular machinery of living organisms, responsible for a vast array of biological functions, exclusively determined by their 3D structures. Geometric alignment has been identified as a vital player in different levels of structural studies; for instance, in folding of α−helical domains (e.g., packing models such as ‘knobs in holes’ and ‘ridges in grooves’ [16]), and in complex formations (e.g., binding models such as ‘lock and key’ or ‘induced fit’ [28]). However, most of these models have been restricted to qualitative interpretations by the biologists. One particularly significant application of binding prediction is in rational drug design, where geometric fit into the receptor protein is the main criterion in designing the scaffold of the ‘lead compounds’ for drug molecules [31]. Access to visualization software has facilitated this process for the pharmacologist, in a similar fashion that CAD technology has revolutionized the engineer’s toolbox. However, automatic identification of a proper fit is even more helpful when dealing with molecular interfaces, noting that mating features are geometrically more complex and less clear to the human eye. Figure 2 shows the drug molecule Saquinavir prescribed in HIV therapy, in complex with a subset of its receptor enzyme, HIV protease (PDB Code: 1FB7) [22]. 2 ing algorithms that are based on overlapping geometric density functions. Given a receptor protein M1 and a ligand molecule M2 in the 3D space, the common idea behind the majority of these methods is to formulate the so-called shape complementarity score f (τ ; M1 , M2 ) as a function of the relative rigid body transformation τ ∈ SE(3): Z f (τ ; M1 , M2 ) = (ρ1 ∗ρ2 )(τ ) = ρ1 (p) ρ2 (τ −1 p) dv, (1) R3 where ∗ stands for the cross-correlation operator, and dv is the differential volume element at p ∈ R3 . The problem then reduces to an efficient search of the configuration space SE(3) of rigid motions for a subset of near-optimal poses that maximize f (τ ). The main challenge, however, lies in a proper formulation of the so-called affinity functions ρ1,2 (p) = ρ(p, M1,2 ) for the two molecules, whose cross-correlation gives a high score when the two are in a “proper fit” pose. A relatively successful and contemporary formulation is based on the double-skin layer (DSL) approach, illustrated in Figure 3 (a). It was first introduced in [12, 53] in 2D and 3D, respectively, implemented using grid-based equispaced FFTs in [26], generalized to complex affinities in [8], and evolved to a grid-free nonequispaced FFT-based algorithm in [7, 4]. Two skin regions are defined implicitly: 1) the grown skin region of the receptor, formed by an additional layer of pseudo-atoms populated over the solvent accessible surface (SAS); and 2) the surface skin region of the ligand, formed by the original solvent accessible atoms. The remaining atoms in both molecules are labeled as core atoms. A radial-basis affinity function was proposed in [7, 4] as a summation of Gaussian kernels centered at the skin/core atoms and pseudo-atoms, modeling the space occupancy of the molecules as a smooth 3D density function. Here is (a slight variation of) their formulation:   X kp − qj k2 −1 , (2) ρ(p, M ) = cj gσ Rj Related Work Most of the research in shape complementarity analysis is indebted to computational attempts in ab initio protein docking, extensively studied among computer scientists and computational biologists [42]. The earlier techniques ranged from geometric hashing [35, 14], to detection and matching of ‘knobs and holes’ [53, 47, 33], and other signature features [23, 18, 14] on the surfaces of the binding proteins. More recent methods characterize the topography of cavities and protrusions of the surface by means of a so-called ‘elevation function’ [1], and compare the maxima of this function for geometric alignment of protein surfaces [54]. A large sub-class of the most effective docking algorithms rely on correlations computed from overlapping geometric densities, reviewed in [17]. The earliest attempts rasterized the geometry to a uniform 3D grid, assigning different values to the cells based on their position with respect to the boundary. The grid representations of the mating partners were overlapped to obtain a score for a given relative “pose”, and used simple methods for sampling and searching the space of all possible such poses [26]. Some methods use discrete Fourier transforms (DFT) to speed-up the search with a cumulative computation of trial solutions, [19, 8, 29, 30]; while others use spherical harmonic Fourier transforms (SHFT) [38, 15, 43, 44]. These methods have evolved to today’s sophisticated systems that use the same basic principles with better density models, grid-free representations, and fast search techniques that are based on adaptive sampling and nonequispaced DFTs [4, 11]. For a more complete review of different approaches, the reader is referred to [17, 42]. In spite of the substantial amount of research on shape complementarity for arrangements of spherical atoms (i.e., proteins), the problem is scarcely studied for objects made of different primitives. Here we propose a novel formulation and computational framework for objects of arbitrary shape in 3D, potentially extensible to higher dimensions. 3 1≤j≤n where n = n1,2 is the number of atoms (including pseudoatoms) in one molecule M = M1,2 ; p ∈ R3 is the query point, qj ∈ R3 and Rj are the center and radius of the j’th atom whose contribution to the sum is weighted by cj for j = 1, 2, · · · , n, k · k2 is the L2 −norm, and gσ (x) ∝ exp[− 12 (x/σ)2 ] is the isotropic Gauss function, the decay rate of which is governed by the constant factor σ > 0. The weights cj are usually chosen to be different constants for skin and core atoms. A clever trick was used by performing computations on complex functions, picking real coefficients cj ∝ λ√ 1 for skin atoms and imaginary coefficients cj ∝ iλ2 (i = −1) for core atoms (typically λ2 > λ1 ). Subsequently, f 0 (τ ) := Re{f (τ )} or f 0 (τ ) := Re{f (τ )} − Im{f (τ )} can be used as the actual score for optimization. As a result, skin-skin overlaps between the receptor and ligand impart a positive real reward, core-core collisions impart a negative real penalty, and skin-core collisions optionally contribute a smaller penalty to the total score. This was improved to a more sophisticated skincurvature and core-depth dependent weight assignment in [11]. The configuration space SE(3) ∼ = SO(3)oT(3) is then searched for the highest values of f 0 (τ ) using an adaptive sampling of rotations in SO(3); for each trial rotation, the translation space T(3) ∼ = R3 is searched rapidly using either a 3D equispaced FFT (the well-known Cooley-Tukey algorithm [13]), or a 3D nonequispaced FFT (Potts et al.’s algorithm [39]). The elegance of this approach lies in the exploitation of the radial-basis Gaussian representation in speeding up the search process; it preserves the shape and location of the Our Approach Before proceeding to a rigorous formalism in Section 4, let us consider the state-of-the-art in the class of protein dock2 score profile, compared to the expensive gird-based FFT approaches [17], using a significantly less amount of memory and computation time (up to two orders of magnitude) [5]. However, these implementations have been progressively calibrated and specialized for the particular application in protein docking. There are a few caveats when trying to extend the ideas to a purely geometric assessment of the shape complementarity for arbitrary shapes; for instance, the radial-basis approach imposes the following limitations: 1. It requires an additional step to identify the skin/core classification of original atoms; however, despite being well-defined for globular proteins, the distinction might not be clear for molecules of extended shape. 2. It imposes the requirement to populate a finite number of pseudo-atoms along the solvent-accessible surface, which can be done in infinitely many different ways, resulting in different scoring schemes. Figure 3: The double-skin layer technique for protein docking: the skin overlap does not discriminate between configurations of ligand protrusion with single and multiple contact points. The outcomes of these pre-processing steps impart inevitable bias to the scoring outcome; in fact the algorithm that populates the pseudo-atoms and its parameters (e.g., the packing density or grid spacing in the algorithm given in [7]) are likely to affect the optimal results even more than those of the affinity formulation in (2), which is not desirable. A possible alleviation to the bias is to overpopulate the surface and grown skins with many pseudo-atoms, allowing penetrations between pseudo-atoms, at the expense of increasing the input size. The bias eventually disappears if n1,2 → ∞, without modifying the shape of the cavity occupied by the original molecules. This can be conceptualized by sweeping a Gaussian probe along the inside and outside of the protein surface. Let us rewrite (2) with the skin-core separation: where ξ = ξ(p, M ) is the signed distance function from each molecular surface and R > 0 is the probe radius as before. The first and second Gaussian terms create the swept-volume skin and core layers, respectively. This resembles the traditional skin-layer approach in [4], and can be adjusted to the improved skin-layer approach in [11] where both the skin thickness R and skin/core weights λ1,2 are varied as a function of surface curvature and penetration depth, and the arguments of the Gaussian are offset to detach the skin from the original surface. Importantly, it is much easier to compute (5) compared to (4) which requires explicit integration over offset surfaces. The idea can be generalized to objects of arbitrary shape, at the expense of losing the speed and memory advantages of radial-basis formulation. There are several known inefficiencies, however, common to both radialbasis and swept-probe techniques, or their numerous possible variations, as long as they are based on overlapping skin/core layers in one way or another:   X η X η − 1 + iλ2 −1 , gσ gσ ρ(p, M ) = λ1 R R core (3) skin where η = η(p, q) = kp − qk2 denotes the distances from the skin or core atom centers to the query point. For simplicity, the probe radius R > 0 is assumed to be the same for all skin and core atoms, respectively, but do not have to be. The skin and core in this case are defined by a finite number of center points of the atoms in the original molecule or the added pseudo-atoms whose center points are sampled on the offset surfaces (e.g., SAS). To eliminate the bias arising from the arbitrary sampling, the finite sum can be replaced with an integral that represents the sum in the limit as the number of pseudo-atoms approaches ∞: 1. The truncated scoring function has a compact support3 that spans an extremely narrow region of the configuration space, i.e., when the molecules are proximal. To the best of our knowledge, there is a lack of a proper formulation that is capable of providing strong local clues to guide the search algorithm, even when the objects are far away. 2. Within the support region, there is little appreciation of the geometric features such as protrusion and depressions, sharp corners, and generally surface curvature similarities between the mating objects. 3. The choice of a proper probe radius is not clear, esp. for objects of arbitrary shape: large probe size will miss small geometric features, while small probe size will further narrow down the support region. Z Z  η  η − 1 ds + iλ2 gσ − 1 ds, ρ(p, M ) = λ1 gσ R R skin core (4) where ds is the differential surface element. The skin and core in this case are not finite sets, but are continuum surfaces defined by positive and negative offsets of the protein surface, respectively, i.e., ±R−iso-surfaces of the signed distance function.2 A much simpler formulation can be obtained by directly applying the Gaussian kernel to the signed distance function, whose iso-surfaces were utilized; namely:     ξ ξ ρ(p, M ) = λ1 gσ − 1 + iλ2 gσ +1 , (5) R R A naïve proposition to solve the first problem could be to replace the Gaussian with a different radial-basis kernel of slower decay rate—e.g., one of inverse-polynomial variation with distance, e.g., ∼ 1/η c in (3) and (4) or ∼ 1/ξ c in (5) with c > 0. The motivation comes from the electrostatic effect (Coulomb’s law), which is the nature’s means of steering molecules to bring them into proper contact [31]. Although it might help to guide the search towards the proper proximity, it also fades away the geometric 3 The support of the scoring function f (τ ) : SE(3) → C is defined as supp(f ) = {τ ∈ SE(3) | f (τ ) 6= 0}. In this case, although the Gaussian kernel is not exactly zero at far distances, it is generally approximated with a truncated window function of compact support in the nonequispaced FFT implementation [39]. 2 Replacing the core by a negative offset Gaussian shell is for the sake of simplifying the formulation, though one could still use the original atom centers (whose locations are not arbitrary, unlike pseudo-atoms) as in the second term on the right-hand side of (3). 3 specificity of the surfaces within the support region,4 and results in a flattened score function. To better understand the other two problems and propose our solution, let us take a closer look at the group of atoms identified as a1 , a2 , and a3 that form a depression on the receptor, which accommodates the protrusion made by atom a0 on the ligand, shown in Figure 3 (b). Alternative optimal and non-optimal positions of a0 are illustrated in Figures 3 (c) and (d), for different radii of a0 compared to the probe radius. Horizontal movements from the optimal position (0) reduce the score due to either decreased skinskin overlap (position (2)) or increased skin-core collision (position (3)), while the score is zeroed out to the right of position (1). However, the scoring is insensitive to sliding motions along the skin, giving the same score to positions (0) and (4) in panel (b), where the radius of a0 happens to be equal to that of the probe. The scoring is less accurate if the skin was thicker, or a0 was smaller, as in panel (c), in which case the algorithm favors position (4) over (5), although there is no contact at position 4, and gives the same lower score to positions (0) and (5). At this point, it should be clear that a more objective and possibly more effective shape complementarity scoring function needs to take into account the multiplicity of contact, i.e., the number of contact points between the spheres in the simpler case of proteins, and more generally the topology and geometry of contact surface when assembling arbitrary objects. The superiority of position 0 in Figures 3 (b) and (c) is realized by noting that a0 is in contact with more than one atom from the partner molecule, i.e., its center is equidistant from multiple spherical sites, hence it lies on the interfaces of their Voronoi tessellation,5 and the multiplicity of contact is the same as the degree of the Voronoi j−faces (0 ≤ j ≤ 2) (including edges and vertices), defined as the number of adjacent cells. This is illustrated for the same group of 4 atoms in Figure 4 (a) through (c), for different radii of the ligand atom. An important observation is that the external subset of the Voronoi graph (i.e., union of j−faces) form the medial axis of the complementary space of the protein, while the atom centers form the most stable points of the medial axis of the interior; hence we propose the following: Figure 4: An overlapping of shape skeletons correlates with contact multiplicity (medial component), but proper contact also requires to reward proximity (proximal component). and geometrical features of the object, is well known in the studies on shape similarities [49, 51]; however, the following concerns are immediately observed: 1. The conventional medial axis (and other variants of shape skeletons) are highly sensitive to noise/errors in shape data, making them extremely unstable and difficult to compute or approximate, even in 2D [34, 3]; and even harder to use for shape complementarity, esp. when assessing approximate complementarity. 2. Obtaining a reliable measure of the extent of approximate overlap between the skeletons using their explicit representations is a challenge. 3. Quantifying the multiplicity of contact, defined earlier as an integer when dealing with spherical primitives, is not a clear notion for general shapes. The difficulties associated with the cases of approximate complementarity are well-known (e.g., when the unbound objects are flexible, and the ‘induced fit’ is made possible with deformations upon assembly) referred to as “soft” docking of proteins [23]. As illustrated in Figure 5 for the simpler case of proteins, the overlaps between skeletons are not exact if the mating objects are not in perfect contact, demanding a flexible or “weak” definition for medial regions—see also Figure 2 for a real example. To solve this problem, we formulate an alternative representation of the shape skeleton, called the skeletal density function (SDF) that is implicit, continuous, and stable in the presence of errors, including noise in shape data or authentic shape discrepancies between the flexible parts before induced deformations during soft assembly. Rather than sweeping a Gaussian probe for continuous doubleskin layer generation as in (4), the Gaussian kernel could be assigned to the generator ball of the medial axis, e.g., Z Z  η  η − 1 ds + iλ2 gσ − 1 ds, ρ(p, M ) = λ1 gσ int-MA R ext-MA R (6) where ext-/int-MA stand for external and internal medial axes, respectively, η = η(p, q) = kp − qk2 is the distance to MA points, and R ≥ 0 is the MA generator ball radius. However, the medial axis is extremely difficult to compute and unstable under first and second order perturbations to surface geometry [3] (which are common due to error/noise in data). In a similar fashion that (5) was obtained by applying the Gaussian kernel directly to the distance function and avoiding explicit computation of the offset surfaces in (4), it is desirable to avoid explicit computation of the medial axis. This time, we apply the Gaussian kernel directly Hypothesis 1. An effective model of geometric fit (i.e., shape complementarity) for objects of arbitrary shape can be obtained from a comparative overlapping of shape skeletons between the mutually complement features. This can be achieved by overlapping the external skeleton of one object with the internal skeleton of its assembly partner. This is slightly harder to visualize when the primitives forming the objects are not spherical, as depicted for a simple case in Figure 4 (d) through (f). The complementarity of geometric features, esp. those associated with sharp corners or local extremal curvatures, can be quantified by comparing the topology and geometry of surface contact between hypothetical balls that are swept to form the exterior of one object, with those that form the interior of its mating partner in a trial position. The subset of such balls that touch the boundary on multiple connected regions are the generator balls of the Medial Axis [10], suggesting the fundamental relationship between the skeletal topologies and shape complementarity. The usefulness of Medial Axes, as a compact abstraction of the topological 4 Note that nature also uses charge distributions, evolved to impart specificity, in addition to the geometric features. 5 Here, the sites are spherical objects, hence the Voronoi diagram of the spheres, equivalent to Voronoi diagram of centers with additively weighted distance function (Johnson-Mehl model [24]) is of interest, which gives rise to hyperboloidical facets. 4 rotations and translations) implies the assumption of rigidity for the mating shapes, which seems contradictory with our intention to implement soft assembly analysis. The flexibility is implicitly incorporated to some extent, however, by the choice of an affinity function that is resistant to small discrepancies between the shapes of the flexible parts—as in “soft” docking of proteins [23]. It is desirable to obtain a score model that applies to objects of arbitrary shape, which is equivalent to a generic mapping f : SE(3) × P∗ (R3 ) × P∗ (R3 ) → R (or C), which is a projection from the space of all possible shapes of the two solids and their relative transformations to the totally (or partially) ordered set of scores R (or C). Here, P∗ (R3 ) stands for some proper subset of the power set of the 3−space, often denoted P(R3 ), to which we restrict our attention. On the other hand, all possible spatial relations between the two objects are identified as points τ ∈ SE(3) that reside in the so-called configuration space [37]. The latter can be pictured by attaching coordinate frames to the objects, with respect to which the solids are described; then the configurations are the transformation that relate these frames by rigid motions [32, 25]. For obvious practical reasons, we restrict our attention to solid objects, i.e., P∗ (R3 ) is chosen to be the collection of ‘r-sets’, defined as bounded, closed, topologically regular, and semianalytic 3D sets whose boundaries (denoted ∂S) form piecewise smooth oriented 2−manifold [46]. Starting from the basic postulate that shape complementarity is concerned with the geometry of contact at the interface of the solids, the pointsets in the 3−space that are relevant to this analysis can be reduced to those of the boundary manifolds. Such a formulation is particularly convenient for computations when the two solids are specified using boundary representations (B-reps), which are widely popular in solid modeling [41]. The complex score function in (1) is repeated below for f : SE(3)×P∗ (R3 )×P∗ (R3 ) → C: Figure 5: Traditional explicit skeletal diagrams are not sufficient to capture imperfect contact, hence a continuous implicit form is needed to give partial reward to approximate overlaps. to the distribution of pairwise distances and its deviation from the minimum distance function to obtain an implicit generalization of the skeleton. In Section 4, we propose an alternative formulation for the affinity functions ρ1,2 (p) in the cross-correlation integral (1), which has as least two characteristic components: 1. A ‘medial’ component that characterizes the skeletal density, which will serve as a continuous measure of the multiplicity of contact with its generator balls. 2. A ‘proximal’ component that obligates the skeletal branches to stronger densities at the proximity of the surface, and decays as they move farther away. The first component results in a reward when the points of high skeletal density from the exterior of one object and the interior of its partner are overlapped in a trial pose e.g., positions (0) and (1) in Figure 4 are favored over position (2). The second component, on the other hand, favors proximity of the partner objects, hence ensures the superiority of position (0) over (1) in a proper trade off between the two effects. The combination of the two components results in an affinity function with a support region that resembles the branches of a “thickened” medial axis (see Figure 5 (b)), slowly decaying away from the boundaries, yet possessing an intrinsic robustness to discrepancies, as a natural consequence of its definition as a density function that is continuous in both shape space and the 3−space. We shall demonstrate that such a branched shape of the support region, together with the gradual decay of affinity, in turn results in a shape complementarity score function (1) that is capable of guiding the gradient-based search algorithms, moving the partner object along these skeletal branches toward the near-optimal fit position. 4 Z ρ1 (p) ρ2 (τ −1 p) dv, (7) f (τ, S1 , S2 ) = (ρ1 ∗ ρ2 )(τ ) = R3 where ρ1,2 (p) = ρ(p, S1,2 ) stand for the shape-dependent affinity functions for S1,2 ∈ P∗ (R3 ), which is preserved under Euclidean isometries, i.e., ρ(p, τ S) = ρ(τ −1 p, S). The rest of this Section is dedicated to formulate the universal affinity field that possesses the desired characteristics articulated in Section 3. We made the case in Section 3 that an effective affinity field extracts an abstraction of the shape in terms of the distribution of the minimum distance from the query point to the manifold, defined using the following notation:6 ξ(p, S) = pmc(p, S) min η(p, q), Formulation q∈∂S The different problems ranging from mechanical assembly to molecular docking can be unified under a generic solid modeling representation. Given two solids S1 , S2 ⊂ R3 , the shape complementarity prediction problem can be divided into two separate steps: (8) where η(p, q) = kp − qk2 is the pairwise distance from boundary points q ∈ ∂S to the query point p ∈ R3 in which k · k2 denotes the L2 −norm, and pmc(p, S) = +1, −1, or 0, is the point membership classification (PMC) of the query point as an external, internal, or boundary point, respectively [50]. The PMC is equivalent to the knowledge of a consistent manifold orientation, e.g., one represented by a unit normal vector n(q, S) for all q ∈ ∂S over the piecewise smooth manifold, and averaged on the sharp attachments. The PMC is equivalent to a knowledge of a consistent manifold orientation, e.g., one represented by a unit normal vector n(q, S) for all q ∈ S over a piecewise 1. Formulating a shape complementarity score function f (τ ; S1 , S2 ) that quantifies their quality of fit, for a given relative transformation τ ∈ SE(3). 2. Developing an efficient algorithm to search the configuration space to obtain a subset of transformations T ⊂ SE(3) that result in affinities above a threshold f (τ ) ≥ f0 , (τ ∈ T ); or proceeding further to find the optimal solution(s) τ ∗ ∈ T : f (τ ∗ ) = maxτ ∈T {f (τ )}. 6 In general, the distance between a point and a set is defined as the infimum (i.e., maximum lower-bound) of pairwise distances, since minimum may not exist (e.g., for open sets). However, for closed solids, the minimum exists and coincide with the infimum. The restriction of the transformations to the special Euclidean group SE(3) ∼ = SO(3) o T(3) (i.e., combined proper 5 connected components in C0 (p, S) (called ‘contact components’ in [10]), or that of C (p, S) as  → 0+ , which need not be necessarily the same for all shapes. Given two shapes S1,2 ∈ P∗ (R3 ) and a configuration τ ∈ SE(3), a comparison of the number of contact components in C0 (p, S1 ) and C0 (p, τ S2 ) ≡ C0 (τ −1 p, S2 ) can identify if the two manifolds are in extensive exact contact with each other. However, a small perturbation of the manifold can invoke dramatic changes in the topology of C0 (p, S), making the medial axis and shape skeleton extremely unstable, and the shape complementarity score function (depending on it) inherently unreliable. On the other hand, when  > 0 is used in (10) and (11), the contact region is guaranteed to contain at least one 2−dimensional region, as a result of the continuity condition on the manifold. The shape complementarity assessments are then built on the geometrical properties of C (p, S) (e.g., the extent of contact region), instead of the topological structure of C0 (p, S) (e.g., the number of contact components), to be implicitly embodied in the definition of the affinity function that follows. Using the formulation in (7), all possible candidates for the affinity function ρ : R3 × P∗ (R3 ) → C share at least two fundamental attributes, namely, 1) they all intend to extract the shape abstraction as real or complex fields over the 3−space, hence are projections of the shape from a high-dimensional space R3 ×P∗ (R3 ) into a 1D or 2D space (i.e., a single real or complex number per shape for a fixed point p ∈ R3 ); and 2) they all use the Euclidean geometry of the 2−manifold in the 3−space as observed from the query point p ∈ R3 , which can be locally represented as a distribution of pairwise distances η(p, q) = kp − qk2 from the boundary points to the query point. This leads to the following natural decomposition of the process to derive an affinity field ρ : R3 × P∗ (R3 ) → C: Figure 6: The SDF is formulated in terms of the distribution of distance from the query point to different boundary elements, integrated over the manifold region within the contact ball. smooth manifold, and averaged on the sharp attachments. Another definition that is useful in our formulation is the angle by which the orientation of the vector (p − q) connecting the boundary points q ∈ ∂S to the query point p ∈ R3 differs from the outward surface normal n(q, S):   (p − q) · n(q, S) , (9) θ(p, q, S) = cos−1 kp − qk2 where · stands for vector inner product. The terminology in (8) through (9) is illustrated in 2D in Figure 6 (a). Next, the concept of a maximal contact ball, pointed out in Section 3 with reference to the conventional medial axis, is extended as follows: Definition 1. Given a solid S ∈ P∗ (R3 ), and a point p ∈ R3 , the −approximate contact ball (with the boundary) centered at p is defined as  B (p, S) = q ∈ R3 | kp − qk2 ≤ (1 + )|ξ(p, S)| , (10) where  ≥ 0 is an arbitrary constant. Subsequently, the −approximate contact region is defined as the subset of the boundary ∂S that lies within the contact ball: 1. A projection ζ : R3 × R3 × P∗ (R3 ) → C that captures the essential distance distribution for the manifold as observed from p. C (p, S) = B (p, S) ∩ ∂S = {q ∈ ∂S | kp − qk2 ≤ (1 + )|ξ(p, S)|} . (11) 2. Applying a kernel φ : C → C over the distance data to obtain the affinity ρ(p, S). Note that contact regions are invariant (up to congruence) under Euclidean isometries, i.e., C (p, τ S) ≡ C (τ −1 p, S) for all τ ∈ SE(3), where ≡ stands for congruence relation.7 The idea is schematically shown in Figure 7. The first step can be accomplished in a number of different ways. To obtain a visually meaningful and practically conducive layout, the following combination is proposed: As pointed out in Section 3, the exact contact ball B0 (p, S) corresponding to  = 0 is fundamentally related to the traditional definition of the shape skeleton. For the simple case of objects made of spherical primitives (i.e., proteins), p ∈ R3 is a k’th degree j−face (1 ≤ j ≤ 2) of the Voronoi diagram of the spheres if |C0 (p, S)| = k, where | · | denotes set cardinality and k ∈ N − {1} was referred to in Section 3 as the multiplicity of contact between B0 (p, S) and the boundary. For the case of arbitrary shapes, however, we argued that the notion of an integer multiplicity is not well-defined, since |C0 (p, S)| is not necessarily finite. In any case, by definition if |C0 (p, S)| > 1, the query point lies on the medial axis. Although the notions of medial axis and shape skeleton are not necessarily the same in the most general terms [10], both concepts are closely related to the geometry and topology of the contact region C0 (p, S), which could be composed of 0−, 1− and 2−dimensional components subject to a variety of possible degeneracies. The multiplicity of contact, in this case, can be defined as the number of Definition 2. Given a solid S ∈ P∗ (R3 ) and the points p ∈ R3 and q ∈ ∂S, the complex projection ζ : R3 × R3 × P∗ (R3 ) → C is defined as: ζ(p, q, S) = ξ(p, S) ± iη(p, q), (12) where Re{ζ} = ξ(p, S) and Im{ζ} = ±η(p, q) were defined in (8), and the choice of ± is left arbitrary as a convention. Subsequently, the complex spread of the boundary as viewed from the query point is defined as:  ζ(p, ∂S, S) = ζ(p, q, S) | q ∈ ∂S , (13) The ζ−map can be regarded as a projection of the shape into the complex plane from the viewpoint of a fixed observer p ∈ R3 , retaining the distances kp − qk2 while the orientation of (p − q) is lost. However, different projections at different query points collectively form a complete representation of the boundary; for instance, the manifold is implicitly specified as the signed distance iso-surface ∂S = {p ∈ R3 | Re{ζ(p, q, S)} = 0}, given any fixed boundary point q ∈ ∂S. Therefore, the ζ−map contains all the information necessary to reproduce the shape (i.e., is informationally complete), but provides a representation that facilitates defining the affinity function. 7 Two solids are congruent if one can be mapped to the other using a rigid transformation. In this case, C (p, τ S) = τ C (τ −1 p, S) thus C (p, τ S) ≡ C (τ −1 p, S). Note that rigid transformations are homeomorphisms, thus congruent shapes have the same topological properties (e.g., number of connected components). 6 where ζ(p, q, S) was defined in (12), θ(p, q, S) was defined in (9), and ds is the differential surface element at q ∈ ∂S. The choice of the kernel φ : C → C determines the share of the points on the complex map ζ(p, ∂S, S) to the integral in (14), thus should be chosen properly to impart the desired ‘medial’ and ‘proximal’ components, discussed in Section 3 into the affinity function. The term cos θ is provided to assign each boundary element a weight of ds⊥ = cos θds, that is, the infinitesimal surface area perpendicular to the line of observation (p − q). Before proceeding to propose a conceptually appealing and experimentally effective from for the φ−kernel, it is worthwhile noting that (14) in its general form represents a platform for a variety of different scoring schemes, unified under a single general formulation. The differences between these methods would then be abstracted only in their particular choice of the φ−kernel, as a result of the process decomposition illustrated in Figure 7. For instance, for a characteristic radius of R > 0, a choice of ξ η − 1) or φ(ξ + iη) ∝ gσ ( R ± 1)—using φ(ξ + iη) ∝ gσ ( R only one of ξ = Re{ζ} or η = Im{ζ} at a time—result in affinity functions that resemble the finite radial-basis or swept-volume double-skin layer affinity functions discussed in Section 3 (Figure 8 (a)). To expand the narrow support region, one could try a more slowly decaying kernel, e.g., of inverse-square form φ(ζ) ∝ |ζ|−2 , which eliminates the characteristic size R, at the expense of less geometric specificity (Figure 8 (b)). Figure 8 illustrates a few examples of φ−kernels and the resulting ρ−function. We use a combination of ideas presented in Section 3 to devise a kernel 1 that makes use of both |ζ| = (ξ 2 + η 2 ) 2 and ∠ζ = η/ξ to provide a more effective shape descriptor that captures the essential properties of the distance distributions: Figure 7: The affinity computation is decomposed into two steps: a projection in (13) characterizing distance distributions from the observer, followed by applying the φ−kernel in (14). Figure 8: A few choices of the φ−kernel (top) and a 2D section of the resulting affinity field for Saquinavir shown earlier in Figure 2 (bottom). From left to right, φ(ζ) ∝ gσ ((Im(ζ)/R) − 1), φ(ζ) ∝ |ζ|−2 , and φ(ζ) ∝ |ζ|−2 gσ (| tan ∠ζ| − 1). The last one is the kernel of choice in (15). Definition 4. We propose the kernel φ(ζ) : (C − I) → C: Figure 7 schematically shows the ζ−map applied to a simple planar solid, where the complex spread ζ(p, ∂S, S) ⊂ C is sketched for 3 query points p1 , p2 , and p3 , each against a number of boundary points. It is clear from the definition in (12) that iso-surfaces of the signed distance function ξ(p, S) in the domain shown in panel (a), are each mapped to a closed vertical line segment in the complex plane, shown in panel (b); in fact a single query point p alone is mapped into a set of points ζ(p, ∂S, S) = ξ(p, S) + iη(p, ∂S) spread along the aforementioned line segment, where each complex point (ξ, η) corresponds to one or more ordered pair (p, q) ∈ (R3 ×∂S) that are a distance η apart. The interior and exterior points are mapped to the left and right half-planes, respectively. The range is restricted to the phase angles π/4 ≤ ∠ζ ≤ 3π/4 (where tan ∠ζ = (η/ξ)), since η ≥ |ξ| as a result of the definition in (8), and the equality η = |ξ| is exclusive to the pairs for which q is a nearest neighbor of p on the object surface, i.e., q ∈ C0 (p, S). Furthermore, if q ∈ C (p, S) for  > 0, as schematically depicted in panel (c), then ζ(p, q, S) lies in the closed region between the lines η = |ξ| and η = (1 + )|ξ|, shaded in panel (b). For a given observer p, the extent of the surface encapsulated within C (p, S) normalized with η 2 —i.e., measured in terms of the spatial angle, as shown in panel (d)—is characterized in terms of the density of the layout within the phase angles 1 ≤ | tan ∠ζ| ≤ (1 + ). This, in turn, can be magnified by a proper phase-dependent kernel. Subsequently, the affinity function is defined as follows: λ(ζ) 1 φσ (ζ) = √ gσ (| tan ∠ζ| − 1) , (15) 2π ζ 2 √ where gσ (x) = ( 2πσ)−1 exp[− 21 (x/σ)2 ] is the isotropic Gauss function, and σ > 0 is the thickness factor. The coefficient λ : (C − I) → {+λ1 , −λ2 } is chosen as: ( +λ1 if Re{ζ} > 0, λ(ζ) = (16) −λ2 if Re{ζ} < 0. The kernel in (15) is discontinuous on the imaginary line I = iR, and is unbounded around ζ = 0 (i.e., when the query point approaches the boundary); however, the integral in (14) is still convergent at the vicinity of the boundary, since tan ∠ζ → ±∞ hence φ(ζ) → 0, when ξ/η → 0. Figure 8 (c) plots the kernel, and the resulting density function on the drug molecule in Figure 2. As discussed in the introduction, the kernel is composed of a ‘medial’ component φM (ζ)√= gσ (| tan ∠ζ| − 1), a ‘proximal’ component φP (ζ) = 1/( 2πζ 2 ), and a coefficient λ(ζ) = ±λ1,2 . The medial component φM takes the ratio |η/ξ| = | tan ∠ζ| as the argument, giving rise to linear iso-curves φM = const, with the highest value √ of φM = ( 2πσ)−1 when tan ∠ζ = ±1 on the bisectors |ξ| = |η|, and highly localized around it if σ  1. This manifests in the affinity function in (14) as a higher density assignment to the query point p ∈ R3 that has an extensive set of approximately closest boundary elements (compare positions (0) and (1) in Figure 4). The proximal component φP , on the other hand, is provided to ensure contact between the assembly partners when their affinities are convolved in (7), as clarified in Section 3, by introducing an inverse-square decay to the integrand in (14) Definition 3. Given a solid S ∈ S, and a point p ∈ R3 , the affinity function ρ : R3 × S → C is defined as follows: I ρ(p, S) = (φ ◦ ζ)(p, q, S) cos θ(p, q, S) ds, (14) ∂S 7 Figure 9: When a given point in the 3−space is equidistant to an extensive region on the boundary to an −approximation, it results in a ζ−projection of the shape that is highly populated around the bisector | tan ∠ζ| = 1, hence a high skeletal density. (compare positions (0) and (1) in Figure 4.) In contrast to φM that was phase-dependent, the argument of φP is the amplitude |ζ|, giving rise to circular iso-curves φP = const, with limζ→0 |φP | = +∞. The proposed φ−kernel is singular at ζ = 0, partly due to |φP | → ∞, and also because φM is undefined due to ambiguous ∠ζ, and λ is discontinuous. Therefore, the affinity is undefined for p ∈ ∂S; however, it can be verified that ρ(p, S) → 0+ when the query point p approaches the boundary (ξ(p, S) → 0± ), and the cross-correlation f (τ ; S1 , S2 ) = (ρ1 ∗ ρ2 )(τ ) is convergent for piecewise smooth boundaries. Substituting for φ(ζ) from (15) in (14) results in an implicit definition of a space-continuous SDF in the 3−space, the high-density regions of which for σ  1 resemble the j−faces (0 ≤ j ≤ 2) of conventional skeletons: I 2 2 1 e− 2 (| tan ϕ|−1) /σ −2iϕ ds⊥ λ , (17) ρσ (p, S) = σ ∂S (cot2 ϕ + 1)/2 4πη 2 Using (18) instead of (17) restricts the computations to the −approximate nearest neighbors (−ANN) of the query point, which is a much smaller set than the entire boundary. This significantly speeds up the implementation explained in Section 5 with a negligible compromise in the accuracy due to neglecting the tail of the Gauss function.8 To make the tradeoff precise, (17) is first rearranged into a 1D integral, noting that the variable of integration can be changed to r := | tan ϕ| = |η/ξ| = (1 + ): Proposition 1. If the φ−kernel obeys the inverse-square decay law φ(αζ) = α−2 φ(ζ) for all α ∈ R, the affinity integral can be rearranged into the following 1D form: Z |µ|  ξ 0 γr−1 (p, S) φ pmc(p, S) ± ir r2 dr, (19) ρ(p, S) = 1 where ξ = ξ(p, S) and µ = µ(p, S) are the min/max distances to the boundary, respectively, and γ0 (p, S) := ∂ γ (p, S) in which γ (p, S) is the total spatial angle by ∂  which the contact region is observed from p ∈ R3 : Z Z ds⊥ ds γ (p, S) = = cos θ . (20) 2 2 4πη 4πη C (p,S) C (p,S) where ds⊥ := cos θ ds is the projected infinitesimal signed surface element, in which θ is the short form for the gaze angle θ(p, q, S) defined in (9), and ϕ is the short form for the phase of ζ−map ϕ(p, q, S) = ∠ζ = tan−1 (η/ξ). The interpretation of (17) is illustrated in Figure 9. The largest contributions to the integral are due to the points with | tan ϕ| ≈ 1, at which the amplitude of the first fraction of the integrand evaluates to almost unity; the remaining term dγ := η −2 ds⊥ = η −2 cos θ ds is the differential signed spatial angle by which the query point p ∈ R3 observes the surface element at q ∈ ∂S, normalized by the term 4π, clarifying part of the reason behind the inverse-square form used in (15). This can also be viewed as a surface integration over a sphere of radius η centered at the query point p (namely, ∂B (p, S) for  := |η/ξ| − 1) normalized by the sphere surface area 4πη 2 . On the other hand, when | tan ϕ| deviates significantly from unity, the Gaussian nominator vanishes. As a result, the density function can be approximated to an integration over the −approximate contact region C (p, S) defined in (11), where /σ determines the error. This leads to the following definition for the ‘truncated’ affinity function: Z 2 2 1 e− 2 (| tan ϕ|−1) /σ −2iϕ ds⊥ λ , (18) ρ̄σ, (p, S) = 2 σ C (p,S) (cot ϕ + 1)/2 4πη 2 As before, pmc(p, S) = +1, −1, or 0, while the choice of ± in ±ir comes from that of (12). Proof. Let r := |η/ξ| to obtain ζ = (ξ + iη) = ξ(1 ± ir) = |ξ|(pmc(p, S) ± ir), then φ(ζ) = φ(pmc(p, S) ± ir)/ξ 2 as a result of the inverse-square decay property. Also cos θ ds = η 2 dγ where dγ is the differential signed spatial angle by which the surface element is observed from the query point; resulting in the term r2 = (η/ξ)2 . On the other hand, r = |η/ξ| is constant over the differential surface encapsulated within the spherical shell C+δ (p, S) − C (p, S) of infinitesimal thickness |ξ|δ as δ → 0+ , letting the shell inner and outer radii be r = (1 + ) and r + dr = (1 +  + δ) δ → 0+ . This differential surface area can be rewritten as the total differential dγ = γ(r−1)+dr − γ(r−1) . Noting that ∂ γ (p, S) ∂ =(r−1) = lim δ→0+ γ − γ+δ δ =(r−1) , (21)  the surface area is obtained as ∂γ dr. Thus the 2D inte∂ gral over the surface is converted to a 1D integral over the interval  = (r − 1) ∈ [0, |µ/ξ| − 1] for which C (p, S) 6= ∅  thus ∂γ 6= 0, while the integral vanishes outside this inter∂ val. This completes the proof, assuming that the partial derivative (i.e., the above limit) exists.9 where C (p, S) is defined in (11). The function ρ̄σ, (p, S) approximates ρσ (p, S) = lim→∞ ρ̄σ, (p, S) , with an error of |Eσ, (p, S)| = |ρσ (p, S) − ρ̄σ, (p, S)|  1 if /σ  1. Note also that the truncated affinity function ρ̄σ, (p, S) could be obtained directly from (14) by using a truncated kernel φ̄σ, (ζ), which, in turn, is defined using a similar formula to that of (15), in which the Guassian is substituted with the truncated Gaussian defined as ḡσ, (x) = gσ (x) if |x| ≤ , and ḡσ, (x) = 0 otherwise. This introduces, for instance, an error of < 10−4 × gσ (0) if  > 4.3σ. 8 Moreover, one can argue that the precise choice of a φ−kernel was arbitrary to some extent, and there is no reason not to pick φ̄σ, over φσ other than the elegance of simpler formulation for the latter, while better performance is achievable with the former. 9 It is possible for the γ−function to have sudden changes (e.g., when the surface has spherical patches centered at the query point), in which case it becomes non-differentiable with respect to r = |η/ξ|. However, the formulation remains valid if we use the Dirac delta function to handle differentiation at such discontinuities. 8 Table 1: The dominant overlaps for shape complementarity Substituting for the φ−kernel from (15) in (19) gives the following, noting that λ(ζ) is a function of ξ(p, S) only, hence fixed over the course of integration: Z |µ| 2 2 −1 1 ξ e− 2 (r−1) /σ −2i tan r λ 0 γr−1 ρσ (p, S) = dr, 2πσ 1 1 + r−2 (22) If γ0 is not bounded (e.g., at the center of perfectly spherical patches on the manifold) the integral is still convergent, but the aggregation abruptly changes as (1 + )|ξ| passes through the radius of the spherical patch. The truncated affinity function in (18) can also be rewritten in terms of a 1D integral: Z 1+ 2 2 −1 1 e− 2 (r−1) /σ −2i tan r λ 0 γr−1 dr. ρ̄σ (p, S) = 2πσ 1 1 + r−2 (23) If σ  1, the major contributions to the integral are over the subinterval r ∈ [0, 1 + ], where  = cσ, which means over the contact region C (p, S) (see Figure 9 (c) and (d)). The contributions from r ∈ [1 + , |µ/ξ|] result in a negligible error, denoted earlier by Eσ, (p, S). This is made precise as follows: p versus S1 p versus τ S2 Score contribution p ∈ e(S1 ) (high-density) p ∈ i(S1 ) (high-density) p ∈ i(S1 ) (high-density) p ∈ e(S1 ) (high-density) p ∈ i(τ S2 ) (high-density) p ∈ e(τ S2 ) (high-density) p ∈ i(τ S2 ) (high-density) p ∈ e(τ S2 ) (high-density) ∝ (∓iλ1 )(±iλ2 ) = +λ1 λ2 = +O(1) ∝ (±iλ2 )(∓iλ1 ) = +λ2 λ1 = +O(1) ∝ (±iλ2 )(±iλ2 ) = −λ22 = −O(p) ∝ (∓iλ1 )(∓iλ1 ) = −λ21 = −O(p−1 ) Figure 10: The spatial relations between the assembly partners and the contributions of high-density points, listed in Table 1. Proposition 2. If σ  1, the truncation error E(p, S; σ) = ρ(p, S; σ) − ρ̄(p, S; ) is bounded as follows: |E| ≤ Em , if  12   + |λ| γm  ≥ 2 loge , σ 2πσ Em degenerates to one over the contact region C0 (p, S), which is generally composed of 0−, 1− and 2− dimensional regions. This means that the support of the SDF shrinks to a subset of the medial axis, as σ → 0+ . A rigorous analysis of the degenerate SDF and its relationship with the medial axis, especially reasoning about the dimensionality of C0 (p, S), is beyond the scope of this article. There is another reason behind the √inverse-square form of the complex function φP (ζ) = 1/( 2πζ 2 ), which is the resulted phase shift ∠φ = −2∠ζ. This in turn, together with an assignment of different coefficients +λ1 6= −λ2 assigned to exterior and interior, respectively, results in phase and amplitude separations that are useful for a meaningful scoring scheme, explained here in simple terms using the schematics in Figure 10. (24) where E = Eσ, (p, S), Em is the desired error upper-bound + (arbitrarily chosen) and γm ≥ γ∞ (p, S) is an upper-bound to the aggregated unsigned spatial angle of observation: Z |µ| Z |µ| ξ ξ ∂ + 0 γm ≥ |γr−1 | dr = γ =(r−1) dr. (25) ∂ 1 1 + The tightest error bound is obtained if γm is picked equal to the right-hand side integral above (if known), while the + most conservative choice is γm = 4π, in which case the right-hand side of (24) simplifies. Lastly, λ ∈ {+λ1 , −λ2 } depending on pmc(p, S) as a result of definition in (16). Proof. The error is due to integration over r ∈ [1 + , | µξ |]: E= λ 2πσ Z |µ | ξ 1+ 1 0 γr−1 2 2 −1 e− 2 (r−1) /σ −2i tan 1 + r−2 • If p is an exterior point of S (denoted p ∈ e(S) thus ξ > 0), with high medial density, the complex spread ζ(p, ∂S, S) is highly populated around ∠ζ = ±π/4. r dr, • If p is an interior point of S (denoted p ∈ i(S) thus ξ < 0), with high medial density, the complex spread ζ(p, ∂S, S) is highly populated around ∠ζ = ±3π/4. |µ | ξ 0 |γr−1 | − 21 (r−1)2 /σ2 e dr, −2 1+ 1 + r Z µ |λ| − 12 ( σ )2 | ξ | 0 |λ| − c22 0 ⇒ |E| ≤ e |γr−1 | dr = e γm . 2πσ 2πσ 1+ |λ| ⇒ |E| ≤ 2πσ Z Therefore, ∠φ ≈ ∓π/2 and |φ| = λ1 φM φP for external points and ∠φ ≈ ∓3π/2 ≡ ±π/2, and |φ| = λ2 φM φP for internal points near the medial axis—assuming the same intensities for the φM and φP terms. The two cases differ by a phase difference of π and amplitude ratio of ∝ λ2 /λ1 . If σ  1, the medial components become dominant, hence the affinity functions obtained for the two cases by accumulating the φ(ζ) values in (14) are expected to have similar relationships, i.e., ρ(p, S) ∝ ∓iλ1 for the high-density exterior points, while ρ(p, S) ∝ ±iλ2 for the low-density interior points. Given two solids S1 and S2 and a configuration τ ∈ SE(3), the three types of overlaps that dominate the shape complementarity score in (7) are depicted in Table 1, assuming λ1 = O(p−1 ) and λ2 = O(p), where p > 1 is referred to as the ‘penalty factor’. Notice that exteriorinterior overlaps impart a reward of +O(1) (proper fit), while interior-interior overlaps add a large penalty of −O(p) (collision), and the exterior-exterior overlaps add a small penalty of −O(p−1 ) (separation), illustrated in Figure 10. Noting that r ≥ (1 + ) ≥ 1 and (1 + r−2 )−1 ≤ 1 and 2 2 1 1  2 e− 2 (r−1) /σ ≤ e− 2 ( σ ) . Equating the right-hand side to Em , and solving for c = /σ yields (24). Using (23) instead of (22) at a small cost bounded by (24) enables the algorithm to perform the integration only over the −ANNs of the query point on the manifold and neglect the contribution of the distant elements, significantly speeding up the implementation explained in Section 5 with little compromise in the accuracy. The relationship between the SDF and the conventional notions of shape skeleton (such as medial axis or its variants) becomes more intuitive when σ → 0+ , in which case the Gaussian bell approaches the Dirac delta function: limσ→0+ gσ (x) = δ(x). Consequently, the integrand in (17) vanishes except when ζ(p, q, S) lies along the bisector η = |ξ| in the complex plane. The integral thus 9 5 Implementation There are various possible geometric representations including but not limited B-reps. Our method is independent of the choice of representation scheme, as long as it supports integration of the φ−kernel over the boundary. Here we present the implementation for triangulated Breps given in the form of triangular tessellations. Given a mesh approximation ∆n (S) of the 2−manifold boundary ∂S of a solid S ∈ P∗ (R3 ) composed of n triangles, the ζ−map and affinity integral can be computed for a given query point p ∈ R3 in O(n) basic steps, having precomputed and tabulated the integral in (22) for parameterized geometry of an arbitrary triangle and its vertex distances against a point, normalized by the minimum distance |ξ(p, S)|. The evaluation can be carried out on a uniform 3D grid Gm of m sample points, which requires a total time of O(mn). However, we showed in Section 4 that the affinity function can be approximated by the truncated integral over the subset of triangles ∆s (p) ⊂ ∆n that carry at least one vertex that is an −approximate nearest neighbor to the query point p ∈ Gm . Hence there is a possibility of speeding the algorithm up by leveraging efficient all-approximate nearest neighbor search algorithms. Given the B-reps of two assembly partners S1 and S2 , each as a mesh ∆n1 (S1 ) and ∆n2 (S2 ), and their affinities computed over the uniform grids Gm1 and Gm2 , a cascade evaluation of the convolution in (7) for a finite collection of transformations T ⊂ SE(3), takes O(m|T |) time, assuming m1,2 = O(m). This can be improved by the decomposition T = Tr × Tt where Tr ∈ SO(3) is the rotation set and Tt ∈ R3 is the translation set. For each rotation τr ∈ Tr , an FFT can be used for cumulative evaluation of the convolution for all τt ∈ Tt in O(m log |Tt |) assuming that |Tt |  m. The total time for evaluating all |T | = |Tr ||Tt | poses then becomes O(m|Tr | log |Tt |), which is a significant improvement over the cascade evaluation time of O(m|Tr ||Tt |). It is noticed that the SDF-based affinity function has higher variations around the points that are closer to the shape skeleton, hence the equispaced sampling on the uniform grid Gm can be replaced with a nonequispaced sampling on a more efficient tree-based data structure, such as an octree Qm0 . The affinity data is adaptively sampled on the oct-tree, with deeper subdivisions at the high skeletal density regions, resulting in a significant reduction of space- and time-complexities due to m0  m. However, the traditional FFT algorithm [13] needs to be replaced with a grid-free nonequispaced FFT algorithm, such as the one introduced in [39], resulting in an arithmetic complexity of O(αm0 |Tr | log(α|Tt |)) for the oversampling factor α > 1 (see [39] for implementation details), which outperforms the grid-based FFT as long as (m0 /m) < α. 6 Figure 11: 3 pairs of simple 2D solids are considered; the SDFs are precomputed offline, and used repeatedly to evaluate the shape complementarity score for different motions. Figure 12: Snapshots of a dynamic simulation using the virtual geometric force-model F(τ ) = −∇E(τ ) ∝ f (t, S1 , S2 ). The moving object may get trapped in a local energy well, as in (c). are convolved for different motions τ ∈ SE(2) represented by the 3-tuple (x, y, ϑ), where (x, y) is the coordinates of the moving solid’s centroid, and ϑ is its right-handed rotation around the positive z−axis. To validate the effectiveness of the continuous score function as a virtual energy-analogue in real-time applications, we first perform a rigid body dynamics simulation, assuming a potential force-field F(τ ) = −∇E(τ ) where E(τ ) ∝ −f (τ, S1 , S2 ) imposed by the stationary object S1 on the moving object S2 , presented in Figure 12 for a particular setting of inertia and damping coefficients. Such a virtual energy formulation conceives a purely geometric force-model, particularly useful for real-time applications such as semi-automatic solid assembly or userinteractive protein docking (e.g., using haptic devices). As expected from the formulation, the proximal component of affinity drags the moving object towards the binding site, where the medial component adjusts the orientation to maximize proper skeletal overlap. However, Figure 12 (c) depicts the possibility of getting trapped in local minima where there is no user interference, as is inevitable with any gradient-based optimization as well. To avoid this, a collection of |T0 | = 25 random initial configurations τ0 ∈ T0 are uniformly sampled in the range (x, y, ϑ)0 ∈ [−2.5, +2.5]2 ×[−π/4, +π/4]. For different possible pairing of the parts in Figure 11 (a), a conjugate-gradients (CG) maximization of the score f (τ ) is carried out for 100 iterations, starting from different initial configuration of the moving part,10 using a 2-point central-difference method Validation The search for a near-optimal assembly configuration can be addressed as an optimization of the score function. To investigate the general properties of the affinity function in practice, we first consider 3 simple 2D example, shown in Figure 11 (a). The circular arcs are approximated with line segments of at most 0.1 length units, and the affinity integral in (23) is numerically computed with an angular precision of δγ = η −1 cos θ δr ≤ 10−4 using Riemann sums. The affinity is computed over a uniform grid of query points with a resolution of 0.05 units of length, using the coefficients λ1 = 1, λ2 = 3, a thickness factor of σ = 0.5 and a generous truncation factor of  = 3σ = 1.5. The resulting SDF affinity fields ρ1,2 (p), plotted in Figure 11 (b), 10 This suffices for the simple 2D examples under consideration. However, a credible Monte Carlo search typically requires a larger sample size, and possibly larger number of iterations, in the case 10 Figure 14: Multiple CG optimization progress of cross-pairings, showing 5 instances out of 25 random starting configurations with highest local maxima. Figure 13: Multiple CG optimization progress of correct pairings, showing 5 instances out of 25 random starting configurations with highest local maxima. for computing the gradients, with δx = δy = 0.01 units of length, and δϑ = 0.01 radians. For each example, the top 20% (i.e., 5 solutions out of 25 which converged to the largest local maxima) are picked for inspection, the progress of which are plotted in Figure 13 for correct partners, and in Figure 14 for cross-pairings. For the proper pairings, the solution is within a translational RMSE of ≤ 0.024 − 0.063 units of length (comparable to the grid resolution, hence reasonable) and a rotational RMSE of ≤ 0.002 − 0.008 radians (0.30◦ − 0.47◦ ), of the correct assembly configuration known from visual perception. The RMSEs can exceed 0.15 − 0.32 unit lengths and 0.17 radians (∼ 10◦ ) for incorrect pairings, and is clearly correlated to the drops in the optimal scores, which are lower by at least 20 − 25% compared to that of the correct pairing of the same constituents. Therefore, the method is useful in feature recognition and classification by comparing pairwise correlations. Next, the effects of the SDF parameters on the score function and the RMSE are investigated with the help of Example 3 at the near-optimal configuration τ ∗ ≈ τ0 , where τ0 is picked at the true global maximum of the score function (known by visual perception), and τ ∗ is obtained with 10 CG steps meant for relaxation, each time with a different set of SDF parameters. Figure 15 (a) depicts the impact of the penalty factor p = λ2 /λ1 , keeping λ1 λ2 constant. As expected from the definition, f (τ ∗ ) does not change significantly with p ≥ 3.0 at the collision-free configuration τ ∗ (see Table 1 for an explanation). In addition, the translational RMSE decreases with increasing p, and remains in the range of 0.005 − 0.015 units of length, which ensures the objectivity of the solution with respect to the choice of penalty ratio. However, the sensitivity of the Figure 15: The effects of the SDF parameters p = λ2 /λ1 and σ on the score and the RMSE. score function to changes in τ increases with p, which can be characterized by the increase in |∇2 f (τ ∗ )| (not shown here), due to higher intolerance to collision. p  1 strictly prohibits collision, while slight penetrations might be allowed with p ≈ 1 in the case of soft assembly (explained in Section 3), hence the penalty factor is useful in tuning the flexibility of the assembly correlations, without significantly disturbing the optimal configuration. The central parameter to the medial effects in SDF is the thickness factor σ, the variation of which is investigated in Figure 15 (b). As a result of definition, increasing σ makes the Gaussian kernel sharper and more locally supported, decreasing the thickness of the medial regions. The result is higher sensitivity to deviations from optimal skeletal overlap, validated by the observed sharp increase in f (τ ∗ ) with decreasing σ. Letting σ  1 results in narrow and high-density medial regions, and allows precision assembly at the expense of a higher resolution requirement for the convolution, while 0.5 ≤ σ allows low-resolution docking for imperfect or flexible contact. We argue that this provides a means to adjust the geometric specificity of assembly features, which can be defined as the differences in geometric affinities between possible pairings, i.e., the change in the complementarity score when one partner is of more complicated shape features. For those cases, genetic algorithms can be used, assisted with FFT-based cumulative evaluation for large populations of samples in the configuration space, which will be presented elsewhere. 11 Figure 18: SDF-based shape complementarity score function variations for a pair of mechanical parts bounded by C 1 −discontinuous algebraic surfaces. Figure 16: DSL-based shape complementarity score function variations for a pair of proteins (namely, NTF2 and GTPase Ran) (PDB Code: 1A2K) [48]. nuclear transport factor 2 (NTF2) and the GTPase Ran (PDB Code: 1A2K) [48]. The plots show the shape complementarity score function changes for translations along xy−, yz− and zx− planes, for a fixed relative orientation (same as the native configuration). Figure 16 uses the DSL-based formulation of the density function in Section 3 while Figure 17 uses our SDF-based formulation. The cross-correlation of both density functions accurately predicts the best fit at the native configuration. However, the former gives a score function of relatively narrow support with undesirable sharp spikes that make the search for the global optimum challenging. On the other hand, our formulation has the advantage of having a nonzero score function over a larger subspace of the configuration space, as well as much smoother variations that are required for gradient-based optimization (e.g., CG-like methods). Figure 18 similarly illustrates the variations of our SDF-based score function for a mechanical assembly with nontrivial matching features as well as sharp and dull corners. Once again, the best fit configuration is predicted correctly irrespective of geometric complexity of the interacting surface patches, whose detection and matching using feature-based heuristics is otherwise challenging. Figure 17: SDF-based shape complementarity score function variations for a pair of proteins (namely, NTF2 and GTPase Ran) (PDB Code: 1A2K) [48]. replaced with another.11 As was the case with the penalty factor, the choice of the thickness factor has little effect on the position of the near-optimal solution τ ∗ , noting that the RMSE remains in the range of 0.005 − 0.020 over one order of magnitude change in the score f (τ ∗ ) ∼ 1/σ. Therefore, the SDF parameters can be regulated to address the particular application needs (precision versus approximate assembly, rigid versus soft protein docking, broadening/narrowing the optimization pathway, etc.) without destabilizing the near-optimal solution. The next step is to validate the results for real 3D examples in solid assembly and protein-docking, the likes of which were shown in Figures 1 and 2 of the introduction. Figures 16 and 17 plot the variations of the shape complementarity score function using the cross-correlation formula in (7) for a pair of protein domains taken from the Xray crystallography of the protein complex formed by the 7 Conclusion A broad range of problems in geometric computing are dependent on a quantification of shape complementarity, which despite being intuitive to human perception for the most simple objects, is difficult to identify for general shapes. As we discussed in Section 3 in the context of the widely studied protein-docking problem, the existing techniques are mostly equipped with application-oriented heuristics, over-simplifications of the shapes, or restrictive assumptions on the building blocks in the first place. In Section 4 we proposed a theoretical framework to address the shape complementarity problem for objects of arbitrary shape in 2D and 3D, which can be extended in principle to higher dimensional spaces. We argued that the first step in the common paradigm of convolution-based scoreand-search, which is the proper formulation of the affinity function, essentially requires a projection of the shapes into a lower-dimensional space (i.e., the complex plane). We decomposed this process into two independent steps, first transforming the shape representation into an equiva- 11 The terminology is borrowed from protein-protein interaction energetics, where specificity is critical for proper molecular recognition and binding. 12 lent form in terms of Euclidean distances from the boundary elements to different observation points, projected to the complex plane (ζ−mapping), followed by integrating a kernel φ : C → C that extracts the relevant features of distance distribution to complementarity analysis. We argued that ostensibly different approaches to formulate the affinity function can be unified under the same conceptualization, differences being attributed to their choices of the φ−kernel. Furthermore, we proposed a particular kernel formulation that subsequently led to an implicit redefinition of the shape skeleton as a space-continuous density function, to which we referred as the skeletal density function (SDF). The φ−kernel was devised to impart two effects into the SDF; namely, a proximal effect due to the inversesquare component, the choice of which appeared natural for a density function in 3D supported by the discussion on spatial angles; and a medial component that assigns higher densities to the query points with more extensive −approximate nearest neighbor region on the boundary. We demonstrated in Section 6 that the proposed score model is consistent with our perception of a proper fit; it favors alignment of complementary sharp features, while avoids collision or separation, hence appears a strong candidate to replace the heuristics for algorithm design. We also showed that the branched topologies of the support region of the overlapped SDFs provide a pathway for the optimization algorithm (i.e., a low-energy valley, making the analogy between score maximization and energy minimization) with relevant local clues towards the near-optimal solution. This in turn enables the simplest gradient-based algorithms to converge in a few number of iterations, as validated in Section 6. In order to make the framework available for use in user-interactive real-time applications, more efficient data structures and algorithms need to be exploited, including all-approximate nearest neighbor search algorithms for faster computation of affinities, systematic adaptive sampling techniques, and nonequispaced FFTs for cumulative evaluation of optimization trials. [8] Rong Chen, Li Li, and Zhiping Weng. ZDOCK: An initial-stage protein-docking algorithm. Proteins: Structure, Function, and Bioinformatics, 52(1):80–87, 2003. [9] B. T. Cheok and A. Y. C. Nee. Trends and developments in the automation of design and manufacture of tools for metal stampings. Journal of Materials Processing Technology, 75(1):240–252, 1998. [10] Hyeong In Choi, Sung Woo Choi, and Hwan Pyo Moon. Mathematical theory of medial axis transform. Pacific Journal of Mathematics, 181(1):57–88, 1997. [11] Rezaul Chowdhury, Muhibur Rasheed, Donald Keidel, Maysam Moussalem, Arthur Olson, Michel Sanner, and Chandrajit L. Bajaj. Protein-protein docking with F2Dock 2.0 and GB-rerank. PloS one, 8(3):e51307, 2013. [12] Michael L. Connolly. Shape complementarity at the hemoglobin α1β1 subunit interface. Biopolymers, 25(7):1229–1247, 1986. [13] James W. Cooley and John W. Tukey. An algorithm for the machine calculation of complex Fourier series. Mathematics of computation, 19(90):297–301, 1965. [14] Dina Duhovny, Ruth Nussinov, and Haim J. Wolfson. Efficient unbound docking of rigid molecules. In Algorithms in bioinformatics, pages 185–200. Springer, 2002. [15] Bruce S. Duncan and Arthur J. Olson. Approximation and characterization of molecular surfaces. Biopolymers, 33(2):219–229, 1993. [16] Markus Eilers, Ashish B. Patel, Wei Liu, and Steven O. Smith. Comparison of helix interactions in membrane and soluble alpha-bundle proteins. Biophysical journal, 82(5):2720, 2002. [17] Miriam Eisenstein and Ephraim Katchalski-Katzir. On proteins, grids, correlations, and docking. Comptes rendus biologies, 327(5):409–420, 2004. [18] Daniel Fischer, Raquel Norel, Ruth Nussinov, and Haim J. Wolfson. 3-d docking of protein molecules. In Combinatorial Pattern Matching, pages 20–34. Springer, 1993. [19] Henry A. Gabb, Richard M. Jackson, Michael J. E. Sternberg, et al. Modelling protein docking using shape complementarity, electrostatics and biochemical information. Journal of Molecular Biology, 272(1):106–120, 1997. [20] Russell P. Goodman, Mike Heilemann, Sören Doose, Christoph M. Erben, Achillefs N. Kapanidis, and Andrew J. Turberfield. Reconfigurable, braced, threedimensional DNA nanostructures. Nature nanotechnology, 3(2):93–96, 2008. References [1] Pankaj K. Agarwal, Herbert Edelsbrunner, John Harer, and Yusu Wang. Extreme elevation on a 2-manifold. Discrete & Computational Geometry, 36(4):553–572, 2006. [21] Jung-Hyun Han, Mike Pratt, and William C. Regli. Manufacturing feature recognition from solid models: a status report. Robotics and Automation, IEEE Transactions on, 16(6):782–796, 2000. [2] Faisal A. Aldaye, Pik Kwan Lo, Pierre Karam, Christopher K. McLaughlin, Gonzalo Cosa, and Hanadi F. Sleiman. Modular construction of DNA nanotubes of tunable geometry and single-or double-stranded character. Nature Nanotechnology, 4(6):349–352, 2009. [22] Lin Hong, Xuenjun C. Zhang, Jean A. Hartsuck, and Jordan Tang. Crystal structure of an in vivo hiv-1 protease mutant in complex with saquinavir: Insights into the mechanisms of drug resistance. Protein Science, 9(10):1898– 1904, 2000. [3] Dominique Attali, Jean-Daniel Boissonnat, and Herbert Edelsbrunner. Stability and computation of medial axes: A state-of-the-art report. In Mathematical foundations of scientific visualization, computer graphics, and massive data exploration, pages 109–125. Springer, 2009. [23] Fan Jiang and Sung-Hou Kim. “soft docking”: Matching of molecular surface cubes. Journal of Molecular Biology, 219(1):79–102, 1991. [4] Chandrajit L. Bajaj, Rezaul Chowdhury, and Vinay Siddahanavalli. F2Dock: Fast Fourier protein-protein docking. IEEE/ACM Transactions on Computational Biology and Bioinformatics (TCBB), 8(1):45–58, 2011. [24] William A. Johnson and Robert F. Mehl. Reaction kinetics in processes of nucleation and growth. Trans. Aime, 135(8):396–415, 1939. [5] Chandrajit L. Bajaj and Vinay Siddavanahalli. F2Dock: A fast and Fourier based error-bounded approach to proteinprotein docking. Technical report, 2006. [25] Leo Joskowicz and Elisha Sacks. Computer-aided mechanical design using configuration spaces. Computing in Science & Engineering, 1(6):14–21, 1999. [6] Morad Behandish and Horea T. Ilieş. On a generic shape complementarity score function. Fall Workshop on Computational Geometry (FWCG’2014), 2014. [26] Ephraim Katchalski-Katzir, Isaac Shariv, Miriam Eisenstein, Asher A Friesem, Claude Aflalo, and Ilya A Vakser. Molecular surface recognition: determination of geometric fit between proteins and their ligands by correlation techniques. Proceedings of the National Academy of Sciences, 89(6):2195–2199, 1992. [7] J. E. Castrillon-Candas, Vinay Siddavanahalli, and Chandrajit L. Bajaj. Nonequispaced Fourier transforms for protein-protein docking. Technical report, 2005. 13 [27] John C. Kendrew, G. Bodo, Howard M. Dintzis, R.G. Parrish, H. Wyckoff, and D.C. Phillips. A three-dimensional model of the myoglobin molecule obtained by X-ray analysis. Nature, 181(4610):662–666, 1958. [48] M. Stewart, H. M. Kent, and A. J. McCoy. Structural basis for molecular recognition between nuclear transport factor 2 (NTF2) and the GDP-bound form of the Ras-family GTPase Ran. Journal of Molecular Biology, 277(3):635–646, 1998. [28] Daniel E. Koshland. The key–lock theory and the induced fit theory. Angewandte Chemie International Edition in English, 33(23-24):2375–2378, 1995. [49] Johan W. H. Tangelder and Remco C. Veltkamp. A survey of content based 3D shape retrieval methods. In Shape Modeling Applications, 2004. Proceedings, pages 145–156. IEEE, 2004. [29] Julio A. Kovacs, Pablo Chacon, Yao Cong, Essam Metwally, and Willy Wriggers. Fast rotational matching of rigid bodies by fast Fouriertransform acceleration of five degrees of freedom. Acta Crystallographica Section D: Biological Crystallography, 59(8):1371–1376, 2003. [50] Robert B. Tilove. Set membership classification: A unified approach to geometric intersection problems. IEEE Transactions on Computers, 100(10):874–883, 1980. [30] Dima Kozakov, Ryan Brenke, Stephen R Comeau, and Sandor Vajda. PIPER: An FFT-based protein docking program with pairwise potentials. Proteins: Structure, Function, and Bioinformatics, 65(2):392–406, 2006. [51] Andrea Torsello and Edwin R. Hancock. A skeletal measure of 2D shape similarity. Computer Vision and Image Understanding, 95(1):1 – 29, 2004. [52] Charlie C. L. Wang, Yu Wang, and Matthew M. F. Yuen. Design automation for customized apparel products. Computer-Aided Design, 37(7):675–691, 2005. [31] John Kuriyan, Boyana Konforti, and David Wemmer. The Molecules of Life: Physical and Chemical Principles. Garland Science, 2012. [53] Huajun Wang. Grid-search molecular accessible surface algorithm for solving the protein docking problem. Journal of Computational Chemistry, 12(6):746–750, 1991. [32] Jean Claude Latombe. Robot Motion Planning. Kluwer Academic Publishers, 1991. [33] Michael C. Lawrence and Peter M. Colman. Shape complementarity at protein/protein interfaces. Journal of Molecular Biology, 234(4):946–950, 1993. [54] Y. Wang. Coarse and reliable geometric alignment for protein docking y. wang, p. k. agarwal, p. brown, h. edelsbrunner, and j. rudolph pacific symposium on biocomputing 10: 64-75 (2005). In Pacific Symposium on Biocomputing, volume 10, pages 64–75. Citeseer, 2005. [34] Der-Tsai Lee. Medial axis transformation of a planar shape. Pattern Analysis and Machine Intelligence, IEEE Transactions on, (4):363–369, 1982. [55] Sungwook Woo and Paul WK Rothemund. Programmable molecular recognition based on the geometry of DNA nanostructures. Nature Chemistry, 3(8):620–627, 2011. [35] Hans-Peter Lenhof. New contact measures for the protein docking problem. In Proceedings of the First Annual International Conference on Computational Molecular Biology, pages 182–191. ACM, 1997. [56] Y. Wu, Y. Rong, W. Ma, and S. R. LeClair. Automated modular fixture planning: Geometric analysis. Robotics and Computer-Integrated Manufacturing, 14(1):1 – 15, 1998. [36] Tim Liedl, Björn Högberg, Jessica Tytell, Donald E Ingber, and William M Shih. Self-assembly of three-dimensional prestressed tensegrity structures from DNA. Nature Nanotechnology, 5(7):520–524, 2010. [37] T. Lozano-Perez. Spatial planning: A configuration space approach. IEEE Transactions on Computers, C-32(2):108– 120, 1983. [38] Nelson L Max and Elizabeth D Getzoff. Spherical harmonic molecular surfaces. Computer Graphics and Applications, IEEE, 8(4):42–50, 1988. [39] Daniel Potts, Gabriele Steidl, and Manfred Tasche. Fast Fourier transforms for nonequispaced data: A tutorial. In Modern sampling theory, pages 247–270. Springer, 2001. [40] J. Robert Reid, Victor M. Bright, and J.T. Butler. Automated assembly of flip-up micromirrors. Sensors and Actuators A: Physical, 66:292–298, 1998. [41] Aristides G. Requicha. Representations for rigid solids: Theory, methods, and systems. Journal of ACM Computational Surveys, 12(4):437–464, December 1980. [42] D. Ritchie. Recent progress and future directions in protein-protein docking. Current Protein and Peptide Science, 9(1):1–15, 2008. [43] David W. Ritchie and Graham J. L. Kemp. Protein docking using spherical polar Fourier correlations. Proteins: Structure, Function, and Bioinformatics, 39(2):178–194, 2000. [44] David W. Ritchie, Dima Kozakov, and Sandor Vajda. Accelerating and focusing protein-protein docking correlations using multi-dimensional rotational FFT generating functions. Bioinformatics, 24(17):1865–1873, 2008. [45] Peter John Rodrigo et al. 2D optical manipulation and assembly of shape-complementary planar microstructures. Opt. Express, 15(14):9009–9014, Jul 2007. [46] V. Shapiro. Handbook of Computer Aided Geometric Design, chapter Solid Modeling, pages 473–518. North Holland, 1st edition edition, 2001. [47] Brian K. Shoichet and Irwin D. Kuntz. Protein docking and complementarity. Journal of Molecular Biology, 221(1):327–346, 1991. 14
1cs.CV
Rethinking Skip-thought: A Neighborhood based Approach Shuai Tang1 , Hailin Jin2 , Chen Fang2 , Zhaowen Wang2 , Virginia R. de Sa1 1 Department of Cognitive Science, UC San Diego, La Jolla CA 92093, USA 2 Adobe Research, 345 Park Ave., San Jose CA 95110, USA {shuaitang93,desa}@ucsd.edu, {hljin,cfang,zhawang}@adobe.com arXiv:1706.03146v1 [cs.CL] 9 Jun 2017 Abstract We study the skip-thought model proposed by Kiros et al. (2015) with neighborhood information as weak supervision. More specifically, we propose a skip-thought neighbor model to consider the adjacent sentences as a neighborhood. We train our skip-thought neighbor model on a large corpus with continuous sentences, and then evaluate the trained model on 7 tasks, which include semantic relatedness, paraphrase detection, and classification benchmarks. Both quantitative comparison and qualitative investigation are conducted. We empirically show that, our skip-thought neighbor model performs as well as the skip-thought model on evaluation tasks. In addition, we found that, incorporating an autoencoder path in our model didn’t aid our model to perform better, while it hurts the performance of the skip-thought model. 1 Introduction We are interested in learning distributed sentence representation in an unsupervised fashion. Previously, the skip-thought model was introduced by Kiros et al. (2015), which learns to explore the semantic continuity within adjacent sentences (Harris, 1954) as supervision for learning a generic sentence encoder. The skip-thought model encodes the current sentence and then decodes the previous sentence and the next one, instead of itself. Two independent decoders were applied, since intuitively, the previous sentence and the next sentence should be drawn from 2 different conditional distributions, respectively. By posing a hypothesis that the adjacent sentences provide the same neighborhood informa- tion for learning sentence representation, we first drop one of the 2 decoders, and use only one decoder to reconstruct the surrounding 2 sentences at the same time. The empirical results show that our skip-thought neighbor model performs as well as the skip-thought model on 7 evaluation tasks. Then, inspired by Hill et al. (2016), as they tested the effect of incorporating an autoencoder branch in their proposed FastSent model, we also conduct experiments to explore reconstructing the input sentence itself as well in both our skip-thought neighbor model and the skip-thought model. From the results, we can tell that our model didn’t benefit from the autoencoder path, while reconstructing the input sentence hurts the performance of the skip-thought model. Furthermore, we conduct an interesting experiment on only decoding the next sentence without the previous sentence, and it gave us the best results among all the models. Model details will be discussed in Section 3. 2 Related Work Distributional sentence representation learning involves learning word representations and the compositionality of the words within the given sentence. Previously, Mikolov et al. (2013b) proposed a method for distributed representation learning for words by predicting surrounding words, and empirically showed that the additive composition of the learned word representations successfully captures contextual information of phrases and sentences. Similarly, Le and Mikolov (2014) proposed a method that learns a fixed-dimension vector for each sentence, by predicting the words within the given sentence. However, after training, the representation for a new sentence is hard to derive, since it requires optimizing the sentence representation towards an objective. Using an RNN-based autoencoder for language representation learning was proposed by Dai and Le (2015). The model combines an LSTM encoder, and an LSTM decoder to learn language representation in an unsupervised fashion on the supervised evaluation datasets, and then finetunes the LSTM encoder for supervised tasks on the same datasets. They successfully show that learning the word representation and the compositionality of words could be done at the same time in an end-to-end machine learning system. Since the RNN-based encoder processes an input sentence in the word order, it is obvious that the dependency of the representation on the starting words will decrease as the encoder processes more and more words. Tai et al. (2015) modified the plain LSTM network to a tree-structured LSTM network, which helps the model to address the long-term dependency problem. Other than modifying the network structure, additional supervision could also help. Bowman et al. (2016) proposed a model that learns to parse the sentence at the same time as the RNN is processing the input sentence. In the proposed model, the supervision comes from the objective function for the supervised tasks, and the parsed sentences, which means all training sentences need to be parsed prior to training. These two methods require additional preprocessing on the training data, which could be slow if we need to deal with a large corpus. Instead of learning to compose a sentence representation from the word representations, the skip-thought model Kiros et al. (2015) utilizes the structure and relationship of the adjacent sentences in the large unlabelled corpus. Inspired by the skip-gram model (Mikolov et al., 2013a), and the sentence-level distributional hypothesis (Harris, 1954), the skip-thought model encodes the current sentence as a fixed-dimension vector, and instead of predicting the input sentence itself, the decoders predict the previous sentence and the next sentence independently. The skip-thought model provides an alternative way for unsupervised sentence representation learning, and has shown great success. The learned sentence representation encoder outperforms previous unsupervised pretrained models on 8 evaluation tasks with no finetuning, and the results are comparable to supervised trained models. In Triantafillou et al. (2016), they finetuned the skip-thought models on the Stanford Natural Language Inference (SNLI) corpus (Bowman et al., 2015), which shows that the skip-thought pretraining scheme is generalizable to other specific NLP tasks. In Hill et al. (2016), the proposed FastSent model takes summation of the word representations to compose a sentence representation, and predicts the words in both the previous sentence and the next sentence. The results on this semantic related task is comparable with the RNN-based skip-thought model, while the skip-thought model still outperforms the FastSent model on the other six classification tasks. Later, Siamese CBOW (Kenter et al., 2016) aimed to learn the word representations to make the cosine similarity of adjacent sentences in the representation space larger than that of sentences which are not adjacent. Following the skip-thought model, we designed our skip-thought neighbor model by a simple modification. Section 3 presents the details. 3 Approach In this section, we present the skip-thought neighbor model. We first briefly introduce the skipthought model (Kiros et al., 2015), and then discuss how to explicitly modify the decoders in the skip-thought model to get the skip-thought neighbor model. 3.1 Skip-thought Model In the skip-thought model, given a sentence tuple (si−1 , si , si+1 ), the encoder computes a fixed-dimension vector as the representation zi for the sentence si , which learns a distribution p(zi |si ; θe ), where θe stands for the set of parameters in the encoder. Then, conditioned on the representation zi , two separate decoders are applied to reconstruct the previous sentence si−1 , and the next sentence si+1 , respectively. We call them previous decoder p(si−1 |zi ; θp ) and next decoder p(si+1 |zi ; θn ), where θ· denotes the set of parameters in each decoder. Since the two conditional distributions learned from the decoders are parameterized independently, they implicitly utilize the sentence order information within the sentence tuple. Intuitively, given the current sentence si , inferring the previous sentence si−1 is considered to be different from inferring the next sentence si+1 . Figure 1: The skip-thought neighbor model. The shared parameters are indicated in colors. The blue arrow represents the dependency on the representation produced from the encoder. For a given sentence si , the model tries to reconstruct its two neighbors, si−1 and si+1 . 3.2 3.4 Encoder: GRU In order to make the comparison fair, we choose to use a recurrent neural network with the gated recurrent unit (GRU) (Cho et al., 2014), which is the same recurrent unit used in Kiros et al. (2015). Since the comparison among different recurrent units is not our main focus, we decided to use GRU, which is a fast and stable recurrent unit. In addition, Chung et al. (2014) shows that, on language modeling tasks, GRU performs as well as the long short-term memory (LSTM) (Hochreiter and Schmidhuber, 1997). Suppose sentence si contains N words, which are wi1 , wi2 , ..., wiN . At an arbitrary time step t, the encoder produces a hidden state hti , and we regard it as the representation for the previous subsequence through time t. At time N , the hidden state hN i represents the given sentence si , which is zi . The computation flow of the GRU in our experiments is shown below (omitting the subscript i) :  t  m = σ Wh ht−1 + Wx xt t r ĥt = tanh Wxt + U rt t t h = (1 − m ) t−1 h +m xt (1) ht−1 t ĥ  (2) t (3) where is the embedding for the word and U are the parameter matrices, and element-wise product. 3.3 Our hypothesis is that, even without the order information within a given sentence tuple, the skipthought model should behave similarly in terms of the reconstruction error, and perform similarly on the evaluation tasks. To modify the skipthought model, given si , we assume that inferring si−1 is the same as inferring si+1 . If we define {si−1 , si+1 } as the two neighbors of si , then the inferring process can be denoted as sj ∼ p(s|zi ; θd ), for any j in the neighborhood of si . The conditional distribution learned from the decoder is parameterized by θd . In experiments, we directly drop one of the two decoders, and use only one decoder to reconstruct the previous sentence si−1 and next sentence si+1 at the same time, given the representation zi of si . Our skip-thought neighbor model can be considered as sharing the parameters between the previous decoder and the next decoder in the original skip-thought model. An illustration is shown in Figure 1. The objective at each time step is defined as the log-likelihood of the predicted word given the previous words, which is `ti,j (θe , θd ) = log p(wjt |wj<t , zi ; θe , θd ) X X X max `ti,j (θe , θd ) θe ,θd wit , W· is the Decoder: Conditional GRU The decoder needs to reconstruct the previous sentence si−1 and the next sentence si+1 given the representation zi . Specifically, the decoder is a recurrent neural network with conditional GRU, and it takes the representation zi as an additional input at each time step. Skip-thought Neighbor Model i j∈{i−1,i+1} (4) (5) t where θe is the set of parameters in the encoder, and θd is the set of parameters in the decoder. The loss function is summed across the whole training corpus. 3.5 Skip-thought Neighbor with Autoencoder Previously, we defined {si−1 , si+1 } as the two neighbors of si . In addition, we assume that si could also be a neighbor of itself. Therefore, the neighborhood of si becomes {si−1 , si , si+1 }. In- r SICK ρ MSE 72.1 / 81.7 72.8 / 81.5 73.5 / 82.1 71.5 / 80.8 72.9 / 81.6 73.7 / 81.7 0.8108 0.8294 0.8381 0.8196 0.8264 0.8312 0.7382 0.7594 0.7721 0.7510 0.7535 0.7610 0.3498 0.3192 0.3039 0.3350 0.3237 0.3164 87.2 89.6 88.7 81.6 86.0 83.2 73.3 / 81.7 73.2 / 81.7 75.4 / 83.0 72.2 / 81.4 72.8 / 81.4 73.2 / 81.4 0.8128 0.8198 0.8347 0.7888 0.7908 0.8086 0.7450 0.7572 0.7680 0.7224 0.7249 0.7410 0.3493 0.3389 0.3135 0.3874 0.3824 0.3562 84.8 87.4 88.6 73.8 / 81.9 72.3 / 81.3 75.0 / 82.5 0.8207 0.8271 0.8396 0.7512 0.7630 0.7739 0.3330 0.3223 0.3013 Model MR CR SUBJ MPQA TREC MSRP (Acc/F1) uni-N-1200 bi-N-1200 combine-N-1200 uni-skip-1200 bi-skip-1200 combine-skip-1200 71.5 71.9 73.6 72.1 72.9 74.0 78.4 79.3 80.2 77.8 79.3 80.4 90.1 90.8 91.4 90.5 90.6 91.5 83.4 85.2 85.7 84.2 85.2 86.1 85.2 88.8 89.0 86.0 87.6 87.8 uni-N-1200+AE bi-N-1200+AE combine-N-1200+AE uni-skip-1200+AE bi-skip-1200+AE combine-skip-1200+AE 70.8 71.1 72.4 68.4 70.0 71.6 75.9 78.4 78.6 76.5 76.4 78.0 90.4 90.8 91.5 89.4 89.6 90.7 82.7 83.7 84.3 81.4 81.4 83.2 uni-N-next-1200 bi-N-next-1200 combine-N-next-1200 73.3 75.0 75.8 80.0 80.5 81.8 90.7 91.1 91.9 84.9 86.5 86.8 Table 1: The model name is given by encoder type - model type - model size with or without autoencoder branch +AE. Bold numbers indicate the best results among all models. Without the autoencoder branch, our skip-thought neighbor models perform as well as the skip-thought models, and our “next” models slightly outperform the skip-thought models. However, with the autoencoder branch, our skip-thought neighbor models outperform the skip-thought models. ferring sj ∼ p(s|zi ; θd ) for any j in the neighborhood of si then involves adding an autoencoder path into to our skip-thought neighbor model. In experiments, the decoder in the model is required to reconstruct all three sentences {si−1 , si , si+1 } in the neighborhood of si at the same time. The objective function becomes X X X t max li,j (θe , θd ) (6) θe ,θd i j∈{i−1,i,i+1} t Previously Hill et al. (2016) tested adding an autoencoder path into their FastSent model. Their results show that, with the additional autoencoder path, the performance on the classification tasks slightly improved, while there was no significant performance gain or loss on the semantic relatedness task. We tested both our skip-thought neighbor model and the original skip-thought model with the autoencoder path, respectively. The results are presented in Sections 4, 5 and 6. 3.6 Skip-thought Neighbor with One Target In our skip-thought neighbor model, for a given sentence si , the decoder needs to reconstruct the sentences in its neighborhood {si−1 , si+1 }, which are two targets. We denote the inference process as si → {si−1 , si+1 }. For the next sentence si+1 , the inference process is si+1 → {si , si+2 }. In other words, for a given sentence pair {si , si+1 }, the inference process includes si → si+1 and si+1 → si . In our hypothesis, the model doesn’t distinguish between the sentences in a neighborhood. In this case, an inference process that includes si → si+1 and si+1 → si is equivalent to an inference process with only one of them. Thus, we define a skip-thought neighbor model with only one target, and the target is always the next sentence. The objective becomes XX max `ti,i+1 (θe , θd ) (7) θe ,θd 4 i t Experiment Settings The large corpus that we used for unsupervised training is the BookCorpus dataset (Zhu et al., 2015), which contains 74 million sentences from 7000 books in total. All of our experiments were conducted in Torch7 (Collobert et al., 2011). To make the comparison fair, we reimplemented the skip-thought model under the same settings, according to Kiros et al. (2015), and the publicly available theano code1 . We adopted the multi-GPU train1 https://github.com/ryankiros/skip-thoughts ing scheme from the Facebook implementation of ResNet2 . We use the ADAM (Kingma and Ba, 2014) algorithm for optimization. Instead of applying the gradient clipping according to the norm of the gradient, which was used in Kiros et al. (2015), we directly cut off the gradient to make it within [−1, 1] for stable training. The dimension of the word embedding and the sentence representation are 620 and 1200. respectively. For the purpose of fast training, all the sentences were zero-padded or clipped to have the same length. 5 Quantitative Evaluation We compared our proposed skip-thought neighbor model with the skip-thought model on 7 evaluation tasks, which include semantic relatedness, paraphrase detection, question-type classification and 4 benchmark sentiment and subjective datasets. After unsupervised training on the BookCorpus dataset, we fix the parameters in the encoder, and apply it as a sentence representation extractor on the 7 tasks. For semantic relatedness, we use the SICK dataset (Marelli et al., 2014), and we adopt the feature engineering idea proposed by Tai et al. (2015). For a given sentence pair, the encoder computes a pair of representations, denoted as u and v, and the concatenation of the component-wise product u · v and the absolute difference |u − v| is regarded as the feature for the given sentence pair. Then we train a logistic regression on top of the feature to predict the semantic relatedness score. The evaluation metrics are Pearsons r, Spearmans ρ, and mean squared error M SE. The dataset we use for the paraphrase detection is the Microsoft Paraphrase Detection Corpus (Dolan et al., 2004). We follow the same feature engineering idea from Tai et al. (2015) to compute a single feature for each sentence pair. Then we train a logistic regression, and 10-fold cross validation is applied to find the optimal hyperparameter settings. The 5 classification tasks are question-type classification (TREC) (Li and Roth, 2002), movie review sentiment (MR) (Pang and Lee, 2005), customer product reviews (CR) (Hu and Liu, 2004), subjectivity/objectivity classification 2 https://github.com/facebook/fb.resnet.torch (SUBJ) (Pang and Lee, 2004), and opinion polarity (MPQA) (Wiebe et al., 2005). In order to deal with more words besides the words used for training, the same word expansion method, which was introduced by Kiros et al. (2015), is applied after training on the BookCorpus dataset. The results are shown in Table 1, where the model name is given by encoder type - model type - model size. We tried with three different types of the encoder, denoted as uni-, bi-, and combinein Table 1. The first one is a uni-directional GRU, which computes a 1200-dimension vector as the sentence representation. The second one is a bi-directional GRU, which computes a 600dimension vector for each direction, and then the two vectors are concatenated to serve as the sentence representation. Third, after training the unidirectional model and the bi-directional model, the representation from both models are concatenated together to represent the sentence, denoted as combine-. In Table 1, -N- refers to our skip-thought neighbor model, -N-next- refers to our skip-thought neighbor with only predicting the next sentence, and -skip- refers to the original skip-thought model. 5.1 Skip-thought Neighbor vs. Skip-thought From the results we show in Table 1, we can tell that our skip-thought neighbor models perform as well as skip-thought models but with fewer parameters, which means that the neighborhood information is effective in terms of helping the model capture sentential contextual information. 5.2 Skip-thought Neighbor+AE vs. Skip-thought+AE For our skip-thought neighbor model, incorporating an antoencoder (+AE) means that, besides reconstructing the two neighbors si−1 and si+1 , the decoder also needs to reconstruct si . For the skipthought model, since the implicit hypothesis in the model is that different decoders learn different conditional distributions, we add another decoder in the skip-thought model to reconstruct the sentence si . The results are also shown in Table 1. As we can see, our skip-thought neighbor+AE models outperform skip-thought+AE models significantly. Specifically, in skip-thought model, adding an autoencoder branch hurts the performance on SICK, MR, CR, SUBJ and MPQA dataset. We find that the reconstruction error on the autoencoder branch decreases drastically during training, while the sum of the reconstruction errors on the previous decoder and next decoder fluctuates widely, and is larger than that in the model without the autoencoder branch. It seems that, the autoencoder branch hurt the skip-thought model to capture sentential contextual information from the surrounding sentences. One could vary the weights on the three independent branches to get better results, but it is not our main focus in this paper. In our skip-thought neighbor model, the inclusion of the autoencoder constraint did not have the same problem. With the autoencoder branch, the model gets lower errors on reconstructing all three sentences. However, it doesn’t help the model to perform better on the evaluation tasks. 5.3 Skip-thought Neighbor with One Target Compared to the skip-thought model, our skipthought neighbor model with one target contains fewer parameters, and runs faster during training, since for a given sentence, our model only needs to reconstruct its next sentence while the skipthought model needs to reconstruct its surrounding two sentences. The third section in Table 1 presents the results of our model with only one target. Surprisingly, it overall performs as well as the skip-thought models as all previous models. A Note on Normalizing the Representation An interesting observation was found when we were investigating the publicly available code for Kiros et al. (2015), which is, during training, the representation produced from the encoder will be directly sent to the two decoders, however, after training, the output from the encoder will be normalized to keep the l2-norm as 1, so the sentence representation is a normalized vector. r SICK ρ MSE uni-N-1200 bi-N-1200 combine-N-1200 uni-skip-1200 bi-skip-1200 combine-skip-1200 0.8174 0.8339 0.8360 0.8232 0.8280 0.8340 0.7409 0.7603 0.7645 0.7493 0.7526 0.7600 0.3404 0.3102 0.3054 0.3292 0.3203 0.3100 uni-N-1200+AE bi-N-1200+AE combine-N-1200+AE uni-skip-1200+AE bi-skip-1200+AE combine-skip-1200+AE 0.8210 0.8302 0.8326 0.7959 0.7986 0.8129 0.7450 0.7610 0.7621 0.7255 0.7282 0.7400 0.3493 0.3169 0.3285 0.3760 0.3693 0.3508 uni-N-next-1200 bi-N-next-1200 combine-N-next-1200 0.8253 0.8296 0.8402 0.7508 0.7621 0.7706 0.3245 0.3175 0.2999 Model Increasing the Number of Neighbors We also explored adding more neighbors into our skip-thought neighbor model. Besides using one decoder to predict the previous 1 sentence, and the next 1 sentence, we expand the neighborhood to contain 4 sentences, which are the previous 2 sentences, and the next 2 sentences. In this case, the decoder is required to reconstruct 4 sentences at the same time. We ran experiments with our model, and we evaluated the trained encoder on 7 tasks. There is no significant performance gain or loss on our model trained with 4 neighbors; it seems that, increasing the number of neighbors doesn’t improve the performance, but it also doesn’t hurt the performance. Our hypothesis is that, reconstructing four different sentences in a neighborhood with only one set of parameters is a hard task, which might distract the model from capturing the sentential contextual information. 5.4 5.5 Table 2: Evaluation on SICK dataset without normalizing the representation. Bold numbers indicate the best values among all models. We conducted experiments on the effect of normalization during the evaluation, and we evaluated both on our skip-thought neighbor model, and our implemented skip-thought model. Generally, the normalization step slightly hurts the performance on the semantic relatedness SICK task, while it improves the performance across all the other classification tasks. The Table 1 presents the results with the normalization step, and Table 2 presents the results without normalization on SICK dataset. 6 Qualitative Investigation We conducted investigation on the decoder in our trained skip-thought neighbor model. 6.1 Sentence Retrieval We first pick up 1000 sentences as the query set, and then randomly pick up 1 million sentences as the database. In the previous section, we i wish i had a better answer to that question . i wish i knew the answer . i only wish i had an answer . i kept my eyes on the shadowed road , watching my every step . i kept my eyes at my feet and up ahead on the trail . i kept on walking , examining what i could out of the corner of my eye . the world prepared to go into its hours of unreal silence that made it seem magical , and it really was . the world changed , and a single moment of time was filled with an hour of thought . everything that was magical was just a way of describing the world in words it could n’t ignore . my phone buzzed and i awoke from my trance . i flipped my phone shut and drifted off to sleep . i grabbed my phone and with groggy eyes , shut off the alarm . i threw my bag on my bed and took off my shoes . i sat down on my own bed and kicked off my shoes . i fell in bed without bothering to remove my shoes . Table 3: In each section, the first sentence is the query, the second one is the nearest neighbor retrieved from the database, and the third one is the 2nd nearest neighbor. The similarity between every sentence pair is measure by the cosine similarity in the representation space. mentioned that normalization improves the performance of the model, so the distance measure we applied in the sentence retrieval experiment is the cosine distance. Most of retrieved sentences look semantically related and can be viewed as the sentential contextual extension to the query sentences. Several samples can be found in Table 3. 6.2 Conditional Sentence Generation “ i do n’t want to talk about it . ” “ i ’m not going to let you drive me home . ” “ hey , what ’s wrong ? ” i ’m not sure how i feel about him . i was n’t going to be able to get to the beach . he was n’t even looking at her . “ i guess you ’re right . ” Table 4: Samples of the generated sentences. Since the models are trained to minimizing the reconstruction error across the whole training corpus, it is reasonable to analyze the behavior of the decoder on the conditional sentence generation. We first randomly pick up sentences from the training corpus, and compute a representation for each of them. Then, we greedily decode the representations to sentences. Table 4 presents the generated sentences. Several interesting observations worth mentioning here. The decoder in our skip-thought neighbor model aims to minimize the distance of the gen- erated sentence to two targets, which lead us to doubt if the decoder is able to generate at least grammatically-correct English sentences. But, the results shows that the generated sentences are both grammatically-correct and generally meaningful. We also observe that, the generated sentences tend to have similar starting words, and usually have negative expression, such as i was n’t, i ’m not, i do n’t, etc. After investigating the training corpus, we noticed that this observation is caused by the dataset bias. A majority of training sentences start with i and i ’m and i was , and there is a high chance that the negation comes after was and ’m. In addition, the generated sentences rarely are the sentential contextual extension of their associated input sentences, which is same for the skipthought models. More investigations are needed for the conditional sentence generation. 7 Conclusion We proposed a hypothesis that the neighborhood information is effective in learning sentence representation, and empirically tested our hypothesis. Our skip-thought neighbor models were trained in an unsupervised fashion, and evaluated on 7 tasks. The results showed that our models perform as well as the skip-thought models. Furthermore, our model with only one target performs better than the skip-thought model. Future work could explore more on the our skip-thought neighbor model with only one target, and see if the pro- posed model is able to generalize to even larger corpora, or another corpus that is not derived from books. Tom Kenter, Alexey Borisov, and Maarten de Rijke. 2016. Siamese cbow: Optimizing word embeddings for sentence representations. In ACL. Acknowledgments Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 . We gratefully thank Jeffrey L. Elman, Benjamin K. Bergen, Seana Coulson, and Marta Kutas for insightful discussion, and thank Thomas Andy Keller, Thomas Donoghue, Larry Muhlstein, and Reina Mizrahi for suggestive chatting. We also thank Adobe Research Lab for GPUs support, and thank NVIDIA for DGX-1 trial as well as support from NSF IIS 1528214 and NSF SMA 1041755. References Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In EMNLP. Samuel R. Bowman, Jon Gauthier, Abhinav Rastogi, Raghav Gupta, Christopher D. Manning, and Christopher Potts. 2016. A fast unified model for parsing and sentence understanding. In ACL. Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP. Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555 . R. Collobert, K. Kavukcuoglu, and C. Farabet. 2011. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop. Andrew M. Dai and Quoc V. Le. 2015. supervised sequence learning. In NIPS. Semi- William B. Dolan, Chris Quirk, and Chris Brockett. 2004. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In COLING. Zellig S Harris. 1954. Distributional structure. Word 10(2-3):146–162. Felix Hill, Kyunghyun Cho, and Anna Korhonen. 2016. Learning distributed representations of sentences from unlabelled data. In HLT-NAACL. Sepp Hochreiter and Juergen Schmidhuber. 1997. Long short-term memory. Neural Computation 9:1735–1780. Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In KDD. Jamie Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Skip-thought vectors. In NIPS. Quoc V. Le and Tomas Mikolov. 2014. Distributed representations of sentences and documents. In ICML. Xin Li and Dan Roth. 2002. Learning question classifiers. In COLING. Marco Marelli, Stefano Menini, Marco Baroni, Luisa Bentivogli, Raffaella Bernardi, and Roberto Zamparelli. 2014. A sick cure for the evaluation of compositional distributional semantic models. In LREC. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013a. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781 . Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. 2013b. Distributed representations of words and phrases and their compositionality. In NIPS. Bo Pang and Lillian Lee. 2004. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In ACL. Bo Pang and Lillian Lee. 2005. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In ACL. Kai Sheng Tai, Richard Socher, and Christopher D. Manning. 2015. Improved semantic representations from tree-structured long short-term memory networks. In ACL. Eleni Triantafillou, Jamie Ryan Kiros, Raquel Urtasun, and Richard Zemel. 2016. Towards generalizable sentence embeddings. In RepL4NLP, ACL Workshop. Janyce Wiebe, Theresa Wilson, and Claire Cardie. 2005. Annotating expressions of opinions and emotions in language. Language Resources and Evaluation 39:165–210. Yukun Zhu, Ryan Kiros, Richard S. Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. ICCV pages 19–27.
2cs.AI
1 FoodNet: Recognizing Foods Using Ensemble of Deep Networks arXiv:1709.09429v1 [cs.CV] 27 Sep 2017 Paritosh Pandey∗, Akella Deepthi∗ , Bappaditya Mandal and N. B. Puhan Abstract—In this work we propose a methodology for an automatic food classification system which recognizes the contents of the meal from the images of the food. We developed a multilayered deep convolutional neural network (CNN) architecture that takes advantages of the features from other deep networks and improves the efficiency. Numerous classical handcrafted features and approaches are explored, among which CNNs are chosen as the best performing features. Networks are trained and fine-tuned using preprocessed images and the filter outputs are fused to achieve higher accuracy. Experimental results on the largest real-world food recognition database ETH Food-101 and newly contributed Indian food image database demonstrate the effectiveness of the proposed methodology as compared to many other benchmark deep learned CNN frameworks. Index Terms—Deep CNN, Food Recognition, Ensemble of Networks, Indian Food Database. I. I NTRODUCTION AND C URRENT A PPROACHES T HERE has been a clear cut increase in the health consciousness of the global urban community in the previous few decades. Given the rising number of cases of health problems attributed to obesity and diabetes reported every year, people (including elderly, blind or semi-blind or dementia patients) are forced to record, recognize and estimate calories in their meals. Also, in the emerging social networking photo sharing, food constitutes a major portion of these images. Consequently, there is a rise in the market potential for such fitness apps products which cater to the demand of logging and tracking the amount of calories consumed, such as [1], [2]. Food items generally tend to show intra-class variation depending upon the method of preparation, which in turn is highly dependent on the local flavors as well as the ingredients used. This causes large variations in terms of shape, size, texture, and color. Food items also do not exhibit any distinctive spatial layout. Variable lighting conditions and the point of view also lead to intra-class variations, thus making the classification problem even more difficult [3], [4], [5]. Hence food recognition is a challenging task, one that needs addressing. In the existing literature, numerous methodologies assume that the texture, color and shape of food items are well defined [6], [7], [8], [9]. This may not be true because of the local variations in the method of food preparation, as well as the ingredients used. Feature descriptors like histogram P. Pandey, A. Deepthi and N. B. Puhan are with the School of Electrical Science, Indian Institute of Technology (IIT), Bhubaneswar, Odisha 751013, India. E-mail: {pp20, da10, nbpuhan}@iitbbs.ac.in B. Mandal is with the Kingston University, London, Surrey KT1 2EE, United Kingdom. Email: [email protected] ∗ Represents equal contribution from the authors. of gradient, color correlogram, bag of scale-invariant feature transform, local binary pattern, spatial pyramidal pooling, speeded up robust features (SURF), etc, have been applied with some success on small datasets [9]. Hoashi et al. in [10], and Joutou et al. in [11] propose multiple kernel learning methods to combine various feature descriptors. The features extracted have generally been used to train an SVM [12], with a combination of these features being used to boost the accuracy. A rough estimation of the region in which targeted food item is present would help to raise the accuracy for cases with non-uniform background, presence of other objects and multiple food items [13]. Two such approaches use standard segmentation and object detection methods [14] or asking the user to input a bounding box providing this information [15]. Kawano et al. [15], [16] proposed a semi-automated approach for bounding box formation around the image and developed a real-time recognition system. It is tedious, unmanageable and does not cater to the need of full automation. Automatic recognition of dishes would not only help users effortlessly organize their extensive photo collections but would also help online photo repositories make their content more accessible. Lukas et al. in [17] have used a random forest to find discriminative region in an image and have shown to under perform convolutional neural network (CNN) feature based method [18]. In order to improve the accuracy, Bettadapura et al. in [19] used geotagging to identify the restaurant and search for matching food item in its menu. Matsuda et al. in [20] employed co-occurrence statistics to classify multiple food items in an image by eliminating improbable combinations. There has been certain progress in using ingredient level features [21], [22], [23] to identify the food item. A variant of this method is the usage of pairwise statistics of local features [24]. In the recent years CNN based classification has shown promise producing excellent results even on large and diverse databases with non-uniform background. Notably, deep CNN based transferred learning using fine-tuned networks is used in [25], [26], [27], [28], [29] and cascaded CNN networks are used in [30]. In this work, we extend the CNN based approaches towards combining multiple networks and extract robust food discriminative features that would be resilient against large variations in food shape, size, color and texture. We have prepared a new Indian food image database for this purpose, the largest to our knowledge and experimented on two large databases, which demonstrates the effectiveness of the proposed framework. We will make all the developed models and Indian food database available online to public [31]. 2 Section II describes our proposed methodology and Section III provides the experimental results before drawing conclusions in Section IV. II. P ROPOSED M ETHOD Our proposed framework is based on recent emerging very large deep CNNs. We have selected CNNs because their ability to learn operations on visual data is extremely good and they have been employed to obtain higher and higher accuracies on challenges involving large scale image data [32]. We have performed extensive experiments using different handcrafted features (such as bag of words, SURF, etc) and CNN feature descriptors. Experimental results show that CNNs outperform all the other methods by a huge margin, similar to those reported in [9] as shown in Table I. It can be seen that CNN based methods (SELC & CNN) features performs much better as compared to others. TABLE I ACCURACY (%) OF HANDCRAFTED & CNN FEATURES ON ETH F OOD -101 DATABASE . T HE METHODS ARE SURF + B AG OF W ORDS 1024 (BW1024), SURF + I NDEPENDENT F ISCHER V ECTOR 64 (SURF+IFV64), B AG OF W ORDS (BW), I NDEPENDENT F ISCHER V ECTORS (IFV), M ID - LEVEL D ISCRIMINATIVE S UPERPIXEL (MDS), R ANDOM F OREST D ISCRIMINATIVE C OMPONENT (RFDC), S UPERVISED E XTREME L EARNING C OMMITTEE (SELC) AND A LEX N ET TRAINED FROM SCRATCH (CNN). Methods Top-1 BW1024 33.47 SURF+IFV64 44.79 BW 28.51 IFV 38.88 MDS 42.63 RFDC 50.76 SELC 55.89 CNN 56.40 A. Proposed Ensemble Network Architecture We choose AlexNet architecture by Krizhevsky et al. [18] as our baseline because it offers the best solution in terms of significantly lesser computational time as compared to any other state-of-the-art CNN classifier. GoogLeNet architecture by Szegedy et al. [33] uses the sparsity of the data to create dense representations that give information about the image with finer details. It develops a network that would be deep enough, as it increases accuracy and yet have significantly less parameters to train. This network is an approximation of the sparse structure of a convolution network by dense components. The building blocks called Inception modules, is basically a concatenation of filter banks with a mask size of 1 × 1, 3 × 3 and 5 × 5. If the network is too deep, the inception modules lead to an unprecedented rise in the cost of computation. Therefore, 1 × 1 convolutions are used to embed the data output from the previous layers. ResNet architecture by He et al. [34] addresses the problem of degradation of learning in networks that are very deep. In essence a ResNet is learning on residual functions of the input rather than unreferenced functions. The idea is to reformulate the learning problem into one that is easier for the network to learn. Here the original problem of learning a function H(x) gets transformed into learning non-linearly by various layers fitting the functional form H(x) = Γ(x) + x, which is easier to learn, where the layers have already learned Γ(x) and the original input is x. These CNN networks are revolutionary in the sense that they were at the top of the leader board of ImageNet classification at one or other time [32], with ResNet being the network with maximum accuracy at the time Fig. 1. Our proposed CNN based ensemble network architecture. of writing this paper. The main idea behind employing these networks is to compare the increment in accuracies with the depth of the network and the number of parameters involved in training. Our idea is to create an ensemble of these classifiers using another CNN on the lines of a Siamese network [35] and other deep network combinations [36]. In a Siamese network [35], two or more identical subnetworks are contained within a larger network. These subnetworks have the same configuration and weights. It has been used to find comparisons or relationships between the two input objects or patches. In our architecture, we use this idea to develop a three layered structure to combine the feature outputs of three different subsections (or subnetworks) as shown in Fig. 1. We hypothesize that these subnetworks with proper fine-tuning would individually contribute to extract better discriminative features from the food images. However, the parameters along with the subnetwork architectures are different and the task is not that of comparison (as in case of Siamese network [35]) but pursue classification of food images. Our proposition is that the features once added with appropriate weights would give better classification accuracies. Let I(w, h, c) represents a pre-processed input image of size w × h pixels to each of the three fine-tuned networks and c is the number of channels of the image. Color images are used in our case. We denote C(m, n, q) as the convolutional layer, where m and n are the sides length of the receptive field and q is the number of filter banks. Pooling layer is denoted by P (s, r), where r is the side length of the pooling receptive field and s is the number of strides used in our CNN model. In our ensemble net we did not use pooling. But in our fine-tuned networks pooling is employed with variable parameters. GoogLeNet for example uses overlapping pooling in the inception module. All convolution layers are followed by ReLU layers (see the text in Sec II-B) considered as an inbuilt activation. L represents the local response normalization layer. Fully connected layer is denoted by F (e), where e is the number of neurons. Hence, the AlexNet CNN model after fine-tuning is represented as: ΦA ≡ I(227, 227, 3) −→ C(11, 4, 96) −→ L −→ P (2, 3) −→ C(5, 1, 256) −→ L −→ P (2, 3) −→ C(3, 1, 384) −→ C(3, 1, 384) −→ C(3, 1, 256) (1) −→ P (2, 3) −→ F (4096) −→ F (4096) −→ F (e). AlexNet is trained in a parallel fashion, referred as a depth of 2. Details of the architecture can be found in [18]. For GoogLeNet we need to define the inception module as: D(c1, cr3, c3, cr5, c5, crM ), where c1, c3 and c5 represent number of filter of size 1 × 1, 3 × 3 and 5 × 5, respectively. cr3 and cr5 represent number of 1 × 1 filters used in the reduction layer prior to 3 × 3 and 5 × 5 filters, and crM represents the 3 number of 1 × 1 filters used as reduction after the built in max pool layer. Hence GoogLeNet is fine-tuned as: ΦG ≡ I(224, 224, 3) −→ C(7, 2, 64) −→ P (2, 3) −→ L −→ C(1, 1, 64) −→ C(3, 1, 192) −→ L −→ P (2, 3) −→ D(64, 96, 128, 16, 32, 32) −→ D(128, 128, 192, 32, 96, 64) −→ P (2, 3) −→ D(192, 96, 208, 16, 48, 64) −→ D(160, 112, 224, 24, 64, 64) −→ (2) D(128, 128, 256, 24, 64, 64) −→ D(112, 144, 288, 32, 64, 64) −→ D(256, 160, 320, 32, 128, 128) −→ P (2, 3) −→ D(256, 160, 320, 32, ∗ (1, 7) −→ F (e), 128, 128) −→ D(384, 192, 384, 48, 128, 128) −→ P P ∗ refers to average pooling rather than max pooling used everywhere else. For fine-tuned ResNet, each repetitive residual unit is presented inside as R and it is defined as: ΦR ≡ I(224, 224, 3) −→ C(7, 2, 64) −→ P (2, 3) −→ 3 × R(C(1, 1, 64) −→ C(3, 1, 64) −→ C(1, 1, 256)) −→ R(C(1, 2, 128) −→ C(3, 2, 128) −→ C(1, 2, 512)) −→ 3 × R(C(1, 1, 128) −→ C(3, 1, 128) −→ C(1, 1, 512)) −→ R(C(1, 2, 256) −→ C(3, 2, 256) −→ C(1, 2, 1024)) −→ 5 × R(C(1, 1, 256) −→ C(3, 1, 256) −→ (3) C(1, 1, 1024)) −→ R(C(1, 2, 512) −→ C(3, 2, 512) −→ C(1, 2, 2048)) −→ 2 × R(C(1, 1, 512) −→ C(3, 1, 512) −→ C(1, 1, 2048)) ∗ −→ P (1, 7) −→ F (e). Batch norm is used after every convolution layer in ResNet. The summations at the end of each residual unit are followed by a ReLU unit. For all cases, the length of F (e) depends on the number of categories to classify. In our case, e is the number of classes. Let Fi denote the features from each of the fine-tuned deep CNNs given by (1)-(3), where i ∈ {A, G, R}. Let the concatenated features are represented by Ω(O, c), where O is the output features from all networks, given by: O = concatenate(wi Fi ) | ∀ i, (4) where wi is the weight given to features from each of the networks with the constraint, such that Σi wi = 1. We define the developed ensemble net as the following: ΦE ≡ Ω(e ∗ η, c) −→ ReLU −→ F (e) −→ Sof tM ax, (5) where η is the number of fine-tuned networks. The Sof tM ax function or the normalized exponential function is defined as: expFj , for j = 1, 2, . . . , e, S(F )j = Pe Fk k=1 exp (6) where exp is the exponential. The final class prediction D ∈ {1, 2, . . . , e} is obtained by finding the maximum of the values of S(F )j , given by: D = arg max(S(F )j ), for j = 1, 2, . . . , e. j (7) B. Network Details The ensemble net we designed consists of three layers as shown in Fig. 1. Preprocessed food images are used to finetune all the three CNN networks: AlexNet, GoogLeNet and ResNet. Then the first new layer one concatenates the features obtained from the previously networks, passing it out with a rectified linear unit (ReLU) non-linear activation. The outputs are then passed to a fully connected (fc) layer that convolves the outputs to the desired length of the number of classes present. This is followed by a softmax layer which computes the scores obtained by each class for the input image. The pre-trained models are used to extract features and train a linear kernel support vector machine (SVM). The feature outputs of the fully connected layers and max-pool layers of AlexNet and GoogLeNet are chosen as features for training and testing the classifiers. For feature extraction, the images are resized and normalized as per the requirement of the networks. For AlexNet we used the last fully connected layer to extract features (fc7) and for GoogLeNet we used last max pool layer (cls3 pool). On the ETH Food 101 database, the top-1 accuracy obtained remained in the range of 39.6% for AlexNet to 44.06% for GoogLeNet, with a feature size varying from a minimum of 1000 features per image to 4096 features per image. Feature length of the features extracted out of the last layer is 1000. The feature length out of the penultimate layer of AlexNet gave a feature length of 4096 features, while the ones out of GoogLeNet had a feature length of 1024. All the three networks are fine-tuned using the ETH Food-101 database. The last layer of filters is removed from the network and replaced with an equivalent filter giving an output of the size 1 × 1 × 101, i.e., a single value for 101 channels. These numbers are interpreted as scores for each of the food class in the dataset. Consequently, we see a decrease in the feature size from 1 × 1000 for each image to 1 × 101 for each image. AlexNet is trained for a total of 16 epochs. We choose the MatConvNet [37] implementation of GoogLeNet with maximum depth and maximum number of blocks. The implementation consists of 100 layers and 152 blocks, with 9 Inception modules (very deep!). To train GoogLeNet, the deepest softmax layer is chosen to calculate objective while the other two are removed. The training ran for a total of 20 epochs. ResNet’s smallest MatConvNet model with 50 layers and 175 blocks is used. The capacity to use any deeper model is limited by the capacity of our hardware. The batch size is reduced to 32 images for the same reason. ResNet is trained with the data for 20 epochs. The accuracy obtained increased with the depth of the network. The ensemble net is trained with normalized features/outputs of the above three networks. Parametrically weights are decided for each network feature by running the experiments multiple times. A total of 30 epochs are performed. A similar approach is followed while fine-tuning the network for Indian dataset. As the number of images is not very high, jitters are introduced in the network to make sure the network remains robust to changes. Same depth and parameters are used for the networks. The output feature has a length of 1 × 1 × 50 implying a score for each of the 50 classes. III. E XPERIMENTAL S ETUP AND R ESULTS The experiments are performed on a high end server with 128GB of RAM equipped with a NVDIA Quadro K4200 with 4GB of memory and 1344 CUDA cores. We performed the experiments on MATLAB 14a using the MatConvNet library offered by vlFeat [38]. Caffe’s pre-trained network models imported in MatConvNet are used. We perform experiments on two databases: ETH Food-101 Database and and our own newly contributed Indian Food Database. A. Results on ETH Food-101 Database ETH Food-101 [17] is the largest real-world food recognition database consisting of 1000 images per food class 100 100 90 90 80 70 60 AlexNet GoogLeNet ResNet Ensemble Net 50 Fig. 2. Top row: 10 sample Indian food images. Bottom two rows: one of the food samples (1 class) variations (20 images). 40 1 2 3 4 5 6 Rank 7 8 9 10 Accuracy (%) Accuracy (%) 4 80 70 AlexNet GoogLeNet ResNet Ensemble Net 60 50 40 1 2 (a) 3 4 5 6 Rank 7 8 9 10 (b) Fig. 3. Rank vs Accuracy plots using various CNN frameworks, (a) for ETH Food 101 Database and (b) for Indian Food Database. picked randomly from foodspotting.com, comprising of 101 different classes of food. So there are 101,000 food images in total, sample images can be seen in [17]. The top 101 most popular and consistently named dishes are chosen and randomly sampled 750 training images per class are extracted. Additionally, 250 test images are collected for each class, and are manually cleaned. Purposefully, the training images are not cleaned, and thus contain some amount of noise. This comes mostly in the form of intense colors and sometimes wrong labels to increase the robustness of the data. All images are rescaled to have a maximum side length of 512 pixels. In all our experiments we follow the same training and testing protocols as that in [17], [9]. All the real-world RGB food images are converted to HSV format and histogram equalization are applied on only the intensity channel. The result is then converted back to RGB format. This is done to ensure that the color characteristics of the image does not change because of the operation and alleviate any bias that could have been present in the data due to intensity/illumination variations. TABLE II TABLE III ACCURACY (%) FOR ETH F OOD -101 AND COMPARISON WITH OTHER METHODS AFTER FINE - TUNING . ACCURACY (%) FOR I NDIAN F OOD DATABASE AND COMPARISON WITH OTHER METHODS AFTER Network/Features AlexNet GoogLeNet Lukas et al. [17] Kawano et al. [15] Martinel et al. [9] ResNet Ensemble Net Top-1 42.42 53.96 50.76 53.50 55.89 67.59 72.12 Top-5 69.46 80.11 81.60 80.25 88.76 91.61 Top-10 80.26 88.04 89.70 89.10 93.79 95.95 FINE - TUNING . Network/Features AlexNet GoogLeNet ResNet Ensemble Net Top-1 60.40 70.70 43.90 73.50 Top-5 90.50 93.40 80.60 94.40 Top-10 96.20 97.60 91.50 97.60 Table II shows the Top-1, Top-5 and Top-10 accuracies using numerous current state-of-the-art methodologies on this database. We tried to feed outputs from the three networks into the SVM classifier but the performance was not good. We have noted only the highest performers, many more results can be found in [9]. It is evident that with fine-tuning the network performance has increased to a large extent. Fig. 3 (a) shows accuracies with the ranks plot up to top 10, where the rank r : r ∈ {1, 2, . . . , 10} shows corresponding accuracy of retrieving at least 1 correct image among the top r retrieved images. This kind of graphs show the overall performance of the system at different number of retrieved images. From Table II and Fig. 3 (a), it is evident that our proposed ensemble net has outperformed consistently all the current state-of-the-art methodologies on this largest real-world food database. B. Results on Indian Food Database One of the contributions of this paper is the setting up of an Indian food database, the first of its kind. It consists of 50 food classes having 100 images each. Some sample images are shown in Fig. 2. The classes are selected keeping in mind the varied nature of Indian cuisine. They differ in terms of color, texture, shape and size as the Indian food lacks any kind of generalized layout. We have ensured a healthy mix of dishes from all parts of the country giving this database a true representative nature. Because of the varied nature of the classes present in the database, it offers the best option to test a protocol and classifier for its robustness and accuracy. We collected images from online sources like foodspotting.com, Google search, as well as our own captured images using handheld mobile devices. Extreme care was taken to remove any kind of watermarking from the images. Images with textual patterns are cropped, most of the noisy images discarded and a clean dataset is prepared. We also ensured that all the images are of a minimum size. No upper bound on image size has been set. Similar to the ETH Food-101 database protocol, we have randomly selected 80 food images per class for 50 food classes in the training and remaining in the test dataset. Fig. 3 (b) shows accuracies with the ranks plot up to top 10 and Table III shows the Top-1, Top-5 and Top-10 accuracies using some of the current state-of-the-art methodologies on this database. Both these depict that our proposed ensemble of the networks (Ensemble Net) is better at recognizing food images as compared to that of the individual networks. ResNet under performs as compared to GoogLeNet and AlexNet probably because of the lack of sufficient training images to train the network parameters. For overall summary: as is evident from these figures (Fig. 3 (a) and (b)) and tables (Tables II and III) that there is no single second best method that outperforms all others methods in both the databases, however, our proposed approach (Ensemble Net) outperforms all other methods consistently for all different ranks in both the databases. IV. C ONCLUSIONS Food recognition is a very crucial step for calorie estimation in food images. We have proposed a multi-layered ensemble of networks that take advantages of three deep CNN fine-tined subnetworks. We have shown that these subnetworks with proper fine-tuning would individually contribute to extract 5 better discriminative features from the food images. However, in these subnetworks the parameters are different, the subnetwork architectures and tasks are different. Our proposed ensemble architecture outputs robust discriminative features as compared to the individual networks. We have contributed a new Indian Food Database, that would be made available to public for further evaluation and enrichment. We have conducted experiments on the largest real-world food images ETH Food-101 Database and Indian Food Database. The experimental results show that our proposed ensemble net approach outperforms consistently all other current state-ofthe-art methodologies for all the ranks in both the databases. R EFERENCES [1] MealSnap:, “Magical meal logging for iphone,” 2017. [Online]. Available: http://mealsnap.com [2] Eatly:, “Eat smart (snap a photo of your meal and get health ratings),” 2017. [Online]. Available: https://itunes.apple.com/us/app/eatly-eat-smart-snap-photo/id661113749 [3] A. Myers, N. Johnston, V. Rathod, A. Korattikara, A. N. Gorban, N. Silberman, S. Guadarrama, G. Papandreou, J. Huang, and K. Murphy, “Im2calories: Towards an automated mobile vision food diary,” in IEEE International Conference on Computer Vision (ICCV), 2015, pp. 1233– 1241. [4] B. Mandal and H.-L. Eng., “3-parameter based eigenfeature regularization for human activity recognition,” in 35th IEEE International Conference on Acoustics Speech and Signal Processing (ICASSP), Mar 2010, pp. 954–957. [5] B. Mandal, L. Li, V. Chandrasekhar, and J. H. Lim, “Whole space subclass discriminant analysis for face recognition,” in IEEE International Conference on Image Processing (ICIP), Quebec city, Canada, Sep 2015, pp. 329–333. [6] S. Sasano, X. H. Han, and Y. W. Chen, “Food recognition by combined bags of color features and texture features,” in 9th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI), Oct 2016, pp. 815–819. [7] C. Pham and T. N. T. Thanh, “Fresh food recognition using feature fusion,” in International Conference on Advanced Technologies for Communications, Oct 2014, pp. 298–302. [8] B. Mandal, W. Zhikai, L. Li, and A. Kassim, “Evaluation of descriptors and distance measures on benchmarks and first-person-view videos for face identification,” in International Workshop on Robust Local Descriptors for Computer Vision, ACCV, Singapore, Nov 2014, pp. 585– 599. [9] N. Martinel, C. Piciarelli, and C. Micheloni, “A supervised extreme learning committee for food recognition,” Computer Vision and Image Understanding, vol. 148, pp. 67–86, 2016. [10] H. Hajime, T. Joutou, and K. Yanai, “Image recognition of 85 food categories by feature fusion,” in IEEE International Symposium on Multimedia (ISM), Dec 2010. [11] T. Joutou and K. Yanai, “A food recognition system with multiple kernel learning,” in IEEE International Conference on Image Processing, Nov 2009. [12] C. Cortes and V. Vapnik, “Support-vector networks,” Machine Learning, vol. 20, no. 3, pp. 273–297, 1995. [13] S. Liu, D. He, and X. Liang, “An improved hybrid model for automatic salient region detection,” IEEE Signal Processing Letters, vol. 19, no. 4, pp. 207–210, Apr 2012. [14] M. Bolaños and P. Radeva, “Simultaneous food localization and recognition,” CoRR, vol. abs/1604.07953, 2016. [Online]. Available: http://arxiv.org/abs/1604.07953 [15] Y. Kawano and K. Yanai, “Real-time mobile food recognition system,” in Computer Vision and Pattern Recognition Workshops (CVPRW), Jun 2013. [16] K. Yanai and Y. Kawano, “Food image recognition using deep convolutional network with pre-training and fine-tuning,” in 2015 IEEE International Conference on Multimedia Expo Workshops (ICMEW), June 2015, pp. 1–6. [17] L. Bossard, M. Guillaumin, and L. Van Gool, “Food-101 – mining discriminative components with random forests,” in European Conference on Computer Vision, 2014, pp. 446–461. [18] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems, 2012. [19] V. Bettadapura, E. Thomaz, A. Parnami, G. D. Abowd, and I. Essa, “Leveraging context to support automated food recognition in restaurants,” in Proceedings of the IEEE Winter Conference on Applications of Computer Vision, 2015, pp. 580–587. [20] M. Yuji and K. Yanai, “Multiple-food recognition considering cooccurrence employing manifold ranking,” in Proceedings of the 21st International Conference on Pattern Recognition, Nov 2012. [21] X. Wang, D. Kumar, N. Thorne, M. Cord, and F. Precioso, “Recipe recognition with large multimodal food dataset,” in IEEE International Conference on Multimedia & Expo Workshops (ICMEW), Jul 2015. [22] J. Chen and C.-w. Ngo, “Deep-based ingredient recognition for cooking recipe retrieval,” in Proceedings of the ACM on Multimedia Conference, 2016, pp. 32–41. [23] J. Baxter, “Food recognition using ingredient-level features.” [Online]. Available: http://jaybaxter.net/6869 food project.pdf [24] S. Yang, M. Chen, D. Pomerleau, and R. Sukthankar, “Food recognition using statistics of pairwise local features,” in Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Jun 2010. [25] S. Song, V. Chandrasekhar, B. Mandal, L. Li, J. Lim, G. S. Babu, P. P. San, and N. Cheung, “Multimodal multi-stream deep learning for egocentric activity recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition Workshops, CVPR Workshops 2016, Las Vegas, NV, USA, 2016, pp. 378–385. [26] S. Zhang, H. Yang, and Z.-P. Yin, “Transferred deep convolutional neural network features for extensive facial landmark localization,” IEEE Signal Processing Letters, vol. 23, no. 4, pp. 478–482, Apr 2016. [27] H. Park and K. M. Lee, “Look wider to match image patches with convolutional neural networks,” IEEE Signal Processing Letters, vol. PP, no. 99, pp. 1–1, Dec 2016. [28] A. G. del Molino, B. Mandal, J. Lin, J. Lim, V. Subbaraju, and V. Chandrasekhar, “Vc-i2r@imageclef2017: Ensemble of deep learned features for lifelog video summarization,” in Working Notes of CLEF 2017 - Conference and Labs of the Evaluation Forum, Dublin, Ireland, Sep 2017. [29] T. Gan, Y. Wong, B. Mandal, V. Chandrasekhar, and M. Kankanhalli, “Multi-sensor self-quantification of presentations,” in ACM Multimedia, Brisbane, Australia, Oct 2015, pp. 601–610. [30] K. Zhang, Z. Zhang, Z. Li, and Y. Qiao, “Joint face detection and alignment using multitask cascaded convolutional networks,” IEEE Signal Processing Letters, vol. 23, no. 10, pp. 1499–1503, Oct 2016. [31] B. Mandal, “Publication and database,” 2017. [Online]. Available: https://sites.google.com/site/bappadityamandal/publications-1 [32] 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. FeiFei, “Imagenet large scale visual recognition challenge,” Int. J. Comput. Vision, vol. 115, no. 3, pp. 211–252, Dec 2015. [33] C. Szegedy and et al., “Going deeper with convolutions,” in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. [34] H. Kaiming and et al., “Deep residual learning for image recognition,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. [35] J. Bromley, I. Guyon, Y. LeCun, E. Säckinger, and R. Shah, “Signature verification using a “siamese” time delay neural network,” in Proceedings of the 6th International Conference on Neural Information Processing Systems (NIPS), 1993, pp. 737–744. [36] H. Zuo, H. Fan, E. Blasch, and H. Ling, “Combining convolutional and recurrent neural networks for human skin detection,” IEEE Signal Processing Letters, vol. 24, no. 3, pp. 289–293, Mar 2017. [37] VLFEAT, “Vlfeat open source,” 2017. [Online]. Available: http://www.vlfeat.org/matconvnet/ [38] ——, “Vlfeat open source,” 2017. [Online]. Available: www.vlfeat.org
1cs.CV
i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 1 — #1 i i Math. Model. Nat. Phenom. proofs no. Clustering˙and˙Biclustering (will be inserted by the editor) Fuzzy Adaptive Resonance Theory, Diffusion Maps and their applications to Clustering and Biclustering arXiv:1411.5737v5 [cs.NE] 6 Oct 2015 S. B. Damelin1 , Y. Gu2 , D. C. Wunsch II3 , R. Xu4 ∗ 1 Mathematical Reviews The American Mathematical Society Ann Arbor, MI 48103 USA 2 Department of Mathematics University of Michigan – Ann Arbor Ann Arbor, MI 48109 USA 3 Applied Computational Intelligence Laboratory Department of Electrical and Computer Engineering University of Missouri – Rolla Rolla, MO 65409-0249 USA 4 GE Global Research Niskayuna, NY 12309 USA Dedicated to our friend and colleague Prof. Alexander Gorban. Abstract. In this paper, we describe an algorithm FARDiff (Fuzzy Adaptive Resonance Diffusion) which combines Diffusion Maps and Fuzzy Adaptive Resonance Theory to do clustering on high dimensional data. We describe some applications of this method and some problems for future research. Keywords and phrases: diffusion maps, nonlinear dimensionality reduction, spectral, fuzzy adaptive resonance theory, fuzzy adaptive resonance diffusion, clustering, biclustering Mathematics Subject Classification: 94A15, 62H30, 60J20, 68T05, 68T45, 68T10 1. Introduction In this paper, we describe an algorithm FARDiff (Fuzzy Adaptive Resonance Diffusion) which combines Diffusion Maps and Fuzzy Adaptive Resonance Theory to do clustering on high dimensional data. This algorithm was introduced in the papers [9, 10, 18, 19, 21]. We describe some applications of this method and some problems for future research. The dimensionality reduction part of FARDiff is achieved via a nonlinear diffusion map, which interprets the eigenfunctions of Markov matrices as a system of coordinates on the dataset in order to obtain ∗ Corresponding author. E-mail: [email protected]. i i i i i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 2 — #2 i S. B. Damelin, Y. Gu, D. C. Wunsch II, R. Xu i ART, Diffusion Maps and App. to Clustering and Biclustering an efficient representation of certain geometric descriptions of the data. Our algorithm is sensitive to the connectivity of the data points. Clustering was achieved using Fuzzy Adaptive Resonance Theory. The structure of this paper is as follows. Section 2 will describe the dimension reduction, section 3 will describe the clustering method, section 4 will discuss some applications, and section 5 will discuss work in progress. 2. Diffusion Maps In this section, we describe the nonlinear dimension reduction spectral method part of FARDiff. We use nonlinear diffusion maps. See [6, 15] and references sited there in. Let m be a large enough fixed non-negative integer, and let X = {xi , i = 1, . . . , N } ⊂ Rm be a data set consisting of N ≥ 1 distinct points. A finite graph with N nodes corresponding to N data points can be constructed on X as follows. Every two nodes in the graph are connected by an edge weighted through a Gaussian kernel, w : Rm × Rm → R, defined by ! 2 z − z0 0 w(z, z ) = exp − , z, z0 ∈ Rm , σ2 where k · k is the Euclidean norm in Rm and σ is a fixed nonzero real number to be chosen in a moment. w here satisfies symmetric property w(z, z0 ) = w(z0 , z) and positivity preserving property w(z, z0 ) ≥ 0. The first property is useful for performing spectral analysis, and the second property allows it to be interpreted as a scaled probability. We choose σ to be a parameter depending on the data set X, and we shall write for each 1 ≤ i, j ≤ N , ! 2 xi − xj , xi , xj ∈ X. (2.1) w(xi , xj ) = exp − σ2 w reflects the degree of similarity between xi and xj . The resulting symmetric semi-positive definite matrix W = {w(xi , xj )}N ×N is called the affinity matrix. Let d : X → R be defined by X d(x) = w(x, x0 ), x ∈ X, (2.2) x0 ∈X be the degree of x. For each 1 ≤ i, j ≤ N , a Markov or affinity matrix PN ×N is then constructed by calculating each entry of P as w(xi , xj ) p(xi , xj ) = . (2.3) d(xi ) From the definition of w, p(xi , xj ) can be interpreted as the transition probability from xi to xj in one time step. From the definition of the Gaussian kernel it can be seen that the transition probability will be high for similar elements. This idea can be further extended by considering pt (xi , xj ) in the tth power Pt of P as the probability of transition from xi to xj in t time steps [6], where t is a fixed non-negative integer. Here, pt (xi , xj ) sums all paths of length t from point xi to point xj . Hence, the parameter t defines the granularity of the analysis. With the increase of the value of t, local geometric information of data is also integrated. The change in size of t makes it possible to control the generation of more specific or broader clusters. The diffusion distance is related to P and is given by X 2 Dt (xi , xj )2 = pt (xi , x) − pt (xj , x) . (2.4) x∈X It can be seen that the more paths that connect two points in the graph, the higher probability of paths of length t between two points is, and the smaller the diffusion distance is. Therefore, the diffusion distance can be used as a measurement of a specific geometric structure. 2 i i i i i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 3 — #3 i S. B. Damelin, Y. Gu, D. C. Wunsch II, R. Xu i ART, Diffusion Maps and App. to Clustering and Biclustering Next, we aim to find a mapping that reassembles the data in a lower dimensional space but preserves the diffusion distances between data points optimally. Consider a mapping  T Ψ 0t (xi ) = pt (xi , x1 ), . . . , pt (xi , xN ) , 1 ≤ i ≤ N. (2.5) The Euclidean distance between two points xi and xj is Ψ 0t (xi ) − Ψ 0t (xj ) 2 = X 2 pt (xi , x) − pt (xj , x) , x∈X which is also the diffusion distance. The mapping thus preserves the original data structure in the sense of diffusion distance. Next, we need to perform dimensionality reduction. Because of the symmetry property of w, for each t, we may obtain a sequence of N eigenvalues of P, 1 = λ1 > λ2 > · · · > λN ≥ 0, with corresponding eigenvectors {Φj , j = 1, . . . , N }, satisfying, Pt Φj = λtj Φj . (2.6) Suppose we wish to reduce our data from Rm to RL where 1 ≤ L < m1. To achieve it, we choose the first L eigenvalues and their corresponding eigenvectors of P, and rewrite the mapping (2.5) as  T Ψ t (xi ) = λt1 Φ1 (xi ), . . . , λtL ΦL (xi ) , (2.7) where Φj (xi ) is the ith element of the eigenvector Φj . We observe that the new data point xi ’s dimension has been reduced to L. The new mapping reduces the dimensionality of the original data set by retaining the important geometric structure associated with dominant eigenvalues and eigenvectors. Correspondingly, the diffusion distance between a pair of points xi and xj is approximated with the Euclidean distance in RL , written as Dt (xi , xj )2 = Ψ t (xi ) − Ψ t (xj ) 2 . (2.8) The kernel width parameter σ represents the rate at which the similarity between two points decays2. One of the main reasons for using spectral clustering methods is that, with sparse kernel matrices, long range affinities are accommodated through the chaining of many local interactions as opposed to standard Euclidean distance methods - e.g. correlation - that impute global influence into each pair-wise affinity metric, making long range interactions dominate local interactions. We have used a Gaussian Kernel scaled with parameter σ. This kernel works well for the two applications we have studied given both trade sparseness and affinity of the point set. FARDIFF however can be defined by way of a wide class of positive definite kernels, see [6, 7] where the choice of kernel is typically application dependent. In addition to the choice of kernel, the trade off in sparsity can be handled by using a restricted isometry, see for example [1]. 3. Fuzzy Adaptive Resonance Theory In this section we describe the second part of FARDiff which uses Fuzzy Adaptive Resonance Theory (FA) [3, 17, 20] for clustering data points whose dimension has been reduced using the method of section 2. See [9, 10, 18, 19, 21]. 1Note that here we require that N ≥ L. This is not a strong requirement given the reduced dimension L is typically small and the number of points are always larger. 2Our choice of σ is determined by a trade off between sparseness of the kernel matrix (small σ) with adequate characterization of true affinity of two points. 3 i i i i i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 4 — #4 i S. B. Damelin, Y. Gu, D. C. Wunsch II, R. Xu i ART, Diffusion Maps and App. to Clustering and Biclustering FA allows stable recognition of clusters in response to both binary and real-valued input patterns with either fast or slow learning. The basic FA architecture consists of two-layer nodes or neurons, the feature representation field F1 , and the category representation field F2 , as shown in Figure 1. The neurons in layer F1 are activated by the input pattern, while the prototypes of the formed clusters are stored in layer F2 . The neurons in layer F2 that are already being used as representations of input patterns are said to be committed. Correspondingly, the uncommitted neuron encodes no input patterns. The two layers are connected via adaptive weights wj , emanating from node j in layer F2 . After an input pattern is presented, the neurons (including a certain number of committed neurons and one uncommitted neuron) in layer F2 compete by calculating the category choice function Tj = Tj (x, wj , α) = x ∧ wj , α + wj (3.1) where ∧ is the fuzzy AND operator defined as follows. Given y = {yi , i = 1, . . . , N } ⊂ Rm and y0 = {y0 i , i = 1, . . . , N } ⊂ Rm , define   (3.2) y ∧ y0 i = min yi , yi0 , i and α > 0 is the choice parameter to break the tie when more than one prototype vector is a fuzzy subset of the input pattern, based on the winner-take-all rule, TJ = max{Tj }. j (3.3) The winning neuron J then becomes activated, and an expectation is reflected in layer F1 and compared with the input pattern. The orienting subsystem with the pre-specified vigilance parameter ρ (0 ≤ ρ ≤ 1) determines whether the expectation and the input pattern are closed matched. If the match meets the vigilance criterion, x ∧ wj ρ≤ , (3.4) x weight adaptation occurs, where learning starts and the weights are updated using the following learning rule,   wj (new) = β x ∧ wj (old) + 1 − β wj (old), (3.5) where β ∈ [0, 1] is the learning rate parameter. On the other hand, if the vigilance criterion is not met, a reset signal is sent back to layer F2 to shut off the current winning neuron, which will remain disabled for the entire duration of the presentation of this input pattern, and a new competition is performed among the rest of the neurons. This new expectation is then projected into layer F1 , and this process repeats until the vigilance criterion is met. In the case that an uncommitted neuron is selected for coding, a new uncommitted neuron is created to represent a potential new cluster. Some of ART’s (Adaptive Resonance Theory) advantages are stability, biological plausibility, and responsiveness to the stability-plasticity dilemma. Further advantages are scalability, speed, configurability, and potential for parallelization. ART has been found to have good ability to interpret well, results on neural net learning and decision based networks with low complexity and good robustness [16]. 4. Applications in Cancer Detection and Hyperspectral Clustering The algorithm which we discuss in this paper which we call FARDiff (Fuzzy Adaptive Resonance Diffusion) combines 1. Diffusion Maps and 2. Fuzzy Adaptive Resonance Theory to do clustering on high dimensional data. This algorithm was introduced in the papers [9, 10, 18, 19, 21]. In [18, 21], we applied FARDiff to investigate cancer detection. Early detection of the site of the origin of a tumor is particularly important for cancer diagnosis and treatment. The employment of 4 i i i i i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 5 — #5 i S. B. Damelin, Y. Gu, D. C. Wunsch II, R. Xu i ART, Diffusion Maps and App. to Clustering and Biclustering Figure 1: Topological structure of Fuzzy ART. Layers F1 and F2 are connected via adaptive weights W. The orienting subsystem is controlled by the vigilance parameter ρ. gene expression profiles for different cancer types or subtypes has already shown significant advantages over traditional cancer classification methods. We applied FARDiff to the small round blue-cell tumor (SRBCT) data set, which is published from the diagnostic research of small round blue-cell tumors in children, and compared results with other widely-used clustering algorithms. The experimental results demonstrate the effectiveness of our method in extracting useful information from the high-dimensional data sets. In [9,10,19], we applied FARDiff to study hyperspectral imaging. The images are sampled at hundreds of frequencies, and the bands are regularly spaced, thus a continuous spectrum can be drawn for every pixel in the image. We reassembled our data into a “hypercube,” called the hyperspectral data. Due to the fact that each pixel of the image contains more than a hundred bands, the occurrence of large amounts of hyperspectral data brings important challenges to storage and processing. We used FARDiff to investigate clustering of high dimensional hyperspectral image data from core samples provided by AngloCold Ashanti, and compared to results obtained by AngloGold Ashanti’s proprietary method. The experimental results demonstrate the potential of our method in addressing the complicated hyperspectral data and identifying the minerals in core samples. 5. Open Questions For Future Research In this section, we discuss some on going work. We are interested in extending the FARDiff algorithm to a biclustering framework and high dimensional data reduction. Biclustering is a technique which performs simultaneous clustering in many dimensions automatically integrating feature selection to clustering without any prior information. Two examples of good biclustering algorithms are BARTMAP and HBiFAM (Hierarchical Biclustering FA algorithm) [16, 22]. It is well known that clustering has been used extensively in the analysis of high-throughput messenger RNA (mRNA) expression profiling with microarrays. This technique is restrictive, in part, due to the existence of many uncorrelated genes with respect to sample or condition clustering, or many unrelated samples or conditions with respect to gene clustering. Biclustering offers a solution to such problems by performing simultaneous clustering on both dimensions, or automatically integrating feature selection to clustering without any prior information, so that the relations of clusters of genes (generally, features) and clusters of samples or conditions (data objects) are established. Challenges which need to be addressed using this method include computational complexity and high dimensional data reduction. Current work focuses on developing a natural framework for an analog of FARDiff for biclustering and related computational complexity challenges, for example, traveling salesman problems. A second question relates to applications of FARDiff to more generalized clustering performance. A third research project investigates unified learning schemes and hardware implementation with ART and FARDiff in clustering and biclustering. A valuable new area of innovation will be the application of FARDiff to more generalized data structures such as trees and grammars. Continued progress on distributed representations is valu5 i i i i i i “Clustering˙and˙Biclustering” — 2015/10/7 — 4:03 — page 6 — #6 i S. B. Damelin, Y. Gu, D. C. Wunsch II, R. Xu i ART, Diffusion Maps and App. to Clustering and Biclustering able because of increased data representation capability, both in terms of system capacity and template complexity. Several aspects of these questions are being investigated in ongoing work. Acknowledgements. Damelin gratefully acknowledges support from the School of Computational and Applied Mathematics at Wits, the American Mathematical Society, the Center for High Performance Computing and the National Science Foundation. Xu and Wunsch gratefully acknowledge support from the Missouri University of Science & Technology Intelligent Systems Center, and the M. K. Finley Missouri Endowment. Wunsch additionally acknowledges support from the National Science Foundation. Gu gratefully acknowledges support from the University of Michigan. References [1] E. J. Candés and T. Tao. Near-optimal signal recovery from random projections: universal encoding strategies. IEEE Trans. Inform. Theory, (52)(2006), pp 5406-5425. [2] G. Carpenter, S. Grossberg, N. Markuzon, J. Reynolds, and D. Rosen, Fuzzy ARTMAP: A neural network architecture for incremental supervised learning of analog multidimensional maps, IEEE Transactions on Neural Networks, (3)(1992), pp 698-713. [3] G. Carpenter, S. Grossberg, and D. Rosen, Fuzzy ART: Fast Stable Learning and Categorization of Analog Patterns by an Adaptive Resonance, Neural Networks, (4)(1991), pp 759-771. [4] K. Cawse, S. B. Damelin, R. McIntyre, M. Mitchley, L. du Plessis and M. Sears, An Investigation of data compression for Hyperspectral core image data, Proceedings of the Mathematics in Industry Study Group, South Africa, 2008, pp 1-25. [5] K. Cawse, M. Sears, A. Robin, S. B. Damelin, K. Wessels, F. van den Bergh, R. Mathieu, Using random matrix theory to determine the number of endmembers in a hyperspectral image, Proceedings of WHISPERS 2010, Reykjavik, Iceland, pp 45-52. [6] R. Coifman and S. Lafon, Diffusion maps. Journal of Applied and Computational Harmonic Analysis, April 2006, pp 5-30. [7] S. B. Damelin, J. Levesley, D. L. Ragozin and X. Sun, Energies, Group Invariant Kernels and Numerical Integration on Compact Manifolds, Journal of Complexity, (25)(2009), pp 152-162. [8] S. B. Damelin and W. Miller, Mathematics and Signal Processing, Cambridge Texts in Applied Mathematics, no. 48, February 2012. [9] L. du Plessis, R. Xu, S. B. Damelin, M. Sears and D. C. Wunsch, Reducing dimensionality of hyperspectral data with diffusion maps and clustering with K-means and fuzzy art, Int. J. Systems Control and Communications, (3)(2011), pp 232-251. [10] L. du Plessis, R. Xu, S. B. Damelin, M. Sears and D. C. Wunsch, Reducing dimensionality of hyperspectral data with diffusion maps and clustering with K-means and fuzzy art, Proceedings of IJCNN 2009, pp 32-36. [11] C. Fefferman, S. B. Damelin and W. Glover, BMO Theorems for ε distorted diffeomorphisms on RD and an application to comparing manifolds of speech and sound, Involve 5-2(2012), pp 159-172. [12] S. Madeira and A. Oliveira, Biclustering algorithms for biological data analysis: A survey, IEEE Transactions on Computational Biology and Bioinformatics, 1-1(2004), pp 24-45. [13] M. Mitchley, M. Sears and S. B. Damelin, Target detection I Hyperpectral mineral data using wavelet analysis, Proceedings of the 2009 IEEE Geosciences and Remote Sensing Symposium, Cape Town, pp 23-45. [14] S. Mulder and D. Wunsch II, Million city traveling salesman problem solution by divide and conquer clustering with adaptive resonance neural networks, Neural Networks, (16)(2003), pp 827-832. [15] J. de la Porte, B. M. Herbst, W. Hereman, S. J. van der Walt, An Introduction to Diffusion Maps, The 19th Symposium of the Pattern Recognition Association of South Africa. 2008. [16] D. Wunsch II, ART Properties of Interest in Engineering Applications, Proceedings of International Conference of Neural Networks, Atlanta, 2009. [17] R. Xu and D. Wunsch II. Clustering. IEEE/Wiley, 2008. [18] R. Xu, S. B. Damelin, and D. C. Wunsch II, Applications of diffusion maps in gene expression data-based cancer diagnosis analysis. In Proceedings of the 29th Annual International Conference of IEEE Engineering in Medicine and Biology Society, Lyon, France, 2007, pp 4613-4616. [19] R. Xu, L. du Plessis, S. B. Damelin, M. Sears, and D. C. Wunsch II, Analysis of Hyperspectral Data with Diffusion Maps and Fuzzy ART. In Proceedings of the 2009 international joint conference on Neural Networks, pp 2302-2309. [20] R. Xu and D. Wunsch II, Survey of Clustering Algorithms, IEEE Transactions on Neural Networks, 16-3(2005), pp 645-678. [21] R. Xu, S. B. Damelin, B. Nadler, and D. C. Wunsch II, Clustering of High-Dimensional Gene Expression Data with Feature Filtering Methods and Diffusion Maps, Bio-Medical Engineering and Informatics, (1)(2008), pp 245-249. [22] R. Xu and D. C. Wunsch II, BARTMAP: A Viable Structure for Biclustering, Neural Networks, (24)(7)(2011), pp 709-716. 6 i i i i
9cs.NE
Neural Computing and Applications manuscript No. (will be inserted by the editor) On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification arXiv:1712.02781v2 [cs.NE] 29 Dec 2017 Kian Ahrabian · Bagher Babaali Submitted: December 2017 Abstract In this paper, we propose a novel writerindependent global feature extraction framework for the task of automatic signature verification which aims to make robust systems for automatically distinguishing negative and positive samples. Our method consists of an autoencoder for modeling the sample space into a fixed length latent space and a Siamese Network for classifying the fixed-length samples obtained from the autoencoder based on the reference samples of a subject as being Genuine or Forged. During our experiments, usage of Attention Mechanism and applying Downsampling significantly improved the accuracy of the proposed framework. We evaluated our proposed framework using SigWiComp2013 Japanese and GPDSsyntheticOnLineOffLineSignature datasets. On the SigWiComp2013 Japanese dataset, we achieved 8.65% EER1 that means 1.2% relative improvement compared to the best-reported result. Furthermore, on the GPDSsyntheticOnLineOffLineSignature dataset, we achieved average EERs of 0.13%, 0.12%, 0.21% and 0.25% respectively for 150, 300, 1000 and 2000 test subjects which indicates improvement of relative EER on the best-reported result by 95.67%, 95.26%, 92.9% and 91.52% respectively. Apart from the Kian Ahrabian School of Mathematics, Statistics, and Computer Science, University of Tehran, Tehran, Iran Tel.: +98-9125482934 E-mail: [email protected] Bagher Babaali School of Mathematics, Statistics, and Computer Science, University of Tehran, Tehran, Iran Tel.: +98-9125248895 E-mail: [email protected] accuracy gain, because of the nature of our proposed framework which is based on neural networks and consequently is as simple as some consecutive matrix multiplications, it has less computational cost than conventional methods such as DTW2 and could be used concurrently on devices such as GPU3 , TPU4 , etc. Keywords Online Handwritten Signature Verification · Siamese Networks · Autoencoders · Sequence to Sequence Learning · Attention Mechanism 1 Introduction The handwritten signature is the most widely accepted biometric measure for authentication in governments, legal systems, banks, etc. Therefore it is of the utmost importance to have robust methods for verifying the identity of people based on their signatures. The task of ASV5 aims to address this problem by making robust systems that automatically classify a signature sample as being Genuine or Forged compared to some previously acquired signatures from the claimed subject. By doing so, we might be able to verify the identity of a person at a speed and accuracy which exceeds the human performance. In online signature verification, the signatures are acquired directly from a capturing device that records the dynamic information of the pen at a constant rate which usually includes coordinates, pressure, velocity, azimuth, etc. Consequently creating a sequence of data points that might also embed some other hidden dynamic information of the signature in itself too. These 2 3 4 1 Equal Error Rate 5 Dynamic Time Warping Graphics Processing Unit Tensor Processing Unit Automatic Signature Verification 2 Kian Ahrabian, Bagher Babaali obscure pieces of information could be further exploited to discriminate the positive and negative samples. This method is in contrast with offline signature verification in which we acquire the sample after the signing process is complete, leaving us with only a picture of the signature. Due to saving the dynamic information of the sample instead of saving just an image, it becomes more difficult to forge a signature while trying to simulate these features. Hence the online methods for signature verification are considered to be more reliable and accurate than the offline forms. The previous studies on online signature verification could be grouped into two main categories based on their approaches for feature extraction [53]: use it in the test time to classify the input signature by comparing it to reference samples. DTW method is the most well-known method in this subcategory, and it has been widely used in many studies [24, 32, 43, 49]. In the second subcategory, the algorithms train a probabilistic model using the signatures in the reference set and later use this model to classify the test signatures as being forged or genuine by calculating the probability of them being genuine and comparing it with a threshold. These methods usually use likelihoods for scoring and decision making. HMM7 [8, 11, 41, 48, 51] and GMM8 [21, 33, 39] are the most common methods in this subcategory. – Global Feature Extraction methods: The primary focus of these methods is to derive a fixed length feature vector from the signature as a whole to make them comparable. We divide this category into two subcategories. The first subcategory consists of algorithms that try to extract the features from the totality of signature. For example, in [23] the number of strokes is used as a global feature. There also exist many other characteristics such as average velocity, average pressure, and the number of times the pen is lifted during the signing [27]. An excellent example of the extent of these features could be found in [12], in which 100 global elements have been sorted by their discrimination power, a subset of these features has been used in other studies [28, 35–37, 40]. The second subcategory consists of algorithms that obtain a fixed length feature vector of elements by applying a transformation on the signature. For example, in [29] a wavelet transform has been used to extract a feature vector from the entire sample. Other study [30], use DCT6 transform to obtain the fixed length feature vector [30]. Also, in a recent work [53], a fixed length vector, called i-vector, is extracted from each signature sample. The low-dimensional fixed length i-vector representation was originally proposed for speaker verification, and in [53] it has been adopted for the application of online signature verification. – Functional methods: These methods are more focused on calculating a distance between two signatures which are represented by a sequence of extracted features (Data Points) and comparing them based on the estimated distance. Like the previous one, this category also could be divided into two subcategories. In the first subcategory, the algorithms do not perform any modeling, and these methods keep a reference set for each subject and From another perspective, it is also possible to divide previous studies on online signature verification into two main groups based on their approach to training the classifier [18]. In a Writer-Dependent method, for each subject, a binary classifier is trained based on a training set which only consists of signatures from the specific subject. In a Writer-Independent approach, a single global classifier is trained based on the whole training set. In both methods, the negative samples are obtained from the forgery samples of the specific subject which is provided in the training set. The main benefit of a writer-independent approach is that it needs much less computation power compared to the other method. Also, because these methods do not require to train a new model for each new user, they are considered easier to deploy and use in different scenarios. Note that it is also possible to use other subjects signatures as negative samples, but due to the nature of this method, it could lead to poor results and degraded generalization ability. At the test time, we use a classifier which is trained with one of the mentioned approaches to classify the query signature as being Forged or Genuine compared to reference signatures of the claimed individual. Some comprehensive reviews on the problem could be found in [22] and [17]. In this paper, we propose a Writer-Independent Global Feature Extraction method which is based on a Recurrent Autoencoder, sometimes called a Diabolo Network [2], as the global feature extractor and a Siamese Network as the global classifier. Our approach for training the Recurrent Autoencoder is based on the proposed technique in [4] which is called Sequence to Sequence Learning. In this method, a model is trained to learn a mapping between samples space where every sample is a sequence of data points and a fixed length latent space. By doing so, we obtain a mapping that 7 6 Discrete Cosine Transform 8 Hidden Markov Model Gaussian Mixture Model On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification could be used to extract a fixed length feature vector that captures the most crucial attributes of each sample. We expect that these feature vectors could be further used to distinguish the forged and genuine samples. As for the classification part, we train a Siamese Neural Network. Characteristically, siamese networks are a perfect solution for verification tasks, as has been previously studied in [3, 6, 7, 9, 26], because their objective is to learn a discriminative similarity measure between two or more inputs that classifies the inputs as being the same or not. So we expect to achieve a promising solution with this combination for the task of Online Signature Verification. It is important to note that the proposed method has a relatively low cost of computation which is mostly during the training time and it reduces to just a few matrix multiplications at the test time. This is a crucial advantage because it could lead to faster verification systems which can respond quickly to the queries by concurrently computing the results on devices such as GPU, TPU, etc. We organize the rest of the paper as follows: In Sect. 2 we describe the architecture and attributes of the models we used along with a detailed description of their structure. Sect. 3 and Sect. 4 presents our experiments and its comparison to the state-of-the-art algorithms. Finally, in Sect. 5, we conclude our paper with possible future directions. 2 The Proposed Framework In this section, at first, the preprocessing performed on samples is explained in Sect. 2.1. This is followed by an overview of the proposed Autoencoder architecture in Sect. 2.2. Finally, a detailed description of the proposed Siamese Network architecture is given in Sect. 2.3. 2.1 Preprocessing At first, we extract a set of 12 local features from the provided coordinates of the pen for each data point. These features are among the local features that have been introduced in [40,53]. These locally extracted features are listed in Table 1. After obtaining the local features, we normalize each sample individually by applying the Standard Normalization method on each local feature of each sample independently. Then a threshold is applied to the length of samples to filter out very long samples. At this stage, we apply a downsampling procedure to each sample. To perform this process with a sampling rate of K, we traverse the data points concerning 3 Table 1 List of extracted local features for each data point. 1. Horizontal position xt 3. Path-tangent angle 5. Log curvature radius 2. Vertical position yt 4. Path velocity magnitude 6. Total acceleration magnitude 7-12. First order derivatives of 1-6 the chronological order and do the following steps repeatedly until we reach the end of the sequence: 1. Select a data point 2. Skip K − 1 data points By applying this method to a given sample with the length of L, we obtain a downsampled sample with the L length of [ K ]. Finally, since batch training in neural networks requires samples to possess the same shape, we must apply a padding procedure to obtain samples with equal length. To do this, for each sample, we use pre-padding with zero to produce a sample that has a length equal to the length of the most extended sample in the dataset. 2.2 Autoencoder The RNN9 is a generalization of feedforward neural networks that make it possible to process sequences sequentially by maintaining a hidden state h which works as a memory containing the previously observed context. Given a sequence of inputs (x1 , ..., xt ), a standard RNN generates a sequence of outputs (y1 , ..., yt ) in which the output at timestep t is computed by ht = f (ht−1 , xt ), (1) yt = Wh ht , (2) where f is a non-linear activation function [4]. It is possible to train an RNN to learn a probability distribution over a set of sequences to predict the next symbol in a sequence given the previous symbols. By doing so, the output at each time step t could be formulated as the conditional distribution p(xt |xt1 , ..., x1 ). Thus the probability of the sequence x is calculated using p(x) = T Y p(xt |xt−1 , ..., x1 ). (3) t=1 After learning the distribution, we could iteratively predict a symbol at each time step to obtain a whole sequence from a sample in the learned distribution [46]. 9 Recurrent Neural Network 4 Kian Ahrabian, Bagher Babaali BRNN10 [44] is an extension to the vanilla RNN. The idea behind these networks is to have two separate RNN and feed each training sequence forward and backward to them, note that both of these RNNs are connected to the same output layer. At each point in a given sequence, this structure provides the network with information about all points before and after it, and this means that the BRNN has complete sequential details of the sequence in each step of the computation. Online signature verification, along with some other online tasks, requires an output after the end of the whole sequence. Therefore it is plausible to use BRNNs to gain improved performance on these tasks. The main difficulty of training RNNs is to learn a model that captures the long-term dependencies. This problem usually appears when we are dealing with long sequences that have dependencies between distant data points. Intuitively it seems that the RNNs are unable to remember the information that is embedded in previously visited distant data points. In theory, RNNs are entirely capable of handling this problem, but unfortunately, in practice, RNNs dont seem to be able to learn them [1, 19]. To address this issue, we use a particular kind of RNN called LSTM11 [20]. These networks are explicitly designed to deal with the long-term dependency problem and have proven their capability of learning long-term dependencies by showing excellent performance on a large variety of problems. Since the length of signature samples could be as high as thousands of data points, even with the use of LSTM networks the problem of long-term dependencies remains. To improve the performance we use a technique called Attention Mechanism [16,50,52]. Intuitively the model tries to learn what to attend to based on the input sequence and the output sequence of the network. By doing so, each output yt of the decoder depends on a weighted combination of all the input states instead of only relying on the last hidden state of the network. Beside the attention mechanism, to improve the performance of the model, we feed the input backward to the encoder. This trick has been introduced in [46] and has shown a positive effect on the performance of the model by introducing many short-term dependencies, making the optimization problem more straightforward to solve. Because of their structure, LSTM networks are more prone to overfitting which is a result of memorizing the training set samples. This problem will lead to a degraded performance and the inability of the model to generalize to new signatures. We use a regularization method called Dropout which has been introduced 10 11 Bidirectional Recurrent Neural Networks Long Short-Term Memory Table 2 Detailed information of configuration used to train autoencoder. Attribute Initializer Function Activation Function Mini Batch Size Loss Function Optimizer Early Stopping Epochs Used Value Glorot Uniform ReLU 128 MAPE ADAM, α = 0.001, β1 = 0.9, β2 = 0.999,  = 1e−8 P atience = 10, M in∆ = 0 1000 in [14, 45] to overcome this problem. The intuition behind this approach is that if we randomly drop units of the network with a probability of p in the training phase, creating a somewhat sparse network, we can prevent the co-adapting of the units and as a result obtaining a model with good generalization ability. We used an Autoencoder architecture that closely follows the work of [4] except applying Bidirectional LSTM with Attention Mechanism instead of Vanilla RNN because of the previously mentioned benefits in boosting the performance. This architecture is illustrated in Fig. 1. As for the other parameters, we used a combination of Glorot Uniform initializer function [15], ReLU12 activation function [34], ADAM optimizer [25], Mini Batch Size of 128, MAPE13 loss function and Early Stopping on loss value [38] to achieve improved performance and training speed. The details of our configuration are illustrated in Table 2. For the training phase, we used the preprocessed sequences which were obtained by the previously described method from the raw coordinate samples. The encoder part of the trained autoencoder will be further used to map each of the given sequences to the fixed-length vector space. 2.3 Siamese Network Siamese networks are a particular kind of neural networks that are made of two input fields followed by two identical neural network called legs with shared weights. These two-legged architecture are eventually merged into a single layer by applying a discriminative function to the resulting output of the legs. These networks are designed to compare two inputs, and as a result, they are a reasonable pick when it comes to verification tasks. We used a Siamese Network which consisted of one fully connected layer before and after the merge pro12 13 Rectified Linear Units Mean Absolute Percentage Error On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification 5 Fig. 1 Autoencoder architecture. The red rectangles show the parts that could be repeated. The dots boxes show the optional components. Table 3 Detailed information of configuration used to train siamese network. Attribute Initializer Function Activation Function Mini Batch Size Loss Function Optimizer Early Stopping Epochs Used Value Glorot Uniform ReLU 128 Binary Cross Entropy ADAM, α = 0.001, β1 = 0.9, β2 = 0.999,  = 1e−8 P atience = 10, M in∆ = 0 1000 cedure followed by a single neuron with sigmoid activation function. The goal of this network is to calculate the probability of two inputs being in the same class. This network enables us to make a decision in the classification step based on the calculated probabilities concerning different reference samples which makes our classifier more accurate than the classic direct classification method. This architecture is depicted in Fig. 2. To prevent the network from overfitting, we used the Dropout method for regularization. As for the other parameters, similar to the autoencoder, we used a combination of Glorot Uniform initializer function, ReLU activation function, ADAM optimizer, Mini Batch Size of 128, Binary Cross Entropy loss function and Early Stopping on loss value to achieve improved performance and training speed. The details of our configuration are illustrated in Table 3. In training phase, we used the fixed length vectors obtained from the encoder part of the previously described autoencoder. A mean normalization method was applied before feeding the samples to the network by calculating a mean vector from the feature vectors of reference signatures of each subject and subtracting it from the feature vectors of each signature of the corresponding subject independently. In the test phase, first, we feed the extracted feature vector of the given sample with every extracted feature vector of the reference samples of the claimed individual to the trained siamese network and calculate the outputs which are probabilities of them being in the same class. Then we apply a predefined threshold to the estimated probabilities to classify them as being in the same category or not. Eventually, we classify a sample as Genuine if it was classified as being in the same class with more than a predefined number of the reference samples of the claimed individual. Otherwise, we classify the sample as being Forged. A complete illustration of our proposed framework is shown in Fig. 3. 3 Experiments Setup For evaluation we used the SigWiComp2013 Japanese [31] and GPDSsyntheticOnLineOffLineSignature [10] datasets. Our codebase is entirely implemented using Keras [5] library with Theano [47] as the backend. We trained the models using a K40 GPU, and it approximately took 1 to 24 hours to finish the training, depending on different datasets and different training settings. 3.1 Datasets In this section, we describe the attributes of the datasets we used for the evaluation. 3.1.1 SigWiComp2013 Japanese The SigWiComp2013 Japanese dataset contains the signatures of 31 subjects, 11 for the training set and 20 for the test set. For each subject, 42 genuine and 36 forged samples are available. This results in 462 genuine and 396 forged signatures in the training set and 840 genuine and 720 forged signatures in the test set. Each subject in the test set has a set of twelve reference signatures. The exact description of autoencoder and 6 Kian Ahrabian, Bagher Babaali Fig. 2 Siamese network architecture. The red rectangles show the parts that could be repeated. The dots boxes show the optional components. Table 4 Detailed information on Autoencoder structure for SigWiComp2013 Japanese dataset. Layer Bidirectional LSTM (Encoder) Dropout Attention Mechanism Bidirectional LSTM (Decoder) Dropout Dense Description 64 units for each direction With probability of 0.5 Follows the work of [52] 64 units for each direction With probability of 0.5 12 units Table 5 Detailed information on Siamese Network structure for SigWiComp2013 Japanese dataset. Layer Dense (Before Merge) Dropout Merge Dense (Before Merge) Dropout Dense Description 128 units With probability of 0.5 Subtract the output of the second leg from the output of the first leg 128 units With probability of 0.5 One unit with sigmoid activation siamese network used for this dataset are illustrated in Table 4 and Table 5 respectively. 3.1.2 GPDSsyntheticOnLineOffLineSignature The GPDSsyntheticOnLineOffLineSignature dataset was built based on the procedure in [10]. It contains the signatures of 10000 subjects. For each subject, 24 genuine and 30 forged signatures are available. For evaluation, we used two non-intersecting subsets of signatures for the training set and the test set with different sizes combination of 150, 300, 1000 and 2000 subjects. Each subject in the test set had a set of five reference signatures. The exact architectures of autoencoder and siamese network used for this network are illustrated in Table 6 and Table 7 respectively. Table 6 Detailed information on Autoencoder structure for GPDSsyntheticOnLineOffLineSignature dataset. Layer Bidirectional LSTM (Encoder) Dropout Bidirectional LSTM (Encoder) Dropout Attention Mechanism Bidirectional LSTM (Decoder) Dropout Bidirectional LSTM (Decoder) Dropout Dense Description 64 units for each direction With probability of 0.65 64 units for each direction With probability of 0.65 Follows the work of [52] 64 units for each direction With probability of 0.65 64 units for each direction With probability of 0.65 12 units Table 7 Detailed information on Siamese Network structure for GPDSsyntheticOnLineOffLineSignature dataset. Layer Dense (Before Merge) Dropout Merge Dense (Before Merge) Dropout Dense Description 128 units With probability of 0.5 Subtract the output of the second leg from the output of the first leg 128 units With probability of 0.5 One unit with sigmoid activation 3.2 Experiment Scenarios We evaluated our proposed method with two somewhat different scenarios. In the first one, for training the Autoencoder we used every available sample in the training set, forged and genuine, along with the reference samples from the test set. For the Siamese Network, we used the cross product of forged and genuine feature vectors of each subject in the training set as negative samples. As for the positive samples, we used the union of the following sets of elements: 1. Every combination of genuine signatures of each subject in the training set On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification 7 Fig. 3 The complete pipeline of our proposed method. The red rectangles show the parts that could be repeated. The dots boxes show the optional components. 8 2. Every combination of forged signatures of each subject in the training set 3. Every combination of reference signatures of each subject in the test set In the second scenario, to train the Autoencoder, we only used the available samples in the training set and dropped the reference samples from the test set. For the Siamese Network, similar to the first scenario, we used the cross product of forged and genuine feature vectors of each subject in the training set as negative samples. As for the positive samples, we used the union of the following sets of elements: 1. Every combination of genuine signatures of each subject in the training set 2. Every combination of forged signatures of each subject in the training set It is essential to discuss the plausibility of using the reference samples in the test set for the training phase. If we consider a real-world scenario, in each of the previously mentioned use-cases every subject has some reference signatures which has been taken for future references. Hence in a real-world situation, we have access to the reference signatures of each subject at any time. As a result, it is entirely plausible to use the reference signatures of the test set during the training phase. Another relevant discussion that could be argued is about using skilled forgery samples provided in training set for the training process. Since our proposed framework consists of two parts in which the second part, siamese network, need negative samples as well as positive samples in the trained phase, it is essential for our framework to use these negative samples for training the network. This issue could be assumed as a disadvantage compared to other methods such as DTW which does not need skilled forgery samples to be trained. These methods usually try to find a threshold for discriminating the positive and negative samples. However, these other methods could also benefit from these samples in the process of fine-tuning. These samples will allow them to achieve a more accurate threshold which leads to producing better models. All things considered, since obtaining the skilled forgery samples for a small number of subjects is a feasible possibility, this problem could be overlooked, and thus our proposed framework could also be a viable option in a real-world situation. 3.3 t-SNE visualization The best vector representation of samples for the task of signature verification is the one that flawlessly discriminates between genuine and skilled forgery samples. Kian Ahrabian, Bagher Babaali Fig. 4 shows t-SNE plots for the genuine and forged signatures of ten individuals in the test set of SigWiComp2013 Japanese dataset using the vectors obtained from the first layer of the siamese network. This representation discriminates between positive and negative samples accurately for almost all of the subjects as clearly shown in Fig. 4. Therefore, we anticipate that using a suitable classifier an acceptable performance is achievable. 4 Experiments Results First, we present the results obtained on SigWiComp2013 Japanese dataset in Sect. 4.1. This is followed by discussions on the effect of attention mechanism and downsampling rate in Sect. 4.2 and Sect. 4.3, respectively. Sect. 4.4 explains the effect of the samples lengths on the achieved result in Sect. 4.1. Then we have the results acquired on GPDSsyntheticOnLineOffLineSignature dataset presented in Sect. 4.5. In the end, we discuss the effect of the reference set size in Sect. 4.6. 4.1 Results on SigWiComp2013 Japanese dataset Table 8 shows the accuracies, false acceptance rates and false rejection rates of our proposed method along with the state-of-the-art techniques on previously discussed SigWiComp2013 Japanese dataset in Sect. 3.1. Because of the low number of subjects in this dataset, 11 for the training set and 20 for the test set, we used the first scenario described in Sect. 3.2 to obtain more samples for the training phase. As shown in Table 8, our method outperformed all of the previously proposed state-ofthe-art methods on this dataset. 4.2 Effect of Attention Mechanism An noticeable observation in our experiments was the effect of the attention mechanism on the performance of the proposed framework. As shown in the Table 8, using this technique has improved the performance of our model significantly. This observation is aligned with other previous use cases of this method [50, 52]. Intuitively, by applying attention mechanism, we end up with a model that has learned to attend to the more critical features of a given sample which is the ultimate goal of this technique. On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification 40 20 75 40 150 50 20 100 0 50 −20 0 −50 −40 −50 −75 −60 −100 25 0 0 −25 −20 −40 −60 −50 0 50 −50 0 50 −50 0 50 9 75 50 25 0 −25 −50 −75 −100 0 100 −50 0 50 100 200 150 40 0 100 20 50 −200 0 0 −400 −20 −50 −600 −40 −100 −100 0 100 −100 0 100 −50 0 50 75 75 50 50 25 25 0 0 −25 −25 −50 −50 −75 −75 0 50 −100 0 100 Fig. 4 t-SNE plots for genuine and forged signatures for ten individuals in the test set of SigWiComp2013 Japanese dataset using the vectors obtained from the first layer of the siamese network. The red crosses show the forged signatures, and the green pluses show the genuine samples. Table 8 Comparison of the proposed method with six other state-of-the-art methods on the SigWiComp2013 Japanese dataset [53]. Dataset SigWiComp2013 Japanese State-of-the-art Methods Qatar University Sabanci University-1 Sabanci University-2 i-vector + NAP-2 i-vector + WCCN-2 i-vector + SVM-2 Autoencoder (No Attention) + Siamese Autoencoder + Siamese 4.3 Effect of the downsampling rate Since downsampling reduces the size of a sample by a factor of K, it would have a significant impact on the processing speed of the framework. But the effect of this method on the performance should also be considered. Because when a downsampling is applied on a sample, many of its data points are removed, leaving us with a sort of summarization of the signature which might not have all of the information stored in the original sample. From another perspective, it is also possible to have a boost in performance by applying this method. Because by employing this technique we remove many of the data points that are very similar to other data Subjects 31 Accuracy 70.55% 72.55% 72.47% 89.06% 89.37% 91.25% 84.31% 91.35% FAR 30.22% 27.37% 27.50% 10.97% 10.69% 8.75% 15.65% 8.60% FRR 29.56% 27.56% 27.56% 10.89% 10.56% 8.75% 15.73% 8.70% Table 9 Accuracies, false acceptance rates and false rejection rates with respect to different downsampling rates. These results are on SigWiComp2013 Japanese dataset. Sampling Rate 3 4 5 6 Accuracy 79.06% 90.29% 91.35% 78.45% FAR 20.92% 9.71% 8.60% 21.59% FRR 20.96% 9.71% 8.70% 21.51% points, making the problem easier to solve. As shown by the results in Table 9, changing the downsampling rate could result in both a better or worse performance. In our experiments, a downsampling rate of five gave us the best result. Kian Ahrabian, Bagher Babaali 30.0% 22.8% Test Misclassification Rate (%) 19.0% 15.2% 11.4% 7.6% 3.8% 0.0% 0 2000 4000 6000 8000 10000 Train Set Length Distribution (%) Fig. 5 Length distribution of the samples in the test set. 22.8% 25.0% 20.0% 15.0% 10.0% 5.0% 0.0% 0 2000 19.0% 6000 8000 10000 Train Writers Count 15.2% 11.4% 7.6% 3.8% 0.0% 4000 Fig. 7 Relative misclassification rate of the test samples compared to the total available samples in the corresponding bin. Samples are put into separate bins based on their lengths. 0 2000 4000 6000 8000 10000 Fig. 6 Length distribution of the samples in the train set. 4.4 Effect of the samples lengths As demonstrated in Fig. 5, Fig. 6 and Fig. 7, the proposed framework perform well in situations that enough samples with similar length are available in the train set. Thus it can generalize well to new samples when enough samples with a proper distribution in lengths are provided in the train set. Another observation is that even with a low number of very long train samples the model has learned to model these very long samples better than the rather shorter samples. In conclusion, this framework tends to perform better in circumstances that either the samples are very long or enough samples with similar lengths are provided in the train set. Test Writers Count Test Set Length Distribution (%) 10 150 300 1000 2000 150 99.95% 99.94% 99.79% 99.83% 300 99.93% 99.93% 99.85% 99.83% 1000 99.89% 99.86% 99.76% 99.66% 2000 99.85% 99.83% 99.74% 99.69% 99.95 99.90 99.85 99.80 99.75 99.70 Fig. 8 Accuracies of the proposed method on the GPDSsyntheticOnLineOffLineSignature dataset with different sizes of the training set and the test set. with different sizes for the training set and test set. The resulted accuracies of our models are illustrated in Fig. 8. Fig. 9 and Fig. 10 shows the produced false acceptance rates and false rejection rates of our proposed method respectively. Since our framework need some negative samples as well as positive samples, the evaluation method used for evaluating GPDSsyntheticOnLineOffLineSignature dataset differs from the previously used process of evaluation for this dataset which only used reference samples of subjects for training phase. Table 10 presents the comparison of the average EER of our proposed method with obtained results using the techniques in [13, 42]. 4.5 Results on GPDSsyntheticOnLineOffLineSignature dataset 4.6 Effect of the reference set size As for the previously discussed GPDSsyntheticOnLineOffLineSignature dataset, since there are many different subjects, 10000 to be exact, we used the second scenario described in Sect. 3.2. We trained our model Our model works well with even a low count of reference samples, as shown by the results in Table 11. This property gives subjects and end-users a massive advantage On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification 11 Table 10 Comparison of the proposed method with two other state-of-the-art methods on the GPDSsyntheticOnLineOffLineSignature dataset. Dataset State-of-the-art Methods DTW HMM Autoencoder + Siamese DTW HMM Autoencoder + Siamese DTW HMM Autoencoder + Siamese DTW HMM Autoencoder + Siamese GPDSsyntheticOnLineOffLineSignature Subjects 150 300 1000 2000 EER 4.59% 3.00% 0.13% 4.32% 2.53% 0.12% 5.09% 2.96% 0.21% 5.29% 2.95% 0.25% Table 11 EERs on different test set sizes and different count of reference samples. These results are obtained on GPDSsyntheticOnLineOffLineSignature dataset with a training set size of 150. Test Set Size EER 150 2.50% 0.17% 0.11% 0.05% 1 3 5 7 Reference Samples Count 300 2.17% 0.21% 0.09% 0.03% 1000 2.07% 0.24% 0.12% 0.10% Train Writers Count Test Writers Count 150 0.11% 300 0.11% 1000 0.3% Train Writers Count 2000 0.33% 0.5 300 0.16% 0.15% 0.26% 0.34% 1000 0.21% 0.25% 0.35% 0.63% 2000 0.27% 0.3% 0.4% 0.59% 150 300 1000 2000 150 0.0% 0.02% 0.13% 0.04% 300 0.0% 0.01% 0.06% 0.02% 0.6 0.4 0.3 0.2 Test Writers Count 150 2000 1.90% 0.18% 0.10% 0.10% because it requires less amount of storage and initialization. Another conclusion that could be drawn from Table 11 is that it is possible to achieve better results with a mid-range count of reference samples. In our experiments, seven reference samples gave us the best results. 5 Conclusion In this paper, we presented a writer-independent global feature extraction framework based on the autoencoder models and the siamese networks for online handwritten signature verification task. Our experiments showed the significant effect of the usage of Attention Mechanism 0.12 0.10 0.08 1000 0.0% 0.04% 0.15% 0.09% 0.06 0.04 2000 Fig. 9 False Acceptance Rate (FAR) of the proposed method on the GPDSsyntheticOnLineOffLineSignature dataset with respect to different sizes of the training set and the test set. 0.14 0.04% 0.07% 0.14% 0.08% 0.02 0.00 Fig. 10 False Rejection Rate (FRR) of the proposed method on the GPDSsyntheticOnLineOffLineSignature dataset with respect to different sizes of the training set and the test set. and applying Downsampling on performance of the proposed framework. Since our approach is based on the deep models, long before running the experiments we suspected that the performance of our method would be more likely to be successful on bigger datasets. This suspicion was proved to be true, as evidently shown in Table 8 and Table 10. Nonetheless, in both datasets, our method outperformed the state-of-the-art techniques. Our experiments are possibly the first attempt to use deep models on large-scale ASV tasks. Experiments results on the GPDSsyntheticOnLineOffLineSignature dataset showed the tremendous potent capability of these models. Even when we had a shortage of training 12 samples while experimenting with the SigWiComp2013 Japanese dataset, our method proved to be completely capable of achieving excellent performance by surpassing the current state-of-the-art results. This might be the very first step toward a robust large-scale global system for the task of automatic signature verification. Furthermore, our future work will consist of adapting our proposed method to other online verification tasks such as speaker verification and further explore different deep models for online verification tasks which perform well under the constraint of the low count of training sample. Conflict of Interest Statement The authors declare that there is no conflict of interest. References 1. Bengio, Y., Simard, P., Frasconi, P.: Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks 5(2), 157–166 (1994) 2. Bengio, Y., et al.: Learning deep architectures for ai. Foundations and trends R in Machine Learning 2(1), 1– 127 (2009) 3. Bromley, J., Guyon, I., LeCun, Y., Säckinger, E., Shah, R.: Signature verification using a” siamese” time delay neural network. In: Advances in Neural Information Processing Systems, pp. 737–744 (1994) 4. Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078 (2014) 5. Chollet, F., et al.: Keras. https://github.com/ fchollet/keras (2015) 6. Chopra, S., Hadsell, R., LeCun, Y.: Learning a similarity metric discriminatively, with application to face verification. In: Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, vol. 1, pp. 539–546. IEEE (2005) 7. Dey, S., Dutta, A., Toledo, J.I., Ghosh, S.K., Lladós, J., Pal, U.: Signet: Convolutional siamese network for writer independent offline signature verification. arXiv preprint arXiv:1707.02131 (2017) 8. Dolfing, J., Aarts, E.H., Van Oosterhout, J.: On-line signature verification with hidden markov models. In: Pattern Recognition, 1998. Proceedings. Fourteenth International Conference on, vol. 2, pp. 1309–1312. IEEE (1998) 9. Du, W., Fang, M., Shen, M.: Siamese convolutional neural networks for authorship verification 10. Ferrer, M.A., Diaz, M., Carmona-Duarte, C., Morales, A.: A behavioral handwriting model for static and dynamic signature synthesis. IEEE transactions on pattern analysis and machine intelligence 39(6), 1041–1053 (2017) 11. Fierrez, J., Ortega-Garcia, J., Ramos, D., GonzalezRodriguez, J.: Hmm-based on-line signature verification: Feature extraction and signature modeling. Pattern recognition letters 28(16), 2325–2334 (2007) Kian Ahrabian, Bagher Babaali 12. Fierrez-Aguilar, J., Nanni, L., Lopez-Peñalba, J., OrtegaGarcia, J., Maltoni, D.: An on-line signature verification system based on fusion of local and global information. In: AVBPA, vol. 5, pp. 523–532. Springer (2005) 13. Fischer, A., Diaz, M., Plamondon, R., Ferrer, M.A.: Robust score normalization for dtw-based on-line signature verification. In: Document Analysis and Recognition (ICDAR), 2015 13th International Conference on, pp. 241– 245. IEEE (2015) 14. Gal, Y., Ghahramani, Z.: A theoretically grounded application of dropout in recurrent neural networks. In: Advances in neural information processing systems, pp. 1019–1027 (2016) 15. Glorot, X., Bengio, Y.: 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) 16. Gregor, K., Danihelka, I., Graves, A., Rezende, D.J., Wierstra, D.: Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623 (2015) 17. Hafemann, L.G., Sabourin, R., Oliveira, L.S.: Offline handwritten signature verification-literature review. arXiv preprint arXiv:1507.07909 (2015) 18. Hafemann, L.G., Sabourin, R., Oliveira, L.S.: Analyzing features learned for offline signature verification using deep cnns. In: Pattern Recognition (ICPR), 2016 23rd International Conference on, pp. 2989–2994. IEEE (2016) 19. Hochreiter, S., Bengio, Y., Frasconi, P., Schmidhuber, J., et al.: Gradient flow in recurrent nets: the difficulty of learning long-term dependencies (2001) 20. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation 9(8), 1735–1780 (1997) 21. Humm, A., Hennebert, J., Ingold, R.: Gaussian mixture models for chasm signature verification. In: International Workshop on Machine Learning for Multimodal Interaction, pp. 102–113. Springer (2006) 22. Impedovo, D., Pirlo, G.: Automatic signature verification: The state of the art. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews) 38(5), 609–635 (2008) 23. Jain, A.K., Griess, F.D., Connell, S.D.: On-line signature verification. Pattern recognition 35(12), 2963–2972 (2002) 24. Kholmatov, A., Yanikoglu, B.: Identity authentication using improved online signature verification method. Pattern recognition letters 26(15), 2400–2408 (2005) 25. Kingma, D., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014) 26. Koch, G., Zemel, R., Salakhutdinov, R.: Siamese neural networks for one-shot image recognition. In: ICML Deep Learning Workshop, vol. 2 (2015) 27. Lee, L.L., Berger, T., Aviczer, E.: Reliable online human signature verification systems. IEEE Transactions on pattern analysis and machine intelligence 18(6), 643– 647 (1996) 28. Lei, H., Govindaraju, V.: A comparative study on the consistency of features in on-line signature verification. Pattern Recognition Letters 26(15), 2483–2489 (2005) 29. Lejtman, D.Z., George, S.E.: On-line handwritten signature verification using wavelets and back-propagation neural networks. In: Document Analysis and Recognition, 2001. Proceedings. Sixth International Conference on, pp. 992–996. IEEE (2001) 30. Liu, Y., Yang, Z., Yang, L.: Online signature verification based on dct and sparse representation. IEEE transactions on cybernetics 45(11), 2498–2511 (2015) On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification 31. Malik, M.I., Liwicki, M., Alewijnse, L., Ohyama, W., Blumenstein, M., Found, B.: Icdar 2013 competitions on signature verification and writer identification for on-and offline skilled forgeries (sigwicomp 2013). In: Document Analysis and Recognition (ICDAR), 2013 12th International Conference on, pp. 1477–1483. IEEE (2013) 32. Martens, R., Claesen, L.: Dynamic programming optimisation for on-line signature verification. In: Document Analysis and Recognition, 1997., Proceedings of the Fourth International Conference on, vol. 2, pp. 653–656. IEEE (1997) 33. Miguel-Hurtado, O., Mengibar-Pozo, L., Lorenz, M.G., Liu-Jimenez, J.: On-line signature verification by dynamic time warping and gaussian mixture models. In: Security Technology, 2007 41st Annual IEEE International Carnahan Conference on, pp. 23–29. IEEE (2007) 34. Nair, V., Hinton, G.E.: Rectified linear units improve restricted boltzmann machines. In: Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807–814 (2010) 35. Nanni, L.: An advanced multi-matcher method for online signature verification featuring global features and tokenised random numbers. Neurocomputing 69(16), 2402–2406 (2006) 36. Nanni, L.: Experimental comparison of one-class classifiers for online signature verification. Neurocomputing 69(7), 869–873 (2006) 37. Nanni, L., Lumini, A.: Ensemble of parzen window classifiers for on-line signature verification. Neurocomputing 68, 217–224 (2005) 38. Prechelt, L.: Automatic early stopping using cross validation: quantifying the criteria. Neural Networks 11(4), 761–767 (1998) 39. Richiardi, J., Drygajlo, A.: Gaussian mixture models for on-line signature verification. In: Proceedings of the 2003 ACM SIGMM workshop on Biometrics methods and applications, pp. 115–122. ACM (2003) 40. Richiardi, J., Ketabdar, H., Drygajlo, A.: Local and global feature selection for on-line signature verification. In: Document Analysis and Recognition, 2005. Proceedings. Eighth International Conference on, pp. 625–629. IEEE (2005) 41. Rúa, E.A., Castro, J.L.A.: Online signature verification based on generative models. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics) 42(4), 1231–1242 (2012) 42. Sae-Bae, N., Memon, N.: Online signature verification on mobile devices. IEEE Transactions on Information Forensics and Security 9(6), 933–947 (2014) 43. SATI, Y.: On-line signature verification based on shape, motion and handwriting pressure. In: Proc. 6th Int. Conf. on Pattern Recognition, vol. 2, pp. 823–826 (1982) 44. Schuster, M., Paliwal, K.K.: Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing 45(11), 2673–2681 (1997) 45. Srivastava, N., Hinton, G.E., Krizhevsky, A., Sutskever, I., Salakhutdinov, R.: Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research 15(1), 1929–1958 (2014) 46. Sutskever, I., Vinyals, O., Le, Q.V.: Sequence to sequence learning with neural networks. In: Advances in neural information processing systems, pp. 3104–3112 (2014) 47. Theano Development Team: Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints abs/1605.02688 (2016). URL http: //arxiv.org/abs/1605.02688 13 48. Van, B.L., Garcia-Salicetti, S., Dorizzi, B.: On using the viterbi path along with hmm likelihood information for online signature verification. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics) 37(5), 1237–1247 (2007) 49. Vivaracho-Pascual, C., Faundez-Zanuy, M., Pascual, J.M.: An efficient low cost approach for on-line signature recognition based on length normalization and fractional distances. Pattern Recognition 42(1), 183–193 (2009) 50. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., Bengio, Y.: Show, attend and tell: Neural image caption generation with visual attention. In: International Conference on Machine Learning, pp. 2048–2057 (2015) 51. Yang, L., Widjaja, B., Prasad, R.: Application of hidden markov models for signature verification. Pattern recognition 28(2), 161–170 (1995) 52. Yang, Z., Yang, D., Dyer, C., He, X., Smola, A.J., Hovy, E.H.: Hierarchical attention networks for document classification. In: HLT-NAACL, pp. 1480–1489 (2016) 53. Zeinali, H., BabaAli, B., Hadian, H.: Online signature verification using i-vector representation. Accepted in IET Biometrics
9cs.NE
2017 25th Iranian Conference on Electrical Engineering (ICEE) arXiv:1801.06014v1 [eess.SP] 18 Jan 2018 Image Enhancement and Noise Reduction Using Modified Delay-Multiply-and-Sum Beamformer: Application to Medical Photoacoustic Imaging Moein Mozaffarzadeh Master Student Biomedical Engineering Tarbiat Modares University Tehran, Iran [email protected] Ali Mahloojifar Associate Professor Biomedical Engineering Tarbiat Modares University Tehran, Iran [email protected] Abstract—Photoacoustic imaging (PAI) is an emerging biomedical imaging modality capable of providing both high contrast and high resolution of optical and UltraSound (US) imaging. When a short duration laser pulse illuminates the tissue as a target of imaging, tissue induces US waves and detected waves can be used to reconstruct optical absorption distribution. Since receiving part of PA consists of US waves, a large number of beamforming algorithms in US imaging can be applied on PA imaging. Delay-and-Sum (DAS) is the most common beamforming algorithm in US imaging. However, make use of DAS beamformer leads to low resolution images and large scale of off-axis signals contribution. To address these problems a new paradigm namely Delay-Multiply-and-Sum (DMAS), which was used as a reconstruction algorithm in confocal microwave imaging for breast cancer detection, was introduced for US imaging. Consequently, DMAS was used in PA imaging systems and it was shown this algorithm results in resolution enhancement and sidelobe degrading. However, in presence of high level of noise the reconstructed image still suffers from high contribution of noise. In this paper, a modified version of DMAS beamforming algorithm is proposed based on DAS inside DMAS formula expansion. The quantitative and qualitative results show that proposed method results in more noise reduction and resolution enhancement in expense of contrast degrading. For the simulation, two-point target, along with lateral variation in two depths of imaging are employed and it is evaluated under high level of noise in imaging medium. Proposed algorithm in compare to DMAS, results in reduction of lateral valley for about 19 dB followed by more distinguished two-point target. Moreover, levels of sidelobe are reduced for about 25 dB. Keywords-Medical photoacoustic imaging; beamforming; noise reduction; delay-and-sum; delay-multiply-and-sum; I. INTRODUCTION Photoacoustic imaging (PAI) is a promising biomedical imaging modality developed over the past few years and offers advantages of distinguishing different structures and materials based on their optical absorption [1, 2]. When a laser pulse irradiates the imaging target, PA waves induces based on Mahdi Orooji Assistant Professor Biomedical Engineering Tarbiat Modares University Tehran, Iran [email protected] thermoelastic expansion and propagated waves will be detected by UltraSound (US) sensors [3]. The main motivation for using this modality is combining high resolution and high contrast of US and optical imaging. The ability of having these properties in one imaging modality providing anatomical, structural and molecular information, is another motivation of using PAI [4]. There are two types of PAI: photoacoustic tomography (PAT) and photoacoustic microscopy (PAM) [5, 6]. In PAT induced acoustic waves are detected using array of transducers on form of linear, arc or circular shape and mathematical reconstruction algorithms are needed to obtain optical absorption distribution [7-9]. Mathematical image reconstruction algorithm uses an ideal and point like transducers and the noise of measurement system is not included in calculation, so there is an inherent artifact in PA reconstructed images caused by imperfect reconstruction algorithms. Reducing these artifacts became the most important challenge in PAT and PA image reconstruction. Using model-based algorithm is a proper option to address these problems [10-12]. Having an access to all sites of tissue is not feasible in most of the applications of PAT and there are some angles we are not able to acquire data from. Mathematical algorithms assume the full-view of tomography and in most cases apply these algorithms to limited view scenario results in boundaries and sharp details blurring. It has been mathematically and experimentally proved that Deconvolution Reconstruction (DR) method has high precision and low noise sensitivity in both full-view and limited-view [11, 13]. As one of PA imaging techniques, PAM has been significantly investigated in field of biology. Beyond the material of tissue, the axial and lateral resolution of PAM depends on numerical aperture and bandwidth of US transducer used for PA waves detection called AcousticResolution PAM (AR-PAM) [14, 15]. Since PA images are obtained based on induced US signals, there are many similarities between PAI and US imaging. Consequently, many of US beamforming algorithms can be used in PA 2017 25th Iranian Conference on Electrical Engineering (ICEE) beamforming [16]. Delay-and-Sum (DAS) can be considered as one of the most common beamforming algorithms in US imaging, but it is a blind and non-adaptive beamformer which results in low resolution images with high levels of sidelobe. This blindness of DAS algorithm can be addressed by adaptive beamforming such as Minimum Variance (MV) with a considerable applications in RADAR and also US imaging [17]. It also has been modified over the past few years in different fields such as complexity reduction [18] and 3-D US imaging [19]. Although DAS can be simply implemented and consequently is the most common beamforming algorithms, it leads to low image quality. In [20], Matrone et al. proposed a new beamformer algorithm namely Delay-Multiply-and-Sum (DMAS) which is technically similar to DAS beamformer and was used as a reconstruction algorithm in confocal microwave imaging for breast cancer detection [21]. Both of these beamformers calculates delays and samples for corresponding elements of array, but in DMAS before summation, calculated samples are combinatorially coupled and multiplied. This algorithm was recently used in PAI and it was proved that can effectively enhance the formed PA images [22]. In this paper, a new modification of DMAS beamformer is introduced. By expanding the DMAS algorithm, and after some algebra, we can see that DMAS can be manipulated by the summation of DAS terms. It is proposed to use DMAS algorithm instead of existing DAS algorithm for all the terms. The rest of paper is organized as follows. Section II contains the photoacoustic wave equations and the theory of beamformers. Proposed method is introduced in section III. Simulation of imaging system and results are presented in section IV and finally the conclusion is presented in section V. II. BACKGROUND A. photoacoustic theory In typical PA imaging, when laser pulse with short duration illuminates the tissue as a target, PA wave induces based on thermoelastic expansion and US transducers enclosing the target, detect propagated PA waves. Under thermal confinement, acoustic homogeneous medium and inhomogeneous optical absorption medium the pressure 𝑃𝑃(𝑟𝑟, 𝑡𝑡) at position r and time t, results from heat sources 𝐻𝐻(𝑟𝑟, 𝑡𝑡) and obeys the following equation: 𝑐𝑐 2 ∇2 𝑃𝑃(𝑟𝑟, 𝑡𝑡) − 𝜕𝜕 2 Γ(r)H(r, t) 𝑃𝑃(𝑟𝑟, 𝑡𝑡) = − , 𝜕𝜕𝜕𝜕 𝑡𝑡 (1) Where Γ(𝑟𝑟) = 𝛽𝛽𝑐𝑐 2 �𝐶𝐶𝑝𝑝 is the gruneisen parameter, 𝛽𝛽 is the isobaric volume expansion, 𝑐𝑐 is the speed of sound and 𝐶𝐶𝑝𝑝 is the heat capacity [6]. The heat function can be written as product of two components as (2): 𝐻𝐻(𝑟𝑟, 𝑡𝑡) = 𝐴𝐴(𝑟𝑟)𝐼𝐼(𝑡𝑡), (2) Where 𝐴𝐴(𝑟𝑟) is the spatial absorption function and 𝐼𝐼(𝑡𝑡) is the temporal illumination function [7]. Assuming 𝐼𝐼(𝑡𝑡) = 𝛿𝛿(𝑡𝑡), the detected acoustic pressure 𝑃𝑃(𝑟𝑟0 , 𝑡𝑡) at the detector position 𝑟𝑟0 and the time 𝑡𝑡 can be written as: 𝑃𝑃(𝑟𝑟0 , 𝑡𝑡) = 1 𝜕𝜕 𝛿𝛿(𝑐𝑐𝑐𝑐 − |𝑟𝑟0 − 𝑟𝑟|) � 𝑑𝑑 3 𝑟𝑟 𝐷𝐷(𝑟𝑟) , 𝑐𝑐 𝜕𝜕𝜕𝜕 4𝜋𝜋|𝑟𝑟0 − 𝑟𝑟| (3) Where 𝐷𝐷(𝑟𝑟) = Γ(r)A(r). (3) represents a forward problem of PA wave propagation. The inverse problem is about how to reconstruct𝐴𝐴(𝑟𝑟) from detected waves. As the wavelength of generated signals is much smaller than distance between position of detectors and heat sources, the distribution of heat sources can be reconstructed by following equation: 𝐷𝐷(𝜌𝜌, 𝜙𝜙, 𝑧𝑧) = − Where 𝑛𝑛. 𝑛𝑛0 = 1 1 𝜕𝜕𝜕𝜕(𝑟𝑟0 , 𝑡𝑡) � 𝑑𝑑𝑠𝑠0 [𝑛𝑛. 𝑛𝑛0 ] � , 2 2𝜋𝜋𝑐𝑐 𝑡𝑡 𝜕𝜕𝜕𝜕 |𝑟𝑟−𝑟𝑟0 | 𝑡𝑡= (4) 𝑐𝑐 (𝜌𝜌 − 𝜌𝜌0 ) 𝜌𝜌2 + 𝜌𝜌02 + 2𝜌𝜌𝜌𝜌0 cos(𝜙𝜙 − 𝜙𝜙0 ) =� (𝑟𝑟 − 𝑟𝑟0 ) (𝑟𝑟 − 𝑟𝑟0 )2 = �1 − (5) (𝑧𝑧0 − , (𝑟𝑟 − 𝑟𝑟0 )2 𝑧𝑧)2 𝑑𝑑𝑠𝑠0 = 𝜌𝜌0 𝑑𝑑𝜙𝜙0 𝑑𝑑𝑧𝑧0 and 𝜌𝜌0 are the projection of 𝑟𝑟 and 𝑟𝑟0 on the 𝑧𝑧 plane [2]. (4) is the representation of backprojection algorithm. B. Beamforming When PA signals are detected by linear array of US transducers, US beamforming algorithms such as DAS can be used to reconstruct image from detected PA signals using following equation: 𝑀𝑀 𝑦𝑦𝐷𝐷𝐷𝐷𝐷𝐷 (𝑘𝑘) = � 𝑥𝑥𝑖𝑖 (𝑘𝑘 − Δ𝑖𝑖 ), (6) 𝑖𝑖=1 Where 𝑦𝑦𝐷𝐷𝐷𝐷𝐷𝐷 is the output of beamformer, M is number of array elements, 𝑥𝑥𝑖𝑖 (𝑘𝑘) and Δ𝑖𝑖 are detected signals and corresponding time delay for element 𝑖𝑖, respectively [19]. To have a more efficient beamformer and improve the reconstructed image, coherence factor (CF) can be used with DAS [17]. Combination of DAS and CF results in sidelobe levels reduction and contrast enhancement. CF is an adaptive weighting process which is defined as: 𝐶𝐶𝐶𝐶(𝑘𝑘) = 2 |∑𝑀𝑀 𝑖𝑖=1 𝑥𝑥𝑖𝑖 (𝑘𝑘)| . 2 𝑀𝑀 ∑𝑀𝑀 𝑖𝑖=1|𝑥𝑥𝑖𝑖 (𝑘𝑘)| (7) (6) can be simply implemented and provide realtime US and PA imaging. However, due to low range of off-axis signals rejection, it leads to low quality images. To address this problem, DMAS was suggested in [20, 22]. The same as DAS, DMAS calculates corresponding sample for each element of 2017 25th Iranian Conference on Electrical Engineering (ICEE) Figure 1: Simulated two-point target using linear array. (a)DAS, (b) DAS+CF, (c) DMAS, (d) DMAS+CF, (e) Modified DMAS, (f) Modified DMAS+CF. array based on delays but samples are multiplied before adding them up. The DMAS formula if given by: 𝑀𝑀−1 𝑦𝑦𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 (𝑘𝑘) = � 𝑖𝑖=1 𝑀𝑀 � 𝑗𝑗=𝑖𝑖+1 (9) 𝑥𝑥𝑗𝑗 �𝑘𝑘 − Δ𝑗𝑗 �𝑥𝑥𝑗𝑗 �𝑘𝑘 − Δ𝑗𝑗 �. To overcome the dimensionally squared problem of (9) following equations are suggested [22]: 𝑥𝑥�𝑖𝑖𝑖𝑖 (𝑘𝑘) = 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠�𝑥𝑥𝑗𝑗 �𝑘𝑘 − Δ𝑗𝑗 �𝑥𝑥𝑗𝑗 �𝑘𝑘 − Δ𝑗𝑗 ��. (10) 𝑀𝑀−1 (11) �|𝑥𝑥𝑗𝑗 (𝑘𝑘 − Δ𝑗𝑗 )𝑥𝑥𝑗𝑗 (𝑘𝑘 − Δ𝑗𝑗 )| , 𝑓𝑓𝑓𝑓𝑓𝑓 1 ≤ 𝑖𝑖 ≤ 𝑗𝑗 ≤ 𝑀𝑀, 𝑦𝑦𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 (𝑘𝑘) = � 𝑖𝑖=1 III. 𝑀𝑀 � 𝑗𝑗=𝑖𝑖+1 𝑥𝑥�𝑖𝑖𝑖𝑖 (𝑘𝑘). PROPOSED METHOD IV. By expanding (9) which represents DMAS algorithm, in every term of expansion a DAS algorithm shows up as follows: 𝑦𝑦𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 (𝑘𝑘) = + + + + [𝑥𝑥𝑑𝑑1 (𝑘𝑘)𝑥𝑥𝑑𝑑2 (𝑘𝑘) + 𝑥𝑥𝑑𝑑1 (𝑘𝑘)𝑥𝑥𝑑𝑑3 (𝑘𝑘) … + 𝑥𝑥𝑑𝑑1 (𝑘𝑘)𝑥𝑥𝑑𝑑𝑑𝑑 (𝑘𝑘)] [𝑥𝑥𝑑𝑑2 (𝑘𝑘)𝑥𝑥𝑑𝑑3 (𝑘𝑘) + 𝑥𝑥𝑑𝑑2 (𝑘𝑘)𝑥𝑥𝑑𝑑4 (𝑘𝑘) … + 𝑥𝑥𝑑𝑑2 (𝑘𝑘)𝑥𝑥𝑑𝑑𝑑𝑑 (𝑘𝑘)] … [𝑥𝑥𝑑𝑑(𝑀𝑀−2) (𝑘𝑘)𝑥𝑥𝑑𝑑(𝑀𝑀−1) (𝑘𝑘) + ⋯ + 𝑥𝑥𝑑𝑑(𝑀𝑀−2) (𝑘𝑘)𝑥𝑥𝑑𝑑𝑑𝑑 (𝑘𝑘)] [𝑥𝑥𝑑𝑑(𝑀𝑀−1) (𝑘𝑘)𝑥𝑥𝑑𝑑𝑑𝑑 (𝑘𝑘)]. DMAS algorithm is a correlation process in which for each point of image, calculated delays for each elements of array are combinatorially coupled and multiplied and the similarity of samples are gained. As can be seen in (12), in every bracket there is a summation of multiplication and outside of bracket there is just summation. This summation is a DAS algorithm where each samples are summing up with other samples. As mentioned, using DAS as a beamformer results in a low resolution images and high contribution of off-axis signals and DMAS was introduced to address these problems. If the contribution of off-axis signals result in a high error in correlation process in DMAS, then summation of calculated correlations leads to summation of high range of error. It is proposed to use DMAS instead of existing DAS algorithm in DMAS expansion to address the error of correlation process of DMAS algorithm. In the next section it is shown using this method results in resolution enhancement and sidelobe reduction in compare to DMAS. (12) RESULTS In this section numerical simulation is presented to illustrate the performance of proposed algorithm in comparison with DMAS and DAS with/without CF coefficient. A. Simulation In Figure 1, results of simulation are presented. K-wave Matlab toolbox was used to design numerical study [23]. Fourteen 0.1 mm radius spherical absorbers as initial pressure were positioned along the vertical axis every 5 mm, beginning distance of 25 mm from transducer surface while two absorbers at each depth were laterally 4.6 mm, 5 mm, 5.4 mm, 5.8 mm, 6.2 mm, 6.6mm and 7 mm away from surface of each other. Imaging region was 20 mm in lateral axis and 60 mm in 2017 25th Iranian Conference on Electrical Engineering (ICEE) vertical axis. Linear array with M=128 elements operating at 7 MHz center frequency and 77% fractional bandwidth, was used to detected PA signals generated from defined initial pressures. Speed of sound was assumed to be 1540 m/s and sampling frequency was 50MHz. Gaussian noise was added to detected signals where SNR of signals is 50dB. As can be seen, formed images using DAS algorithm has a poor resolution and high levels of sidelobe. Although combination of DAS and CF improved the image quality, sidelobes are still degrading the image, particularly in depth of 50 mm and 55 mm. DMASbased algorithms improve the image resolution and reduce levels of sidelobe in comparison with DAS. By comparing Figure 1(a), Figure 1(c) and Figure 1(e), it can be realized DMAS results in a higher PA image quality. In all reconstructed images, it is clear that using CF combined with other beamforming algorithms results in sidelobe levels reduction. By comparing Figure 1(c) and Figure 1(e) it can be seen that using proposed method causes more exact points formation. Indeed, each point are more like a point-target using modified version of DMAS in comparison with DMAS. To illustrate, consider the leteral variation of mentioned algorithms which is shown in Figure 2. Lateral variation for two depths of imaging are presented. Figure 2(a) and Figure 2(b) represents the lateral variation in depth of 50 mm and 55 mm, respectively. As it can be seen, the levels of sidelobe in different algorithm variates in a wide range. To illustrate, consider the depth of 50 mm. DMAS algorithm results in sidelobe reduction in comparison with DAS about 30 dB. Moreover, the resolution of formed image in DMAS enhances due to reduction of valley between two-point target for about 9 dB. Modified version of DMAS results in more distinguished two-point target in comparison with other beamformers. For instance, consider the valley between two-point target in depth of 55 mm. Using modified DMAS leads to reduction of lateral valley about 19 dB in comparison with DMAS which is a proof of resolution enhancement. Moreover, levels of sidelobe are reduced for about 25 dB and 40 dB in comparison with DMAS and DAS, respectively. Also, it can be seen using CF with all of mentioned algorithms results in approximately 15~20 dB sidelobe levels reduction and resolution improvement. The proposed method has been evaluated using high noisy signals where SNR of signals is 10dB. The results of the reconstructed images using mentioned method are presented in Figure 3. eight 0.1 mm radius spherical absorbers as initial pressure were positioned along the vertical axis every 10 mm, beginning distance of 20 mm from transducer surface while two absorbers at each depth were laterally 4.6 mm, 5 mm, 5.4 mm and 5.8 mm away from surface of each other. As it can be seen, using DAS algorithm leads to low resolution image with high presence of noise which is the consequence of large scale of off-axis signals contribution, but using DMAS algorithm as beamforming method results resolution enhancement in comparison with DAS. However, the reconstructed image still suffers from the presence of noise. It is obvious that modified version of DMAS results in high range of noise and off-axis signals rejection, but image resolution and quality are enhanced. As it can be concluded, proposed method has a high potential to reduce the noise of measurement system and medium of imaging. Figure 2: Lateral variation of two-point target simulation for imaging depth of (a) 50 mm and (b) 55 mm. Figure 3: Simulated two-point target using linear array in presence of high level of noise. (a) DAS, (b) DMAS and (c) Modified DMAS. 2017 25th Iranian Conference on Electrical Engineering (ICEE) V. CONCLUSION In this paper a new method based on DMAS beamformer has been introduced to improve the resolution of PA reconstructed images. It has been shown, there is a DAS algorithm inside DMAS algorithm expansion and it was proposed to use DMAS instead of existing DAS. Two-point target simulation has been presented in the case of high and low level of noise in imaging medium. It has been shown using DMAS based algorithm results in images with higher quality compared with DAS beamformer. More importantly, using modified version of DMAS leads to a resolution enhancement and sidelobe reduction for about 19 dB and 25 dB, respectively. Also, in presence of high level of noise in imaging medium, modified DMAS results in large scale of noise reduction and consequently resolution improves. VI. FURTHER WORK Despite the promising improvement in the resolution of the reconstructed synthetic photoacoustic images (via the simulation), the proposed method needs to be evaluated independently on the actual experimental data. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] J. Xia and L. V. Wang, "Small-animal whole-body photoacoustic tomography: a review," IEEE Transactions on Biomedical Engineering, vol. 61, pp. 1380-1389, 2014. M. Xu and L. V. Wang, "Photoacoustic imaging in biomedicine," Review of scientific instruments, vol. 77, p. 041101, 2006. J. Kim, D. Lee, U. Jung, and C. Kim, "Photoacoustic imaging platforms for multimodal imaging," Ultrasonography, vol. 34, p. 88, 2015. M. Jeon and C. Kim, "Multimodal photoacoustic tomography," IEEE transactions on multimedia, vol. 15, pp. 975-982, 2013. H. F. Zhang, K. Maslov, G. Stoica, and L. V. Wang, "Functional photoacoustic microscopy for high-resolution and noninvasive in vivo imaging," Nature biotechnology, vol. 24, pp. 848-851, 2006. Y. Zhou, J. Yao, and L. V. Wang, "Tutorial on photoacoustic tomography," Journal of biomedical optics, vol. 21, pp. 061007-061007, 2016. M. Xu and L. V. Wang, "Time-domain reconstruction for thermoacoustic tomography in a spherical geometry," IEEE transactions on medical imaging, vol. 21, pp. 814-822, 2002. Y. Xu, D. Feng, and L. V. Wang, "Exact frequency-domain reconstruction for thermoacoustic tomography. I. Planar geometry," IEEE transactions on medical imaging, vol. 21, pp. 823-828, 2002. Y. Xu, M. Xu, and L. V. Wang, "Exact frequency-domain reconstruction for thermoacoustic tomography. II. Cylindrical geometry," IEEE transactions on medical imaging, vol. 21, pp. 829-833, 2002. [10] Y. Han, V. Ntziachristos, and A. Rosenthal, "Optoacoustic image reconstruction and system analysis for finite-aperture detectors under the wavelet-packet framework," Journal of biomedical optics, vol. 21, pp. 016002-016002, 2016. [11] C. Zhang, C. Li, and L. V. Wang, "Fast and robust deconvolution-based image reconstruction for photoacoustic tomography in circular geometry: experimental validation," IEEE photonics journal, vol. 2, pp. 57-66, 2010. [12] C. Zhang, Y. Wang, and J. Wang, "Efficient block-sparse model-based algorithm for photoacoustic image reconstruction," Biomedical Signal Processing and Control, vol. 26, pp. 11-22, 2016. [13] C. Zhang and Y. Wang, "Deconvolution reconstruction of full-view and limited-view photoacoustic tomography: a simulation study," JOSA A, vol. 25, pp. 2436-2443, 2008. [14] J. Y. Kim, C. Lee, K. Park, G. Lim, and C. Kim, "Fast optical-resolution photoacoustic microscopy using a 2-axis water-proofing MEMS scanner," Scientific reports, vol. 5, 2015. [15] S. Park, C. Lee, J. Kim, and C. Kim, "Acoustic resolution photoacoustic microscopy," Biomedical Engineering Letters, vol. 4, pp. 213-222, 2014. [16] C.-W. Wei, T.-M. Nguyen, J. Xia, B. Arnal, E. Y. Wong, I. M. Pelivanov, et al., "Real-time integrated photoacoustic and ultrasound (PAUS) imaging system to guide interventional procedures: ex vivo study," IEEE transactions on ultrasonics, ferroelectrics, and frequency control, vol. 62, pp. 319-328, 2015. [17] B. M. Asl and A. Mahloojifar, "Minimum variance beamforming combined with adaptive coherence weighting applied to medical ultrasound imaging," IEEE transactions on ultrasonics, ferroelectrics, and frequency control, vol. 56, pp. 1923-1931, 2009. [18] A. M. Deylami and B. M. Asl, "Low complex subspace minimum variance beamformer for medical ultrasound imaging," Ultrasonics, vol. 66, pp. 43-53, 2016 [19] S. A. I. Avanji, A. Mahloojifar, and B. M. Asl, "Adaptive 3D MV beamforming in medical ultrasound imaging," in Biomedical Engineering (ICBME), 2013 20th Iranian Conference on, 2013, pp. 8186. [20] G. Matrone, A. S. Savoia, G. Caliano, and G. Magenes, "The delay multiply and sum beamforming algorithm in ultrasound B-mode medical imaging," IEEE transactions on medical imaging, vol. 34, pp. 940-949, 2015. [21] H. B. Lim, N. T. T. Nhung, E.-P. Li, and N. D. Thang, "Confocal microwave imaging for breast cancer detection: Delay-multiply-and-sum image reconstruction algorithm," IEEE Transactions on Biomedical Engineering, vol. 55, pp. 1697-1704, 2008. [22] J. Park, S. Jeon, J. Meng, L. Song, J. S. Lee, and C. Kim, "Delaymultiply-and-sum-based synthetic aperture focusing in photoacoustic microscopy," Journal of biomedical optics, vol. 21, pp. 036010-036010, 2016. [23] B. E. Treeby and B. T. Cox, "k-Wave: MATLAB toolbox for the simulation and reconstruction of photoacoustic wave fields," Journal of biomedical optics, vol. 15, pp. 021314-021314-12, 2010.
7cs.IT
arXiv:1312.0324v1 [math.AC] 2 Dec 2013 Perfect Sets and f -Ideals ∗ Jin Guo†, Tongsuo Wu‡ Department of Mathematics, Shanghai Jiaotong University Qiong Liu§ Department of Mathematics, Shanghai University of Electric Power Abstract. A square-free monomial ideal I is called an f -ideal, if both δF (I) and δN (I) have the same f -vector, where δF (I) (δN (I), respectively) is the facet (Stanley-Reisner, respectively) complex related to I. In this paper, we introduce and study perfect subsets of 2[n] and use them to characterize the f ideals of degree d. We give a decomposition of V (n, 2) by taking advantage of a correspondence between graphs and sets of square-free monomials of degree 2, and then give a formula for counting the number of f -ideals of degree 2, where V (n, 2) is the set of f -ideals of degree 2 in K[x1 , . . . , xn ]. We also consider the relation between an f -ideal and an unmixed monomial ideal. Key Words and phrases: perfect set; perfect number; f -ideal; StanleyReisner complex; facet complex 2010 Mathematics Subject Classification: 13P10, 13F20, 13C14, 05A18. 1 Introduction Throughout the paper, for a positive integer n, let [n] = {1, 2, . . . , n}. For a set A, let Ad be the set of the subsets of A with cardinality d. In particular, for a simplicial complex ∆, let ∆d be the set of faces of ∆ with dimension d − 1. Let S = K[x1 , . . . , xn ] be the ∗ This research is supported by the National Natural Science Foundation of China (Grant No. 11271250). † [email protected] ‡ Corresponding author. [email protected] § [email protected] polynomial ring over a field k, and let I be a monomial ideal of S. Denote by sm(S) and sm(I) the set of square-free monomials in S and I respectively. There is a natural bijection between sm(S) and 2[n] , denoted by σ : xi1 xi2 · · · xik 7→ {i1 , i2 , . . . , ik }. For other concepts and notations, see references [2, 5, 7, 9, 10]. Given a simplicial complex ∆, one can define a Stanley-Reisner ideal I∆ and a facet ideal I(∆) corresponding to ∆. Conversely, given a square-free monomial ideal I of S = K[x1 , . . . , xn ], there are a pair of simplicial complexes related to I. One is the facet complex of I and is denoted by δF (I). δF (I) is generated by the set σ(G(I)), i.e., σ(G(I)) = {σ(g) | g ∈ G(I)} is the set of facets of δF (I), where G(I) is the minimal generating set of the monomial ideal I of S. The other one is the Stanley-Reisner complex δN (I) of I, or alternatively, the non-face complex of I. Note that the Stanley-Reisner ideal of δN (I) is I, in other words, δN (I) = {σ(g) | g ∈ sm(S) \ sm(I)}. The above correspondences construct a bridge between algebraic properties of ideals and combinatorial properties of simplicial complexes. In order to study algebraic properties such as linear resolution of square-free monomial ideals, one usually takes advantage of the structures of simplicial complexes corresponding to the ideal, see references [6, 8, 11, 4]. Throughout the paper, a monomial ideal I is called of degree d (or alternatively, homogeneous of degree d), if all monomials in G(I) have the same degree d. Note that the degree of a monomial ideal I, denoted by deg(I), is the maximal degree of the monomials in G(I). Note the difference between the two phrases. Recall that a square-free monomial ideal I is called an f -ideal, if both δF (I) and δN (I) have the same f -vector. Note that the f -vector of a complex δN (I) is essential in the computation of the Hilbert series of S/I, and in general the f -vector of δN (I) is not easy to calculate. Since the correspondence of the complex δF (I) and the ideal I is direct and clear, it is more easier to calculate the f -vector of δF (I). So, it is easy to calculate the Hilbert series and study other corresponding properties of S/I while I is an f -ideal. It seems that the original impetus for combining the simplicial complex δF (I) with δN (I) comes from Remark 2 of [6], while the formal definition of an f -ideal first appeared in [1], in which the authors studied the properties of f -ideals of degree 2, and presented an interesting characterization of such ideals. In [3], the authors generalized the characterization for f -ideals of degree d (d ≥ 2), though their main result seems to be a little bit inaccurate, see Example 5.1 in this paper. The importance of f -ideals of degree 2 lies in the fact that they are unmixed, see Proposition 5.2 of this paper. In this paper, we determine all f -ideals of degree 2, thus providing a class of unmixed monomial ideals. In this paper, we focus on the following questions: (1) How to characterize f -ideals of degree d directly? (2) How many f -ideals of degree d are there in the polynomial ring S = K[x1 , . . . , xn ]? (3) Is there any f -ideal which is not unmixed? (4) What can one say about f -ideals in general case? In section 2, we give an answer to questions (1). We give a complete answer to question (2) in sections 3 and 4, in the case d = 2 . In section 5, we present a class of f -ideals which are not unmixed, and prove further that in the case d = 2, an ideal is f -ideal if and only if it is an unmixed f -ideal. Finally, in section 6, we give a preliminary answer to question (4). In order to compare with the definition of the degree of a monomial ideal, we need the following: Definition 1.1. For a monomial ideal I, the minimal degree of monomials in G(I) is called the lower degree of I, denoted by ldeg(I). Lemma 1.2. ([3] Lemma 3.6) Let I be a square-free monomial ideal of degree d. Then for each 0 ≤ i < d − 1, δF (I)i+1 ⊆ δN (I)i+1 holds. In particular, fi (δF (I)) ≤ fi (δN (I)) holds for each 0 ≤ i < d − 1. The proof to the following lemma is direct to check, so we omit its verification: Lemma 1.3. Let I be a square-free monomial ideal of S = K[x1 , . . . , xn ] with ldeg(I) = k. Then for each 0 < i < k, fi−1 (δN (I)) = Cni holds. Furthermore, if I is an f -ideal, then fi−1 (δF (I)) = fi−1 (δN (I)) = Cni holds for each 0 < i < k. The following corollary follows directly from Lemma 1.3: Corollary 1.4. ([3] Lemma 3.7) If I is an f -ideal of degree d, then fi−1 (δF (I)) = fi−1 (δN (I)) = Cni holds for each 0 < i < d. 2 Perfect sets and f -ideals of degree d In order to characterize f -ideals clearly, we need the following definitions. Definition 2.1. For a set of square-free monomials A in K[x1 , . . . , xn ], the upper generated set ⊔(A) of A is defined by ⊔(A) = {gxi | g ∈ A, xi ∤ g, 1 ≤ i ≤ n}. Dually, the lower cover set ⊓(A) of A is defined by ⊓(A) = {h | 1 6= h, h = g/xi for some g ∈ A and some xi with xi | g }. i ∞ ∞ i Similarly, we define ⊔2 (A) = ⊔(⊔(A)), and ⊔∞ (A) = ∪∞ i=1 ⊔ (A), ⊓ (A) = ∪i=1 ⊓ (A). Actually, both ⊔∞ (A) and ⊓∞ (A) are finite union. Denote by sm(S)d the set of square-free monomials of degree d in S. Definition 2.2. Let S = K[x1 , . . . , xn ], and let A ⊆ sm(S)d . A is called upper perfect, if ⊔(A) = sm(S)d+1 holds. Dually, A is called lower perfect, if ⊓(A) = sm(S)d−1 holds. If A is both upper perfect and lower perfect, then A is called (n, d)th perfect , or alternatively, a perfect subset of sm(S)d . For a given pair of numbers (n, d), the least number among cardinalities of (n, d)th perfect sets is called the (n, d)th perfect number, and will be denoted by N(n,d) . Example 2.3. Let S = K[x1 , x2 , x3 , x4 ]. Consider the following three subsets of sm(S)2 : A = {x1 x2 , x1 x3 , x1 x4 }, B = {x1 x2 , x1 x3 , x2 x3 }, C = {x1 x2 , x3 x4 }. It is direct to check that A is lower perfect, B is upper perfect, C is perfect. Note that x2 x3 x4 6∈ ⊔(A), so A is not upper perfect. Since x4 6∈ ⊓(B), B is not lower perfect. With the aid of the bijection σ : sm(S) → 2[n] , we can define an upper generated subset, an lower cover subset and a (lower, upper) perfect subsets of 2[n] , respectively. For example, a subset A of [n]d is called a perfect set, if σ −1 (A) is a perfect subset of sm(K[x1 , . . . , xn ]d ). The following theorem will show how to judge a square-free monomial ideal of degree d to be an f -ideal directly and conveniently. Theorem 2.4. Let S = K[x1 , . . . , xn ], and let I be a square-free monomial ideal of S of degree d with the minimal generating set G(I). Then I is an f -ideal if and only if G(I) is (n, d)th perfect and |G(I)| = 12 Cnd holds true. P roof. If I is an f -ideal of degree d, then by definition, δF (I) and δN (I) have the same fvector. In particular, dim(δN (I)) = dim(δF (I)) = d − 1. By the definition of the non-face complex δN (I), I is the Stanley-Reisner ideal of δN (I). Hence I contains every square-free monomial of degree d+1, thus G(I) is upper perfect since G(I) is homogeneous of degree d. Furthermore, note that every facet of δF (I) has dimension d − 1, and fd−2 (δF (I)) = Cnd−1 holds by Corollary 1.4, it follows that G(I) is lower perfect, thus G(I) is a perfect subset of sm(S)d . Finally, |G(I)| = Cnd /2 clearly holds true. Conversely, if G(I) is (n, d)th perfect and |G(I)| = Cnd /2, we claim that δN (I) is the simplicial complex generated by D = E ∪ [n]d−1 , where E = [n]d \ σ(G(I)). In fact, let ∆ be the simplicial complex generated by D. Then clearly the Stanley-Reisner ideal I∆ of ∆ contains all the monomials in G(I) and thus I ⊆ I∆ holds. Note further that G(I) is upper perfect, it follows that I is the Stanley-Reisner ideal I∆ of ∆. On the other hand, each set in [n]d−1 is a face of δF (I) since G(I) is lower perfect. Thus δF (I) and δN (I) have the same f-vector, and hence I is an f -ideal.  Remark 2.5. By Definition 2.2, Theorem 2.4 actually provides a rather simple algorithm for listing all the perfect subsets of 2[n] of degree d: 1. List all elements of [n]d , [n]d+1 , [n]d−1 respectively. 2. For each A ⊆ [n]d , if |A| = 21 Cnd , then go to the next step. 3. List ⊔(A) and ⊓(A), and then check if ⊔(A) = [n]d+1 and ⊓(A) = [n]d−1 holds true. Note that A is perfect if and only if both equalities hold. 3 Perfect number N(n,2) and existence of (n, 2)th f ideals In the following, an ideal I is called an (n, d)th f -ideal if I is an f -ideal of K[x1 , . . . , xn ] of degree d. We denote by V (n, d) the set of all (n, d)th f -ideals. By the characterization of Theorem 2.4, G(I) is an (n, d)th perfect set if I is an (n, d)th f -ideal. We denote by U(n, d) the set of (n, d)th f -ideals whose minimal generating set contains a least (n, d)th perfect set, where a least (n, d)th perfect set is an (n, d)th perfect set with cardinality N(n,d) . In this section, we mainly study V (n, 2). It is easy to see that N(3,2) = 2 and V (3, 2) = ∅. So, assume n ≥ 4 in the following. Note that 2 ∤ Cn2 holds whenever n = 4k + 2 or n = 4k + 3, thus in these cases, V (n, 2) = ∅. In the following, we only consider the case when n = 4k or n = 4k + 1. Clearly, it is important to find a perfect set with the least cardinality. For this purpose, we begin with the calculation of the perfect number N(n,2) for general n ≥ 4. Combining with Proposition 4.3, the following theorem can be proved by Turan’s theorem. In order to read conveniently, we show a direct proof in the following. Theorem 3.1. Let k be a positive integer, and let n ≥ 4. Then the perfect number N(n,2) is given under the following rules:  k 2 − k, if n = 2k; N(n,2) = (1) k 2 , if n = 2k + 1. P roof. We will prove the conclusion by the following two steps. Step 1: we want to estimate the lower bound of the cardinalities of (n, 2)th perfect sets. Let A be an (n, 2)th perfect set. Denote Ai+ = {j | j > i and xi xj ∈ A}. Substep 1: If xi xj ∈ A holds for each pair of i, j ∈ [n], then the cardinality of A is very large. Without loss of generality, assume that x1 x2 6∈ A. Note that A is upper perfect, hence for every i ∈ [n] \ [2], x1 x2 xi ∈ ⊔(A). So, either x1 xi ∈ A or x2 xi ∈ A. Hence A1+ ∪ A2+ = [n] \ [2] and thus |A1+ | + |A2+ | ≥ n − 2 holds. Substep 2: This substep is similar to step 1. In fact, if xi xj ∈ A holds for each pair of i, j ∈ [n] \ [2], then the cardinality of A is very large. Without loss of generality, assume that x3 x4 6∈ A. Since for every i ∈ [n] \ [4], x3 x4 xi ∈ ⊔(A). So, either x3 xi ∈ A or x4 xi ∈ A. Hence A3+ ∪ A4+ = [n] \ [4], thus |A3+ | + |A4+ | ≥ n − 4 holds. Continuing the substeps if necessary. It is easy to see that for each positive integer l such that 2l ≤ n, we have A(2l−1)+ ∪ A2l+ = [n] \ [2l] and |A(2l−1)+ | + |A2l+ | ≥ n − 2l P hold. Therefore, |A| = ni=1 |Ai+ | ≥ (n − 2) + (n − 4) + · · · holds. Then we proceed the calculation in the following two subcases: If n = 2k for some positive integer k, then |A| ≥ k 2 − k. If n = 2k + 1 for some positive integer k, then |A| ≥ k 2 . Step 2: We will show that N(n,2) can get to the lower bound. Consider also the two subcases: n = 2k and n = 2k + 1. The following discussion are based on the assumption n = 2k, and the other case is similar to construct, so we omit the details. Assume n = 2k for some positive integer k. Based on the discussion of step 1, in order to show that N(n,2) can get to the lower bound k 2 − k, it is suffice to show that for each l = k, k −1, . . . , 1, we can distribute the elements of [n]\[2l] to A(2l−1)+ and A2l+ properly. Substep 0: Set An+ = ∅, and set A(n−1)+ = ∅. Substep 1: Set A(n−2)+ = {n}, and set A(n−3)+ = {n − 1}. Analysis: By now, we can make sure that xi xj xt ∈ ⊔(A) for {i, j, t} ⊆ [n] \ [n − 4]. Substep 2: Set A(n−4)+ = {n − 2} ∪ A(n−2)+ , and set A(n−5)+ = {n − 3} ∪ A(n−3)+ . Analysis: By now, we can make sure that xi xj xt ∈ ⊔(A) for {i, j, t} ⊆ [n] \ [n − 6]. Substeps 3, 4, et. al. are similar to substeps 1 and 2. In general, for a positive integer l ≤ n/2, set A2l+ = {2l +2}∪A(2l+2)+ , and set A(2l−1)+ = {2l +1}∪A(2l+1)+ . It is not hard to see that xi xj xt ∈ ⊔(A) for {i, j, t} ⊆ [n] \ [2l − 2]. In fact, if {2l − 1, 2l} ∩ {i, j, t} = ∅, then by the previous substep, the conclusion is true. If {2l − 1, 2l} ∩ {i, j, t} = 6 ∅, without loss of generality, assume i = 2l. Now consider j and t: if one of them is in A2l+ , then the conclusion is true. In the other case, {j, t} ⊆ A(2l−1)+ holds, thus the conclusion is also true since xj xt ∈ A by the definition of A(2l−1)+ . Finally, set A2+ = {4} ∪ A4+ , and set A1+ = {3} ∪ A3+ . We also have xi xj xt ∈ ⊔(A) for {i, j, t} ⊆ [n]. By now, we get an upper perfect set A. It is easy to see that the set A is also lower perfect, and |A| = k 2 − k holds.  Remark 3.2. The proof to Theorem 3.1 also answers the afore-mentioned question: How to find an (n, 2)th perfect set with the least cardinality? In fact, what is needed is to decompose the set [n] into a disjoint union of two subsets B and C uniformly, namely, ||B| − |C|| ≤ 1. Then set A = {xi xj | i, j ∈ B, or i, j ∈ C}. By the above theorem, A is an (n, 2)th perfect set. Actually, it is easy to check directly that A is a perfect set, and the cardinality of A is equal to the (n, 2)th perfect number N(n,2) , which provides another new understanding of the formula in Theorem 3.1, i.e.,  C 2 + C 2 = k 2 − k, if n = 2k; k k N(n,2) = (2) 2 C + C 2 = k 2 , if n = 2k + 1. k k+1 Note that any set D such that A ⊆ D ⊆ sm(S)2 is also an (n, 2)th perfect set. It follows clearly from the definition of an (n, 2)th perfect set. Now we are ready to settle the existence of (n, 2)th f -ideals: Proposition 3.3. V (n, 2) 6= ∅ if and only if n = 4k or n = 4k + 1 for some positive integer k. P roof. The necessary part is clear. For the sufficient part, it is suffice to show that the (n, 2)th perfect number is not greater than Cn2 /2 in the two cases respectively. If n = 4k, then by Theorem 3.1 N(n,2) = 4k 2 − 2k and Cn2 /2 = 4k 2 − k, so N(n,2) < Cn2 /2. If  n = 4k + 1, then N(n,2) = 4k 2 and Cn2 /2 = 4k 2 + k, so we also have N(n,2) < Cn2 /2. 4 Structure of V (n, 2) For a nontrivial subset B of [n], let B be the complement of B in [n] and let WB = {xi xj | i, j ∈ B or i, j ∈ B} be a subset of sm(S). Clearly WB = WB holds, and WB is an (n, 2)th perfect set. Such a way to construct a perfect set is called a Two Part Complete Construction. A subset A of sm(S)2 is called satisfying Two Part Complete Structure, abbreviated as TPCS, if there exists a B ⊆ [n], such that WB ⊆ A. If further |B| = l, then A is called satisfying lth TPCS. An f -ideal I is called of l type, if G(I) satisfies lth TPCS. Denote by Wl the set of f -ideals of l type in S. It is easy to see that U(n, 2) = W2k holds, if n = 4k or n = 4k + 1 for some positive integer k. We begin with a counting formula for |U(n, 2)|: Proposition 4.1. If k is a positive integer, then   1 2k k    2 C4k C4k2 , |U(n, 2)| = 2k k C4k+1 C4k 2 +2k ,    0, if n = 4k; if n = 4k + 1; otherwise (3) P roof. We only prove the case when n = 4k, and the other cases are similar to this one. Assume I ∈ U(n, 2), where n = 4k. Since U(n, 2) = W2k , there exists a subset B ⊆ [n] with |B| = 2k, such that WB ⊆ G(I) holds. We claim that such a subset B is unique, i. e., if there exists another B1 ⊆ [n] with |B1 | = 2k such that WB1 ⊆ G(I), 2 then {B, B} = {B1 , B1 } holds. In fact, note that both |G(I)| = C4k /2 = 4k 2 − k and 2 |WB | = 2C2k = 4k 2 − 2k hold, hence there are at most k monomials in G(I) \ WB . Now assume to the contrary that {B, B} 6= {B1 , B1 } holds, and assume without loss of generality further that 1, 2 ∈ B, 1 ∈ B1 and 2 6∈ B1 hold. Then WB1 contains half of the monomials in W = {x1 xj | j 6∈ B} ∪ {x2 xj | j 6∈ B}. Let M ⊆ W be such that M ⊆ WB1 and |M| = 2k. Then M ⊆ G(I) \ WB and |G(I) \ WB | ≤ k hold, a contradiction. The contradiction shows the uniqueness of the set {B, B}. In order to count the cardinality of U(n, 2), we need first choose a 2k set B randomly, then choose k monomials of sm(S)2 \ WB randomly. Note that WB = WB holds, thus 2k k 2k k CC 2 −2C 2 = 12 C4k C4k2 also holds. This completes the proof.  |U(n, 2)| = 12 C4k 4k 2k In the rest part of this section, we will consider a possible decomposition of V (n, 2) into a disjoint union of the afore-mentioned Wl . For this purpose, it is natural to ask the following interesting question: Is there any f -ideal who is of no l type? The following example gives an immediate answer to the question. In the following, we will show that this is the only kind of the example. Example 4.2. Let S = K[x1 , x2 , x3 , x4 , x5 ]. It is direct to check that I = hx1 x2 , x2 x3 , x3 x4 , x4 x5 , x1 x5 i is an f -ideal, but I is not of l type for any l. How to find further f -ideals which are not of l type for any l? In order to answer this question, we need a new idea to construct an f -ideal. Let S = K[x1 , . . . , xn ], and let τ be a bijection sending a subset A of sm(S)2 to a graph T whose vertices are v1 , . . . , vn , such that vi vj ∈ E(T ) holds if and only if xi xj ∈ A, where E(T ) is the edge set of T . The above example shows that if T is a cycle with 5 vertices, then the ideal generated by τ −1 (T ) is an f -ideal. Such a class of f -ideals will be denoted by C5 , which consists of 12 f -ideals. Proposition 4.3. Let A ⊆ sm(S)2 . Then (1) A is upper perfect if and only if ω(τ (A)) ≤ 2 holds, where τ (A) is the complement graph of τ (A). (2) A is lower perfect if and only if for each i ∈ [n], d(vi ) < n − 1 holds in the graph τ (A). P roof. (1) We will prove it by reduction to an absurdity. For the sufficiency part, assume to the contrary that A is not upper perfect. Then there exists a subset {i, j, t} ⊆ [n] such that none of xi xj , xi xt , xj xt is in A, hence {vi vj , vi vt , vj vt } ∩ E(τ (A)) = ∅ holds, thus {vi , vj , vt } is a clique in τ (A), contradicting ω(τ (A)) ≤ 2. The necessity part is similar to get, if we reverse the above discussion. (2) It is not hard to see that, A is lower perfect if and only if there exists no vertex vi ∈ V (τ (A)) with d(vi ) = 0 in τ (A), and the latter holds if and only if for each i ∈ [n], d(vi ) < n − 1 holds in the graph τ (A). This completes the proof.  By the above proposition, Theorem 3.1 is equivalent to the classical Turan’s theorem, and the proof to Theorem 3.1 is an alternative proof to Turan’s theorem. Proposition 4.4. If I is an (n, 2)th f -ideal, then I is of l type for some 1 ≤ l ≤ ⌊n/2⌋ if and only if τ (G(I)) is a bipartite graph. P roof. For the necessity part, assume first that I is of l type. By definition, there exists a subset B ⊆ [n] with |B| = l, such that WB ⊆ G(I) holds. Hence KB ∪ KB ⊆ E(τ (G(I))), where KB = {vi vj | i, j ∈ B} and KB = {vi vj | i, j 6∈ B}. It is easy to see that τ (G(I)) is a bipartite graph, with two parts corresponding to B and B, respectively. Reversing the above discussion, we get the proof of the sufficiency part.  By Proposition 4.3 and Proposition 4.4, the following lemma is clear. Lemma 4.5. I is an (n, 2)th f -ideal which is not of l type for any l, if and only if τ (G(I)) satisfies the following four conditions (abbreviated as FC in what follows): (1) For each i ∈ [n], d(vi ) < n − 1 holds in τ (G(I)). (2) ω(τ (G(I))) = 2. 2 (3) |E(τ (G(I)))| = C2n . (4) τ (G(I)) is not a bipartite graph. Note that a square-free monomial ideal I of degree 2 is an f -ideal if and only if τ (G(I)) satisfies the above conditions (1), (2) and (3). Our idea to deal with the above FC question is illustrated the following: Based on the condition (4), construct our model by the rules (1) and (2), and then check the model by the condition (3). Note that a graph is bipartite if and only if the graph contains no odd cycle, so we will construct our model on an odd cycle. We find an amazing result as the following theorem shows. S⌊n/2⌋ Theorem 4.6. If n 6= 5, then V (n, 2) = l=1 Wl , which is a mutually disjoint union of the Wl ’s. ⌊n/2⌋ P roof. Note that V (n, 2) = ∪l=1 Wl holds true, if and only if each f -ideal is of l type for some l; and the latter holds if and only if, there is no graph satisfying the FC. We will show that a graph will not satisfy condition (3) if it satisfies conditions (2) and (4), except for the case n = 5. Assume that T is a graph satisfying conditions (2) and (4). Since T is not a bipartite graph, there exists at least an odd cycle in T . Assume that D is a minimal odd cycle of T , with |V (D)| = 2i + 1. Note that ω(T ) = 2, so i ≥ 2. Denote by |E(D)| the edge number of the subgraph induced on D, and denote by |E(B, C)| the number of edges, each of which has end vertices in B and C respectively. It is clear that |E(T )| = |E(D)| + |E(T \ D)| + |E(D, T \ D)|. holds. Note that |E(D)| = 2i + 1 holds, since D is a minimal cycle. Since there exists no triangles in T , it is not hard to see that |E(D, T \ D)| ≤ (n − 2i − 1)i holds, since D is an odd cycle. We will discuss |E(T \ D)| in the following two subcases: If n = 2k for some positive k, then |V (T \ D)| = 2k − 2i − 1 holds. It follows from Turan’s theorem that |E(T \ D)| ≤ (k − i)(k − i − 1) hold, hence we get |E(T )| = |E(D)| + |E(T \ D)| + |E(D, T \ D)| ≤ (2i + 1) + (2k − 2i − 1)i + (k − i)(k − i − 1) = k 2 − k − i2 + 2i + 1. Note that Cn2 /2 = k 2 − k/2, thus Cn2 /2 − |E(T )| ≥ k/2 + i2 − 2i − 1 = k/2 + (i − 1)2 − 2 holds. Since i ≥ 2 and 2k > 2i + 1, Cn2 /2 − |E(T )| > 0 holds. This shows that there is no graph satisfying FC when n = 2k. If n = 2k +1, then |V (T \D)| = 2k −2i holds. Again by Turan’s theorem, |E(T \D)| ≤ (k − i)2 holds, hence we have |E(T )| = |E(D)| + |E(T \ D)| + |E(D, T \ D)| ≤ (2i + 1) + (2k − 2i)i + (k − i)2 = k 2 − i2 + 2i + 1. Note that Cn2 /2 = k 2 + k/2, thus Cn2 /2 − |E(T )| ≥ k/2 + i2 − 2i − 1 = k/2 + (i − 1)2 − 2 holds true. Then we have Cn2 /2 − |E(T )| ≥ 0, since i ≥ 2 and k ≥ i hold by assumption. Note further that the equality holds if and only if k = i = 2. Thus in this case, there is no graph satisfying FC except n = 5. This completes the proof.  By the proof of the above theorem, if an f -ideal of degree 2 is not of l type for any l, then it must be contained in the set C5 , see Example 4.2. In order to explain the above theorem more precisely, we need the following proposition. Proposition 4.7. (1) If n = 4k for some positive integer k, then W2k−i 6= ∅ holds if and only if i2 ≤ k. (2) If n = 4k + 1, then W2k−i 6= ∅ holds if and only if i2 + i ≤ k. 2 2 2 P roof. (1) Note that W2k−i 6= ∅ if and only if C2k−i + C2k+i ≤ C4k /2 holds. By direct 2 calculation, the latter holds if and only if i ≤ k. (2) It is similar to (1) to check.  The following refines Theorem 4.6: Theorem 4.8. Let k be a positive integer. Then the following equalities hold true:   ∪√ W2k−i , if n = 4k;    0≤i≤ k     W2k−i , if n = 4k + 1(k 6= 1); ∪ √ V (n, 2) = 0≤i≤ 1+4k−1 2     W2 ∪ C5 , if n = 5;     ∅, if n = 4k + 2 or n = 4k + 3. (4) Remark 4.9. Theorem 4.8 shows the construction of any (n, 2)th f -ideal clearly. In the following, we show the construction of an (n, 2)th f -ideal while n = 4k, the other cases are similar to construct. √ (1) Choose a nonempty subset B ⊆ [n], such that |B| = i ≤ k; (2) Let t = k − i2 , and choose a subset Et ⊆ sm(S)2 \ WB such that |Et | = t; (3) Let I be the ideal with the minimal generating set G(I) = WB ∪ Et . The proof of the following proposition is similar to Proposition 4.1, so we omit it. Proposition 4.10. Let i, j ∈ [⌊n/2⌋]. Then the following hold: (1) If i 6= j, then Wi ∩ Wj = ∅; (2) If I ∈ Wi , then there exists a unique subset B ⊆ [n] with |B| = i, such that WB ⊆ G(I). Note that in the above proposition, the uniqueness of B refers to the uniqueness of WB . By Theorem 4.8 and Proposition 4.10, the following proposition is direct to check, so we omit the proof. Proposition 4.11. Let k be a positive integer. Then the following formula holds:  P 2k−i k−i2 1 2k k  C C C C4k2 −i2 , if n = 4k; 2 +  4k 4k 4k 2  √   k 1≤i≤   P  2k−i k−i−i2  C4k+1 C4k2 +2k−i−i2 , if n = 4k + 1(k 6= 1); √ |V (n, 2)| = 0≤i≤ 1+4k−1 2     72, if n = 5;      0, if n = 4k + 2 or n = 4k + 3. (5) By now, the structure of V (n, 2) is completely characterized. However, a complete characterization of V (n, d) for d > 2 is still open. 5 Unmixed f -ideals It is known that Cohen-Macaulay property is very important in commutative algebra. In [6], Faridi proved that a Cohen-Macaulay simplicial complex is unmixed. So, it is essential to study the f -ideals which are unmixed. Recall that an ideal I is called unmixed if codim(I) = codim(P ) holds for all prime ideals minimal over I. Recall also the following famous Unmixed Theorem: If I is generated by r elements and codim(I) = r, then I is unmixed (see, e.g., [5, Corollary 18.14]). The following example shows that an f -ideal need not to be unmixed. Example 5.1. Let S = K[x1 , x2 , x3 , x4 , x5 ], and let I = hx1 x2 x3 , x1 x2 x4 , x1 x2 x5 , x3 x4 x5 , x2 x3 x4 i. It is not hard to check that G(I) is perfect and |G(I)| = 5 = C52 /2, which satisfies the condition of Theorem 2.4. Hence I is an f -ideal. But the standard primary decomposition of I is I = hx2 , x5 i ∩ hx2 , x3 i ∩ hx2 , x4 i ∩ hx1 , x4 i ∩ hx1 , x3 i ∩ hx3 , x4 , x5 i, which shows that I is not unmixed. However, when using formulae of section 3 to consider the f -ideals of degree 2, we rediscover the following surprising property, which constitutes the main part of [1, Theorem 3.5]. Note that our approach is combinatoric, and is quite different from the proof of [1, Theorem 3.5]. Proposition 5.2. Let S = K[x1 , . . . , xn ] and let I be a square-free monomial ideal of S of degree 2. If I is an f -ideal, then I is unmixed. P roof. Assume on the contrary that I is not unmixed. By Corollary 1.11 of [6], δN (I) is not pure. Assume without loss of generality that {n} is a facet of δN (I). Then it is easy to see that each of {1, n}, {2, n}, . . . , {n − 1, n} is a facet of δF (I), hence G1 = {x1 xn , x2 xn , . . . , xn−1 xn } ⊆ G(I). Further more, G(I) contains at least another (n−1, 2)th upper perfect set, denoted by G2 , since xi1 xi2 xi3 ∈ ⊔(G(I)) for each {i1 , i2 , i3 } ⊆ [n − 1]. Hence the cardinality of G(I) is not less than the sum of the cardinalities of the above two parts G1 and G2 . Now that I is an f -ideal, by Proposition 3.3, n = 4k or n = 4k + 1 holds for some positive integer k. In the following, we will make use of the formula in Theorem 3.1 to estimate the cardinality of G(I) in the two cases respectively. If n = 4k, then |G(I)| ≥ |G1 | + |G2 | ≥ (n − 1) + N(n−1,2) = (4k − 1) + (2k − 1)2 = 4k 2 , and Cn2 /2 = 4k 2 − k, so |G(I)| > Cn2 /2. In the case, there is a contradiction to Theorem 2.4. If n = 4k + 1, then |G(I)| ≥ |G1 | + |G2 | ≥ (n − 1) + N(n−1,2) = 4k + (4k 2 − 2k) = 4k 2 + 2k, and Cn2 /2 = 4k 2 + k, so |G(I)| > Cn2 /2, another contradiction. This completes the proof.  It is known that a square-free monomial ideal I is unmixed, if and only if δN (I) is a pure simplicial complex ([6]). So, we have the following proposition: Proposition 5.3. Let S = K[x1 , . . . , xn ]. If I is an f -ideal of S of degree d, then I is unmixed if and only if sm(S)d \ G(I) is lower perfect. 6 F -ideals in general case For a square-free monomial ideal I, denote G(I) = ∪ki=1 Gdi , in which Gdi consists of the generators of degree di . As Theorem 2.4, the following proposition is direct to check, and we omit the verification. Proposition 6.1. Let I be a square-free monomial ideal of S = K[x1 , . . . , xn ], with the minimal generating set G(I) = ∪ki=1 Gdi . Then I is an f -ideal if and only if the following conditions hold: (1) For each positive l ∈ {d1 , . . . , dk }, 1 |Gl | = (Cnl − | ∪di >l (⊓di −l (Gdi ))| − | ∪di <l (⊔l−di (Gdi ))| ). 2 (2) For each positive l 6∈ {d1 , . . . , dk }, ∪ ⊓di −l (Gdi ) = sm(S)l \ ∪ ⊔l−di (Gdi ). di >l di <l Actually, we have another way to understand the above proposition directly and clearly. We need the following lemma, which can be checked directly and thus we omit the proof. Lemma 6.2. If I is a square-free monomial ideal, then (1) σ(⊓∞ (G(I))) = δF (I) ∩ δN (I); (2) σ(⊔∞ (G(I))) ∩ δF (I) = ∅ and σ(⊔∞ (G(I))) ∩ δN (I) = ∅. Theorem 6.3. Let I be a square-free monomial ideal of S = K[x1 , . . . , xn ], with the minimal generating set G(I) = ∪ki=1 Gdi . Then I is an f -ideal if and only if 1 |Gl | = (Cnl − | ∪di >l (⊓di −l (Gdi ))| − | ∪di <l (⊔l−di (Gdi ))| ) 2 holds for each l ∈ [n]. P roof. For each l ∈ [n], denote by Al the faces in (δN (I) \ δF (I)) ∩ [n]l . Note that sm(S)l is a disjoint union of four parts: sm(S)l = Gl ∪ ∪di >l (⊓di −l (Gdi )) ∪ ∪di <l (⊔l−di (Gdi )) ∪ σ −1 (Al ). By Lemma 6.2, fl−1 (δF (I)) = |Gl | + | ∪di >l (⊓di −l (Gdi ))| and fl−1 (δN (I)) = | ∪di >l (⊓di −l (Gdi ))| + |σ −1 (Al )|. Thus I is an f -ideal if and only if fl−1 (δF (I)) = fl−1 (δN (I)) holds for each l, and the latter holds if and only if |Gl | = |σ −1 (Al )| = 12 (Cnl − | ∪di >l (⊓di −l (Gdi ))| − | ∪di <l (⊔l−di (Gdi ))| ) holds for each l.  Note that in Proposition 6.1, if l 6∈ {d1 , . . . , dk }, then |Gl | = 0. It is not hard to see that Proposition 6.1 and Theorem 6.3 are equivalent. Even though the abstract properties of f -ideals in general case are characterized in Proposition 6.1 and Theorem 6.3, it is still not easy to show an example of an f -ideal which is not homogeneous of degree d for any d ≥ 2. Corollary 6.4. Let I be an f -ideal of S = K[x1 , . . . , xn ]. For an integer l ∈ [n] with l < ldeg(I), sm(S)l ⊆ ⊓∞ (G(I)) holds true. On the other hand, if l > deg(I), then sm(S)l ⊆ ⊔∞ (G(I)) holds. It is easy to see that Theorem 2.4 is a special case of Theorem 6.3. References [1] G. Q. Abbasi, S. Ahmad, I. Anwar, W. A. Baig, f -Ideals of degree 2, Algebra Colloquium, 19(Spec1)(2012), 921 − 926. [2] M.F. Atiyah and I.G. MacDonald, Introduction to Commutative Algebra, AddisonWesley, Reading, MA, 1969. [3] I. Anwar, H. Mahmood, M. A. Binyamin and M. K. Zafar, On the Characterization of f -Ideals, arXiv: 1309.3765 (Sep. 15, 2013 ). [4] E. Connon and S. Faridi. Chorded complexes and a necessary condition for a monomial ideal to have a linear resolution. Journal of Combinatorial Theory, Series A, 120(2013), 1714 − 1731. [5] D. Eisenbud, Commutative Algebra with a View Toward Algebraic Geometry. Springer Science + Business Media, Inc, 2004. [6] S. Faridi, The facet ideal of a simplicial complex, Manuscripta Mathematica, 109(2002), 159 − 174. [7] J. Herzog and T. Hibi, Monomial Ideals. Springer-Verlag London Limited, 2011. [8] J. Herzog, T. Hibi, X. Zheng, Diracs theorem on chordal graphs and Alexander duality, European J. Combin. 25 (2004)949 − 960. [9] R. H. Villarreal, Monomial Algebra. Marcel Dekker, Inc, New York, 2001. [10] O. Zariski and P. Samuel, Commutative Algebra. Vol.1 Reprints of the 1958 − 60 edition. Springer-Verlag New York, 1979. [11] X. Zheng, Resolutions of facet ideals, Commun. Algebra 32 (6) (2004) 2301 − 2324.
0math.AC
Variance-based regularization with convex objectives John C. Duchi1 Hongseok Namkoong2 Stanford University Departments of 1 Statistics, 1 Electrical Engineering, and 2 Management Science and Engineering arXiv:1610.02581v3 [stat.ML] 14 Dec 2017 {jduchi,hnamk}@stanford.edu Abstract We develop an approach to risk minimization and stochastic optimization that provides a convex surrogate for variance, allowing near-optimal and computationally efficient trading between approximation and estimation error. Our approach builds off of techniques for distributionally robust optimization and Owen’s empirical likelihood, and we provide a number of finite-sample and asymptotic results characterizing the theoretical performance of the estimator. In particular, we show that our procedure comes with certificates of optimality, achieving (in some scenarios) faster rates of convergence than empirical risk minimization by virtue of automatically balancing bias and variance. We give corroborating empirical evidence showing that in practice, the estimator indeed trades between variance and absolute performance on a training sample, improving out-of-sample (test) performance over standard empirical risk minimization for a number of classification problems. 1 Introduction We propose and study a new approach to risk minimization that automatically trades between bias—or approximation error—and variance—or estimation error. Let X be a sample space, P0 a distribution on X , and Θ a parameter space. For a loss function ℓ : Θ × X → R, consider the problem of finding θ ∈ Θ minimizing the risk Z R(θ) := E[ℓ(θ, X)] = ℓ(θ, x)dP (x) (1) given a sample {X1 , . . . , Xn } drawn i.i.d. according to the distribution P . Under appropriate conditions on the loss ℓ, parameter space Θ, and random variables X, a number of researchers [3, 4, 10, 25] have shown results of the form that with high probability, r n Var(ℓ(θ, X)) C2 1X ℓ(θ, Xi ) + C1 + for all θ ∈ Θ (2) R(θ) ≤ n n n i=1 where C1 and C2 depend on the parameters of problem (1) and the desired confidence guarantee. Such bounds justify empirical risk minimization (ERM), which chooses θbn to minimize 1 Pn i=1 ℓ(θ, Xi ) over θ ∈ Θ. Further, these bounds showcase a tradeoff between n Pbias and variance, where we identify the bias (or approximation error) with the empirical risk n1 ni=1 ℓ(θ, Xi ), while the variance arises from the second term in the bound. Short (NIPS) version of the paper is available at https://goo.gl/o6Y3nF. 1 Given bounds of the form above and heuristically considering the classical “bias-variance” tradeoff in estimation and statistical learning, it is natural to instead choose θ to directly minimize a quantity trading between approximation and estimation error, say of the form s n VarPbn (ℓ(θ, X)) 1X ℓ(θ, Xi ) + C , (3) n n i=1 where VarPbn denotes the empirical variance of its argument. Maurer and Pontil [33] considered precisely this idea, giving a number of guarantees on the convergence and good performance of such a procedure. Unfortunately, even when the loss ℓ is convex in θ, the formulation (3) is in general non-convex, yielding computationally intractable problems, which has limited the applicability of procedures that minimize the variance-corrected empirical risk (3). In this paper, we develop an approach based on Owen’s empirical likelihood [38] and ideas from distributionally robust optimization [5, 8, 7] that—whenever the loss ℓ is convex—provides a tractable convex formulation that very closely approximates the penalized risk (3), and we give a number of theoretical guarantees and empirical evidence for its performance. Before summarizing our contributions, we first describe our approach. Let φ : R+ → R be a convex function with φ(1) = 0. Then the φ-divergence between distributions P and Q defined on a space X is    Z Z  p(x) dP φ dQ = q(x)dµ(x), Dφ (P ||Q) = φ dQ q(x) X dQ where µ is any measure for which P, Q ≪ µ, and p = dP dµ , q = dµ . Throughout this paper, we use φ(t) = 21 (t − 1)2 , which gives the χ2 -divergence [45]. Given φ and a sample X1 , . . . , Xn , we define the local neighborhood of the empirical distribution with radius ρ by  ρo n  Pn := distributions P such that Dφ P ||Pbn ≤ , n where Pbn denotes the empirical distribution of the sample, and our choice of φ(t) = 12 (t − 1)2 means that Pn consists of discrete distributions supported on the sample {Xi }ni=1 . We then define the robustly regularized risk n ρo b . (4) Rn (θ, Pn ) := sup EP [ℓ(θ, X)] = sup EP [ℓ(θ, X)] : Dφ (P ||Pn ) ≤ n P ∈Pn P As it is the supremum of a family of convex functions, the robust risk θ 7→ Rn (θ, Pn ) is convex in θ whenever ℓ is convex, no matter the value of ρ ≥ 0. Given the robust empirical risk (4), our proposed estimation procedure is to choose a parameter θbnrob by minimizing Rn (θ, Pn ). Let us now discuss a few of the properties of procedures minimizing the robust empirical risk (4). Our first main technical result, which we show in Section 2, is that for bounded loss functions, the robust risk Rn (θ, Pn ) is a good approximation to the variance-regularized quantity (3). That is, s 2ρVarPbn (ℓ(θ, X)) + εn (θ), (5) Rn (θ, Pn ) = EPbn [ℓ(θ, X)] + n where εn (θ) ≤ 0 and is OP (1/n) uniformly in θ. We show specifically that whenever ℓ(θ, X) has suitably large variance, with high probability we have εn = 0. From variance expansions of the 2 form (5) and empirical Bernstein inequality (2), we see that Rn (θ, Pn ) is a O(1/n)-approximation √ to the population risk R(θ), in contrast to the cruder O(1/ n)-approximation that the empirical risk EPbn [ℓ(θ; X)] provides. Based on this intuition that the robustly regularized risk Rn (θ; Pn ) is a tighter approximation to the population risk R(θ), we show a number of finite-sample convergence guarantees for the estimator   ρ o n  rob b b (6) θn ∈ argmin sup EP [ℓ(θ, X)] : Dφ P ||Pn ≤ n P θ∈Θ that are often tighter than those available for ERM (see Section 3). The above problem is a convex optimization problem when the original loss ℓ(·; X) is convex and Θ is a convex set. Based on the expansion (5), solutions θbnrob of problem (6) enjoy automatic finite sample optimality certificates: for ρ ≥ 0, with probability at least 1 − C1 exp(−ρ) we have C2 ρ C2 ρ R(θbnrob ) = E[ℓ(θbnrob ; X)] ≤ Rn (θbnrob ; Pn ) + = inf Rn (θ, Pn ) + θ∈Θ n n where C1 , C2 are constants (which we specify) that depend on the loss ℓ and domain Θ. That is, with high probability the robust solution has risk no worse than the optimal finite sample robust objective up to an O(ρ/n) error term. To guarantee a desired level of risk performance with probability 1 − δ, we may specify the robustness penalty ρ = O(log 1δ ). Secondly, we show that the procedure (6) allows us to automatically and near-optimally trade between approximation and estimation error (bias and variance), so that ) ( r Cρ 2ρ rob rob Var(ℓ(θ; X)) + (7) R(θbn ) = E[ℓ(θbn ; X)] ≤ inf E[ℓ(θ; X)] + 2 θ∈Θ n n with high probability. When there are parameters θ with small risk R(θ) and small variance Var(ℓ(θ, X)), this guarantees that the excess risk R(θbnrob )−inf θ∈Θ R(θ) is essentially of order O(ρ/n), where ρ governs our desired confidence level. Our bounds do not require the Bernstein-type condition Var(ℓ(θ; X)) ≤ M R(θ) often required for ERM. Since it is often the case that M depends on global information (e.g. size of parameter space Θ), we have Var(ℓ(θ; X)) ≪ M R(θ), in which case the bound (7) offers a tighter guarantee than that available for the ERM solution θbnerm . In particular, we give an explicit example in Section 3.3 where our robustly regularized procedure (6) √ converges at rate O(log n/n) compared to O(1/ n) of empirical risk minimization. Bounds that trade between risk and variance are known in a number of cases in the empirical risk minimization literature [32, 44, 3, 10, 4, 11, 25], which is relevant when one wishes to achieve “fast √ rates” of convergence for statistical learning algorithms (that is, faster than the O(1/ n) guaranteed by a number of uniform convergence results [2, 10, 11]). In many cases, however, such tradeoffs require either conditions such as the Mammen and Tsybakov’s noise condition [32, 10] or localization results made possible by curvature conditions that relate the loss/risk and variance [4, 3, 35]. The robust solutions (6) enjoy a different tradeoff between variance and risk than that in this literature, but essentially without conditions except compactness of Θ. In proposing any new estimator, it is essential to understand the limits of the proposed procedure and identify situations in which its performance may be worse than existing estimators. There are indeed situations in which minimizing the robust-regularized risk (4) yields some inefficiency (for example, in classical statistical estimation problems with correctly specified model). To understand limits of the inefficiency induced by using the distributionally-robustified estimator (6), 3 in Section 4 we study explicit finite sample properties of the robust estimator for general stochastic optimization problems, and we also provide asymptotic normality results in classical problems. There are a number of situations, based on growth conditions on the population risk R, when √ convergence rates faster than 1/ n (or even 1/n) are attainable (see Shapiro et al. [40, Chapter 5]). We show that under these conditions, the robust procedure (6) still enjoys (near-optimal) fast rates of convergence, similar to empirical risk minimization (also known as sample average approximation in the stochastic programming literature). Our study of asymptotics makes precise the asymptotic efficiency loss of the robust procedure over minimizing p the standard (asymptotically optimal) empirical expectation: there is a bias term that scales as ρ/n in the limiting distribution of θbnrob , though its variance is optimal. We complement our theoretical results in Section 5, where we conclude by providing three experiments comparing empirical risk minimization strategies to robustly-regularized risk minimization (6). These results validate our theoretical predictions, showing that the robust solutions are a practical alternative to empirical risk minimization. In particular, we observe that the robust solutions outperform their ERM counterparts on “harder” instances with higher variance. In classification problems, for example, the robustly regularized estimators exhibit an interesting tradeoff, where they improve performance on rare classes (where ERM usually sacrifices performance to improve the common cases—increasing variance slightly) at minor cost in performance on common classes. Related Work The theoretical foundations of empirical risk minimization are solid [48, 2, 10, 11]. When the expec√ tation of the excess loss bounds its variance, it is possible to achieve faster rates than the O(1/ n) offered by standard uniform convergence arguments [49, 50, 4, 25, 11] (see Boucheron et al. [10, Section 5] for an overview in the case of classification, and Shapiro et al. [40, Chapter 5.3] for more general stochastic optimization problems). Vapnik and Chervonenkis [49, 50] first provided such results in the context of {0, 1}-valued losses for classification (see also [1]), where the expectation of the loss always upper bounds its variance, so that if there exists a perfect classifier the convergence rates of empirical risk minimization procedures are O(1/n). Mammen and Tsybakov [32, 44] give low noise conditions for binary classification substantially generalizing these results, which yield a spectrum of fast rates. Under related conditions, Bartlett, Jordan, and McAuliffe [4] show similar fast rates of convergence for convex risk minimization under appropriate curvature conditions on the loss. The robust procedure (6), on the other hand, is guaranteed to provide an at most O(1/n) over-estimate of the population risk and a small increase of its variance regularized population p counterpart. It may be the case that the variance-regularized risk inf θ {R(θ) + Var(ℓ(θ, X))/n} decreases to R(θ ⋆ ) more slowly than 1/n. As we note above and detail in Section 4, however, in stochastic optimization problems the variance-regularized approach (6) suffers limited degradation with respect to empirical risk minimization strategies, even under convexity and curvature properties that allow faster rates of convergence than those achievable in classical regimes, as detailed by [40, Chapter 5.3]. Most related to our work is that of Maurer and Pontil [33], who propose directly regularizing empirical risk minimization by variance, providing guarantees similar to ours and giving a natural foundation off of which many of our results build. In their setting, however—as they carefully note—it is unclear how to actually solve the variance-regularized problem, as it is generally nonconvex. Shivaswamy and Jebara [41, 42] build on this and develop an elegant approach for boosting 4 binary classifiers based on a variance penalty applied to the exponential loss; as it is a boosting approach, their approach provides a coordinate-wise strategy for decreasing the loss, but it is not guaranteed to converge to a global minimizer and applies to classification-like problems. Our approach, handling general stochastic optimization problems, removes these obstructions. The robust procedure (6) is based on distributionally robust optimization ideas that many researchers have developed [6, 8, 27], where the goal (as in robust optimization more broadly [5]) is to protect against all deviations from a nominal data model. In the optimization literature, there is substantial work on tractability of the problem (6), including that of Ben-Tal et al. [6], who show that the dual of (4) often admits a standard form (such as a second-order cone problem) to which standard polynomial-time interior point methods can be applied. Namkoong and Duchi [36] develop stochastic-gradient-like procedures for solving the problem (6), which efficiently provide low accuracy solutions (which are still sufficient for statistical tasks). Work on the statistical analysis of such procedures is nascent; Bertsimas, Gupta, and Kallus [8] and Lam and Zhou [27] provide confidence intervals for solution quality under various conditions, and Duchi et al. [20] give asymptotics showing that the optimal robust risk Rn (θbnrob ; Pn ) is a calibrated upper confidence bound for inf θ∈Θ E[ℓ(θ; X)]. They and Gotoh et al. [22] also provide a number of asymptotic results showing relationships between the robust risk Rn (θ; Pn ) and variance regularization, but they do not leverage these results for guarantees on the solutions θbnrob . Notation We collect our notation here. We let B denote a unit norm ball in Rd , B = {θ ∈ Rd : kθk ≤ 1}, where d and k·k are generally clear from context. Given sets A ⊂ Rd and B ⊂ Rd , we let A + B = {a + b : a ∈ A, b ∈ B} denote Minkowski addition. For a convex function f , the subgradient set ∂f (x) of f at x is ∂f (x) = {g : f (y) ≥ f (x) + g⊤ (y − x) for all y}. For a function h : Rd → R, we let h∗ denote its Fenchel (convex) conjugate, h∗ (y) = supx {y ⊤ x − h(x)}. For sequences an , bn , we let an . bn denote that there is a numerical constant C < ∞ such that d an ≤ Cbn for all n. For a sequence of random vectors X1 , X2 , . . ., we let Xn → X∞ denote that Xn converges in distribution to X∞ . For a nonegative sequence a1 , a2 , . . ., we say Xn = OP (an ) if limc→∞ supn P(kXn k ≥ can ) = 0, and we say Xn = oP (an ) if limc→0 lim supn P(kXn k ≥ can ) = 0. 2 Variance Expansion We begin our study of the robust regularized empirical risk Rn (θ, Pn ) by showing that it is a good approximation to the empirical risk plus a variance term, that is, studying the variance expansion (5). Although the variance of the loss is in general non-convex (see Figure 1 for a simple example), the robust formulation (6) is a convex optimization problem for variance regularization whenever the loss function is convex (the supremum of convex functions is convex [24, Prop. 2.1.2.]). 2.1 Variance expansion for a single variable To gain intuition for the variance expansion that follows, we begin with a slightly simpler problem, which is to study the quadratically constrained linear maximization problem maximize p n X i=1 pi zi   1 2 n subject to p ∈ Pn = p ∈ R+ : knp − 1k2 ≤ ρ, h1, pi = 1 , 2 5 (8) 1.8 1.6 1.4 1.2 1.0 0.8 −4 −3 −2 −1 0 1 2 3 4 p Figure 1. Plot of θ 7→ Var(ℓ(θ, X)) for ℓ(θ; X) = |θ − X| where X ∼ Uni({−2, −1, 0, 1, 2}). The function is non-convex, with multiple local minima, inflection points, and does not grow as θ → ±∞. where z ∈ Rn is a vector. For simplicity, let s2n = n1 kzk22 − (z)2 = n1 kz − zk22 denote the empirical “variance” of the vector z, where z = n1 h1, zi is the mean value of z. Then by introducing the variable u = p − n1 1, the objective in problem (8) satisfies hp, zi = z + hu, zi = z + hu, z − zi because hu, 1i = 0. Thus problem (8) is equivalent to solving 2ρ 1 , h1, ui = 0, u ≥ − . n2 n p √ Notably, by the Cauchy-Schwarz inequality, we have hu, z − zi ≤ 2ρ kz − zk2 /n = 2ρs2n /n, and equality is attained if and only if √ √ 2ρ(zi − z) 2ρ(zi − z) p . = ui = n kz − zk2 n ns2n z + hu, z − zi subject to kuk22 ≤ maximize n u∈R It is possible to choose such ui while satisfying the constraint ui ≥ −1/n if and only if √ 2ρ(zi − z) p min ≥ −1. i∈[n] ns2n (9) Thus, if inequality (9) holds for the vector z—that is, there is enough variance in z—we have r 2ρs2n sup hp, zi = z + . n p∈Pn For losses ℓ(θ, X) with enough variance relative to ℓ(θ, Xi ) − EPbn [ℓ(θ, Xi )], that is, those satisfying inequality (9), then, we have s 2ρVarPbn (ℓ(θ, X)) Rn (θ, Pn ) = EPbn [ℓ(θ, X)] + . n A slight elaboration of this argument, coupled with the application of a few concentration inequalities, yields the next theorem. The theorem as stated applies only to bounded random variables, 6 but in subsequent sections we relax this assumption by applying the characterization (9) of the exact expansion. As usual, we assume that φ(t) = 21 (t − 1)2 in our definition of the φ-divergence. Theorem 1. Let Z be a random variable taking values in [M0 , M1 ], and let M = M1 − M0 . Let σ 2 = Var(Z) and s2n = EPbn [Z 2 ] − EPbn [Z]2 denote the population and sample variance of Z, respectively. Fix ρ ≥ 0. Then ! r r n ρo 2ρ 2 2M ρ 2ρ 2 b − EPbn [Z] ≤ sn − s . (10) ≤ sup EP [Z] : Dφ (P ||Pn ) ≤ n n n n n P + n o   2 nσ2 Moreover, for n ≥ max 5, M max {8σ, 44} , with probability at least 1 − exp − σ2 11M 2 sup ρ P :Dφ (P ||Pbn )≤ n EP [Z] = EPbn [Z] + r 2ρ 2 s . n n (11) See Section A for the proof of Theorem 1. Inequality (10) and the exact expansion (11) show that, at least for bounded loss functions ℓ, the robustly regularized risk (4) is a natural (and convex) surrogate for empirical risk plus standard deviation of the loss, and the robust formulation approximates exact variance regularization with a convex penalty. In the sequel, we leverage this result to provide sharp guarantees for a number of stochastic risk minimization problems. 2.2 Uniform variance expansions We now turn to a more uniform variant Theorem 1, which depends on familiar notions of function complexity based on Rademacher averages. For a sample x1 , . . . , xn and i.i.d. random signs εi ∈ {−1, 1}, independent of the xi , the empirical Rademacher complexity of the class F is # " n 1X εi f (xi ) . Rn (F) := E sup f ∈F n i=1 The worst-case Rademacher complexity [43] is " n 1X Rsup sup E sup εi f (xi ) n (F) := x1 ,...,xn ∈X f ∈F n i=1 # . For example, when F is a class of functions bounded by M with VC-subgraph dimension d, we q sup d have the inequalities E[Rn (F)] ≤ Rn (F) . M n . See van der Vaart and Wellner [47, Chapter 2] and Bartlett and Mendelson [2] for other bounds. With this definition, we provide a result showing that the variance expansion (5) holds uniformly for all functions with enough variance. Theorem 2. Let F be a collection of bounded functions f : X → [M0 , M1 ] where M = M1 − M0 , and M ≤ n. There exists a universal constant C such that if τ 2 > 0 satisfies   M2 4ρM 2 sup 2 3 2 + C Rn (F) log n + (t + log log n) . τ ≥ n n 7 Then with probability at least 1 − 3e−t sup ρ P :Dφ (P ||Pbn )≤ n EP [f (X)] = EPbn [f (X)] + r 2ρ VarPbn (f (X)) n (12) for all f ∈ F such that Var(f ) ≥ τ 2 . We prove the theorem in Section B. Theorem 2 shows that the variance expansion of Theorem 1 holds uniformly for all functions f with sufficient variance. An asymptotic analogue of the equality (12) for heavier tailed random variables is also possible [20]. In the remainder of the section, we consider examples and applications to make the theorem somewhat clearer. 2.2.1 Linear and margin-based losses Consider a standard margin-based classification problem [2], where we have data pairs (x, y) ∈ X × {−1, 1}, and X ⊂ Rd . Let Θ ⊂ Rd be a norm ball of radius r(Θ), Θ = {θ ∈ Rd | kθk ≤ r}, and let k·k∗ be the associated dual norm, assuming also that X ⊂ {x ∈ Rd | kxk∗ ≤ r(X )}. We may then consider the standard loss minimization setting, where for some non-increasing and 1-Lipschitz loss ℓ : R → R+ , we have the risk R(θ) := E [ℓ(Y hθ, Xi)] , so that ℓ(yhx, θi) is the loss suffered by making prediction hθ, xi when the label is y. By taking the function class F = {(x, y) 7→ ℓ(yhx, θi) − ℓ(0) | θ ∈ Θ}, in this case, an application of the Ledoux-Talagrand contraction inequality [28] implies for any y1 , x1 , . . . , yn , xn that # " n # # " " n n X X X εi xi . (13) εi hθ, xi i ≤ r(Θ)E εi [ℓ(yi hθ, xi i) − ℓ(0)] ≤ E sup E sup θ∈Θ i=1 θ∈Θ i=1 i=1 ∗ Example 1 (Euclidean norms): In the above context, suppose that norm k·k is the standard ℓ2 Euclidean norm so that Θ is contained in an ℓ2 -ball of radius r(Θ), and X ⊂ Rd in an ℓ2 ball of radius r(X ). Then Jensen’s inequality and independence of εi ’s give the bound v !2 u d n n X u X X √ t εi xi k] ≤ E E[k εi xij ≤ r(X ) n. i=1 i=1 j=1 Then, inequality (13) and Theorem 1 imply that sup ρ P :Dφ (P ||Pbn )≤ n EP [ℓ(Y hθ, Xi)] = EPbn [ℓ(Y hθ, Xi)] + for all θ satisfying Var(ℓ(Y hθ, Xi)) ≥ with probability at least 1 − e−t . ✸ r 2ρ VarPbn (ℓ(Y hθ, Xi)) n  r(X )2 r(Θ)2  4ρ + C log3 n + Ct , n Example 2 (High-dimensional problems): In high dimensional problems, the Euclidean scaling of Example 1 may be problematic, so that using ℓ1 -constraints is preferred [16]. Thus, taking the 8 d norm k·kP in the preceding to be pthe ℓ1 norm, so that Θ ⊂ {θ ∈ R | kθk1 ≤ r1 (Θ)} and k·kd∗ = k·k∞ , n then E[k i=1 εi xi k∞ ] ≤ r(X ) n log(2d), where r∞ (X ) denotes the ℓ∞ -radius of X ⊂ R . Thus, if we take the loss class F = {ℓ(hθ, ·i) − ℓ(0) | θ ∈ Θ}, we obtain " n # r X r1 (Θ) log(2d) sup Rn (F) . sup εi xi E . ≤ r1 (Θ)r∞ (X ) n n x1 ,...,xn ∈X ∞ i=1 Then the exact variance expansion (12) holds with probability at least 1 − e−t uniformly over θ 2 2 satisfying Var(ℓ(Y hθ, Xi)) ≥ r1 (Θ) nr∞ (X ) [4ρ + C log d · log3 n + Ct]. ✸ 2.2.2 Covering number guarantees It is also possible to provide guarantees on the exact variance expansion using standard covering numbers, though careful arguments based on Rademacher complexity can be tighter. We begin by recalling the appropriate notions from approximation theory. Let V be a vector space and V ⊂ V be any collection of vectors in V. Let k·k be a (semi)norm on V. We say a collection v1 , . . . , vN ⊂ V is an ǫ-cover of V if for each v ∈ V, there exists vi such that kv − vi k ≤ ǫ. The covering number of V with respect to k·k is then N (V, ǫ, k·k) := inf {N ∈ N : there is an ǫ-cover of V with respect to k·k} . Now, let F be a collection of functions f : X → R, and define the L∞ (X ) norm on f by kf − gkL∞ (X ) := sup |f (x) − g(x)|. x∈X We also relax our covering number requirements to empirical ℓ∞ -covering numbers as follows. Define F(x) = {(f (x1 ), . . . , f (xn )) : f ∈ F} for x ∈ X n , and define the empirical ℓ∞ -covering numbers N∞ (F, ǫ, n) = sup N (F(x), ǫ, k·k∞ ) , x∈X n which bound the number of ℓ∞ -balls of radius ǫ required to cover F(x). Note that we always have N∞ (F, ǫ, n) ≤ N (F, ǫ, k·kL∞ (X ) ) by definition. The classical Dudley entropy integral [21, 47] shows that, if Pn denotes the point masses on x1 , . . . , xn and k·kL2 (Pn ) the empirical L2 -norm on functions f : X → [−M, M ], then # "   Z Mq n X 1 1 log N (F, ǫ, k·kL2 (Pn ) )dǫ E εi f (xi ) . inf δ + √ sup δ≥0 n f ∈F n δ i=1   Z Mp 1 ≤ inf δ + √ log N∞ (F, ǫ, n)dǫ . (14) δ≥0 n δ Our main (essentially standard [47]) motivating example is that of Lipschitz loss functions for a parametric set Θ, as follows. Example 3: Let Θ ⊂ Rd and assume that ℓ : Θ × X → [0, M ] is L-Lipschitz in θ with respect to the ℓ2 -norm for all x ∈ X , meaning that |ℓ(θ, x) − ℓ(θ ′ , x)| ≤ L kθ − θ ′ k2 . Then taking F = {ℓ(θ, ·) : 9 θ ∈ Θ}, any ǫ-covering {θ1 , . . . , θN } of Θ in ℓ2 -norm guarantees that mini |ℓ(θ, x) − ℓ(θi , x)| ≤ Lǫ for all θ, x. That is, N (F, ǫ, k·kL∞ (X ) ) ≤ N (Θ, ǫ/L, k·k2 ) ≤  diam(Θ)L 1+ ǫ d , where diam(Θ) = supθ,θ′ ∈Θ kθ − θ ′ k2 . Thus ℓ2 -covering numbers of Θ control L∞ -covering numbers of the family F, and we have by the entropy integral (14) that r r Z r d diam(Θ)L d diam(Θ)L sup log Rn (F) . dǫ . diam(Θ)L . n 0 ǫ n That is, with high probability, for all θ such that Var(ℓ(θ, X)) ≥ the exact variance expansion (12). ✸ 3 4M 2 ρ n 2 L2 + Cd diam(Θ) n log3 n , we have Optimization by Minimizing the Robust Loss Based on the precise variance expansions in the preceding section, it is natural to expect that the robust solution (6) automatically trades between approximation and estimation error. This intuition is accurate, and we show that the robustly regularized objective Rn (θ; Pn ) overestimates the population risk R(θ) by at most O(1/n). By virtue of optimizing this tighter approximation— √ as opposed to the usual O(1/ n)-approximation given by the empirical risk EPbn [ℓ(θ; X)]—the robustly regularized solution (6) enjoys a number of favorable finite-sample properties, which are not always comparable to those for empirical risk minimization (ERM). In Section 3.1, we present two versions of our main result that depend on covering numbers and discuss their consequences, and we provide an example where the robustly regularized solution θbnrob achieves a tighter excess risk bound compared to those that a straightforward application of localized Rademacher complexities [3] show that the ERM solution θbnerm achieves. As evidenced by the substantial work on Rademacher- and Gaussian-complexity and symmetrization, in some instances covering-number-based arguments do not provide the sharpest scaling [2, 3, 43]; thus, in Section 3.2 we present a version of our main result that depends on localized Rademacher complexities, which can allow more refined uniform concentration bounds than covering numbers. We also provide a concrete (but admittedly somewhat contrived) example where our robustly regularized procedure (6) achieves R(θbnrob ) − inf θ∈Θ R(θ) . logn n , while empirical risk minimization suffers R(θbnerm ) − inf θ∈Θ R(θ) & √1n , in Section 3.3. The robust “regularizer” has invariance properties other regularization procedures do not, and we mention these briefly in Section 3.4. 3.1 Covering arguments Our first guarantee depends on the covering numbers of the function class F as we describe in Section 2.2.2. While we state our results abstractly, in the loss minimization setting we typically consider the function class F := {ℓ(θ, ·) : θ ∈ Θ} parameterized by θ. We have the following theorem, where as usual, we let F be a collection of functions f : X → [M0 , M1 ] with M = M1 − M0 . 10 Theorem 3. Let n ≥ 8M 2 /t, t ≥ log 12, ǫ > 0, and ρ ≥ 9t. Then with probability at least 1 − 2(3N∞ (F, ǫ, 2n) + 1)e−t , r ! 11 M ρ 2t ǫ (15) + 2+4 E[f (X)] ≤ sup EP [f (X)] + 3 n n ρ P :D (P ||Pbn )≤ φ n for all f ∈ F. Defining the empirical minimizer   n ρo fb ∈ argmin sup EP [f (X)] : Dφ (P ||Pbn ) ≤ n P f ∈F we have with the same probability that ( ) r 19M ρ 2ρ E[fb(X)] ≤ inf E[f ] + 2 Var(f ) + + f ∈F n 3n r 2+4 2t n ! ǫ. (16) See Section C for a proof of the theorem. Because uniform L∞ -covering numbers upper bound empirical L∞ -covering numbers, it is immediate that covering F in k·kL∞ (X ) provides an identical result. 3.1.1 Covering bounds: corollaries We turn to a number of corollaries that expand on Theorem 3 to investigate its consequences. Our first corollary shows that Theorem 3 applies to standard Vapnik-Chervonenkis (VC) classes. As VC dimension is preserved through composition, this result also extends to the procedure (6) in typical empirical risk minimization scenarios. Corollary 3.1. In addition to the conditions of Theorem 3, let F have finite VC-dimension VC(F). Then for a numerical constant c < ∞, the bounds (15) and (16) hold with probability at least !   16M ne VC(F )−1 + 2 e−t . 1 − c VC(F) ǫ R Proof Let kf kL1 (Q) := |f (x)|dQ(x) denote the L1 -norm on F for the probability distribution Q. Then by Theorem 2.6.7 of van der Vaart and Wellner [47], we have   8M e VC(F )−1 sup N (F, ǫ, k·kL1 (Q) ) ≤ cVC(F) ǫ Q for a numerical constant c. Because kxk∞ ≤ kxk1 , taking Q to be uniform on x ∈ X 2n yields ǫ , k·kL1 (Q) ). The result is immediate. N (F(x), ǫ, k·k∞ ) ≤ N (F, 2n Next, we focus more explicitly on the estimator θbnrob defined by minimizing the robust regularized risk (6). Let us assume that Θ ⊂ Rd , and that we have a typical linear modeling situation, where a loss h is applied to an inner product, that is, ℓ(θ, x) = h(θ ⊤ x). In this case, by making the substitution that the class F = {ℓ(θ, ·) : θ ∈ Θ} in Corollary 3.1, we have VC(F) ≤ d, and we obtain the following corollary. In the corollary, recall the definition (1) of the population risk R(θ) = E[ℓ(θ, X)], and the uncertainty set Pn = {P : Dφ (P ||Pbn ) ≤ nρ }, and that Rn (θ, Pn ) = supP ∈Pn EP [ℓ(θ, X)]. By setting ǫ = M/n in Corollary 3.1, we obtain the following result. 11 Corollary 3.2. Let the conditions of the previous paragraph hold and let θbnrob ∈ argminθ∈Θ Rn (θ, Pn ). Assume also that ℓ(θ, x) ∈ [0, M ] for all θ ∈ Θ, x ∈ X . Then if n ≥ ρ ≥ 9 log 12, ) ( r r   2M 11M ρ ρ 2ρ 11M ρ rob rob + Var(ℓ(θ; X)) + 1+ ≤ inf R(θ) + 2 R(θbn ) ≤ Rn (θbn , Pn ) + θ∈Θ 3n n n n n with probability at least 1 − 2 exp(c1 d log n − c2 ρ), where ci are universal constants with c2 ≥ 1/9. To give an alternate concrete variant of Corollary 3.2 and Theorem 3, let Θ ⊂ Rd and recall Example 3. We assume that for each x ∈ X , inf θ∈Θ ℓ(θ, x) = 0 and that ℓ is L-Lipschitz in θ. If D := diam(Θ) = supθ,θ′ ∈Θ kθ − θ ′ k2 < ∞, then ℓ(θ, x) ≤ L diam(Θ), and for δ > 0, we define ρ = log 2 + d log(2nDL). δ (17) Setting t = ρ and ǫ = n1 in Theorem 3 and assuming that δ . 1/n, D . nk and L . nk for a numerical constant k, choosing δ = n1 we obtain that with probability at least 1 − δ = 1 − 1/n, ( ) r dLD log n d Var(ℓ(θ, X)) rob rob b b E[ℓ(θn ; X)] = R(θn ) ≤ inf R(θ) + C log n + C (18) θ∈Θ n n where C is a numerical constant. 3.1.2 Examples and heuristic discussion Unpacking Theorem 3, the first result (15) (and its in Corollary 3.2) provides a high-probability guarantee that the true expectation E[fb] cannot be more than O(1/n) worse than its robustlyregularized empirical counterpart. The second result (16) (and inequality (18)) guarantees convergence of the empirical minimizer to a parameter with risk at most O(log n/n) larger than the best possible variance-corrected risk. To illustriate how variance regularization can yield tighter guarantees than empirical risk minimization by optimizing a O(1/n) upper bound on the risk, we now compare the second bound (16) with an analogous result for empirical risk minimization (ERM). We first give a heuristic version, making it more precise in a coming example. For the ERM solution θbnerm ∈ argminθ∈Θ EPbn [ℓ(θ; X)], one common assumption is an upper bound of the variance by the risk; for example, when the losses take values in [0, M ], one has Var(ℓ(θ, X)) ≤ M R(θ). In such cases, there is typically some complexity measure Compn associated with the class of functions being learned, and it is possible to achieve bounds of the form r Compn M Compn M R(θ ⋆ ) erm ⋆ b +C (19) R(θn ) ≤ R(θ ) + C n n where θ ⋆ ∈ argminθ∈Θ R(θ), a type of result common for bounded nonnegative losses [10, 49, 48]. For example, for classes of functions of VC-dimension d, we typically have Compn . d log nd . In this caricature, when Var(ℓ(θ ⋆ , X)) ≪ M R(θ ⋆ ) and ρ & Compn , the optimality guarantee (16) for variance regularization can be tighter than its ERM counterpart (19). This bound is certainly not always sharp, but yields minimax optimal rates in some cases. Example 4 (Well-specified least-absolute-deviation regression): We consider the least-absolutedeviation (LAD) regression problem, comparing the rates of convergence that localized Rademacher 12 complexities guarantee against those that the robust program provides. Let Z = (X, Y ) ∈ Rd × R, where X ∈ {x ∈ Rd | kxk2 ≤ L}, and let D := diam(Θ) be the ℓ2 -diameter of Θ. The LAD loss is ℓ(θ; (x, y)) := |y − hθ, xi|. For some θ ⋆ ∈ Θ, assume that Y = hθ ⋆ , Xi + ǫ where ǫ ∈ [−B, B] is independent of X. We have the global bound ℓ(θ; (X, Y )) ≤ DL + B =: M. Suppose for simplicity that ǫ is uniform on [−B, B]; then θ ⋆ = argminθ∈Θ R(θ) and R(θ ⋆ ) = E[ℓ(θ ⋆ ; Z)] = 12 B. In this case, Var (ℓ(θ ⋆ ; Z)) = B2 1 ≤ (DL + B)B = M E[ℓ(θ ⋆ ; Z)] = M R(θ ⋆ ). 12 2 Using that the loss is 1-Lipschitz, the L∞ covering numbers for the set of functions F := {fθ (x, y) = |hθ, xi − y| | θ ∈ Θ} satisfy log N (F, ǫ, k·kL∞ (X ) ) . d log DL ǫ , and so applying the rob b bound (18) for the robustly regularized solution θ with ǫ = DL/n, we obtain n R(θbnrob ) ≤ R(θ ⋆ ) + C r d log n 2 d(LD + B) log n B +C n n with probability at least 1− 1/n. On the other hand, even an “optimistic” (but naive) ERM bound, achieved by taking Compn . 1 in the bound (19), yields r (LD + B) log n log n erm ⋆ (BDL + B 2 ) + C R(θbn ) ≤ R(θ ) + C n n with probability at least 1−1/n. We see that leading term for the robustly regularized solution θbnrob only depends on the noise-level B 2 while the corresponding term for the ERM solution θbnerm depends on global information like the size of the parameter space D, and a uniform bound over covariates L. For typical VC and other d-dimensional classes, the bound p Compn scales linearly in d (cf. [3, ⋆ Corollary 3.7], in which case the bound (19) scales as R(θ )+C d(BDL + B 2 ) log n/n+O(log n/n), which is worse. ✸ Example 5 (A hard median estimation problem): To give a bit more insight into the behavior of the robust estimator, consider the simple 1-dimensional median problem, where ℓ(θ; x) = |θ−x|, and ⋆ assume that x ∈ {−B, B} with P(X = B) = 1+δ 2 for some δ > 0, so that θ = argmin R(θ) = B and ⋆ R(θ ) = (1−δ)B. In this case, taking θ0 = 0 yields Var(ℓ(θ; X)) = 0 and R(θ0 )−R(θ ⋆ ) = δB. For δ √ small (on the order of 1/ n), with constant probability the empirical risk minimizer is θbnerm = −B, yielding risk R(θbnerm ) − R(θ ⋆ ) = 2δB. On the other hand, with high probability θbnrob ≥ 0 (because Var(ℓ(θ0 ; X)) = 0 as ℓ(0; X) ≡ B), and so R(θbnrob ) − R(θ ⋆ ) ≤ δB. This gap is of course small, but it shows that the robust solution is more conservative: it chooses θbnrob so that large losses (of scale 2B) are less frequent. ✸ When the population problem is “easy”, it is often possible to achieve faster rates of convergence √ than the usual O (1/ n) rate. The simplest scenario where this occurs is if the problem is realizable 13 R(θ ⋆ ) = 0, in which case θbnerm has excess risk of the order O(log n/n); see the bound (19). The robustly regularized solution θbnrob enjoys the same faster rates of convergence under the more general condition that Var(ℓ(θ ⋆ ; X)) is small. As a concrete instance of this, let ℓ(θ; X) ∈ [0, M ] and assume that ℓ(θ; X) satisfies the conditions of the first part of Example 3, and let the problem be realizable R(θ ⋆ ) = 0. Since Var(ℓ(θ; X)) ≤ M R(θ), we have from the bounds (18) and (19) that R(θbnerm ) ≤ CdDL log n CdDL log n and R(θbnrob ) ≤ . n n For example, Var(ℓ(θ; X)) = 0 allows for the existence of some θ0 ∈ Θ such that ℓ(θ0 ; X) < ℓ(θ ⋆ ; X) with positive probability. 3.2 Localized Rademacher Complexity A somewhat more sophisticated approach to concentration inequalities and generalization bounds is based on localization ideas, motivated by the fact that near the optimum of an empirical risk, the complexity of the function class may be smaller than over the entire (global) class [47, 3]. With this in mind, we now present a refined version of Theorem 3 that depends on localized Rademacher averages. The starting point for this approach is a notion of localized Rademacher complexity (we give a slightly less general notion than Bartlett et al. [3], as it is sufficient for our derivations). For a function class F of functions f : X → R, the localized Rademacher complexity at level r is    E Rn cf | f ∈ F, c ∈ [0, 1], E[c2 f 2 ≤ r] . In addition, we require a few analytic notions, beginning with sub-root functions, where we recall [3] √ that a function ψ : R+ → R+ is sub-root if it is nonnegative, nondecreasing, and r 7→ ψ(r)/ r is nonincreasing for all r > 0. Any non-constant sub-root function ψ is continuous and has a unique positive fixed point r ⋆ = ψ(r ⋆ ), where r ≥ ψ(r) for all r ≥ r ⋆ . Lastly, we consider upper bounds ψn : R+ → R+ on the localized Rademacher complexity satisfying ψn (r) ≥ E[Rn ({cf : f ∈ F, c ∈ [0, 1], E[c2 f 2 ] ≤ r})], (20) where ψn is sub-root. (The localized Rademacher complexity itself is sub-root.) Roots of ψn play a fundamental role in providing uniform convergence guarantees, and Bartlett et al. [3] and Koltchinskii [25] provide careful analyses of localized Rademacher complexities, with typical results as follows. For a class of functions f with range bounded by 1, for any root rn⋆ of ψn , with probability at least 1 − e−t we have   1 t 1 ⋆ for all f ∈ F and η ≥ 0. + E[f ] ≤ EPbn [f ] + EPbn [f ] + C(1 + η) rn + η n n As an example, when F is a bounded VC-class, we have rn⋆ ≍ With this motivation, we have the following theorem. VC(F ) log(n/VC(F )) n [3, Corollary 3.7]. Theorem 4. For M ≥ 1, let F be a collection of functions f : X → [0, M ], let ψn be a sub-root function bounding the localized complexity (20), and let rn⋆ ≥ ψn (rn⋆ ). Let t > 0 be arbitrary and assume that ρ satisfies   l 45M  n m ρ ⋆ t + log log + 18rn . ≥8 (21) n n t 14 Then with probability at least 1 − e−t , r ! 2ρ sup E[f ] ≤ 1 + 2 EP [f ] + n P :D (P ||Pbn )≤ ρ φ r 13 + 4 n 2ρ n ! Mρ for all f ∈ F. n Additionally, if fb minimizes supP :Dφ (P ||Pbn)≤ρ/n EP [f ], then with probability at least 1 − 3e−t , E[fb] ≤ r 1+2 2ρ n ! inf f ∈F E[f ] + r ! 91ρ Var(f ) + 45n r 14 + 6 2ρ n ! M (3ρ + t) . n (22) (23) We provide the proof of Theorem 4 in Appendix D. It builds off of and parallels many of the techniques developed by Bartlett, Bousquet, and Mendelson [3], but we require a bit of care to develop the precise variance boundsq we provide. ρ Let us consider the additional n factors in Theorem 4 (as compared to Theorem 3). In general, these terms are negligible to the extent that the variance of f dominates the first moment of the function f —heuristically, in situations in which we expect penalizing the variance to improve performance. Let us make this more precise in a regime where n is large. Letting f ∈ F, we see that we have the inequality r r   p ρ ρ Var(f ) ≤ E[f ] + C Var(f ) (1 + ρ/n) E[f ] + n n p p (for a constant C > 1+ ρ/n) if and only if (C −1− ρ/n)2 Var(f ) ≥ E[f ]2 . Equivalently, as n gets 2 −2C+2 large, this occurs roughly when E[f 2 ] ≥ C E[f ]2 , which holds for large enough C whenever C 2 −2C+1 Var(f ) > 0. In some scenarios, we can obtain substantially tighter bounds by using localized Rademacher averages instead of the covering number arguments considered in Section 3.1. (Recall also the discussion following Theorem 2.) To illustriate this point, we consider the case where F is a bounded subset of a reproducing kernel Hilbert space generated by some sufficiently nice kernel K; even for the Gaussian kernel K(x, z) = exp(− 21 kx − zk2 ), log covering numbers for such function spaces grow at least exponentially in the dimension [51, 26]. Example 6 (Reproducing kernels and least-absolute-deviation regression): We now give an example using a non-parametric class of functionals in which covering number arguments do not apply, as the covering numbers of the associated classes are too large. Let H be a reproducing kernel Hilbert space (RKHS) with norm k·kH and associated kernel (representer of evaluation) K : X × X → R. Letting P be a distribution on X , Mercer’s theorem R [e.g. 18] implies that the integral operatorPTK : L2 (X , P ) → L2 (X , P ) defined by TK (f )(x) = K(x, z)dP (z) is compact, and K(x, x′ ) = ∞ j=1 λj φj (x)φj (z) where λj are the eigenvalues of T in decreasing order and φj form an orthonormal decomposition of L2 (X , P ). Consider now the least absolute deviation (LAD) loss function ℓ(h; x, y) = |h(x)− y|, defined for h ∈ H, and let BH be the unit k·kH -ball of H. Assume additionally that the model is well-specified, and that y = h⋆ (x) + ξ for some random variable ξ with E[ξ | X] = 0, E[ξ 2 ] ≤ σ 2 , and h⋆ ∈ BH . Let the function class  {ℓ ◦ H}≤r := (x, y) 7→ cℓ(h(x), y) | c ∈ [0, 1], c2 E[ℓ(h(X), Y )2 ] ≤ r . 15 Based on inequality (20), we consider the localized complexity # " X 1 2 2 Rn ({ℓ ◦ H}≤r ) = E εi cℓ(h(xi ), yi ) | E[ℓ(h(X), Y ) ] ≤ r/c . sup n h∈BH ,c∈[0,1] We claim that Rn ({ℓ ◦ H}≤r ) . p 1 2 ∞ X 1   r/n + . min{λj , r} n  (24) j=1 As this claim is not central to our development—but does show a slightly different localization result based on Gaussian comparison inequalities than available, for example, in Mendelson [34]— we provide its proof in Appendix G.1. Let us use inequality (24). To apply Theorem 3, we must find a bound on the fixed point of the localized complexity. To give this bound, we require some knowledge on the eigenvalues λj , for which there exists a body of work. For example [34], the Gaussian kernel K(x, x′ ) = exp(− 12 kx − x′ k22 ) 2 generates a class of smooth functions for which the eigenvalues λj decay exponentially, as λj . e−j . Kernel operators underlying Sobolev spaces with different smoothness orders [9, 23] typically have eigenvalues scaling as λj . j −2α for some α > 21 . As a concrete example, the first-order Sobolev (min) kernel K(x, x′ ) = 1 + min{x,√x′ } generates an RKHS of Lipschitz functions with α = 1. In 2 n the former case of λj . e−j , rn⋆ = log n 1 1  √ 2 √   2 Z ∞ log n √ ∞ X X log n 1 log n 1 −j 2 log n  −t2  1  min e , e dt + = rn⋆ . ≈ . √ n n n n n log n n  j=1 j=1 1 In the latter case of polynomially decaying eigenvalues λj . j −2α , we have j −2α = r when r − 2α = j, so Z ∞ ∞ X 2α−1 2α−1 −2α min{j , r} ≈ r 2α + t−2α dt ≍ r 2α . r −1/2α j=1 2α √ 2α−1 2α−1 Solving for nr = r 2α , we find the fixed point (rn⋆ ) 4α = rn⋆ n yields rn⋆ = n− 2α+1 . Ignoring constants, the above √ analysis shows that in the case that the kernel eigenvalues scale 2 −j as λj . e , as soon as ρ & log n we have ! r p 2ρ Cρ E[ℓ(h(X), Y )] ≤ (1 + 2 2ρ/n) EPbn [ℓ(h(X), Y )] + VarPbn (ℓ(h(X), Y )) + for all h ∈ BH n n with high probability. In the case of polynomial eigenvalues, if b h minimizes the robust empirical 2α 1− 2α+1 , then loss supP :D (P ||Pbn)≤ρ/n EP [ℓ(h(X), Y )] and ρ ≍ n φ   i   α p α 2α E ℓ(b h(X), Y ) ≤ 1 + Cn− 2α+1 inf E[ℓ(h(X), Y )] + Cn− 2α+1 Var(ℓ(h(X), Y )) + Cn− 2α+1 . h h∈BH This rate of convergence holds without any assumptions on the smoothness of the distribution of the noise ξ. ✸ 16 3.3 Beating empirical risk minimization We now provide a concrete example where the robustly regularized estimator θbnrob exhibits a substantial performance gap over empirical risk minimization. In the sequel, we bound the performance degradation to show that the formulation (6) in general loses little over empirical risk minimization. For intuition in this section, consider the (admittedly contrived) setting in which we replace the loss ℓ(θ, X) with ℓ(θ, X) − ℓ(θ ⋆ , X), where θ ⋆ ∈ argminθ∈Θ R(θ). Then in this case, by taking θ = θ ⋆ in Corollary 3.2, we have R(θbnrob ) ≤ R(θ ⋆ ) + O(1/n) with high probability. More broadly, we expect the robustly regularized approach to offer performance benefits in situations in which the empirical risk minimizer is highly sensitive to noise, say, because the losses are piecewise linear, and slight under- or over-estimates of slope may significantly degrade solution quality. With this in mind, we construct a concrete 1-dimensional example—estimating the median of a discrete distribution supported on X = {−1, 0, 1}—in which the robustly regularized estimator √ has convergence rate log n/n, while empirical risk minimization is at best 1/ n. Define the loss ℓ(θ; x) = |θ − x| − |x|, and for δ ∈ (0, 1) let the distribution P be defined by P (X = 1) = 1−δ 1−δ , P (X = −1) = , P (X = 0) = δ. 2 2 (25) Then for θ ∈ R, the risk of the loss is R(θ) = δ|θ| + 1−δ 1−δ |θ − 1| + |θ + 1| − (1 − δ). 2 2 By symmetry, it is clear that θ ⋆ := argminθ R(θ) = 0, which satisfies R(θ ⋆ ) = 0. (Note also that ℓ(θ, x) = ℓ(θ, x) − ℓ(θ ⋆ , x).) Without loss of generality, we assume that Θ = [−1, 1] in this problem. Now, consider a sample X1 , . . . , Xn drawn i.i.d. from the distribution P , let Pbn denote its empirical distribution, and define the empirical risk minimizer θbnerm := argmin EPbn [ℓ(θ, X)] = argmin EPbn [|θ − X|]. θ∈R θ∈[−1,1] If too many of the observations satisfy Xi = 1 or too many satisfy Xi = −1, then θbnerm will be either 1 or −1; for small δ, such events reasonably probable, as the following lemma makes precise. R x become 1 − 12 t2 √ In the lemma, Φ(x) = 2π −∞ e dt denotes the standard Gaussian CDF. (See Section G.2 for a proof.) Lemma 3.1. Let the loss ℓ(θ; x) = |θ − x| − |x|, δ ∈ [0, 1], and X follow the distribution (25). Then R(θbnerm ) − R(θ ⋆ ) ≥ δ with probability at least ! r r nδ2 8 2 n . − (1 − δ ) 2 2Φ − 2 1−δ πn On the other hand, we certainly have ℓ(θ ⋆ ; x) = 0 for all x ∈ X , so that Var(ℓ(θ ⋆ ; X)) = 0. Now, consider the bound in Theorem 3. We see that log N ({ℓ(θ, ·) : θ ∈ Θ}, ǫ, k·kL∞ (X ) ) ≤ 2 log 1ǫ , Rn (θ, Pn ), then and taking ǫ = 1 , we have that if θbrob ∈ argmin n R(θbnrob ) ≤ R(θ ⋆ ) + n θ∈Θ 15ρ with probability ≥ 1 − 4 exp (2 log n − ρ) . n 17 In particular, taking ρ = 3 log n, we see that R(θbnrob ) ≤ R(θ ⋆ ) + 4 45 log n with probability at least 1 − . n n The risk for the empirical risk minimizer, as Lemma 3.1 be substantially q shows, may qhigher; taking √ √ √ 1 n n ) − n− 2 , δ = 1/ n we see that with probability at least 2Φ(− n−1 ) − 2 2/ πen ≥ 2Φ(− n−1 1 R(θbnerm ) ≥ R(θ ⋆ ) + n− 2 . (For n ≥ 20, the probability of this event is ≥ .088.) For this (specially constructed) example, there 1 is a gap of nearly n 2 in order of convergence. 3.4 Invariance properties The robust regularization (4) technique enjoys a number of invariance properties. Standard regularization techniques (such as ℓ1 - and ℓ2 -regularization), which generally regularize a parameter toward a particular point in the parameter space, do not. While we leave deeper discussion of these issues to future work, we make two observations, which apply when Θ = Rd is unconstrained. Throughout, we let θbnrob ∈ argminθ Rn (θ, Pn ) denote the robustly regularized empirical solution. First, consider a location estimation problem in which we wish to estimate the minimizer of some the expectation of a loss of the form ℓ(θ, X) = h(θ − X), where h : Rd → R is convex and symmetric about zero. Then the robust solution is by inspection shift invariant, as ℓ(θ + c, X + c) = ℓ(θ, X) for any vector c ∈ Rd . Concretely, in the example of the previous section, ℓ1 - or ℓ2 -regularization achieve better convergence guarantees than ERM does, but if we shift all data x 7→ x + c, then non-invariant regularization techniques lose efficiency (while the robust regularization technique does not). Second, we may consider a generalized linear modeling problem, in which data comes in pairs (x, y) ∈ X × Y and ℓ(θ, (x, y)) = h(y, θ ⊤ x) for a function h : Y × R → R that is convex in its second argument. Then θbnrob is invariant to invertible linear transformations, in the sense that for any invertible A ∈ Rd×d , n o o n sup EP [ℓ(θ, (X, Y ))] = argmin EP [ℓ(A−1 θ, (AX, Y ))] = θbnrob . sup argmin θ ρ P :Dφ (P ||Pbn )≤ n θ ρ P :Dφ (P ||Pbn )≤ n Our results in this section do not precisely apply as we require unbounded θ, however, the next section shows that localization approaches can address this. 4 Robust regularization cannot be too bad The previous two sections provide guarantees on the performance of the robust regularized estimator (6), it does not—cannot—dominate classical approaches based on empirical risk minimization (also known as sample average approximation in the stochastic optimization literature), though it can improve on them in some cases. For example, with a correctly specified linear regression model with gaussian noise, least-squares—empirical risk minimization with the loss ℓ(θ, (x, y)) = 21 (θ ⊤ x − y)2 —is essentially optimal. Our goal in this section is thus to provide more understanding of potential poor behavior of the procedure (6) with respect to ERM, considering two scenarios. The first is in stochastic (convex) optimization problems, where we investigate the 18 finite-sample convergence rates of the robust solution to the population optimal risk. We show that the robust solution θbnrob enjoys fast rates of convergence in cases in which the risk has substantial curvature—precisely as with empirical risk minimization. The second is to consider the asymptotics of the robust solution θbnrob , where we show that in classical statistical scenarios the robust solution √ is nearly efficient, though there is an asymptotic bias of order 1/ n that scales with the confidence ρ. 4.1 Fast Rates In cases in which the risk R has curvature, empirical risk minimization often enjoys faster rates of convergence [10, 40]. The robust solution θbnrob similarly attains faster rates of convergence in such cases, even with approximate minimizers of Rn (θ, Pn ). For the risk R and ǫ ≥ 0, let   ǫ ⋆ S⋆ := θ ∈ Θ : R(θ) ≤ inf R(θ ) + ǫ ⋆ θ ∈Θ denote the ǫ-sub-optimal (solution) set, and similarly let   ′ Sb⋆ǫ := θ ∈ Θ : Rn (θ, Pn ) ≤ inf R (θ , P ) + ǫ . n n ′ θ ∈Θ For a vector θ ∈ Θ, let πS⋆ (θ) = argminθ⋆ ∈S⋆ kθ ⋆ − θk2 denote the Euclidean projection of θ onto the set S⋆ ; this projection operator is very useful for showing faster rates of convergence in stochastic optimization (see Shapiro et al. [40], whose techniques we closely follow). In the statement of the result, for A ⊂ Θ, we let Rn (A) denote the Rademacher complexity of the localized process {x 7→ ℓ(θ; x) − ℓ(πS⋆ (θ); x) : θ ∈ A}. We then have the following result, whose proof we provide in Section E. Theorem 5. Let Θ be convex and let ℓ(·; x) be convex and L-Lipshitz in its first argument for all x ∈ X . For constants λ > 0, γ > 1, and r > 0, assume the risk R satisfies R(θ) − inf R(θ) ≥ λ dist(θ, S⋆ )γ for all θ such that dist(θ, S⋆ ) ≤ r. θ∈Θ Let t > 0. If 0 ≤ ǫ ≤ 21 λr γ satisfies ǫ≥  8γ Lγ 2 λ  1 γ−1 ρ γ 2(γ−1) n ǫ ≥ 2E[Rn (S⋆2ǫ )] + L and 2  2ǫ λ 1 r γ 2t , n (26) (27) then P(Sb⋆ǫ ⊂ S⋆2ǫ ) ≥ 1 − e−t , We provide a brief discussion of this result as well as a corollary that gives more explicit rates of convergence. First, we note that (by an inspection of the proof) the L-Lipschitz assumption need only hold in the neighborhood S⋆2ǫ for the result to hold. We also have the following Corollary 4.1. In addition to the conditions of Theorem 5, assume that S⋆ = {θ ⋆ } is a single point and Θ ⊂ Rd . Then for any ǫ ≤ 12 λr γ , we have P(Sb⋆ǫ ⊂ S⋆2ǫ ) ≥ 1 − e−t for ǫ&  Lγ λ  1 γ−1  n t ρ d log + + n d n n 19  γ 2(γ−1) . So long as ρ . d log nd , this rate of convergence is as good as that enjoyed by standard empirical risk minimization approaches [40, Ch. 5] under these types of growth conditions. The case that γ = 2 corresponds (roughly) to strong convexity, and in this case we get the approximate rate of 2 d log n convergence of Lλ n d , the familiar rate of convergence under these conditions. Of course, if there is too much variance penalization (i.e. ρ is too large), then the rates of convergence may be slower. 1 Proof That S⋆ is a singleton implies that S⋆2ǫ ⊂ {θ | kθ − θ ⋆ k ≤ (2ǫ/λ) γ }. Moreover, in this case we also have that EPbn [ℓ(θ; X) − ℓ(θ ⋆ ; X)] − EPbn [ℓ(θ ′ ; X) − ℓ(θ ⋆ ; X)] ≤ L θ − θ ′ , 1 so that an ǫ/L-cover of {θ | kθ − θ ⋆ k ≤ (2ǫ/λ) γ } is an ǫ-cover of the function class F = {f (x) = ℓ(θ; x) − ℓ(θ ⋆ ; x) | θ ∈ S⋆2ǫ } in k·kL2 (Pn ) norm. Thus, the standard Dudley entropy integral [21, 47] yields Z ∞q 1 log N (F, δ, k·kL2 (Pn ) )dδ E[Rn (S⋆2ǫ )] . √ n 0 r  1 s Z L(2ǫ/λ) γ1 r 1 L 1 λ d 2ǫ γ .√ d log dδ ≤ L 1 + log γ n 0 δ n λ γ 2L ǫ q Rεq where we have used that 0 log Lδ dδ ≤ ε 1 + log Lε . Solving for ǫ in the localization inequality (27) then yields the corollary, showing that the specified choice of ǫ is sufficient for all the conditions (27) to hold. 4.2 Asymptotics It is important to understand the precise limiting behavior of the robust estimator in addition to its finite sample properties—this allows us to more precisely characterize when there may be degradation relative to classical risk minimization strategies. With that in mind, in this section we provide asymptotic results for the robust solution (6) to better understand the consequences of penalizing the variance of the loss itself. In particular, we would like to understand efficiency losses relative to (say) maximum likelihood in situations in which maximum likelihood is efficient. Before stating the results, we make a few standard assumptions on the risk R(θ), the loss ℓ, and the moments of ℓ and its derivatives. Concretely, we assume that θ ⋆ := argmin R(θ) and ∇2 R(θ ⋆ ) ≻ 0, θ that is, the risk functional has strictly positive definite Hessian at θ ⋆ , which is thus unique. Additionally, we have the following smoothness assumptions on the loss function, which are satisfied by common loss functions, including the negative log-likelihood for any exponential family or generalized linear model [29]. In the assumption, we let B denote the ℓ2 -ball of radius 1 in Rd . Assumption A. For some ǫ > 0, there exists a function L : X → R+ satisfying |ℓ(θ, x) − ℓ(θ ′ , x)| ≤ L(x) θ − θ ′ 2 for θ, θ ′ ∈ θ ⋆ + ǫB and E[L(X)2 ] ≤ L(P ) < ∞. Additionally, there is a function H such that the function θ 7→ ℓ(θ, x) has H(x)-Lipschitz continuous Hessian (with respect to the Frobenius norm) on θ ⋆ + ǫB, where E[H(X)2 ] < ∞. 20 Then, recalling the robust estimator (6) as the minimizer of Rn (θ, Pn ), we have the following theorem, which we prove in Section F. Theorem 6. Let Assumption A hold, and let the sequence θbnrob be defined by θbnrob ∈ argminθ Rn (θ, Pn ). Define b(θ ⋆ ) := −1 −1 Cov(∇θ ℓ(θ ⋆ , X), ℓ(θ ⋆ , X)) p and Σ(θ ⋆ ) = ∇2 R(θ ⋆ ) Cov(∇ℓ(θ ⋆ , X)) ∇2 R(θ ⋆ ) . Var(ℓ(θ ⋆ , X)) a.s. Then θbnrob → θ ⋆ and  p  √ d n(θbrob − θ ⋆ ) → N − 2ρ b(θ ⋆ ), Σ(θ ⋆ ) n The asymptotic variance Σ(θ ⋆ ) in Theorem 6 is generally unimprovable, as made apparent by Le Cam’s local asymptotic normality theory and the Hájek-Le Cam local minimax theorems [47]. Thus, Theorem 6 shows that the robust regularized estimator (6) has some efficiency loss, but it is only in the bias term. We explore this a bit more in the context of the risk of θbnrob . Letting W ∼ N(0, Σ(θ ⋆ )), as an immediate corollary to this theorem, the delta-method implies that h i 2 d 1 p (28) 2ρ b(θ ⋆ ) + W 2 ⋆ , n R(θbnrob ) − R(θ ⋆ ) → 2 ∇ R(θ ) where we recall that kxk2A = x⊤ Ax. This follows from a Taylor expansion, because ∇R(θ ⋆ ) = 0 and so R(θ) − R(θ ⋆ ) = 21 (θ − θ ⋆ )⊤ ∇2 R(θ ⋆ )(θ − θ ⋆ ) + o(kθ − θ ⋆ k2 ), or   1 brob rob ⋆ ⋆ ⊤ 2 ⋆ brob ⋆ rob ⋆ 2 b b n(R(θn ) − R(θ )) = n (θ − θ ) ∇ R(θ )(θn − θ ) + o(kθn − θ k ) 2 n ⊤  √ 1 √ brob = n(θn − θ ⋆ ) ∇2 R(θ ⋆ ) n(θbnrob − θ ⋆ ) + oP (1) 2 p d 1 p → ( 2ρ b(θ ⋆ ) + W )⊤ ∇2 R(θ ⋆ )( 2ρ b(θ ⋆ ) + W ) 2 by Theorem 6. The limiting random variable in expression (28) has expectation p 1 1 E[k 2ρb(θ ⋆ ) + W k2∇2 R(θ⋆ ) ] = ρb(θ ⋆ )⊤ ∇2 R(θ ⋆ )b(θ ⋆ ) + tr(∇2 R(θ ⋆ )−1 Cov(ℓ(θ ⋆ , X)), 2 2 while the classical empirical risk minimization procedure (standard M -estimation) [29, 47] has limiting mean-squared error 21 tr(∇2 R(θ ⋆ )−1 Cov(ℓ(θ ⋆ , X))). Thus there is an additional ρ kb(θ ⋆ )k2∇2 R(θ⋆ ) penalty in the asymptotic risk (at a rate of 1/n) for the p robustly-regularized estimator. An inspection of the proof of Theorem 6 reveals that b(θ ⋆ ) = ∇θ Var(ℓ(θ ⋆ , X)); if the variance of the loss is stable near θ ⋆ , so that moving to a parameter θ = θ ⋆ + ∆ for some small ∆ has little effect on the variance, then the standard loss terms dominate, and robust regularization p has asymptotically little effect. On the other hand, highly unstable loss functions for which ∇θ Var(ℓ(θ ⋆ , X)) is large yield substantial bias. We conclude our study of the asymptotics with a (to us) somewhat surprising example. Consider the classical linear regression setting in which y = x⊤ θ ⋆ + ε, where ε ∼ N(0, σ 2 ). Using the standard squared error loss ℓ(θ, (x, y)) = 21 (θ ⊤ x − y)2 , we obtain that ∇ℓ(θ ⋆ , (x, y)) = (x⊤ θ ⋆ − y)x = (x⊤ θ ⋆ − x⊤ θ ⋆ − ε)x = −εx, 21 while ℓ(θ ⋆ , (x, y)) = 21 ε2 . The covariance Cov(εX, ε2 ) = E[εX(ε2 − σ 2 )] = 0 by symmetry of the error distribution, and so—in the special classical case of correctly specified linear regression— the bias term b(θ ⋆ ) = 0 for linear regression in Theorem 6. That is, the robustly regularized estimator (6) is asymptotically efficient. 5 Experiments We present three experiments in this section. The first is a small simulation example, which serves as a proof of concept allowing careful comparison of standard empirical risk minimization (ERM) strategies to our variance-regularized approach. The latter two are classification problems on real datasets; for both of these we compare performance of robust solution (6) to its ERM counterpart. 5.1 Minimizing the robust objective As a first step, we give a brief description of our (essentially standard) method for solving the robust risk problem. Our work in this paper focuses mainly on the properties of the robust objective (4) and its minimizers (6), so we only briefly describe the algorithm we use; we leave developing faster and more accurate specialized methods to further work. To solve the robust problem, we use a gradient descent-based procedure, and we focus on the case in which the empirical sampled losses {ℓ(θ, Xi )}ni=1 have non-zero variance for all parameters θ ∈ Θ, which is the case for all of our experiments. Recall the definition of the subdifferential ∂f (θ) = {g ∈ Rd : f (θ ′ ) ≥ f (θ) + hg, θ ′ − θi for all θ ′ }, which is simply the gradient for differentiable functions f . A standard result in convex analysis [24, Theorem VI.4.4.2] is that if the vector p∗ ∈ Rn+ achieving the supremum in the definition (4) of the robust risk is unique, then ∂θ Rn (θ, Pn ) = ∂θ sup EP [ℓ(θ; X)] = P ∈Pn n X p∗i ∂θ ℓ(θ; Xi ), i=1 where the final summation is the standard Minkowski sum of sets. As this maximizing vector p is indeed unique whenever VarPbn (ℓ(θ; X)) 6= 0, we see that for all our problems, so long as ℓ is differentiable, so too is Rn (θ, Pn ) and ∇θ Rn (θ, Pn ) = n X i=1 p∗i ∇θ ℓ(θ; Xi ) ∗ where p = argmax p∈Pn X n i=1  pi ℓ(θ; Xi ) . (29) In order to perform gradient descent on the risk Rn (θ, Pn ), then, by equation (29) we require only the computation of the worst-case distribution p∗ . By taking the dual of the maximization (29), this is an efficiently solvable convex problem; for completeness, we provide a procedure for this computation in Section H that requires time O(n log n + log 1ǫ log n) to compute an ǫ-accurate solution to the maximization (29). As all our examples have smooth objectives, we perform gradient descent on the robust risk Rn (·, Pn ), with stepsizes chosen by a backtracking (Armijo) line search [15, Chapter 9.2]. Code is available at https://github.com/hsnamkoong/robustopt. 22 5.2 Simulation experiment For our simulation experiment, we use a quadratic loss with linear perturbation. For v, x ∈ Rd , define the loss ℓ(θ; x) = 12 kθ − vk22 + x⊤ (θ − v). We set d = 50 and take X ∼ Uni({−B, B}d ), varying B in the experiment. For concreteness, we let the domain Θ = {θ ∈ Rd : kθk2 ≤ r} and set r 1, so that v ∈ int Θ; we take r = 10. Notably, standard regularization strategies, such as v = 2√ d ℓ1 or ℓ2 -regularization, pull θ toward 0, while the variance of ℓ(θ; X) is minimized by θ = v (thus naturally advantaging the variance-based regularization we consider, as R(v) = inf θ R(θ) = 0). Moreover, as X is pure noise, this is an example where we expect variance regularization to be √ particularly useful. We choose δ = .05 and set ρ as in Eq. (17) (using that ℓ is (3r+ dB)-Lipschitz) to obtain robust coverage with probability at least 1 − δ. In our experiments, we obtained 100% coverage in the sense of (15), as the high probability bound is conservative. 10 B=.01 B=.1 B=1 B=10 0 Log Risk −10 −20 −30 −40 −50 10 2 5 · 10 2 10 3 Sample Size 5 · 10 3 10 4 Figure 2. Simulation experiment. log E[R(θbnerm )] is the solid lines, in decreasing order from B = 10 (top) to B = .01 (bottom). log E[R(θbnrob )] is the dashed line, in the same vertical ordering at sample size n = 102 . Figure 2 summarizes the results. The robust solution θbnrob = argminθ∈Θ Rn (θ, Pn ) always outperforms the empirical risk minimizer θbnerm = argminθ∈Θ EPbn [ℓ(θ, X)] in terms of the true risk E[ℓ(θ, X)] = 12 kθ − vk22 . Each experiment consists of 1,200 independent replications for each sample size n and value B. In Tables 1 and 2, we display the risks of θbnerm and θbnrob and variances, respectively, computed for the 1,200 independent trials. The gap between the risk of θbnerm and θbnrob is siginificant at level p < .01 for all sample sizes and values of B we considered according to a one-sided T-test. Notice also in Table 2 that the variance of the robust solutions is substantially smaller than that of the empirical risk minimizer—often several orders of magnitude smaller for large sample sizes n. This simulation shows that—in a simple setting favorable to it—our procedure outperforms standard alternatives. 23 Table 1: Simulation experiment: Mean risks over 1,200 simulations n 100 500 1000 5000 10000 n 100 500 1000 5000 10000 5.3 B = .01 erm b R(θbnrob ) R(θn ) 4.06E-06 7.42E-07 8.91E-07 5.01E-15 4.47E-07 1.52E-15 1.44E-07 2.68E-16 7.64E-08 1.32E-16 B = .1 erm b R(θbnrob ) R(θn ) 4.17E-04 7.65E-05 8.22E-05 1.63E-14 4.02E-05 1.64E-17 8.00E-06 2.74E-18 4.02E-06 1.32E-18 B=1 erm b R(θbnrob ) R(θn ) 4.20E-02 7.64E-03 8.36E-03 2.19E-13 4.20E-03 6.32E-18 8.27E-04 5.09E-20 4.13E-04 2.57E-20 B = 10 erm b R(θbnrob ) R(θn ) 4.15E+00 7.12E-01 8.41E-01 8.21E-12 4.19E-01 2.45E-17 8.38E-02 6.55E-20 4.18E-02 3.34E-20 b over 1,200 simulations Table 2: Simulation experiment: Variances of R(θ) B = .01 ERM Robust 7.06E-13 9.76E-14 5.98E-14 7.15E-28 2.63E-14 1.07E-31 7.34E-15 2.94E-33 1.60E-15 6.54E-34 B = .1 ERM Robust 6.58E-09 1.03E-09 3.04E-10 3.52E-26 7.53E-11 1.99E-35 2.70E-12 3.28E-37 6.74E-13 7.59E-38 B=1 ERM Robust 7.09E-05 1.08E-05 2.80E-06 2.26E-24 7.14E-07 3.44E-33 2.95E-08 2.50E-39 7.04E-09 3.34E-39 B = 10 ERM Robust 7.37E-01 9.20E-02 2.92E-02 3.26E-21 7.03E-03 4.78E-32 2.74E-04 5.24E-38 6.52E-05 2.25E-38 Protease cleavage experiments For our second experiment, we compare our robust regularization procedure to other regularizers using the HIV-1 protease cleavage dataset from the UCI ML-repository [31]. In this binary classification task, one is given a string of amino acids (a protein) and a featurized representation of the string of dimension d = 50960, and the goal is to predict whether the HIV-1 virus will cleave the amino acid sequence in its central position. We have a sample of n = 6590 observations of this process, where the class labels are somewhat skewed: there are 1360 examples with label Y = +1 (HIV-1 cleaves) and 5230 examples with Y = −1 (does not cleave). We use the logistic loss ℓ(θ; (x, y)) = log(1 + exp(−yθ ⊤ x)). We compare the performance of different constraint sets Θ by taking n o Θ = θ ∈ Rd : a1 kθk1 + a2 kθk2 ≤ r , which is equivalent to elastic net regularization [52], while varying a1 , a2 , and r. We experiment with ℓ1 -constraints (a1 = 1, a2 = 0) with r ∈ {50, 100, 500, 1000, 5000}, ℓ2 -constraints (a1 = 0, a2 = 1) with r ∈ {5, 10, 50, 100, 500}, elastic net (a1 = 1, a2 = 10) with r ∈ {100, 200, 1000, 2000, 10000}, our robust regularizer with ρ ∈ {100, 1000, 10000, 50000, 100000} and our robust regularizer coupled with the ℓ1 -constraint (a1 = 1, a2 = 0) with r = 100. Though we use a convex surrogate (logistic loss), we measure performance of the classifiers using the 0-1 (misclassification) loss 1{sign(θ T x)y ≤ 0}. For validation, we perform 50 experiments, where in each experiment we randomly select 9/10 of the data to train the model, evaluating its performance on the held out fraction (test). We plot results summarizing these experiments in Figure 3. The horizontal axis in each figure indexes our choice of regularization value (so “Regularizer = 1” for the ℓ1 -constrained problem corresponds to r = 50). The figures show that the robustly regularized risk provides a different type of protection against overfitting than standard regularization or constraint techniques do: while other regularizers underperform in heavily constrained settings, the robustly regularized estimator 24 θbnrob achieves low classification error for all values of ρ (Figure 3(b)). Notably, even when coupled with a fairly stringent ℓ1 -constraint (r = 100), robust regularization has perofrmance better than ℓ1 except for large values r, especially on the rare label Y = +1 (Figure 3 (d) and (f)). We investigate the effects of the robust regularizer with a slightly different perspective in Figure 4, where we use Θ = {θ : kθk1 ≤ r} with r = 100 for the constraint set for each experiment. The horizontal axis indicates the tolerance ρ we use in construction of the robust estimator θbnrob , where b = E[ℓ(θ, b (X, Y ))] for the train and ERM means ρ = 0. In Fig. 4(a), we plot the logistic risk R(θ) test distribution. We also plot the upper confidence bound Rn (θ, Pn ) in this plot, which certainly over-estimates the test risk—we hope to tighten this overestimate in future work. In Figure 4(b), we plot the misclassification error on train and test for different values of ρ, along with 2-standarderror intervals for the 50 runs. Figures 4(c) and (d) show the error rates restricted to examples from the uncommon (c) and common (d) classes. In Table 3 we give explicit error rates and logistic risk values for the different procedures. Due to the small size of the test dataset (ntest = 659), the deviation across folds is somewhat large. 25 0.10 0.11 L1 L2 Elastic Net Robust L1 + Robust 0.08 L1 L2 Elastic Net Robust L1 + Robust 0.10 0.09 Error Error 0.06 0.08 0.04 0.07 0.02 0.00 0.06 1 2 3 Regularizer 4 0.05 5 1 (a) Train error 0.45 0.35 4 0.45 5 L1 L2 Elastic Net Robust L1 + Robust 0.40 0.35 Error (y = + 1) Error (y = + 1) 0.30 3 Regularizer (b) Test error L1 L2 Elastic Net Robust L1 + Robust 0.40 2 0.25 0.20 0.15 0.30 0.25 0.20 0.10 0.15 0.05 0.00 1 2 3 Regularizer 4 0.10 5 (c) Train error on rare class (Yi = +1) 0.030 0.025 0.020 0.005 0.015 2 3 Regularizer 4 5 0.030 0.010 1 4 0.035 0.015 0.000 3 Regularizer 0.040 Error (y = − 1) Error (y = − 1) 0.020 2 (d) Test error on rare class (Yi = +1) L1 L2 Elastic Net Robust L1 + Robust 0.025 1 0.010 5 (e) Train error on common class (Yi = −1) L1 L2 Elastic Net Robust L1 + Robust 1 2 3 Regularizer 4 5 (f) Test error on common class (Yi = −1) Figure 3. HIV-1 Protease Cleavage plots (2-standard error confidence bars). Comparison of misclassification error rates among different regularizers. 26 0.6 train test 0.06 0.05 0.4 Error Risk 0.5 0.07 risk train risk test robust train 0.04 0.3 0.03 0.2 ERM 10 2 10 3 0.02 10 4 ρ (a) Logistic risk and confidence bound 0.20 10 4 train test 0.035 0.030 Error (y = − 1) Error (y = + 1) 10 3 ρ 0.040 0.16 0.14 0.12 0.025 0.020 0.10 0.015 0.08 0.06 10 2 (b) Misclassification error rate train test 0.18 ERM ERM 10 2 10 3 0.010 10 4 ρ (c) Error on rare class (Yi = +1) ERM 10 2 10 3 10 4 ρ (d) Error on common class (Yi = −1) Figure 4. HIV-1 Protease Cleavage plots (2-standard error confidence bars). Plot (a) shows the ⊤ logistic risk R(θ) = E[log(1 + e−Y θ X )] and confidence bounds computed from the robust risk (4). Plots (b)–(d) show misclassification error rates plotted against robustness parameter ρ. In this experiment, we see (roughly) that the ERM solutions achieve good performance on the common class (Y = −1) but sacrifice performance on the uncommon class. As we increase ρ, performance of the robust solution θbnrob on the rarer label Y = +1 improves (Fig. 4(c)), while the misclassification rate on the common class degrades a small (insignificant) amount (Fig. 4(d)); see also Table 3. This behavior is roughly what we might expect for the robust estimator: the poor performance of the ERM estimator θbnerm on the rare class induces (relatively) more variance, which the robust solution reduces by via improved classification performance on the rare (Y = +1) class. This occurs at little expense over the more common label Y = −1 so that overall performance improves by a small amount. We remark—but are unable to explain—that this improvement on classification error for the rare labels comes despite increases in logistic risk; while the average logistic loss increases, misclassification errors decrease. 27 Table 3: HIV-1 Cleavage Error risk ρ erm 100 1000 10000 5.4 train 0.1587 0.1623 0.1777 0.283 error train 5.52 4.99 4.5 2.39 test 0.1706 0.1763 0.1944 0.3031 (%) test 6.39 5.92 5.92 5.67 error (Y train 17.32 15.01 13.35 7.18 = +1) test 18.79 17.04 16.33 14.65 error (Y = −1) train test 2.45 3.17 2.38 3.02 2.19 3.2 1.15 3.32 Document classification in the Reuters corpus For our final experiment, we consider a multi-label classification problem with a reasonably large dataset. The Reuters RCV1 Corpus [30] has 804,414 examples with d = 47,236 features, where feature j is an indicator variable for whether word j appears in a given document. The goal is to classify documents as a subset of the 4 categories Corporate, Economics, Goverment, and Markets, and each document in the data is labeled with a subset of those. As each document can belong to multiple categories, we fit binary classifiers on each of the four categories. There are different numbers of documents labeled as each category, with the Economics category having the fewest number of positive examples. Table 4 gives the number of times a document is labeled as each of the four categories (so each document has about 1.18 associated classes). In this experiment, we expect the robust solution to outperform ERM on the rarer category (Economics), as the robustification (6) naturally upweights rarer (harder) instances, which disproportionally affect variance—as in the experiment on HIV-1 cleavage. Table 4: Reuters Number of Examples Corporate 381,327 Economics 119,920 Government 239,267 Markets 204,820 For each category k ∈ {1, 2, 3, 4}, we use the logistic loss ℓ(θk ; (x, y)) = log(1 + exp(−yθk⊤ x)). For each binary classifier, we use the ℓ1 constraint set Θ = θ ∈ Rd : kθk1 ≤ 1000 . To evaluate performance on this multi-label problem, we use precision (ratio of the number of correct positive labels to the number classified as positive) and recall (ratio of the number of correct positive labels to the number of actual positive labels): n 1X precision = n recall = 1 n P4 ⊤ k=1 1{θk xi ≥ 0, yi = P4 ⊤ k=1 1{θk xi > 0} i=1 n P4 ⊤ X k=1 1{θk xi ≥ 0, yi = P4 k=1 1 {yi = 1} i=1 1} 1} , . We partition the data into ten equally-sized sub-samples and perform ten validation experiments, where in each experiment we use one of the ten subsets for fitting the logistic models and the remaining nine partitions as a test set to evaluate performance. In Figure 5, we summarize the results of our experiment averaged over the 10 runs, with 2standard error bars (computed across the folds). To facilitate comparison across the document categories, we give exact values of these averages in Tables 5 and 6. Both θbnrob and θbnerm have reasonably high precision across all categories, with increasing ρ giving a mild improvement in 28 0.8 0.7 0.945 risk train risk test robust train 0.935 0.6 0.930 Risk Precision 0.5 0.4 0.925 0.920 0.3 0.915 0.2 0.1 train test 0.940 0.910 ERM 10 3 10 4 ρ 10 5 10 6 0.905 ERM 10 3 (a) Logistic risk and confidence bound 0.940 0.82 0.78 Recall (Economics) Recall 10 6 train test 0.80 0.930 0.925 0.920 0.915 0.76 0.74 0.72 0.70 0.910 0.905 10 5 (b) Precision train test 0.935 10 4 ρ 0.68 ERM 10 3 10 4 ρ 10 5 10 6 0.66 (c) Recall ERM 10 3 10 4 ρ 10 5 10 6 (d) Recall on rare category (Economics) Figure 5: Reuters Corpus (2-standard error deviations) precision (from .93 ± .005 to .94 ± .005); see also Figure 5(a). On the other hand, we observe in Figure 5(d) that ERM has low recall (.69 on test) for the Economics category, which contains about 15% of documents. As we increase ρ from 0 (ERM) to 105 , we see a smooth and substantial improvement in recall for this rarer category (without significant degradation in precision). This improvement in recall amounts to reducing variance in predictions on the rare class. We also note that while the robust solutions outperform ERM in classification performance for ρ ≤ 105 , for very large ρ = 106 ≥ 10n, the regularizing effects of robustness degrade the solution θbnrob . This precision and recall improvement comes in spite of the increase in the average binary logistic risk for each of the 4 classes, which we show in Figure 5a, which plots the average binary logistic loss (on train and test sets) averaged over the 4 categories as well as the upper confidence bound Rn (θ, Pn ) as we vary ρ. The robust regularization effects reducing variance appear to improve the performance of the binary logistic loss as a surrogate for true misclassification error. 29 Table 5: Reuters Corpus Precision (%) ρ erm 1E3 1E4 1E5 1E6 Precision train test 92.72 92.7 92.97 92.95 93.45 93.45 94.17 94.16 91.2 91.19 Corporate train test 93.55 93.55 93.31 93.33 93.58 93.61 94.18 94.19 92 92.02 ρ erm 1E3 1E4 1E5 1E6 Recall train test 90.97 90.96 91.72 91.69 92.40 92.39 93.46 93.44 93.10 93.08 Corporate train test 90.20 90.25 90.83 90.86 91.47 91.54 92.65 92.71 92.00 92.04 Economics train test 89.02 89 87.84 87.81 87.6 87.58 86.55 86.56 74.81 74.8 Government train test 94.1 94.12 93.73 93.76 93.77 93.8 94.07 94.09 91.19 91.25 Markets train test 92.88 92.94 92.56 92.62 92.71 92.75 93.16 93.24 89.98 90.18 Table 6: Reuters Corpus Recall (%) Economics train test 67.53 67.56 70.42 70.39 72.38 72.36 76.79 76.78 79.84 79.71 Government train test 90.49 90.49 91.26 91.23 91.76 91.76 92.26 92.21 91.89 91.90 Markets train test 88.77 88.78 89.62 89.58 90.48 90.45 91.46 91.47 92.00 91.97 Summary We have seen through multiple examples that robustification—our convex surrogate for variance regularization—is an effective tool in a number of applications. As we heuristically expect, variancebased regularization (robust regularization) yields predictors with better performance on “hard” instances, or subsets of the problem that induce higher variance, such as classes with relatively few training examples in classification problems. The robust regularization ρ gives a principled knob for tuning performance to trade between variance (uniform or across-the-board performance) and—sometimes—absolute performance. 6 Discussion In this paper, we have developed theoretical results for robust regularization (6) that apply to general stochastic optimization and learning problems problems. The examples we describe in Section 3 illustrate our expectation that the robust solution θbnrob should have good performance in cases in which Var(ℓ(θ ⋆ ; X)) is small (recall also Theorems 3 and 4). Identifying the separation between the performance empirical risk minimization and related estimators and that of the robustly-regularized estimators—as well as variance-regularized estimates—we consider more generally remains a challenge. We hope that this paper inspires work in this direction in machine learning and statistics, and more broadly, torward considering distributionally robust problems. Part of this is likely to come from making rigorous our empirical observations (Section 5) that robust regularization improves performance on “hard” instances without sacrificing performance on easier cases. Our understanding of so-called “fast rates” for stochastic optimization problems, while considering robustness, is also limited. For empirical risk minimization, fast rates of convergence hold under conditions in which the the gap R(θ) − R(θ ⋆ ) controls the variance of the excess loss ℓ(θ, X) − ℓ(θ ⋆ , X) [cf. 32, 3, 10, 4], which usually requires some type of uniform convexity assump30 tion. These bounds typically follow from localization guarantees [3, Section 5] on the function class {x 7→ ℓ(θ, x) − ℓ(θ ⋆ , x) | θ ∈ Θ} . While in Section 4.1, we show that the robust estimate θbnrob enjoys faster rates of convergence under growth conditions analogous to uniform convexity of the risk, as Var(ℓ(θ; X) − ℓ(θ ⋆ ; X)) 6= Var(ℓ(θ; X)), it is not clear how to directly connect these guarantees to results of the form in Theorems 3 and 4. We leave investigation of these topics to future work. The last point of our discussion is to revisit Theorem 4, which provides a guarantee for robustly regularized estimators based on localized Rademacher complexities. An investigation of our proof shows that our derivation proceeds by considering the complexity of self-normalized classes of functions of the form  r r f |f ∈F . Gr = E[f 2 ] ∨ r In contrast, the analogous result of Bartlett et al. [3, Thereom 3.3] for empirical risk minimization considers the complexity of classes of functions of the form   r f |f ∈F . Gr = E[f 2 ] ∨ r p The latter class normalizes functions f by E[f 2 ]—a type of self-normalization that arises in the computation of pivotal (asymptotically independent of the underlying distribution) statistics. While this choice prima facie is just a step in our proof, the robust objective Rn (θ, Pn ) defined in Eq. (4) is an empirical likelihood upper confidence bound on the optimal population risk [see also 20]. One of the important characteristics of empirical likelihood confidence bounds is that they are self-normalizing and yield pivotal statistics [38]. Investigating such self-normalization in complexity guarantees seems likely to yield fruitful insights. Acknowledgments We thank Feng Ruan for pointing out a much simpler proof of Theorem 1 than in our original paper. JCD and HN were partially supported by the SAIL-Toyota Center for AI Research and HN was partially supported Samsung Fellowship. JCD was also partially supported by the National Science Foundation award NSF-CAREER-1553086 and the Sloan Fellowship. 31 A Proof of Theorem 1 The theorem is immediate if sn = 0 or σ 2 = 0, as in this case supP :D b φ (P ||Pn )≤ρ/n EP [Z] = EPbn [Z] = E[Z]. In what follows, we will thus assume that σ 2 , s2n > 0. We recall the maximization problem (8), which is   n X 1 pi zi subject to p ∈ Pn = p ∈ Rn+ : knp − 1k22 ≤ ρ, h1, pi = 1 , maximize p 2 i=1 and p the solution criterion (9), which guarantees that the maximizing value of problem (8) is z + 2ρs2n /n whenever p zi − z 2ρ p ≥ −1. ns2n Letting z = Z, then under the conditions of the theorem, we have |zi − z| ≤ M , and to satisfy inequality (9) it is certainly sufficient that 2ρ M2 2ρM 2 2ρM 2 2 ≤ 1, or n ≥ , or s ≥ . n ns2n s2n n Conversely, suppose that s2n < 2ρM 2 n . Then we have 1 sup hp, zi ≥ h1, zi + n p∈Pn 2ρs2n n r < 4ρ2 M 2 , n2 2ρs2n 2M ρ − n n (30) which in turn implies that ! . + Combining this inequality with the condition (30) for the exact expansion to hold yields the twosided variance bounds (10). We now turn to showing the high-probability exact expansion (11), which occurs whenever the sample variance is large enough by expression (30). To that end, we show that s2n is bounded from below with high probability. Define the event   3 2 2 σ , En := sn ≥ 64 2 2 2 and let n ≥ 4M max {2σ, 11}. Then, on event En we have n ≥ 44ρM ≥ 2ρM , so that the σ2 σ2 s2n sufficient condition (30) holds and expression (11) follows. We now argue that the event En has high probability via the following lemma, which is an application of concentration inequalities for convex functions coupled with careful estimates of the expectation of standard deviations. Lemma A.1. Let Zi be i.i.d. random variables taking values in [M0 , M1 ] with M = M1 − M0 , and 2 P P 7 + n32 . For all t ≥ 0, we have let s2n = n1 ni=1 Zi2 − n1 ni=1 Zi . Let cn = 1 + 4n       p p nt2 cn M 2 2 2 P sn ≥ Esn + t ∨ P sn ≤ Esn − − t ≤ exp − . n 2M 2 The proof of the lemma is involved, but the lemma yields a quick proof of the theorem that we now provide. (See Section A.1 for a proof.) 32 √ Let σ 2 = Var(Z) and note that E[s2n ] = (1 − n1 )σ 2 . Set t = 43 σ and note that cn < 23 if n ≥ 5. 2 Then, since n ≥ 8M σ by hypothesis, we have that √ √ p 3 cn M 2 2 5 3M 2 7 −1 σ 1−n − −t≥ σ− −t> σ−t> σ. n 5 2n 10 8 √ 2 2 2 Lemma A.1 implies that sn ≥ σ 1 − n−1 − cnnM − t with probability at least 1 − e−nt /2M = 2 2 1 − e−3nσ /32M , which gives the theorem. A.1 Proof of Lemma A.1 We use three technical lemmas in the proof of this lemma. Lemma A.2 (Samson [39], Corollary 3). Let f : Rn → R be convex and L-Lipschitz continuous with respect to the ℓ2 -norm over [a, b]n , and let Z1 , . . . , Zn be independent random variables on [a, b]. Then for all t ≥ 0,   t2 P(f (Z1:n ) ≥ E[f (Z1:n )] + t) ∨ P(f (Z1:n ) ≤ E[f (Z1:n )] − t) ≤ exp − 2 . 2L (b − a)2 The function Rn ∋ z 7→ (I − (1/n)11⊤ )z 2 is 1-Lipschitz with respect to the Euclidean norm, so Lemma A.2 implies   q  q  q q nt2 . P VarPbn (Z) ≥ E[ VarPbn (Z)] + t ∨ P VarPbn (Z) ≤ E[ VarPbn (Z)] − t ≤ exp − 2M 2 p 1 1 As E[VarPbn (Z) 2 ] ≤ E[VarPbn (Z)] 2 = (1 − 1/n)Var(Z), this yields the first part of the first in1 equality of the lemma. We must, however, also lower bound E[VarPbn (Z) 2 ]. Lemma A.3. Let Yi be random variables with finite 4th moment and assume that Cov(Yi2 , Yj2 ) ≤ σ 4 for all pairs i, j. Then we have the following inequalities: s P " n !1 1 # n n 2 1 2 4 1X 1X 2 2 1 i=1 Var(Yi ) + nσ n ≥ E −√ Yi E[Yi2 ] (31a) P n 1 2 n n n i=1 E[Yi ] n i=1 i=1 !1 " n Pn 1 # n 2 1 n1 i=1 Var(Yi2 ) + nσ 4 1X 1X 2 2 2 Yi E[Yi ] − ≥ . (31b) E 1 Pn 2] n n n E[Y i=1 i n i=1 i=1 Lemma A.4. Let Z1 , . . . , Zn be i.i.d variables with finite fourth moment. Let Yi = Zi − n1 Then " n !1  1 #  n 2 1X 1X 2 2 1 E[(Z − E[Z])4 ] 7 + 12/n 2 ≥ E Yi E[Yi ] + Var(Z) − n n n Var(Z) n i=1 Pn j=1 Zj . i=1 If maxj Zj − minj Zj ≤ C with probability 1, then for the constant cn = 1 + E " n 1X 2 Yi n i=1 1 # 2 ≥ !1 n 2 1X C2 E[Yi2 ] − cn . n n i=1 33 7 4n + 3 , n2 we have We provide the proof of Lemmas A.3 and A.4 in Sections A.2 and A.3, respectively. P Based on these lemmas, Lemma A.1 is immediate once we set Yi = Zi − n1 nj=1 Zj , so that P s2n = n1 ni=1 Yi2 , and apply Lemma A.4 with C = M . A.2 Proof of Lemma A.3 We first prove the claim (31a). To see this, we use that  2  √ a λ + inf = a2 = |a|, λ≥0 2λ 2 and taking derivatives yields that for all λ′ ≥ 0, q P n 1 By setting λn = " E λ a2 λ′ a2 + ≥ ′+ − 2λ 2 2λ 2 2 i=1 Yi , n n 1X 2 Yi n i=1 1 # 2  a2 1 2 − 2 ′ 2λ  (λ − λ′ ). we thus have for any λ ≥ 0 that  Pn  λn 2nλn 2 Pn  Pn    2 2 λ 1 i=1 Yi i=1 Yi ≥E + − (λn − λ) . +E 2nλ 2 2 2nλ2 =E 2 i=1 Yi + q P Now we take λ = n1 ni=1 E[Yi2 ], and we apply the Cauchy-Schwarz inequality to obtain " n 1 # 1X 2 2 E (32) Yi n i=1 1  1   2 1 1 2 ! ! ! 2 2 1   n n n n 2 2 X X X 2 1 1 1X 1 1   − E[Yi2 ] (Yi2 − E[Yi2 ])  E  Yi2 E[Yi2 ]   . ≥ − 2E n 2λ n n n i=1 i=1 i=1 We control each of these quantities in turn. First, our assumption that Cov(Yi2 , Yj2 ) ≤ σ 4 implies that  !2  n X 1 (Yi2 − E[Yi2 ])  E n i=1 n  1 X 1 X  2 1 = 2 Var(Yi2 ) + 2 E (Yi − E[Yi2 ])(Yj2 − E[Yj2 ]) ≤ n n n i=1 i6=j i=1 ! n 1X 2 4 Var(Yi ) + nσ . n i=1 q P P P 1 1 1 The triangle inequality implies that E[((n−1 ni=1 Yi2 ) 2 −(n−1 ni=1 E[Yi2 ]) 2 )2 ] 2 ≤ 2λ = 2 n1 ni=1 E[Yi2 ], so that substituting in inequality (32) we have !1 !1 " n 1 # n n 2 2 1 1X 1X 2 2 1X 2 2 4 Yi E[Yi ] Var(Yi ) + nσ − √ . E ≥ n n λ n n i=1 i=1 i=1 34 This is the bound (31a). Now we give the sharper result. We have   ! 1 2 1  X n n n 2 2 1X  2X  1 2 2  Yi E[Yi ] E[Yi2 ] − 2 − E = n n n i=1 i=1 i=1 2 ≤√ n ! 1  n 1  n 2 1X 2 2 1X 2 E E[Yi ] Yi n n i=1 i=1 n 1X Var(Yi2 ) + nσ 4 n i=1 !1 2 , where we have used the bound (31a). Returning to inequality (32), we obtain the second claim (31b) of the lemma. A.3 Proof of Lemma A.4 P As Yi = Zi − n1 nj=1 Zj , it is no loss of generality to assume that E[Z] = 0, as Yi is shift-invariant. The lemma follows immediately from Lemma A.3 once we prove the claims that Var(Y12 ) ≤ n−1 6 E[Z 4 ] + Var(Z)2 n n (33a) and 1 + 12/n E[(Y12 − E[Y12 ])(Y12 − E[Y12 ])] ≤ Var(Z)2 . (33b) n2 P Note that E[Yi2 ] = E[(Zi − n1 nj=1 Zj )2 ] = n−1 n Var(Z). We begin with the first inequality (33a). We have (n − 1)2 Var(Z)2 , Var(Y12 ) = E[Y14 ] − E[Y12 ]2 = E[(Z1 − Z n )4 ] − n2 P where we use the shorthand Z n = n1 nj=1 Zj . Expanding the first quantity, the fourth moment of Y1 , we have 2 3 4 E[(Z1 − Z n )4 ] = E[Z 4 ] − 4E[Z13 Z n ] + 6E[Z12 Z n ] − 4E[Z1 Z n ] + E[Z n ]. 3 Using that E[Z1 Z n ] = E[Z 4 ]/n3 + 1 3 4 2 n3 E[Z ] + n2 Var(Z) , we obtain 3(n−1) Var(Z)2 , n3 2 E[Z12 Z n ] = 1 E[Z 4 ] n2 + n−1 Var(Z)2 , n2    6 3 3n − 3 3 n−1 4 4 + 2 Var(Z)2 E[(Z1 − Z n ) ] ≤ 1 − + 2 − 3 E[Z ] + 6 2 − 4 n n n n n3 n 6 n−1 E[Z 4 ] + Var(Z)2 , ≤ n n 4  which is the result (33a). For the second claim (33b), we expand 2 Yi2 − E[Yi2 ] = Zi2 + Z n − 2Zi Z n − 35 n−1 Var(Z). n 4 and E[Z n ] ≤ The right-hand-side of Eq. (33b) is thus  i h 2 2 E Z12 − Var(Z) + n−1 Var(Z) + Z n − 2Z1 Z n Z22 − Var(Z) + n−1 Var(Z) + Z n − 2Z2 Z n h  i 2 = 2E (Z12 − Var(Z)) n−1 Var(Z) + Z n − 2Z2 Z n h  i 2 2 + E n−1 Var(Z) + Z n − 2Z1 Z n n−1 Var(Z) + Z n − 2Z2 Z n . (34) The first term above satisfies i Var(Z 2 ) i h h  2 2 E (Z12 − Var(Z)) n−1 Var(Z) + Z n − 2Z2 Z n = E (Z12 − Var(Z))Z n = . n2 The latter term (34) is equal to 4 1 2 2 4 3 2 Var(Z)2 + Var(Z)E[Z n ] − Var(Z)E[Z1 Z n ] + E[Z n ] − 4E[Z1 Z n ] + 4E[Z1 Z2 Z n ] 2 n n n   1 4 3 2 2 2 3 = − 2 Var(Z)2 + E[Z n ] − 4E[Z1 Z n ] + 4E[Z1 Z2 Z n ] = Var(Z n ) + 4 E[Z1 Z2 Z n ] − E[Z1 Z n ] . n 3 2 Var(Z)2 , E[Z1 Z2 Z n ] = As earlier, we have that E[Z1 Z n ] = E[Z 4 ]/n3 + 3(n−1) n3 4 and E[Z n ] ≤ 1 3 4 2 n3 E[Z ] + n2 Var(Z) , − 2 E[Z12 Z22 ] n2 = 2 Var(Z)2 , n2 so that we can bound the last term (34) by 3 3−n 12 − n 3 E[Z 4 ] + 2 Var(Z)2 + 4 3 Var(Z)2 ≤ Var(Z)2 . n3 n n n3 This yields the claim (33b). The final inequality, when Zi are bounded, follows immediately upon noticing that E[(Z − E[Z])4 ] ≤ C 2 Var(Z) when Z takes values in an interval of width at most C, and that moreover, in 2 this circumstance, Var(Z) ≤ C4 . B Proof of Theorem 2 Our starting point is to recall from inequality (30) in the proof of Theorem 1 that for each f ∈ F, 4ρM 2 the empirical variance equality (12) holds if n ≥ Var . As a consequence, Theorem 2 will follow b (f ) Pn if we can provide a uniform lower bound on the sample variances VarPbn (f ) that holds with high enough probability. We use C to denote a universal constant whose value may change from line to line. Noting that VarPbn (f ) = EPbn (f − E[f ])2 − (EPbn (f − E[f ]))2 , we proceed in two parts. First, we give a lower bound for EPbn (f − E[f ])2 . Lemma B.1. Let F be a collection of bounded functions f : X → [M0 , M1 ] with M := M1 − M0 . Then, with probability at least 1 − e−t , for every f ∈ F   M2 2 sup 2 3 (t + log log n) . Var(f ) ≤ 2EPbn (f − E[f ]) + C Rn (F) log (nM ) + n Proof X , let We follow the arguments of Srebro et al. [43] and Bousquet [13, Thm. 6.1]. For x1 , . . . , xn ∈ o n Fn,r := f − E[f ] ∈ F | EPbn [(f − E[f ])2 ] ≤ r , 36 where Pbn is the empirical measure on x1 , . . . , xn . Let ψnsup be a sub-root upper bound on the worst-case Rademacher complexity ψnsup (r) ≥ Rsup n (Fn,r ), where implicitly in the right hand side we take the supremum over x1 , . . . , xn definining Fn,r as well. The function t 7→ t2 has 2-Lipschitz derivatives, so we may apply Srebro et al. [43, Lemma 2.2] to obtain √ sup 3 2 2 (35) Rsup n (Fn,r ) ≤ C rRn (F) log n where we recall the notation that G 2 = {g 2 | g ∈ G} for any function class G. Thus we may take √ 3 sup 3 2 2 = C 2 Rsup ψnsup (r) = C rRsup n (F) log n. Since f ≥ 0, n (F) log 2 n, which has fixed point rn Theorem 6.1 of Bousquet [13] yields that for all f ∈ F,   M2 2 sup 2 3 2 E(f − E[f ]) ≤ 2EPbn (f − E[f ]) + C Rn (F) log nM + (t + log log n) n with probability at least 1 − e−t . Next, we give an upper bound for (EPbn (f − E[f ]))2 . We use the following version of Talagrand’s inequality due to Bousquet [12, 14]. (See also Bartlett et al. [3, Thm 2.1].) Lemma B.2. Let r > 0 and F be a class of functions that map X into [a, b] such that for every f ∈ F, Var(f (X)) ≤ r. Then, with probability at least 1 − e−t ( r  ) 1 t 1 2rt + (b − a) + sup {E[f ] − EPbn [f ]} ≤ inf 2(1 + α)E[Rn (F)] + . α>0 n n 3 α f ∈F The same statement holds with supf ∈F (EPbn [f ]−E[f ]) replacing the left-hand side of the inequalities. Applying Lemma B.2 and letting α = 12 , with probability at least 1 − 2e−t r 2t |EPbn [f ] − E[f ]| ≤ 3E[Rn (F)] + 2M n holds for all f ∈ F. Combining the above display with Lemma B.1, we obtain the desired result. C Proof of Theorem 3 Before proving the theorem proper, we state a technical lemma that provides uniform Bernstein-like bounds for the class F using empirical ℓ∞ -covering numbers. 2 Lemma C.1 (Maurer and Pontil [33], Theorem 6). Let n ≥ 8Mt and t ≥ log 12. Then with probability at least 1 − 6N∞ (F, ǫ, 2n)e−t , we have s r ! 2VarPbn (f )t 15M t 2t ǫ (36) + +2 1+2 E[f ] ≤ EPbn [f ] + 3 n n n for all f ∈ F. 37 We return to the proof of Theorem 3. Let E1 denote that the event that the inequalities (36) hold. Then on E1 hold, uniformly over f ∈ F we have s r ! 18VarPbn (f (X))t 15M t 2t ǫ + +2 1+2 E[f ] ≤ EPbn [f ] + n n n s (i) 2ρVarPbn (f (X)) ≤ sup EP [f (X)] + n ρ P :Dφ (P ||Pbn )≤ n s  r ! 2ρVarPbn (f (X)) 2M ρ 2t 5M ρ  + − ǫ − +2 1+2 n n 3n n + r ! 11 M ρ 2t ǫ for all f ∈ F, (37) +2 1+2 ≤ sup EP [f (X)] + 3 n n P :D (P ||Pbn )≤ ρ φ n where inequality (i) follows from the bounds (10) in Theorem 1 and the fact that ρ ≥ 9t by assumption. This gives the first result (15). For the second result (16), we recall that fb ∈ argminf ∈F supP {EP [f (X)] : Dφ (P ||Pbn ) ≤ nρ }, and we bound the supremum term in expression (37). First, we note that because fb minimizes the supremum term in expression (37), we have r ! 11M ρ 2t +2 1+2 ǫ for all f ∈ F. EP [f (X)] + E[fb] ≤ sup 3n n P :D (P ||Pbn )≤ ρ φ n Now fix f ∈ F. As the function f is fixed, by Bernstein’s inequality, we have r 2Var(f )t 2M t EPbn [f ] ≤ E[f ] + + n 3n with probability at least 1 − e−t . Similarly, we have by Lemma A.1 that r q p p 2tM 2 −1 VarPbn (f ) ≤ 1 − n Var(f ) + n with probability at least 1 − e−t . That is, for any fixed f ∈ F, we have with probability at least 1 − 2e−t that s (i) 2ρVarPbn (f ) sup EP [f (X)] ≤ EPbn [f ] + n ρ P :Dφ (P ||Pbn )≤ n r r p 2Var(f )t 2M 2ρVar(f ) 2 M 2 ρt ≤ E[f ] + + t+ + 3n n n r n (ii) 2Var(f )ρ 8 M ρ + , ≤ E[f ] + 2 n 3 n 38 where inequality (i) follows from the uniform upper bound (10) of Theorem 1 and inequality (ii) from our assumption that ρ ≥ t. Substituting this expression into our earlier bound (37) yields that for any f ∈ F, with probability at least 1 − 2(3N∞ (F, ǫ, 2n) + 1)e−t , we have r E[fb(X)] ≤ E[f (X)] + 2 r ! 2ρVar(f (X)) 19 M ρ 2t ǫ. + +2 1+2 n 3 n n This gives the theorem. D Proof of Theorem 4 We first show the following version of uniform Bernstein’s inequality with Rademacher complexities. The proof uses a peeling technique [3, 46], in conjuction with Talagrand’s concentration inequality (Lemma B.2). Lemma D.1. Let r > 0 and F be a collection of bounded functions f : X → [0, M ] with Var(f (X)) ≤ r. Then, with probability at least 1 − e−t , for every f ∈ F r l l 2eVar(f )  nr m 7M  nr m t + log log 2 + 6E[Rn (F)] + t + log log 2 . E[f ] ≤ EPbn [f ] + n M t n M t The same statements hold with the roles of E[f ] and EPbn [f ] reversed. 2 We defer the proof to section D.1 at the end of this section. Because  Var(f ) ≤nM for all f ∈ F,   n nr Lemma D.1 also holds if we replace the terms log M 2 t with log t ≤ 1 + log t . Next, we show an important extension of Lemma D.1 that replaces the Rademacher complexity term E[Rn (F)] by a local quantity rn⋆ , the fixed point of ψn (r). To this end, we use another peeling argument and apply Lemma D.1 to the self-normalized class r   r Gr := f : f ∈ F ⊆ cf : f ∈ F, E[c2 f 2 ] ≤ r, c ∈ [0, 1] . 2 E[f ] ∨ r This idea follows the techniques p of Bartlett et al. [3, Thm. 3.3], though we use a type of selfnormalizing scale, that is, f / E[f 2 ], whereas they use a variance-normalizing scaling by studying classes of functions of the form f /E[f 2 ]. Our use of this alternative normalization is important in the next lemma, which allows us to obtain bounds that apply to the robustly regularized risk. Lemma D.2. Let F be a collection of bounded functions f : X → [0, M ] satisfying the localization  inequality (20) for some sub-root function ψn (·) with root rn⋆ . Let Bn = n1 t + log log nt . Then with probability at least 1 − e−t , for every f ∈ F p p p 2eBn + 6 rn⋆ + 7M Bn /3 E[f 2 ] + 6rn⋆ + 14M Bn . E[f ] ≤ EPbn [f ] + The same statement holds with the roles of E[f ] and EPbn [f ] reversed. See Section D.2 for the proof. Next, we give an analogous result for f 2 . 39 Lemma D.3. Let F be a collection of bounded functions f : X → [0, M ] satisfying the localization inequality (20) for some sub-root function ψn (·) with root rn⋆ . Let η > 0. Then, with probability at least 1 − e−t , for every f ∈ F   Mt 7 1 4+ M . E[f 2 ] ≤ EPbn [f 2 ] + EPbn [f 2 ] + 72M 2 (1 + η)rn⋆ + η n 3 Also, with probability at least 1 − e−t , for every f ∈ F Mt η E[f 2 ] + 72M 2 (1 + η)rn⋆ + EPbn [f ] ≤ E[f ] + 1+η n 2 2  7 4+ M 3  . See Section D.3 for the proof. Now, we make two additional pieces of shorthand notation. Let Vn = 4((2e + 84M )Bn + 36rn⋆ ). Then, Lemma D.2 implies that E[f ] ≤ EPbn [f ] + p Vn E[f 2 ] + 6rn⋆ + 14M Bn with probability at least 1 − e−t . Applying Lemma D.3 to this bound with the choice η = 1 immediately yields that q E[f ] ≤ EPbn [f ] + 2Vn EPbn [f 2 ] + 144M 2 Vn rn⋆ + 7Vn M max{M, 1}t/n + 6rn⋆ + 14M Bn s   q 7 max{M, 1} t 2 ⋆ + 6rn⋆ + 14M Bn ≤ EPbn [f ] + 2Vn EPbn [f ] + 12M Vn rn + M n for all f ∈ F with probability at least 1 − 2e−t . Subtracting and adding (EPbn [f ])2 to the second term, we have q q q p 2Vn EPbn [f 2 ] = 2Vn VarPbn (f ) + 2Vn EPbn [f ]2 ≤ 2Vn VarPbn (f ) + 2Vn EPbn [f ], where we have used that f ≥ 0. We thus obtain s   7 max{M, 1} t + 6rn⋆ + 14M Bn Vn rn⋆ + M n     q p 7 max{M, 1}t ⋆ ≤ 1 + 2Vn EPbn [f ] + 2Vn VarPbn (f ) + 6M Vn + 6M rn + + 6rn⋆ + 14M Bn , Mn √ where the second inequality follows because ab ≤ 21 a + 12 b for a, b ≥ 0. Recalling the bound (21), which implies ρ ≥ nVn , ρ ≥ n(rn⋆ + 7 max{M,1}t ), and ρ/n ≥ 6rn⋆ + 14M Bn , we obtain that Mn r r ! 13M ρ 2ρ 2ρ VarPbn (f ) + . EPbn [f ] + E[f ] ≤ 1 + n n n   q p E[f ] ≤ 1 + 2Vn EPbn [f ] + 2Vn VarPbn (f ) + 12M 40 Theorem 1 implies EPbn [f ] + we arrive at q 2ρ n VarPbn (f ) r E[f ] ≤ 1+2 2ρ n ! ≤ supP :Dφ (P ||Pbn )≤ ρ EP [f (X)] + n sup ρ P :Dφ (P ||Pbn )≤ n EP [f (X)] + r 13 + 4 2M ρ n , 2ρ n ! so we immediately Mρ n for all f ∈ F with probability at least 1 − 2e−t . This is the first result (22). To show the second result, we simply apply Bernstein’s inequality and the concentration inequalities for the standard deviation in Lemma A.1. For any fixed f ∈ F, by Bernstein’s inequality, we have r 2tVar(f ) 2M t EPbn [f ] ≤ E[f ] + + n 3n with probability at least 1 − e−t . From Lemma A.1, we have q VarPbn (f ) ≤ p 1 − n−1 p Var(f ) + r 2tM 2 n with probability at least 1 − e−t . We thus obtain that for any fixed f , r r r √ 2ρ 2t 2ρ 2M ρt 2M t EP [f ] ≤ EPbn [f ] + sup VarPbn (f ) ≤ E[f ] + Var(f ) + Var(f ) + + n n n n 3n P :D (P ||Pbn )≤ ρ φ n √ √ with probability at least 1 − 2e−t . Noting that ρ ≥ 45M t by assumption (21), so ρ + t ≤ p p √ 46ρ/45 + 45t ≤ 91ρ/45 and that always 2 ρt ≤ 3ρ + 13 t, we have that with probability at least 1 − 2e−t that r 3M ρ M t 91ρ Var(f ) + + . sup EP [f ] ≤ E[f ] + 45n n n P :D (P ||Pbn )≤ ρ φ n Noting that we could take f to minimize the right hand side of the preceding expression and that fb minimizes supP :Dφ (P ||Pbn )≤ρ/n EP [f ], we have the result (23). D.1 Proof of Lemma D.1 We first show the claim for g ∈ Fcentered = {f − E[f ] : f ∈ F}. To see the claim for g ∈ Fcentered , let us fix L ∈ N to be chosen later, and for l = 1, . . . , L − 1 define the classes n o  Fl := g ∈ Fcentered : e−l r < E[g2 ] ≤ e−(l−1) r , FL := g ∈ Fcentered : E[g 2 ] ≤ e−L r so that Fcentered = ∪L l=1 Fl . Let z > 0 be such that t ≤ z. Applying Lemma B.2 (with the choice α = 12 ) to Fl for each l = 1, . . . , L − 1, we have with probability at least 1 − e−t , for every g ∈ Fl r t 2te−(l−1) r + 3E[Rn (Fl )] + 5M E[g] ≤ EPbn [g] + n n r t 2et ≤ EPbn [g] + E[g2 ] + 3E[Rn (Fl )] + 5M n n 41 where in the last line we have used e−l r ≤ E[g2 ] for g ∈ Fl . Similarly, applying Lemma B.2 to FL , then with probability at least 1 − e−t , for every g ∈ FL r t 2te−L r + 3E[Rn (FL )] + 5M E[g] ≤ EPbn [g] + n n r r −L t 2et 2te r ≤ EPbn [g] + E[g2 ] + + 3E[Rn (FL )] + 5M . n n n Taking a union bound, we have with probability at least 1 − Le−t , for every g ∈ Fcentered r r t 2et 2te−L r 2 E[g ] + 3E[Rn (Fcentered )] + 5M + . E[g] ≤ EPbn [g] + n n n   Noting that E[Rn (Fcentered )] ≤ 2E[Rn (F)] by Jensen’s inequality, we take L = log Mrn2 t and map t to t + log L to obtain the lemma. The case when the roles of E[f ] and EPbn [f ] are reversed follows similarly. D.2 Proof of Lemma D.2 Let r ≥ rn⋆ be an arbitrary but fixed value to be choosen later. Using this r, define the selfnormalized class of functions  r  r f : f ∈ F ⊆ cf : f ∈ F, E[c2 f 2 ] ≤ r, c ∈ [0, 1] . Gr := 2 E[f ] ∨ r From the truncation by r, we have E[g2 ] ≤ r for all g ∈ Gr . Lemma D.1 implies that with probability at least 1 − e−t , uniformly over g ∈ Gr r l  l 2e 7M  n m n m E[g] ≤ EPbn [g] + + 6E[Rn (Gr )] + t + log log . (38) E[g 2 ] t + log log n t n t Using the sub-root property of ψn and that ψn (rn⋆ ) = rn⋆ , we have the inequality p p √ √ √ ψn (r) = rψn (r)/ r ≤ rψn (rn⋆ )/ rn⋆ = rrn⋆ for any r ≥ rn⋆ , so p  E[Rn Gr ] ≤ E[Rn cf : f ∈ F, E[c2 f 2 ] ≤ r, c ∈ [0, 1] ] ≤ ψn (r) ≤ rrn⋆   Using this upper bound in Eq. (38) and recalling the notation Bn = n1 t + log log nt , we get E[g] ≤ EPbn [g] + p p 2eBn E[g 2 ] + 6 rn⋆ r + 7M Bn . (39) Now, we return to choose the value r to optimize the bound (39). let r be the largest solution √ to 6 rn⋆ r + 7M Bn = 6r. The following elementary lemma provides a bound on r. Lemma D.4. Let x be the largest solution to ax + b = a2 d2 + 2bd. 42 x2 d where a, b, d > 0. Then a2 d2 ≤ x2 ≤   √ From the quadratic formula, we have x = 21 ad + a2 d2 + 4b from which the lower √ √ √ bound follows. From convexity of z 7→ z 2 and z1 + z2 ≤ z1 + z2 for z1 , z2 > 0, we obtain the upper bound. Lemma D.4 immediately yields 7M Bn rn⋆ ≤ r ≤ rn⋆ + . 3 q For each g ∈ Gr , there exists f ∈ F such that g = E[f r2 ]∨r f . If E[f 2 ] ≤ r, we have g = f and Proof the bound (39) yields p 2eBn E[f 2 ] + 6rn⋆ + 14M Bn . √ If E[f 2 ] > r, rescaling g in the bound (39) and using the choice 6r = 6 rn⋆ r + 7M Bn yields p p E[f ] ≤ EPbn [f ] + 2eBn E[f 2 ] + 6 rE[f 2 ] p p ≤ EPbn [f ] + 2eBn E[f 2 ] + 6 (rn⋆ + 7M Bn /3)E[f 2 ] E[f ] ≤ EPbn [f ] + instead. Combining the cases E[f 2 ] ≶ r, we conclude that for all f ∈ F, p p p E[f ] ≤ EPbn [f ] + 2eBn + 6 rn⋆ + 7M Bn /3 E[f 2 ] + 6rn⋆ + 14M Bn with probability at least 1 − e−t . Similarly, we can reverse the roles of E[f ] and EPbn [f ] to get the second result. D.3 Proof of Lemma D.3 We frequently use the Rademacher contraction principle [28, Thm. 4.12] in what follows. Lemma D.5. Let φ : R → R be L-Lipschitz. Then, for every class G Eǫ [Rn (φ ◦ G)] ≤ LEǫ [Rn (G)] where φ ◦ G = {φ ◦ f : f ∈ G}. As in Section D.2, define the self-normalized functions in F r   r Gr := f : f ∈ F ⊆ cf : f ∈ F, E[c2 f 2 ] ≤ r, c ∈ [0, 1] E[f 2 ] ∨ r where r ≥ rn⋆ will be choosen later. Let Gr2 = {g2 : g ∈ Gr }. From the truncation by r, we have that for all g2 ∈ Gr2 , Var(g2 ) ≤ E[g4 ] ≤ M 2 E[g2 ] ≤ M 2 r. Let c1 = 3 and c2 = 37 . Then by Lemma B.2 applied to Gr2 , with probability at least 1 − e−t , for every g ∈ Gr r M 2t 2rt 2 2 2 E[g ] ≤ EPbn [g ] + c1 E[Rn (Gr )] + M + c2 n n r (a) 2rt c2 M 2 t + ≤ EPbn [g 2 ] + 2c1 M E[Rn (Gr )] + M n n r 2 (b) p 2rt c2 M t + (40) ≤ EPbn [g2 ] + 2c1 M rrn⋆ + M n n 43 where in step (a) we used the contraction principle (Lemma D.5) and that x 7→ x2 is 2M -Lipschitz √ on [−M, M ], and in step (b), we used that ψn (r) ≤ rrn⋆ as in the proof of Lemma D.2 in Section D.2. q √ ⋆ c2 M 2 t Let A = 2c1 M rn + M 2t n and D = n . For any fixed K > 1, choose r to be the largest √ r solution to A r + D = K so that the bound (40) becomes E[g2 ] ≤ EPbn [g2 ] + r . D From Lemma D.4, we have K 2 A2 ≤ r ≤ K 2 A2 + 2KD and in particular, r ≥ K 2 A2 ≥ rn⋆ . For each g ∈ Gr , there exists f ∈ F such that g = If E[f 2 ] ≤ r, rescaling the inequality (40) and using the upper bound on r, we obtain E[f 2 ] ≤ EPbn [f 2 ] + q r f. E[f 2 ]∨r r ≤ EPbn [f 2 ] + KA2 + 2D. K If E[f 2 ] > r, rescaling instead yields E[f 2 ] ≤ EPbn [f 2 ] + E[f 2 ] . K Combining the two cases, we obtain E[f 2 ] ≤ K E b [f 2 ] + KA2 + 2D. K − 1 Pn   2 Noting that A ≤ 2 4c21 M 2 rn⋆ + 2 Mn t by convexity, we have the first result once we replace K with η = K − 1 > 0. The second result similarly follows by reversing the roles of E[f ] and EPbn [f ] in the above argument. E Proof of Theorem 5 Recall our shorthand notation that π(θ) = argminθ∗ ∈S⋆ {kθ − θ ∗ k2 } denotes the Euclidean projection of θ onto S⋆ , which is a closed convex set. Define also the localized empirical deviation function ∆n (θ) := E [ℓ(θ; X) − ℓ(π(θ); X)] − EPbn [ℓ(θ; X) − ℓ(π(θ); X)] . (41) We begin with the following Claim E.1. If Sb⋆ǫ 6⊂ S⋆2ǫ , then ( sup θ∈S⋆2ǫ ∆n (θ) + r 2ρ VarPbn (ℓ(θ; X) − ℓ(π(θ); X)) n ) ≥ ǫ. (42) Deferring the proof of the claim, let us prove the theorem. First, the growth condition (26) shows that (  1 ) (  1 ) γ 2ǫ 2ǫ γ S⋆2ǫ ⊂ θ ∈ Θ : kθ − π(θ)k2 ≤ = θ ∈ Θ : dist(θ, S⋆ ) ≤ . λ λ 44 Therefore, we have for all θ ∈ S⋆2ǫ that 2 2 VarPbn (ℓ(θ; X) − ℓ(π(θ); X)) ≤ L dist(θ, S⋆ ) ≤ L 2 γ 2  2ǫ λ 2 γ , 1 and so by the assumption (27) that ǫ ≥ ( 8Ln ρ ) 2(γ−1) ( λ2 ) γ−1 , we have r 2ρ VarPbn (ℓ(θ; X) − ℓ(π(θ); X)) ≤ L n r 2ρ n  2ǫ λ 1 γ ǫ ≤ . 2 In particular, if the event (42) holds then ǫ sup ∆n (θ) ≥ , 2 θ∈S⋆2ǫ and recalling the definition (41) of ∆n , it then follows that   P Sb⋆ǫ 6⊂ S⋆2ǫ ≤ P ǫ sup ∆n (θ) ≥ 2 θ∈S⋆2ǫ ! . (43) To bound the probability (43), we use standard bounded difference and symmetrization arguments [e.g. 11, Theorem 6.5]. Letting f (X1 , . . . , Xn ) := supθ∈S⋆2ǫ ∆n (θ), the function f satisfies bounded differences: sup |f (X1 , · · · , Xj−1 , x, Xj+1 , · · · , Xn ) − f (X1 , · · · , Xj−1 , x′ , Xj+1 , · · · , Xn )| x,x′ ∈X 1 1 (ℓ(θ; x) − ℓ(π(θ); x)) − (ℓ(θ; x′ ) − ℓ(π(θ); x′ )) n x,x′ ∈X θ∈S⋆2ǫ n  1 2L 2ǫ γ 2L sup dist(θ, S⋆ ) ≤ ≤ n θ∈S⋆2ǫ n λ ≤ sup sup for j = 1, . . . , n. Using the standard symmetrization inequality E[supθ∈S⋆2ǫ ∆n (θ)] ≤ 2E[Rn (S⋆2ǫ )] and the bounded differences inequality [11, Theorem 6.5], we have !  2 ! 2 λ γ nt P sup ∆n (θ) ≥ 2E[Rn (S⋆2ǫ )] + t ≤ exp − 2 2L 2ǫ θ∈S⋆2ǫ 2 nt2 λ γ for all t ≥ 0. Letting u = 2L above and recalling the assumption (27) upper bounding 2 2ǫ 2ǫ E[Rn (S⋆ )], we have P(supθ∈S⋆2ǫ ∆n (θ) ≥ 2ǫ ) ≤ e−u . The theorem follows from the bound (43). Proof of Claim E.1 If Sb⋆ǫ 6⊂ S⋆2ǫ , then certainly it is the case that there is some θ ∈ Θ \ S⋆2ǫ such that Rn (θ, Pn ) ≤ inf Rn (θ, Pn ) + ǫ ≤ Rn (π(θ), Pn ) + ǫ. θ∈Θ Using the convexity of Rn , we have for all t ∈ [0, 1] that Rn (tθ + (1 − t)π(θ), Pn ) ≤ tRn (θ, Pn ) + (1 − t)Rn (π(θ), Pn ) ≤ Rn (π(θ), Pn ) + tǫ. 45 For all t ∈ [0, 1], we have by definition of orthogonal projection (because the vector θ − π(θ) belongs to the normal cone to S⋆ at π(θ); cf. [24, Prop. III.5.3.3]) that π(tθ + (1 − t)π(θ)) = π(θ). Thus, choosing t appropriately, there exists θ ′ ∈ bd S⋆2ǫ with θ ′ = tθ + (1 − t)π(θ), π(θ ′ ) = π(θ), and Rn (θ ′ , Pn ) ≤ Rn (π(θ ′ ), Pn ) + ǫ. Adding and subtracting the risk R(θ) and R(π(θ)), we have that for some θ ∈ bd S⋆2ǫ that Rn (θ, Pn ) − R(θ) + R(π(θ)) − Rn (π(θ), Pn ) ≤ R(π(θ)) − R(θ) + ǫ ≤ −ǫ, where we have used that R(θ) = R(π(θ)) + 2ǫ by construction. Multiplying by −1 on each side of the preceding display and taking suprema, we find that ǫ ≤ sup {R(θ) − Rn (θ, Pn ) − (R(π(θ)) − Rn (π(θ), Pn ))} θ∈S⋆2ǫ ≤ sup sup θ∈S⋆2ǫ P :Dφ (P ||Pbn )≤ρ/n {R(θ) − R(π) + EP [ℓ(π(θ); X) − ℓ(θ; X)]} . Applying the upper bound in inequality (10) of Theorem 1 gives the claim. F Proof of Theorem 6 We begin by establishing a few technical lemmas, after which the proof of the theorem follows essentially standard arguments in asymptotics. To prove Theorem 6, we first show that (eventually) we have the exact expansion s 2ρVarPbn (ℓ(θ, X)) Rn (θ, Pn ) = EPbn [ℓ(θ, X)] + n for all θ in a neighborhood of θ ⋆ . As in the proof of Theorem 1, this exact equality holds once there is suitable variability in the values ℓ(θ, Xi ) over i = 1, . . . , n, however, we require a bit more care as the values ℓ(θ, Xi ) may be unbounded below and above. Heuristically, however, assuming that 1 we have this exact expansion and that θbnrob − θ ⋆ = OP (n− 2 ), then we can write the expansions 0 = ∇θ Rn (θbnrob , Pn ) s   X n n X 2ρVarPbn (ℓ(θbnrob , X)) 1 1 1 =∇ ℓ(θ ⋆ , Xi ) + ∇2 ℓ(θ ⋆ , Xi ) (θbnrob − θ ⋆ ) + ∇ + oP (n− 2 ) n n n i=1 i=1 r n 1 1X 2ρVar(ℓ(θ ⋆ , X)) = ∇ℓ(θ ⋆ , Xi ) + ∇2 R(θ ⋆ )(θbnrob − θ ⋆ ) + ∇ + oP (n− 2 ). n n i=1 p √ Multiplying by n and solving for θbnrob in the preceding expression, computing ∇ Var(ℓ(θ ⋆ , X)) then yields the theorem. The remainder of the proof makes this heuristic rigorous, and the outline is as follows: 1. We show that there is a uniform expansion of the form (12) in a neighborhood of θ ⋆ . (See Section F.1.) 2. Using the uniform expansion, we can then leverage standard techniques for asymptotic analysis of finite-dimensional estimators (see, e.g. van der Vaart and Wellner [47] or Lehmann and Casella [29]), which proceed by performing a Taylor expansion of the objective in a neighborhood of the optimum and using local asymptotic normality arguments. (See Section F.2.) 46 F.1 The uniform variance expansion To lighten notation, we define a few quantities similar to those used in the proof of Theorem 1. Let Z(θ) := ℓ(θ, X) − E[ℓ(θ, X)] be the deviation of ℓ(θ, X) around its mean (the risk), and similarly let Zi (θ) be the version of this quantity for observation Xi . In addition, let s2n (θ) = VarPbn (Z(θ)) be the empirical variance of Z(θ), which is identical to the empirical variance of ℓ(θ, X). Now, recall the problem maximize EP [Z(θ)] subject to Dφ (P ||Pbn ) ≤ P ρ , n P and for each θ ∈ Θ, let p(θ) = argmaxp∈Pn ni=1 pi Zi (θ) be the solution (probability) vectors. Following expression (9) we see for any ǫ ≥ 0 that √ 2ρ(Zi (θ) − Z(θ)) √ min ≥ −1 for all θ ∈ θ ⋆ + ǫB nsn (θ) i∈[n] is sufficient for the exact variance expansion to hold. We now show that this is indeed likely. Let ǫ > 0 be small enough that Assumption A holds, that is, the random Lipschitz function L(X) satisfies |ℓ(θ, x) − ℓ(θ ′ , x)| ≤ L(x)kθ − θ ′ k for θ, θ ′ ∈ θ ⋆ + ǫB. Then because √ √ nsn (θ) − nsn (θ ′ ) ≤ ≤ q P n 1 so θ 7→ sn (θ) is inf sup n X u:kuk2 ≤1 i=1 sup n X u:kuk2 ≤1 i=1  ui ℓ(θ, Xi ) − ℓ(θ ′ , Xi ) ui L(Xi ) θ − θ ′ v u n uX L2 (Xi ) θ − θ ′ ≤t n 2 i=1 L(Xi ) -Lipschitz for θ ∈ θ ⋆ + ǫB, we have min √  θ∈θ ⋆ +ǫB i∈[n] 2ρ(Zi (θ) − Z(θ)) √ nsn (θ) i=1 √ 2ρ(Zi (θ ⋆ ) − Z(θ ⋆ ) − 2ǫL(Xi )) ≥ min r  q P . i∈[n] n 1 ⋆ 2 n sn (θ ) − ǫ n j=1 L(Xj ) Summarizing our development thus far, we have the following lemma. Lemma F.1. Let the conditions of the previous paragraph hold. Then v 1  X n o √ u np u 2 1 ⋆ ⋆ t 2 ⋆ L(Xi ) 2ρ(Zi (θ ) − Z(θ ) − 2ǫL(Xi )) ≥ n sn (θ ) − ǫ min n i∈[n] i=1 implies that Rn (θ, Pn ) = EPbn [ℓ(θ, X)] + r 2ρ VarPbn (ℓ(θ, X)) for all θ ∈ θ ⋆ + ǫB. n 47 Now, we use the following standard result to show that the conditions of Lemma F.1 eventually hold with probability one. Lemma F.2 (Owen [37], Lemma 3). Let Yi be independent random variables with supi E[Yi2 ] < ∞. 1 a.s. Then n− 2 max1≤i≤n |Yi | → 0. Based on Lemma F.2 and the strong law of large numbers, we see immediately that 1 1 a.s. a.s. √ max |Zi (θ ⋆ )| → 0, and √ max L(Xi ) → 0, n 1≤i≤n n 1≤i≤n because E[Z(θ ⋆ )2 ] < ∞ and E[L(Xi )2 ] < ∞. Applying the strong law of large numbers to obtain v u n p u1 X a.s. p ⋆ a.s. ⋆ sn (θ ) → Var(ℓ(θ , X)) and t L(Xi )2 → E[L(X)2 ], n i=1 we see immediately that for small enough ǫ > 0, the condition of Lemma F.1 holds eventually with probability 1. That is, the following uniform expansion holds. Lemma F.3. There exists ǫ > 0 such that, with probability 1, there exists an N (which may be random) such that n ≥ N implies s 2ρVarPbn (ℓ(θ, X)) for all θ ∈ θ ⋆ + ǫB. Rn (θ, Pn ) = EPbn [ℓ(θ, X)] + n F.2 Asymptotics and Taylor expansions Let En,exact be the event that the exact variance expansion of Lemma F.3 occurs for θ ∈ θ ⋆ + ǫB. Now that we know that P(En,exact eventually) = 1, we may perform a few asymptotic expansions of the variance-regularized objective to provide the convergence guarantees specified by the theorem. We use the following lemma. Lemma F.4. Let the conditions of the theorem hold. If a.s. θbnrob ∈ argmin Rn (θ, Pn ) then θbnrob → θ ⋆ . (44) θ The proof is standard, but for completeness we include it in Section G.3. By combining Lemmas F.3 and F.4, we see that with probability 1, for any ǫ > 0, we eventually have both r 2ρ rob rob ⋆ rob VarPbn (ℓ(θbnrob , X)). kθbn − θ k2 < ǫ and Rn (θbn , Pn ) = EPbn [ℓ(θbn , X)] + n Assume for the remainder of the argument that both of these conditions hold. Standard results on subdifferentiability of maxima of collections of convex functions [24, Chapter X] give that Rn (θ, Pn ) is differentiable near θ ⋆ , and thus r 2ρ rob rob VarPbn (ℓ(θbnrob , X)) 0 = ∇Rn (θbn , Pn ) = EPbn [∇ℓ(θbn , X)] + ∇ n i h r brob , X) − E b [∇ℓ(θbrob , X)])(ℓ(θbrob , X) − E b [ℓ(θbrob , X)]) n E (∇ℓ( θ X b n n n n Pn Pn 2ρ Pn 1 q ∇ℓ(θbnrob , Xi ) + . = n n Var (ℓ(θbrob , X)) i=1 Pbn n (45) 48 a.s. Because θbnrob → θ ⋆ , by the continuous mapping theorem and local uniform convergence of the empirical expectations EPbn [·] to E[·], the second term of expression (45) satisfies i h EPbn (∇ℓ(θbnrob , X) − EPbn [∇ℓ(θbnrob , X)])(ℓ(θbnrob , X) − EPbn [ℓ(θbnrob , X)]) Cov(∇ℓ(θ ⋆ , X), ℓ(θ ⋆ , X)) q p +oP (1). = ⋆ , X)) Var(ℓ(θ rob b VarPbn (ℓ(θn , X)) {z } | =:b(θ ⋆ ) For simplicity, we let b(θ ⋆ ) denote the final term, which we shall see becomes an asymptotic bias. Thus, performing a Taylor expansion of the terms ∇ℓ(θbnrob , Xi ) around θ ⋆ in equality (45), there exist (random) error matrices En (Xi ), where kEn (Xi )k ≤ H(Xi )kθbnrob − θ ⋆ k by Assumption A, such that r n  rob 2ρ 1X 2 ⋆ ⋆ ⋆ b (b(θ ⋆ ) + oP (1)) ∇ ℓ(θ , Xi ) + En (Xi ) (θn − θ ) + 0 = EPbn [∇ℓ(θ , X)] + n n i=1 r  rob 2ρ ⋆ 2 ⋆ ⋆ b = EPbn [∇ℓ(θ , X)] + ∇ R(θ ) + oP (1) (θn − θ ) + (b(θ ⋆ ) + oP (1)). n √ Multiplying both sides by n, using that ∇2 R(θ ⋆ ) + oP (1) is eventually invertible, and applying the continuous mapping theorem, we have n p √ 1 X n(θbnrob − θ ⋆ ) = −(∇2 R(θ ⋆ ) + oP (1))−1 √ ∇ℓ(θ ⋆ , Xi ) − 2ρb(θ ⋆ ) + oP (1). n i=1 The first term on the right side of the above display converges in distribution to a N(0, Σ) distribution, where Σ = (∇2 R(θ ⋆ ))−1 Cov(∇ℓ(θ ⋆ , X))(∇2 R(θ ⋆ ))−1 , so that √  p  d n(θbnrob − θ ⋆ ) → N − 2ρ b(θ ⋆ ), Σ as claimed in the theorem statement. G G.1 Proofs of Technical Lemmas Proof of Inequality (24) Define the Gaussian complexity " Gn ({ℓ ◦ H}≤r ) := E sup h∈BH ,c∈[0,1] X # gi cℓ(h(xi ), yi ) | E[ℓ(h(X), Y )2 ] ≤ r/c2 , iid (46) where gi ∼ N(0, 1) (here we recall the standard result [2] that Gaussian complexity upper bounds Rademacher complexities up to a constant). Now, the set h − h⋆ such that h ∈ BH is contained in 2BH , which is convex. Moreover, we have E[ℓ(h(X), Y )2 ] = E[(h(X) − h⋆ (X))2 ] + σ 2 , and so we have for any c that {h ∈ BH | c2 E[ℓ(h(X), Y )2 ] ≤ r} ⊂ {h ∈ BH | E[(h(X) − h⋆ (X))2 ] ≤ r/c2 }, 49 and E[ℓ(h(X), Y )2 ] ≤ r/c2 also implies σ 2 ≤ r/c2 . Returning to expression (46) and enlarging the sets over which we take suprema, we thus obtain # " n X r r gi |c1 (h(xi ) − h⋆ (xi )) − c2 ξi | | E[(h(X) − h⋆ (X))2 ] ≤ 2 , σ 2 ≤ 2 Gn (ℓ ◦ H) ≤ E sup c1 c2 h∈BH ,c1 ,c2 ∈[0,1] i=1 # " n X ≤E sup gi |f (xi ) − cξi | | E[f (X)2 ] ≤ r, σ 2 ≤ r/c2 , f ∈2BH ,c∈[0,1] i=1 where we have used that h − h⋆ ∈ 2BH and that the set BH is convex to obtain the second inequality. We now upper bound the final display using the classical Sudakov-Fernique comparison theorem [e.g. 17]. Indeed, define the two Gaussian processes indexed by f ∈ H and c ∈ [0, 1] Pn Pn Pn iid by Yf,c = i=1 gi |f (xi ) − cξi | and Zf,c = i=1 gi f (xi ) + c i=1 wi ξi , where gi ∼ N(0, 1) and iid wi ∼ N(0, 1). Then we have for any f1 , f2 ∈ H and c1 , c2 ∈ [0, 1] that E[(Yf1 ,c1 − Yf2 ,c2 )2 ] = ≤ n X i=1 n X (|f1 (xi ) − c1 ξi | − |f2 (xi ) − c2 ξi |)2 (f1 (xi ) − f2 (xi ) + (c2 − c1 )ξi )2 i=1 n X ≤2 i=1 (f1 (xi ) − f2 (xi ))2 + 2(c2 − c1 )2 n X ξi2 . i=1 Pn 2 2 2 Moreover, E[(Zf1 ,c1 − Zf2 ,c2 )2 ] = i=1 (f1 (xi ) − f2 (x√ i )) + (c1 − c2 ) i=1 ξi . Thus, the SudakovFernique inequality guarantees that E[supf,c Yf,c ] ≤ 2E[supf,c Zf,c ], and Gn (ℓ ◦ H) . E " Pn sup n X f ∈2BH i=1 # 2 gi f (xi ) | E[f (X) ] ≤ r + E " sup c c∈[0,1] n X i=1 2 2 # wi ξi | c σ ≤ r . √ The last term in the expression has bound nr by Jensen’s inequality and the relaxation that c ∈ [−1, 1]. For the first term, Mendelson [34, Thm. 2.1] shows that for RKHS with kernel eigenvalues λ1 , λ2 , . . ., we have E " sup n X f ∈2BH i=1 1  2 ∞ X √ 2   gi f (Xi ) | E[f (X) ] ≤ r . n min{λj , r} , # j=1 which yields our desired claim (24). G.2 Proof of Lemma 3.1 Defining Ny := card{i ∈ [n] : Xi = y} for y ∈ {−1, 0, 1}, we immediately obtain EPbn [ℓ(θ; X)] = 1 [N−1 |θ + 1| + N1 |θ − 1| + N0 |θ| − (n − N0 )] , n 50 because N1 + N−1 + N0 = n. In particular, we find that the   1 erm θbn := argmin EPbn [ℓ(θ; X)] = −1  θ∈R  ∈ [−1, 1] empirical risk minimizer θ satisfies if N1 > N0 + N−1 if N−1 > N0 + N1 otherwise. On the events N1 > N−1 + N0 or N−1 > N0 + N1 , which are disjoint, then, we have R(θbnerm ) = δ = R(θ ⋆ ) + δ. Let us give a lower bound on the probability of this event. Noting that marginally N1 ∼ Bin(n, 1−δ 2 ) and using N0 + N−1 = n − N1 , we have N1 > N0 + N−1 if and only if N1 > n2 , and we would like to lower bound          n 1−δ n 1+δ n P N1 > = P Bin n, > = P Bin n, < . 2 2 2 2 2 Rt 2 Letting Φ(t) = √12π −∞ e−u /2 du denote the standard Gaussian CDF, then Zubkov and Serov [53] show that s  !  1 1+δ n P N1 ≥ ≥ Φ − 2nDkl || 2 2 2 where Dkl (p||q) = p log pq + (1 − p) log 1−p 1−q denotes the binary KL-divergence. We have by standard bounds on the KL-divergence [45, Lemma 2.7] that Dkl ( 21 || 1+δ 2 )≤ r  n n nδ2 P N1 > or N−1 > ≥ 2Φ − 2 2 1 − δ2 ! δ2 , 2(1−δ2 ) so that  n . − 2P N1 = 2 For n odd, the final probability is 0, while for n even, we have r    n n 2 −n 2 n/2 2 n/2 =2 , P N1 = (1 − δ ) ≤ (1 − δ ) 2 πn n/2  n √4 where the inequality uses that 2n n ≤ πn by Stirling’s approximation. Summarizing, we find that r  n n nδ2 P N1 > or N−1 > ≥ 2Φ − 2 2 1 − δ2 G.3 ! 2 n/2 − (1 − δ ) r 8 . πn Proof of Lemma F.4 Under the conditions of the theorem, the compactness of θ ⋆ + ǫB guarantees that a.s. sup |EPbn [ℓ(θ, X)] − R(θ)| → 0, θ∈θ ⋆ +ǫB as the functions θ 7→ ℓ(θ, x) are Lipschitz in a neighborhood of θ ⋆ by Assumption A. Similarly, sup θ∈θ ⋆ +ǫB a.s. VarPbn (ℓ(θ, X)) − Var(ℓ(θ, X)) → 0, 51 using the local Lipschitzness of ∇2 ℓ. (See, for example, the Glivenko-Cantelli results in Chapters 2.4–2.5 of van der Vaart and Wellner [47].) Thus, using the two-sided bounds (10) of Theorem 1, we have that sup |Rn (θ, Pn ) − R(θ)| θ∈θ ⋆ +ǫB ≤ sup θ∈θ ⋆ +ǫB EPbn [ℓ(θ, Pn )] − R(θ) + r q 2ρ a.s. sup VarPbn (ℓ(θ, X)) → 0. n θ∈θ⋆ +ǫB Now, we use the fact that ∇2 R(θ ⋆ ) ≻ 0, and that θ 7→ ∇2 R(θ) is continuous in a neighborhood of θ ⋆ . Fix ǫ > 0 small enough that the preceding uniform convergence guarantees hold over θ ⋆ + 2ǫB and ∇2 R(θ)  λI for some λ > 0 and all θ ∈ θ ⋆ + 2ǫB. Let θ 6∈ θ ⋆ + ǫB, but θ ∈ θ ⋆ + 2ǫB. Then for sufficently large n, we have that (i) λ 2 ǫ 4 (ii) λ (iii) λ λ ≥ R(θ ⋆ ) + kθ − θ ⋆ k22 − ǫ2 ≥ R(θ ⋆ ) + ǫ2 2 4 4 (iv) λ λ λ ≥ EPbn [ℓ(θ ⋆ , X)] + ǫ2 − ǫ2 = EPbn [ℓ(θ ⋆ , X)] + ǫ2 , 4 8 8 Rn (θ, Pn ) ≥ EPbn [ℓ(θ, X)] ≥ R(θ) − where inequalities (i) and (iv) follow from the uniform convergence guarantee, inequality (ii) from the strong convexity of R near θ ⋆ , and (iii) because kθ − θ ⋆ k2 ≥ ǫ. Finally, we have that r 2ρ VarPbn (ℓ(θ ⋆ , X)), EPbn [ℓ(θ ⋆ , X)] ≥ Rn (θ ⋆ , Pn ) − n | {z } a.s. →0 so that eventually Rn (θ, Pn ) > Rn (θ ⋆ , Pn ) for all θ ∈ θ ⋆ +2ǫB\ǫB. By convexity, then this inequality holds for all θ 6∈ θ ⋆ + ǫB. Thus if θbnrob ∈ argminθ Rn (θ, Pn ), then for any ǫ > 0 we must eventually have kθbnrob − θ ⋆ k2 < ǫ. H Efficient solutions to computing the robust expectation In this appendix, we give a detailed description of the procedure we use to compute the supremum problem (8). In particular, our procedure requires time O(n log n + log 1ǫ log n), where ǫ is the desired solution accuracy. Let us reformulate this as a minimization problem in a variable p ∈ Rn for simplicity. Then we wish to solve minimize p⊤ z subject to 1 knp − 1k22 ≤ ρ, p ≥ 0, p⊤ 1 = 1. 2n We take a partial dual of this minimization problem, then maximize this dual to find the optimizing p. Introducing the dual variable λ ≥ 0 for the constraint that 12 kp − n1 1k22 ≤ nρ and performing the standard min-max swap [15] (strong duality obtains for this problem because the Slater condition is satisfied by p = n1 1) yields the maximization problem   1 2 λρ λ ⊤ ⊤ + p z | p ≥ 0, 1 p = 1 . (47) p− 1 − maximize f (λ) := inf p λ≥0 2 n 2 n 52 If we can efficiently compute the infimum (47), then it is possible to binary search over λ. Recall the standard fact [24, Chapter VI.4.4] that for a collection {fp }p∈P of concave functions, if the infimum f (x) = inf p∈P fp (x) is attained at some p0 then any vector ∇fp0 (x) is a supergradient of f (x). Thus, letting p(λ) be the (unique) minimizing value of p for any λ > 0, the objective (47) ⊤ becomes f (λ) = λ2 kp(λ) − n1 1k22 − λρ n + p(λ) z, whose derivative with respect to λ (holding p fixed) ρ 1 1 ′ 2 is f (λ) = 2 kp(λ) − n 1k2 − n . Now we use well-known results on the Euclidean projection of a vector to the probability simplex [19] to provide an efficient computation of the infimum (47). First, we assume with no loss of generality that z1 ≤ z2 ≤ · · · ≤ zn and that 1⊤ z = 0, because neither of these changes the original optimization problem (as 1⊤ p = 0 and the objective is symmetric). Then we define the two vectors s, σ 2 ∈ Rn , which we use for book-keeping in the algorithm, by X X si = zj , σi2 = zj2 , j≤i j≤i and we let z 2 be the vector whose entries are zi2 . The infimum problem (47) is equivalent to projecting the vector v(λ) ∈ Rn defined by 1 1 − zi n λ onto the probability simplex. Notably [19], P the projection p(λ) has the form pi (λ) = (vi − η)+ for some η ∈ R, where η is chosen such that ni=1 pi (λ) = 1. Finding such a value η is equivalent [19, Figure 1] to finding the unique index i such that vi = i X j=1 (vj − vi ) < 1 and Pi i+1 X (vj − vi+1 ) ≥ 1, j=1 taking i = n if no such index exists (the sum j=1 (vj − vi ) is increasing in i and v1 − v1 = 0). 1 1 Pi 1 1 1 1 − − Given the index i, algebraic manipulations show that η = j=1 zj /λ = n − i − i si /λ n i i Pn satisfies the equality i=1 (vi − η)+ = 1 and that vj − η ≥ 0 for all j ≤ i while vj − η ≤ 0 for j > i. ∂ Of course, given the index i and η, we may calculate the derivative ∂λ f (λ) efficiently as well:   ∂ λ λρ 2 p(λ) − n−1 1 2 − f ′ (λ) = + p(λ)⊤ z ∂λ 2 n 1 = p(λ) − n−1 1 2 = 1 2 i  X j=1 1 zj + η λ 2 2 2 i n ρ 1X ρ 1 X 1 −1 2 − = − (vj − η − n ) + 2 n 2 2 n n j=1 + j=i+1 n−i ρ σi2 iη 2 si η n − i ρ − = + + + − . 2n2 n 2λ2 2 λ 2n2 n Finding the index optimal i can be done by a binary search, which requires O(log n) time, and f ′ (λ) is then computable in O(1) time using the vectors s and σ 2 . It is then possible to perform a binary search over λ using f ′ (λ), which which requires log 1ǫ iterations to find λ within accuracy ǫ, from which it is easy to compute p(λ) via pi (λ) = (vi − η)+ = n−1 − λ−1 zi − η + . We summarize this discussion with pseudo-code in Figures 6 and 7, which provide a main routine and sub-routine for finding the optimal vector p. These routines show that, once provided the sorted vector z with z1 ≤ z2 ≤ · · · ≤ zn (which requires n log n time to compute), we require only O(log 1ǫ · log n) computations. 53 Inputs: Sorted vector z ∈ Rn with 1⊤ z = 0, parameter ρ > 0, solution accuracy ǫ p Set λmin P = 0 and λmax = λ∞ = max{n kzk∞ , n/2ρ kzk2 } P Set si = j≤i zj and σi2 = j≤i zj2 While |λmax − λmin | > ǫλ∞ min Set λ = λmax +λ 2 Set (η, i) = FindShift(z, λ, s) // (Figure 7) η η2 2 1 n−i ′ 2 Set f (λ) = 2λ2 σi + 2 i + λ si + 2n2 − nρ If f ′ (λ) > 0 Set λmin = λ Else Set λmax = λ Set λ = 12 (λmax + λmin), (η, i) = FindShift(z, λ, s) Set pi = n1 − λ1 zi − η + and return p Figure 6. Procedure FindP to find the vector p minimizing 2 1 1 2n knp − 1k2 ≤ ρ. Method takes log ǫ iterations of the loop. Pn i=1 pi zi subject to the constraint Inputs: Sorted vector z with 1⊤ z = 0, λ > 0, vector s with si = P j≤i zj Set ilow = 1, ihigh = n If n1 − zλn ≥ 0 Return (η = 0, i = n) While ilow 6= ihigh i = 21 (ilow + ihigh ) P sleft = λ1 (izi − si ) // (this is sleft = ij=1 (vj − vi )) P sright = λ1 ((i + 1)zi+1 − si+1 ) // (this is sright = i+1 j=1 (vj − vi+1 )) If sright ≥ 1 and sleft < 1 1 si and return (η, i) Set η = n1 − 1i − λi Else if sleft ≥ 1 Set ihigh = i − 1 Else Set ilow = i + 1 1 Set i = ilow and η = n1 − 1i − λi si and return (η, i) Figure 7. Procedure FindShift to find index i and parameter η P such that, for the definition n vi = n1 − λ1 zi , we have vj − η ≥ 0 for j ≤ i, vj − η ≤ 0 for j > i, and j=1 (vj − η)+ = 1. Method requires time O(log n). References [1] M. Anthony and J. Shawe-Taylor. A result of Vapnik with applications. Discrete Applied Mathematics, 47:207–217, 1993. [2] P. L. Bartlett and S. Mendelson. Rademacher and Gaussian complexities: Risk bounds and 54 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] structural results. Journal of Machine Learning Research, 3:463–482, 2002. P. L. Bartlett, O. Bousquet, and S. Mendelson. Local Rademacher complexities. Annals of Statistics, 33(4):1497–1537, 2005. P. L. Bartlett, M. I. Jordan, and J. McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101:138–156, 2006. A. Ben-Tal, L. E. Ghaoui, and A. Nemirovski. Robust Optimization. Princeton University Press, 2009. A. Ben-Tal, D. den Hertog, A. D. Waegenaere, B. Melenberg, and G. Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science, 59(2):341– 357, 2013. A. Ben-Tal, E. Hazan, T. Koren, and S. Mannor. Oracle-based robust optimization via online learning. Operations Research, 63(3):628–638, 2015. D. Bertsimas, V. Gupta, and N. Kallus. Robust SAA. arXiv:1408.4445 [math.OC], 2014. URL http://arxiv.org/abs/1408.4445. M. Birman and M. Solomjak. Piecewise-polynomial approximations of functions of the classes Wpα . Sbornik: Mathematics, 2(3):295–317, 1967. S. Boucheron, O. Bousquet, and G. Lugosi. Theory of classification: a survey of some recent advances. ESAIM: Probability and Statistics, 9:323–375, 2005. S. Boucheron, G. Lugosi, and P. Massart. Concentration Inequalities: a Nonasymptotic Theory of Independence. Oxford University Press, 2013. O. Bousquet. A bennett concentration inequality and its application to suprema of empirical processes. Comptes Rendus Mathematique, 334(6):495–500, 2002. O. Bousquet. Concentration inequalities and empirical processes theory applied to the analysis of learning algorithms. PhD thesis, L’Ecole Polytechnique, 2002. O. Bousquet. Concentration inequalities for sub-additive functions using the entropy method. In Stochastic inequalities and applications, pages 213–247. Springer, 2003. S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. P. Bühlmann and S. van de Geer. Statistics for High-Dimensional Data: Methods, Theory and Applications. Springer, 2011. S. Chatterjee. An error bound in the Sudakov-Fernique inequality. arXiv:0510424 [math.PR], 2005. N. Cristianini and J. Shawe-Taylor. Kernel Methods for Pattern Analysis. Cambridge University Press, 2004. J. C. Duchi, S. Shalev-Shwartz, Y. Singer, and T. Chandra. Efficient projections onto the ℓ1 -ball for learning in high dimensions. In Proceedings of the 25th International Conference on Machine Learning, 2008. J. C. Duchi, P. W. Glynn, and H. Namkoong. Statistics of robust optimization: A generalized empirical likelihood approach. arXiv:1610.03425 [stat.ML], 2016. URL https://arxiv.org/abs/1610.03425. R. M. Dudley. Uniform Central Limit Theorems. Cambridge University Press, 1999. J.-y. Gotoh, M. J. Kim, and A. Lim. Robust empirical optimization is almost the same as mean-variance optimization. Available at SSRN 2827400, 2015. 55 [23] C. Gu. Smoothing spline ANOVA models. Springer, 2002. [24] J. Hiriart-Urruty and C. Lemaréchal. Convex Analysis and Minimization Algorithms I & II. Springer, New York, 1993. [25] V. Koltchinskii. Local Rademacher complexities and oracle inequalities in risk minimization. Annals of Statistics, 34(6):2593–2656, 2006. [26] T. Kühn. Covering numbers of Gaussian reproducing kernel Hilbert spaces. Journal of Complexity, 27(5):489–499, 2011. [27] H. Lam and E. Zhou. Quantifying input uncertainty in stochastic optimization. In Proceedings of the 2015 Winter Simulation Conference. IEEE, 2015. [28] M. Ledoux and M. Talagrand. Probability in Banach Spaces. Springer, 1991. [29] E. L. Lehmann and G. Casella. Theory of Point Estimation, Second Edition. Springer, 1998. [30] D. Lewis, Y. Yang, T. Rose, and F. Li. RCV1: A new benchmark collection for text categorization research. Journal of Machine Learning Research, 5:361–397, 2004. [31] M. Lichman. UCI machine learning repository, 2013. URL http://archive.ics.uci.edu/ml. [32] E. Mammen and A. B. Tsybakov. Smooth discrimination analysis. Annals of Statistics, 27: 1808–1829, 1999. [33] A. Maurer and M. Pontil. Empirical Bernstein bounds and sample variance penalization. In Proceedings of the Twenty Second Annual Conference on Computational Learning Theory, 2009. [34] S. Mendelson. On the performance of kernel classes. Journal of Machine Learning Research, 4(Oct):759–771, 2003. [35] S. Mendelson. Learning without concentration. In Proceedings of the Twenty Seventh Annual Conference on Computational Learning Theory, 2014. [36] H. Namkoong and J. C. Duchi. Stochastic gradient methods for distributionally robust optimization with f -divergences. In Advances in Neural Information Processing Systems 29, 2016. [37] A. Owen. Empirical likelihood ratio confidence regions. The Annals of Statistics, pages 90–120, 1990. [38] A. B. Owen. Empirical likelihood. CRC press, 2001. [39] P. Samson. Concentration of measure inequalities for Markov chains and φ-mixing processes. Annals of Probability, 28(1):416–461, 2000. [40] A. Shapiro, D. Dentcheva, and A. Ruszczyński. Lectures on Stochastic Programming: Modeling and Theory. SIAM and Mathematical Programming Society, 2009. [41] P. K. Shivaswamy and T. Jebara. Empirical Bernstein boosting. In Proceedings of the 13th International Conference on Artificial Intelligence and Statistics, 2010. [42] P. K. Shivaswamy and T. Jebara. Variance penalizing AdaBoost. In Advances in Neural Information Processing Systems 24, 2011. [43] N. Srebro, K. Sridharan, and A. Tewari. Smoothness, low noise and fast rates. In nips23, pages 2199–2207, 2010. [44] A. B. Tsybakov. Optimal aggregation of classifiers in statistical learning. Annals of Statistics, pages 135–166, 2004. [45] A. B. Tsybakov. Introduction to Nonparametric Estimation. Springer, 2009. 56 [46] S. van de Geer. Empirical Processes in M-Estimation. Cambridge University Press, 2000. [47] A. W. van der Vaart and J. A. Wellner. Weak Convergence and Empirical Processes: With Applications to Statistics. Springer, New York, 1996. [48] V. N. Vapnik. Statistical Learning Theory. Wiley, 1998. [49] V. N. Vapnik and A. Y. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and its Applications, XVI(2):264–280, 1971. [50] V. N. Vapnik and A. Y. Chervonenkis. Theory of Pattern Recognition. Nauka, Moscow, 1974. (In Russian). [51] D.-X. Zhou. Capacity of reproducing kernel spaces in learning theory. IEEE Transactions on Information Theory, 49(7):1743–1752, 2003. [52] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society, Series B, 67(2):301–320, 2005. [53] A. Zubkov and A. Serov. A complete proof of universal inequalities for the distribution function of the binomial law. Theory of Probability & Its Applications, 57(3):539–544, 2013. 57
10math.ST
Journal of Information & Communication Technology-JICT Vol. 10 Issue. 2, December 2016 A Survey on Optical Character Recognition System Noman Islam, Zeeshan Islam, Nazia Noor Abstract—Optical Character Recognition (OCR) has been a topic of interest for many years. It is defined as the process of digitizing a document image into its constituent characters. Despite decades of intense research, developing OCR with capabilities comparable to that of human still remains an open challenge. Due to this challenging nature, researchers from industry and academic circles have directed their attentions towards Optical Character Recognition. Over the last few years, the number of academic laboratories and companies involved in research on Character Recognition has increased dramatically. This research aims at summarizing the research so far done in the field of OCR. It provides an overview of different aspects of OCR and discusses corresponding proposals aimed at resolving issues of OCR. Keywords—character recognition, document image analysis, OCR, OCR survey, classification I. INTRODUCTION Optical Character Recognition (OCR) is a piece of software that converts printed text and images into digitized form such that it can be manipulated by machine. Unlike human brain which has the capability to very easily recognize the text/ characters from an image, machines are not intelligent enough to perceive the information available in image. Therefore, a large number of research efforts have been put forward that attempts to transform a document image to format understandable for machine. OCR is a complex problem because of the variety of languages, fonts and styles in which text can be written, and the complex rules of languages etc. Hence, techniques from different disciplines of computer science (i.e. image processing, pattern classification and natural language processing etc. are employed to address different challenges. This paper introduces the reader to the problem. It enlightens the reader with the historical perspectives, applications, challenges and techniques of OCR. II. LITERATURE REVIEW Character recognition is not a new problem but its roots can be traced back to systems before the inventions of computers. The earliest OCR systems were not computers but mechanical devices that were able to recognize characters, but very slow speed and low accuracy. In 1951, M. Sheppard invented a reading and robot GISMO that can be considered as the earliest work on modern OCR [1]. GISMO can read musical notations as well as words on a printed page one by one. However, it can only recognize 23 characters. The machine also has the capability to could copy a typewritten page. J. Rainbow, in 1954, devised a machine that can read uppercase typewritten English characters, one per minute. The early OCR systems were criticized due to errors and slow recognition speed. Hence, not much research efforts were put on the topic during 60’s and 70’s. The only developments were done on government agencies and large corporations like banks, newspapers and airlines etc. Because of the complexities associated with recognition, it was felt that three should be standardized OCR fonts for easing the task of recognition for OCR. Hence, OCRA and OCRB were developed by ANSI and EMCA in 1970, that provided comparatively acceptable recognition rates[2] . During the past thirty years, substantial research has been done on OCR. This has lead to the emergence of document image analysis (DIA), multi-lingual, handwritten and omni-font OCRs [2]. Despite these extensive research efforts, the machine’s ability to reliably read text is still far below the human. Hence, current OCR research is being done on improving accuracy and speed of OCR for diverse style documents printed/ written in unconstrained environments. There has not been availability of any open source or commercial software available for complex languages like Urdu or Sindhi etc. III. Manuscript Received August 17, 2016; accepted 10th October, 2016; date of current version December 2016 Noman Islam is with Iqra University, Karachi, Pakistan (email:[email protected]) Zeeshan Islam is with Aladdin Solutions, Pakistan (email: [email protected]) Nazia Noor is with Indus University, Pakistan (email: [email protected]) Page | 1 TYPES OF OPTICAL CHARACTER RECOGNITION SYSTEMS There has been multitude of directions in which research on OCR has been carried out during past years. This section discusses different types of OCR systems have emerged as a result of these researches. We can categorize these systems based on image acquisition mode, character connectivity, font-restrictions etc. Fig. 1 categorizes the character recognition system. Based on the type of input, the OCR systems can be categorized as handwriting recognition and machine printed character recognition. The former is relatively ISSN-2409-6520 Journal of Information & Communication Technology-JICT Vol. 10 Issue. 2, December 2016 simpler problem because characters are usually of uniform dimensions, and the positions of characters on the page can be predicted [3]. Handwriting character recognition is a very tough job due to different writing style of user as well as different pen movements by the user for the same character. These systems can be divided into two sub-categories i.e. on-line and off-line systems. The former is performed in real-time while the users are writing the character. They are less complex as they can capture the temporal or time based information i.e. speed, velocity, number of strokes made, direction of writing of strokes etc. In addition, there no need for thinning techniques as the trace of the pen is few pixels wide. The offline recognition systems operate on static data i.e. the input is a bitmap. Hence, it is very difficult to perform recognition. There have been many online systems available because they are easier to develop, have good accuracy and can be incorporated for inputs in tablets and PDAs [4]. Character Recognition Printed Handwritte n Online OCR in the image. In these situations, advance character segmentation techniques are used. Feature extraction: The segmented characters are then processes to extract different features. Based on these features, the characters are recognized. Different types of features that can be used extracted from images are moments etc. The extracted features should be efficiently computable, minimize intra-class variations and maximizes inter-class variations. Character classification: This step maps the features of segmented image to different categories or classes. There are different types of character classification techniques. Structural classification techniques are based on features extracted from the structure of image and uses different decision rules to classify characters. Statistical pattern classification methods are based on probabilistic models and other statistical methods to classify the characters. Post processing: After classification, the results are not 100% correct, especially for complex languages. Post processing techniques can be performed to improve the accuracy of OCR systems. These techniques utilizes natural language processing, geometric and linguistic context to correct errors in OCR results. For example, post processor can employ a spell checker and dictionary, probabilistic models like Markov chains and n-grams to improve the accuracy. The time and space complexity of a post processor should not be very high and the application of a post-processor should not engender new errors. a. Image Acquisition Offline Figure.1: Types of character recognition system IV.APPLICATIONS OF OCR OCR enables a large number of useful applications. During the early days, OCR has been used for mail sorting, bank cheque reading and signature verification [5]. Besides, OCR can be used by organizations for automated form processing in places where a huge number of data is available in printed form. Other uses of OCR include processing utility bills, passport validation, pen computing and automated number plate recognition etc [6]. Another useful application of OCR is helping blind and visually impaired people to read text [7]. IV. MAJOR PHASES OF OCR The process of OCR is a composite activity comprises different phases. These phases are as follows: Image acquisition: To capture the image from an external source like scanner or a camera etc. Preprocessing: Once the image has been acquired, different preprocessing steps can be performed to improve the quality of image. Among the different preprocessing techniques are noise removal, thresholding and extraction image base line etc. Character segmentation: In this step, the characters in the image are separated such that they can be passed to recognition engine. Among the simplest techniques are connected component analysis and projection profiles can be used. However in complex situations, where the characters are overlapping /broken or some noise is present Page | 2 Image acquisition is the initial step of OCR that comprises obtaining a digital image and converting it into suitable form that can be easily processed by computer. This can involve quantization as well as compression of image [8]. A special case of quantization is binarization that involves only two levels of image. In most of the cases, the binary image suffices to characterize the image. The compression itself can be lossy or loss-less. An overview of various image compression techniques have been provided in [9]. b. Pre-processing Next to image acquisition is pre-processing that aims to enhance the quality of image. One of the pre-processing techniques is thresholding that aims to binaries the image based on some threshold value [9]. The threshold value can be set at local or global level. Different types of filters such as averaging, min and max filters can be applied. Alternatively, different morphological operations such as erosion, dilation, opening and closing can be performed. ISSN-2409-6520 Journal of Information & Communication Technology-JICT Vol. 10 Issue. 2, December 2016 Table.1: Major Phases of OCR system Phase Description Approaches Acquisition The process of acquiring image Digitization, binarization, compression Noise removal, Skew To enhance quality removal, thinning, Pre-processing of image morphological operations To separate image Segmentation into its constituent characters Implicit Vs Explicit Segmentation Feature Extraction Geometrical feature such as loops, corner points Statistical features such as moments To extract features from image To categorize a Classification character into its particular class Postprocessing To improve accuracy of OCR results Neural Network, Bayesian, Nearest Neighborhood Contextual approaches, multiple classifiers, dictionary based approaches An important part of pre-processing is to find out the skew in the document. Different techniques for skew estimation includes: projection profiles, Hough transform, nearest neighborhood methods. In some cases, thinning of the image is also performed before later phases are applied [10]. Finally, the text lines present in the document can also be found out as part of pre-processing phase. This can be done based on projections or clustering of the pixels. c. Character Segmentation In this step, the image is segmented into characters before being passed to classification phase. The segmentation can be performed explicitly or implicitly as a byproduct of classification phase [11]. In addition, the other phases of OCR can help in providing contextual information useful for segmentation of image. d. Feature Extraction In this stage, various features of characters are extracted. These features uniquely identify characters. The selection of the right features and the total number of features to be used is an important research question. Different types of features such as the image itself, geometrical features (loops, strokes) and statistical feature (moments) can be used. Finally, various techniques such as principal component analysis can be used to reduce the dimensionality of the image. Page | 3 e. Classification It is defined as the process of classifying a character into its appropriate category. The structural approach to classification is based on relationships present in image components. The statistical approaches are based on use of a discriminate function to classify the image. Some of the statistical classification approaches are Bayesian classifier, decision tree classifier, neural network classifier, nearest neighborhood classifiers etc [12]. Finally, there are classifiers based on syntactic approach that assumes a grammatical approach to compose an image from its subconstituents. f. Post-processing Once the character has been classified, there are various approaches that can be used to improve the accuracy of OCR results. One of the approaches is to use more than one classifier for classification of image. The classifier can be used in cascading, parallel or hierarchical fashion. The results of the classifiers can then be combined using various approaches. In order to improve OCR results, contextual analysis can also be performed. The geometrical and document context of the image can help in reducing the chances of errors. Lexical processing based on Markov models and dictionary can also help in improving the results of OCR [12]. V. CONCLUSION In this paper, an overview of various techniques of OCR has been presented. An OCR is not an atomic process but comprises various phases such as acquisition, preprocessing, segmentation, feature extraction, classification and post-processing. Each of the steps is discussed in detail in this paper. Using a combination of these techniques, an efficient OCR system can be developed as a future work. The OCR system can also be used in different practical applications such as number-plate recognition, smart libraries and various other real-time applications. Despite of the significant amount of research in OCR, recognition of characters for language such as Arabic, Sindhi and Urdu still remains an open challenge. An overview of OCR techniques for these languages has been planned as a future work. Another important area of research is multi-lingual character recognition system. Finally, the employment of OCR systems in practical applications remains an active are of research. ACKNOWLEDGMENT The authors would like to thank Iqra University, Karachi for their support in the completion of this research work. ISSN-2409-6520 Journal of Information & Communication Technology-JICT Vol. 10 Issue. 2, December 2016 REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Satti, D.A., 2013, Offline Urdu Nastaliq OCR for Printed Text using Analytical Approach. MS thesis report Quaid-i-Azam University: Islamabad, Pakistan. p. 141. Mahmoud, S.A., & Al-Badr, B., 1995, Survey and bibliography of Arabic optical text recognition. Signal processing, 41(1), 49-77. Bhansali, M., & Kumar, P, 2013, An Alternative Method for Facilitating Cheque Clearance Using Smart Phones Application. International Journal of Application or Innovation in Engineering & Management (IJAIEM), 2(1), 211-217. Qadri, M.T., & Asif, M, 2009, Automatic Number Plate Recognition System for Vehicle Identification Using Optical Character Recognition presented at International Conference on Education Technology and Computer, Singapore, 2009. Singapore: IEEE. Shen, H., & Coughlan, J.M, 2012, Towards A Real Time System for Finding and Reading Signs for Visually Impaired Users. Computers Helping People with Special Needs. Linz, Austria: Springer International Publishing. Bhavani, S., & Thanushkodi, K, 2010, A Survey On Coding Algorithms In Medical Image Compression. International Journal on Computer Science and Engineering, 2(5), 1429-1434. Bhammar, M.B., & Mehta, K.A, 2012, Survey of various image compression techniques. International Journal on Darshan Institute of Engineering Research & Emerging Technologies, 1(1), 85-90. Lazaro, J., Martín, J.L, Arias, J., Astarloa, A., & Cuadrado, C, 2010, Neuro semantic thresholding using OCR software for high precision OCR applications. Image and Vision Computing, 28(4), 571-578. Lund, W.B., Kennard, D.J., & Ringger, E.K. (2013). Combining Multiple Thresholding Binarization Values to Improve OCR Output presented in Document Recognition and Retrieval XX Conference 2013, California, USA, 2013. USA: SPIE Shaikh, N.A., & Shaikh, Z.A, 2005, A generalized thinning algorithm for cursive and non-cursive language scripts presented in 9th International Multitopic Conference IEEE INMIC, Pakistan, 2005. Pakistan: IEEE Shaikh, N.A., Shaikh, Z.A., & Ali, G, 2008, Segmentation of Arabic text into characters for recognition presented in International Multi Topic Conference, IMTIC, Jamshoro, Pakistan, 2008. Pakistan: Springer. Ciresan, D.C., Meier, U., Gambardella, L.M., & Schmidhuber, J, 2011, Convolutional neural network committees for handwritten character classification presented in International Conference on Document Analysis and Recognition, Beijing, China, 2011. USA: IEEE. Page | 4 ISSN-2409-6520
1cs.CV
Online Fault Identification of Digital Hydraulic Valves Using a Combined Model-Based and Data-Driven Approach Johan Ersfolka , Miika Ahopeltob , Wictor Lunda , Jonatan Wiika , Marina Waldéna , Matti Linjamab , Jan Westerholma a Åbo arXiv:1803.05644v1 [cs.SY] 15 Mar 2018 b Tampere Akademi University, Finland University of Technology, Finland Abstract Robustness and fault-tolerance are desirable properties for hydraulic working machines and field robots. In applications where service personnel do not have easy access to the machine, it is important that the machine can continue its operation despite single machinery faults. Digital hydraulics enables a design which is inherently fault-tolerant by having each hydraulic actuator controlled by a number of parallel on/off valves. The exact state operation of a digital hydraulic system enables model based diagnostics of the hydraulic components and the possibility to compensate for identified faults. This paper presents an approach for identifying faulty valves based on combination of pressure measurements made during the normal operation of the machine and a mathematical model describing the flow balance of the hydraulic system. Keywords: Fault identification; Fault diagnosis; Digital hydraulics; L1-Optimization 1. Introduction Modern field robots and work machines are highly automated and are often used for tasks which require high precision. In some applications, such as operation in hazardous areas, a field robot is not only required to complete its tasks without the presence of an operator, but also to continue its operation despite single machinery faults. This need for fault-tolerance requires machines with redundant hardware, the ability to perform online diagnostics identifying the faulty machine parts, and a control system that can compensate for the faults. Digital hydraulics addresses this need for fault tolerance by using simple and robust components which have precise and known control states [18]. By controlling each hydraulic flow path by several parallel connected valves, a controller which is aware of a faulty valve can find an alternative control state that compensate for the fault. A digital valve system uses a number of simple on/off-valves to achieve discrete controllability of hydraulic actuators. For each flow path, traditional valves are replaced with digital flow control units (DFCU) which consist of a number of parallel binary on/off-valves. When the flow capacities of Preprint submitted to Elsevier the N valves of a DFCU follow powers of two, the flow path can be controlled with 2N unique control states. A typical system, like the one shown in Figure 1, having four DFCUs with five valves each thus provides 220 (1,048,576) unique control states. Efficient control of a digital hydraulic system can be achieved by evaluating and choosing control states that optimize the operation of the machine according to different criteria [8, 20]. One jammed valve implies that the machine has to be controlled with the remaining 219 control states. The exact operation of digital valves makes it possible to control a digital hydraulic system with a model based controller which evaluates the steady state of a hydraulic actuator for several different valve states and chooses the best candidate. In a similar fashion, an exact model of the system makes it possible to observe the difference between the measured behavior of the machine and the expected behavior predicted by the steady state model. In this paper we show that it is possible to identify a broken valve and the position in which it is jammed, by simply analyzing the pressures in a cylinder’s chambers and the supply pressure. This is an important feature as it enables diagnostics, of the digital valve system, without requiring any additional March 16, 2018 v F pA Controller pB QAT QPA QPB Hydraulic System Model Based Controller B A Valves QBT 𝑒𝑣 𝑢1 . . 𝑢20 𝑒𝑣 qPA,5 Hydraulic Actuator 𝑥 Pressure Sensors 𝑒𝑠 Diagnostics qPA,4 Filter qPA,3 Process Model 𝑥 𝑝𝑆 , 𝑝𝐴 , 𝑝𝐵 𝑒1 . . 𝑒40 qPA,2 qPA,1 DFCU AT DFCU PA DFCU PB pS Figure 2: The interaction between controller, hydraulic system and online diagnostics. The diagnostics uses the three available pressure sensors and the control signal to estimate the performance of the hydraulic actuator in Figure 1. DFCU BT pT Figure 1: A hydraulic actuator with four DFCUs each containing five binary valves. pA and pB are the pressures in the cylinder chambers while pS is the supply pressure and pT is the pressure in the tank. the system is fully operational despite single machinery faults [2]. For a digital hydraulic system to continue its operation despite broken valves, the faults need to be identified and compensated for by the control algorithm. This can be achieved by using simple and robust parallel connected on/off valves which operation can be modeled exactly. This enables both fault identification based on an exact machine model and the compensation for the fault by searching for alternative control states. sensors, instead we only need the sensors that already are present in a system. The approach presented in this paper operates online, during the normal operation of a hydraulic machine, by passively analyzing the pressure measurements and control signals without interfering with the machine operation. The approach is targeted towards analyzing the performance of a large number of valves while only sampling a relatively small number of pressure signals. In our example case we have 20 valves for which we consider single faults in both open and closed positions, thus we have 40 potential faults, while we only use three pressure sensors. The measurements from these few pressure sensors are collected over short periods (e.g. a hundred samples corresponding to one second) during various conditions and control states. This enables us to compute a likely cause for a deviation between the model and the measurements, which in turn enables the machine to quickly identify failing components and to automatically compensate for this without interrupting the current task. In case service is possible, our method provides information regarding which valve is malfunctioning. 2.1. Fault Detection Procedures It is crucial that machinery faults can be identified, either by online diagnostics during the normal operation of the machine or by interrupting the machine to run a diagnostics procedure. An approach for identifying faulty digital hydraulics components by a diagnostics procedure is presented in [26, 25]. Siivonen et al. [26] consider five different cases where a valve may be jammed in either open, closed, or intermediate position, or where the valve does not open or close completely. Compared to this method, the approach we present here analyses the machine performance during normal operation of the machine and provides a probabilistic answer to whether any valve is faulty in either its open or closed position. Clearly, the quality of the online fault identification of a valve depends on the activity of that valve during the analyzed time frame. The main components of our approach are presented in Figure 2. The hydraulic system has as its input signal the desired state of each of the on/off valves (u1 ..u20 ) while its outputs are the pressures measured at the hydraulic supply pump pS and the two cylinder chambers pA and pB (compare Figure 1). The pressure difference in the cylinder’s chambers results in the movement of the piston 2. Background and Related Work In work machines, a component failure is both a safety and cost concern. For a modern work machine, with a large number of components, it can be expected that parts such as valves and hoses break. As it is not possible to completely avoid faults, a fault-tolerant design can be used to guarantee that 2 with velocity v, which also depends on the external force F . The state of the hydraulic system x represents the actual performance of the hydraulic valves while the state x̂ represents the valve performance predicted by the model of the system. This prediction is based on a steady state model that describes a balance of the hydraulic flows in the system, where a broken valve will cause an imbalance which is identifiable by finding the fault that minimizes the difference between the model and the measured behavior of the system. approach can be regarded as a parameter estimation fault diagnosis method with a large number of parameters to be estimated. As the number of parameters to be estimated is significantly larger than the number of sensors it is necessary to estimate the parameters based on data from a time frame rather than a single time instance. The estimation is an optimization problem where the objective is to minimize the residual for the collected data. The estimated variables will then describe the most likely fault of the system. This focus on data makes our approach resemble data-driven fault diagnosis methods. 2.2. Model-Based and Data-Driven Fault Diagnosis Fault-detection techniques are typically based on monitoring measurable variables of a process, generating alarms if a limit-value is reached. Based on the measured variables, fault diagnosis techniques are then used to identify the fault and to take countermeasures. Model-based techniques provide the fault diagnosis with more in-depth information of the process by describing dependencies between different measurable variables [13]. Model-based fault diagnosis methods are based on having a mathematical model of the monitored process. The model is usually constructed from physical principles or by system identification [9]. When the process parameters are known, state or output observers can be used to produce an estimate of the real system’s state or output respectively [13]. The difference between the outputs of the physical system and the expected outputs, i.e. the residual, is monitored by diagnosis algorithms to detect symptoms of a fault. To isolate several different faults, a bank of observers can be used where a single residual is designed to be sensitive to a specific fault while robust against other faults [9, 12]. In our case, using observers could mean that we monitor the pressures pA and pB and detect a fault in one or more of the valves by comparing the estimated pressures to measured pressures. This would enable us to detect but not to identify a valve fault. Instead our goal is to model each of the hydraulic flows in the system and estimate how each of these match the measurements. The challenge here is that we only measure three pressure values while we estimate 40 variables. An alternative to model-based fault detection based on observers is parameter estimation [13]. In this approach, some parameters of the process are estimated online and these estimates are compared to the expected parameters of the process [9]. Our Data-driven fault detection methods as opposed to model-driven methods do not typically model the process they monitor but base the analysis on data collected from the process. These methods can be divided into supervised and unsupervised. Supervised methods train a classifier with historical data for both normal and faulty conditions. Representatives of methods that have been used in supervised data-driven fault detection are Support Vector Machines (SVM) [30, 5] and Neural Networks [27]. With unsupervised methods, the normal operation of a process is modeled while faults are detected from deviations from the normal operation. Unsupervised fault detection methods are threshold based and identify some key features in the analyzed data where a deviation from the normal value indicate a fault. Some important methods are Principal Component Analysis (PCA) [15, 22], Independent Component Analysis (ICA) [16] and Partial Least Squares [22]. A comparison of supervised and unsupervised data-driven methods and their ability to detect faults that is not present in the training data is presented in [10]. Our method is data-driven in the sense that it performs fault identification on measurements from a time frame of one to a few seconds, and identifies the fault that matches the data. Compared to the other mentioned data-driven approaches, our system model is not constructed from data but is constructed as in model-based fault diagnosis techniques. The model combined with the measured data forms the optimization problem describing likely faults. This optimization problem resembles problems from sparse optimization and compressive sensing, and, as we will show later in this paper, similar methods produce a sufficiently precise estimate of the faults in our case. 3 2.3. Compressive Sensing circuits such as opening valves on both DFCU PA and DFCU AT simultaneously (see Figure 1). The efficiency of a control signal for a hydraulic system depends on several objectives where the desired trade-off can be described with a penalty function. Finding the optimal control state includes evaluating the steady state achieved by different valve state combinations and finding the best combination with respect to the penalty function. The hydraulic system is described by the steady-state in (1), where the first two equations describe that the difference in flow in and out of a chamber equals the change in the volume of the chamber (movement of the piston). The third equation describes the balance between the external force F and the pressures in the cylinder chambers. Measuring the three pressure sensors during the operation of the machine enables us to approximate the flow through each of the 20 valves indicated with q in Figure 1. The pressure is thus measured for a number of valve combinations which gives different pieces of information for us to determine the state of the system. This makes our approach related to compressive sensing (or compressive sampling) [4, 6]. Compressive sensing makes use of the fact that sparse signals can be recovered from far less samples than what is stated by the Shannon-Nyquist sampling theorem [28, 3]. The original signal can then be reconstructed by using l1 optimization to find solutions to an underdetermined linear equation system. Such techniques has been used for e.g. reconstructing images for applications such as magnetic resonance imaging [21] and single pixel cameras [7, 11]. The problem statement for online diagnostics is similar to that of compressive sensing, in that we look for a likely explanation to few observations. Similar to compressive sensing, we also use l1 optimization to solve an linear equation system which is based on measurements, however, in our case the equation system is constructed based on the combination of pressure measurements and the steady state model of the hydraulic system. Another difference is that the goal of compressive sensing is to enable the reconstruction of a signal from a small number of samples while our goal is to identify a fault from a few sensors where the number of samples is not required to be small. QP A − QAT = AA · v QP B − QBT = −AB · v (1) F = AA · p A − AB · p B In these equations, the flows Q are given for the path between the supply pump, the cylinder chambers, and the tank. As an example, the flow from the pump to chamber A is given by: QP A = 5 X αi ui · Kv,i · SP (pS − pA ) i=1 where ui denotes the 0/1 state of the i-th valve, α and Kv are valve parameters and SP (x)α is the signed power. For a precise model, each valve has individual parameters for α and Kv . The unknown variables in the steady state equations are the piston velocity v and the pressures in the two cylinder chambers pA and pB for the new state. The pressures pA and and pB are measured for hte current state and used to compute the external force F but are computed for the prospective next state. The controller’s task is hence to find the valve state such that the velocity is close to the desired velocity, the pressures pA and pB are within some given limits while minimizing other undesired properties. The steady state describes a balance in the pressures and the flows through the different flow paths. The steady state in (1) is not known to have an analytical solution. Instead we need to use numerical methods to find a solution [17]. As an example, a controller evaluating all 220 control states and choosing the optimal one in real-time using 3. Steady State Model The model based diagnostics approach is closely related to model based control of the same system. As the steady state equations are more intuitive in relation to controlling the system, we will start by describing the model based control approach. The control system’s task is to choose a control signal that makes the hydraulic actuator follow a desired trajectory as closely as possible while simultaneously minimizing quantities such as energy consumption and valve switching. As an example, a digital valve system may have a number of valve combinations resulting in almost identical movements of the piston but with some combinations having worse energy efficiency due to short 4 Newton-Raphson is presented in [8]. By using the model of the system to predict the effect of a specific valve state, the controller can then choose a state that have desired properties. The balance we are interested in from a diagnostic point of view, is the balance between the pressure and the hydraulic flows, which can be described as QP B − QBT QP A − QAT + =0 AA AB A faulty valve will cause a considerable residual when the valve is in the faulty state (e.g. the valve is set to be open but is actually closed). To make the model match the actual system better, we evaluate how to introduce a deviation in the discrete control states of the valves, such that the residual is minimized. To make this more general, we evaluate both how a valve deviates from its closed state and its open state. To start with, we consider only a single time instant and a single evaluation of the balance equation. If we split Equation (3) into flows through individual valves, the flow through a single open valves of P A can be described as: (2) where the velocity and the external force have been eliminated from Equation 1 and we are left with the balance between the flows and the pressures. This means that there is a balance between valve states and the pressures pS , pA and pB . The pressure difference causes the piston to move, which increases the volume of one cylinder chamber as the other decreases. Equation (2) simply says that the inflow should be proportional to the outflow, and with the measured pressures the flows through the valves can be predicted. αi qP A,i = ui · Kv,i · SP (pS − pA ) where the variable ui is 1 when the valve is set to be open. When the valve is closed the flow should equal 0, but to enable us to evaluate the error of a valve that does not close properly introduce the complement flow: αi qPc A,i = (1 − ui ) · Kv,i · SP (pS − pA ) which describes the valve when it is set to be closed. As the control signal to the valve ui is a binary variable, only one of these two equations will have a nonzero value. With these two variables we can model the error for both a closed and an open valve. The hydraulic flow through one DFCU can be described as the ideal flow through the valve and a deviation from the two possible states of the valve. We add two variables for estimating the error of each valve, xo for a valve which is open and xc for a closed valve, which should have the values 0 when the valve is working properly and approach 1 when the valve is jammed in the corresponding state. The flow through a DFCU with N valves can then be described as: N   X 0 QP A = qP A,i − qP A,i · xoi + qPc A,i · xci (4) i=1 4. Fault Estimation For fault-tolerance, a machine should be able to identify malfunctioning components. Faulty valves and sensors make the machine work differently than what is predicted by the model based controller, and by estimating these errors a faulty valve can be identified and compensated for. In this section we evaluate a model based error estimation where a sequence of measurements from a few sensors are used to estimate how valves deviate from their expected discrete on/off states. The idea is that this information is collected over every control period (e.g. every 10 ms) while the actual computation of the error estimate can run at a slower rate (e.g. once every second). 4.1. Deviation between model and measurements Starting from Equation (2) where the unknown variables are pA and pB , we can revert the problem to known pressures and unknown valve states. With the measured pressures and the corresponding valve states, Equation (2) should ideally hold. In practice, however, we can expect a small residual rerr which represents the difference between the model and the actual behavior of the machine. QP B − QBT QP A − QAT + = rerr AA AB = QP A − QoP A + QcP A Here the first term describes the expected behavior of the valve while the second and third describe the possible faults of the valve. The variables xo only have an impact on the equation when the particular valve is open and xc when the valve is closed. 4.2. Describing the most likely fault We can describe the steady state equation with prediction of errors by substituting QP A in Equation (2) with Q0P A from Equation (4), performing (3) 5 similar substitutions for QAT , QP B , and QBT . We can further reorganize the equation such that we can substitute the terms QP A , QAT , QP B , and QBT with Equation (3) giving us the following equation: −QcP A Qc QoP A − + ... + BT = rerr (5) AA AA AB To approximate the source of the residual we need to solve Equation (5) and thereby approximate the size of the error variables xo and xc . With the 40 variables we get from modeling 20 valves, there is an arbitrary number of solutions for the error. However, with many samples, say K = 100, we can find a solution which minimizes the error for all the samples. For the whole system, we write the equation system in matrix form Ax = b, where each row of A corresponds to one sample of Equation (5) with the corresponding pressure measurements and valve states.  q1,1 q2,1   ..  .  qk,1    p1   0   ..  . 0 q1,2 q2,2 .. . ··· ··· .. . qk,2 ··· 0 p2 .. . ··· ··· .. . 0 ···    rerr q1,40  xo1  rerr  q2,40  xo2        ..  ..  ..     .  .   .    o    r qk,40   err x    20  =    c   x   0  1   0  c  x2   0   0     ..    ..   .    .  .  . .  xc20 p40 0 Figure 3: Example of Quantile Regression where the valve AT3 is jammed in closed position. It can be seen that error open is close to one (i.e. indicating fault) during the periods when the valve is actively used. Also AT1 indicates a fault for a short period, however, it can be statistically identified not to have significance. the valves. In practice, it may be underdetermined as the elements in the sensing matrix Am,n is a result of the control signal to the machine and many of its rows may be identical or linear combinations of each other implying that rank(A) < min(m, n). To determine the performance of the valves from Equation (6), we can use regression to find the errors that best explain the observations. To enforce a solution where the errors are as close as possible to no error, we add the lower part of the matrix in Equation (6), introducing a penalty for leaving the no error area. Here the parameters in and pn are tuned such that an error gives a clear offset while no error keeps the error variables close to 0. In our particular case p1 to p20 correspond to average values of the corresponding flows q, while p21 to p40 are 1. (6) In Equation (6), qk,n indicates one flow parameter of the k-th sample. The number of unknown variables are 40 as we may have faults both on open and closed valves, and as a consequence the qm,n is given by the potential flow through the respective valves with the measured pressures according to the left hand side terms of Equation (5) as follows:  qP A,i /AA for xo1 ..xo5    −q  for xo6 ..xo10 BT,i /AB    −q  for xo11 ..xo15 AT,i /AA    q for xo16 ..xo20 P B,i /AB qk,n = c −q /AA for xc1 ..xc5    q c P A,i  /AB for xc6 ..xc10    BT,i c  q /AA for xc11 ..xc15    AT,i c −qP B,i /AB for xc16 ..xc20 4.3. Fault identification by Regression A solution to Equation (6) approximates how much the valves deviate from the discrete on/off setting. An example of the result with one jammed valve is shown in Figure 3, where the linear equation system is solved for time frames of one second by Quantile Regression (QR) [14]. The results in Figure 3 show the obtained predictions of the faults for each of the valves in DFCU AT as well as the valve state of each of these valves. In this example, the cable between the valve AT3 and the controller has been physically unplugged which results in the valve being jammed in its closed state. We can see that during intervals where valve AT3 is set to open, the error open is close to 1. Ideally, with more samples than unknowns, we get an overdetermined equation system with the unknown vector ~x which describes the error of each of 6 Another important observation, which also is visible in Figure 3, is that actual faults are constantly present when there is activity of the broken valve while false positives seems to occur more sporadically (e.g. see AT1 at 1500 ms in Figure 3). In practice, we know that the false positives often are a result of fast changes in pressure. By combining this information, we can eliminate many of the false positives by removing samples around pressure peaks (see Figure 4) and by estimating faults based on evidence collected during a longer time period. The results from solving the equation system in Equation (6) gives the predicted state of the valves for periods of 100 samples (which corresponds to one second in our case). To make the prediction more robust against noise and thus avoiding false positives, the diagnostics should not be based on single periods but instead slowly evolve during many periods. For this purpose we filter the fault approximation of each valve such that the impact of old data receive less weight with time. In practice we implement a filter that computes the Exponentially Weighted Moving Average (EWMA) [23]. This is simply an infinite impulse response (IIR) filter 7 2.5 x 10 pA pB pP 2 1.5 1 0.5 0 0 500 1000 1500 2000 2500 3000 3500 Figure 4: The measured pressures showing noise and both plateaus and spikes in the chamber pressures. The spikes cause false positives in the fault identification. To obtain the solution for Equation (6), we want to minimize the absolute deviations (i.e. l1 regression) meaning that we compute the median of the (conditional) distribution. Finding the median is a special case of QR, where QR is defined by min ρτ (b − Ax) xi ∈0..1 where ρτ (u) = X  ui · τ, ui ≥ 0 τ − 1, ui < 0 giving the weighted sum of absolute residuals, which in our case simply is the median as we use the parameter τ = 0.5. This minimization problem can be solved efficiently by linear programming [14, 29]. While we obtain good results with this approach, we observe that also other valves occasionally show deviation, e.g. due to noise in the pressure measurements. For this reason it is necessary to collect more information about each valve and, based on the history, approximate the error. yk = λ · uk + (1 − λ) · yk−1 where y is the prediction, u is a new measurement, and λ is the weighting factor which determines how fast the filter reacts to new data. To get an accurate prediction of the valve operation, a new prediction of the specific valve is only computed from periods where the estimated property of the valve has been active. As an example, if we estimate the error of a valve in open position, the evidence collected during a period where the valve never was in open position, is not useful. For this reason, the estimate of a single valve fault is only used from periods where the proportion of samples with evidence of that fault reaches a threshold (10% in the presented results). The results in Table 1 show the impact of using a filter with λ = 0.10 (Filtered) compared to the largest errors shown in the input to the filter (Not filtered). The experiment includes four sample runs of a hydraulic excavator boom where all valves work properly and five runs where one valve has been jammed in closed position by physically unplugging the control signal. In the table, the columns named Fault represent the estimation of the actual fault while the columns named False represent the larges fault shown on a properly working valve. As we 5. Experimental Validation There are various scenarios where the identification described in the previous section will cause false positives. Already by studying Figure 3 we can see a disturbance at around sample 1500 on the valve AT1 which is caused by a fast change of piston direction which causes oscillations in the measured pressures. During these circumstances, the steady state model does not properly describe the behavior of the physical system. This means that the estimated error is the error between the physical system and the steady state model instead of a faulty valve. For this reason it is important not to draw conclusions based on a single deviation between the model and the measurements. 7 hydraulic on/off valves based on sampling a small number of pressure sensors during the normal operation of a machine. The approach does not require adding new sensors to the hydraulic system, but only uses sensors that are needed for controlling the hydraulic actuator. A steady state model of the hydraulic system is used to estimate the hydraulic flow through the valves, based on the measured pressures. When the difference between the hydraulic system and the model is large, the most probable cause for the deviation is computed using quantile regression. The experiments, performed on an excavator boom, show that jammed valves can be precisely identified almost in real-time while the machine operates. This enables more efficient service as the faulty component is automatically identified potentially before the operation notices the fault. It also enables utilizing the redundancy of digital hydraulic systems, enabling a machine to be fully operational despite a faulty valve, as a controller which is aware of a fault can choose to control the hydraulic actuator with control states which are not affected by the fault. Table 1: Comparison of identified faults and the largest fault shown for valves working properly. Values close to 1 identifies a fault. Applying a filter effectively removes the problem of false positives. The asterisk means synthetic data. Q-Regress Scenario No fault 1 No fault 2 No fault 3 No fault 4 Closed AT1 Closed AT3 Closed AT5 Closed PA3 Closed PB3 Open PB3* Filtered Fault False 0.12 0.08 0.13 0.11 0.40 0.14 0.92 0.15 0.96 0.33 0.91 0.18 0.90 0.18 0.91 0.10 Not filtered Fault False 0.37 0.40 0.87 0.76 1.0 0.71 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.97 0.22 can see, the filter effectively removes false positives when the system is working properly while letting the actual faults slowly appear when present. For completeness, a single experiment based on synthetic data for a valve jammed in open position was added to verify that the approach can identify both types of faults. The synthetic data for Open PB3 was created from the parts of the measured sequences where PB3 was in the open state while the control signal to this valve was a random sequence. This means that the precision of the fault identification in Open PB3 is not interesting, instead it only shows that the approach can distinguish between both types of faults. The results presented in Table 1 are based om measurements collected from an excavator boom and analyzed with Matlab. The used measurements including measured pressures of the excavator boom with the corresponding valve states and control signals are available at [19]. The corresponding functionality was also implemented on NVIDIA Jetsontk1 [24], which was connected to the excavator boom’s control system through a CAN-bus. A demonstration video of running the fault identification during normal operation of the machine while a valve becomes broken (by being unplugged) can be viewed at [1]. Acknowledgements This work has been funded by the Academy of Finland project Merge (No. 286094). References References [1] Online diagnostic for digital hydraulics. Demonstration video, Youtube 2017. [2] Mogens Blanke, Michel Kinnaert, Jan Lunze, Marcel Staroswiecki, and J. Schröder. Diagnosis and FaultTolerant Control. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. [3] E. J. Candes, J. Romberg, and T. Tao. Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information. IEEE Transactions on Information Theory, 52(2):489–509, Feb 2006. [4] Emmanuel J Candès et al. Compressive sampling. In Proceedings of the international congress of mathematicians, volume 3, pages 1433–1452. Madrid, Spain, 2006. [5] Leo H. Chiang, Mark E. Kotanchek, and Arthur K. Kordon. Fault diagnosis based on fisher discriminant analysis and support vector machines. Computers & Chemical Engineering, 28(8):1389 – 1401, 2004. [6] D. L. Donoho. Compressed sensing. IEEE Trans. Inf. Theor., 52(4):1289–1306, April 2006. 6. Conclusion In this paper we present an approach to identify faults in the operation of a large number of 8 [7] M. F. Duarte, M. A. Davenport, D. Takbar, J. N. Laska, T. Sun, K. F. Kelly, and R. G. Baraniuk. Single-pixel imaging via compressive sampling. IEEE Signal Processing Magazine, 25(2):83–91, March 2008. [8] J Ersfolk, P Boström, V Timonen, J Westerholm, J Wiik, O Karhu, M Linjama, and M Waldén. Optimal digital valve control using embedded gpu. In Proceedings of the Eight Workshop on Digital Fluid Power, pages 239 – 250, 2016. [9] Z. Gao, C. Cecati, and S. X. Ding. A survey of fault diagnosis and fault-tolerant techniques – part i: Fault diagnosis with model-based and signal-based approaches. IEEE Transactions on Industrial Electronics, 62(6):3757–3767, June 2015. [10] M. Grbovic, W. Li, N. A. Subrahmanya, A. K. Usadi, and S. Vucetic. Cold start approach for data-driven fault detection. IEEE Transactions on Industrial Informatics, 9(4):2264–2273, Nov 2013. [11] Stefan Grönroos, Wictor Lund, and Jerker Björkqvist. A single pixel camera based on a dlp video projector. In Sirkka-Liisa Jämsä-Jounela, editor, Proceedings of Automaatio XXI, volume 44, page 1–6. Suomen Automaatioseura ry Finnish Society of Automation, 2015. [12] I. Hwang, S. Kim, Y. Kim, and C. E. Seah. A survey of fault detection, isolation, and reconfiguration methods. IEEE Transactions on Control Systems Technology, 18(3):636–653, May 2010. [13] Rolf Isermann. Model-based fault-detection and diagnosis – status and applications. Annual Reviews in Control, 29(1):71 – 85, 2005. [14] Roger Koenker and Kevin F. Hallock. Quantile regression. The Journal of Economic Perspectives, 15(4):143– 156, 2001. [15] Wenfu Ku, Robert H. Storer, and Christos Georgakis. Disturbance detection and isolation by dynamic principal component analysis. Chemometrics and Intelligent Laboratory Systems, 30(1):179 – 196, 1995. [16] Jong-Min Lee, ChangKyoo Yoo, and In-Beum Lee. Statistical monitoring of dynamic processes based on dynamic independent component analysis. Chemical Engineering Science, 59(14):2995 – 3006, 2004. [17] M Linjama. On the numerical solution of steady-state equations of digital hydraulic valve-actuator system. In Proceedings of the Eight Workshop on Digital Fluid Power, pages 141 – 155, 2016. [18] Matti Linjama. Digital fluid power – state of the art. In Proceedings of the Twelfth Scandinavian International Conference on Fluid Power, SICFP’11, 2011. [19] Matti Linjama, Miika Ahopelto, and Johan Ersfolk. Digital hydraulic boom with valve faults. Etsin research data finder, 2017-05-08. [20] Matti Linjama, Mikko Huova, Pontus Boström, Arto Laamanen, Lauri Siivonen, Lionel Morel, Marina Waldén, and Matti Vilenius. Design and implementation of energy saving digital hydraulic control system. In J. Vilenius, K. T. Koskimies, and J. UusiHeikkilä, editors, Proceedings of 10th Scandinavian International Conference on Fluid Power (SICFP’07), volume 2, pages 341–359. Tampere University of Technology, 2007. [21] M. Lustig, D. L. Donoho, J. M. Santos, and J. M. Pauly. Compressed sensing mri. IEEE Signal Processing Magazine, 25(2):72–82, March 2008. [22] J.F. MacGregor and T. Kourti. Statistical process control of multivariate processes. Control Engineering Practice, 3(3):403 – 414, 1995. [23] NIST/SEMATECH. EWMA Control Charts. eHandbook of Statistical Methods. [24] NVIDIA. Jetson-tk1 embedded development platform. 2017. [25] L. Siivonen, M. Linjama, M. Huova, and M. Vilenius. Fault detection and diagnosis of digital hydraulic valve system. In The Tenth Scandinavian International Conference on Fluid Power, May 21-23, 2007, Tampere, Finland, SICFP0́7. Tampere University of Technology, 2007. [26] L. Siivonen, M. Linjama, M. Huova, and M. Vilenius. Pressure based fault detection and diagnosis of a digital valve system. In Power Transmission and Motion Control (PTMC 2007), University of Bath, UK, 12-14 September 2007, 2007. [27] S. Simani. Identification and fault diagnosis of a simulated model of an industrial gas turbine. IEEE Transactions on Industrial Informatics, 1(3):202–216, Aug 2005. [28] M. Unser. Sampling—50 Years after Shannon. Proceedings of the IEEE, 88(4):569–587, April 2000. [29] Jiyan Yang, Xiangrui Meng, and Michael W. Mahoney. Quantile Regression for Large-scale Applications. In Proceedings of the 30th International Conference on Machine Learning, volume 28 of JMLR Proceedings, pages 881–887. JMLR.org, 2013. [30] Zuyu Yin and Jian Hou. Recent advances on {SVM} based fault diagnosis and process monitoring in complicated industrial processes. Neurocomputing, 174, Part B:643 – 650, 2016. 9
3cs.SY
arXiv:1610.05684v1 [math.NT] 15 Oct 2016 Recursive constructions of k-normal polynomials over finite fields Mahmood Alizadeh Department of Mathematics, Ahvaz Branch, Islamic Azad University, Ahvaz, Iran [email protected] Saeid Mehrabi Department of Mathematics, Farhangian University, Tehran, Iran [email protected] Abstract The paper is devoted to produce infinite sequences of k-normal polynomials Fu (x) ∈ Fq [x] of degrees npu (u ≥ 0), for a suitably chosen initial k-normal polynomial F0 (x) ∈ Fq [x] of p −x degree n over Fq by iteratively applying the transformation x → xpx−x+δ , where δ ∈ Fq and 0 ≤ k ≤ n − 1. Keywords:Finite fields; normal basis; k-normal element; k-normal polynomial. Mathematics Subject Classification:12A20 1 Introduction Let Fq be the Galois field of order q = pm , where p is a prime and m is a natural number, and F∗q be n−1 its multiplicative group. A normal basis of Fqn over Fq is a basis of the form N = {α, αq , ..., αq }, i.e. a basis that consists of the algebraic conjugates of a fixed element α ∈ F∗qn . Such an element α ∈ Fqn is said to generate a normal basis for Fqn over Fq , and for convenience, is called a normal element. A monic irreducible polynomial F (x) ∈ Fq [x] is called normal polynomial or N -polynomial if its roots are linearly independent over Fq . Since the elements in a normal basis are exactly the roots of some N-polynomials, there is a canonical one-to-one correspondence between N-polynomials and normal elements. Normal bases have many applications, including coding theory, cryptography and computer algebra systems. For further details, see [9]. Recently, the k-normal elements over finite fields are defined and characterized by Huczynska et al [8]. For each 0 ≤ k ≤ n − 1, the element α ∈ Fqn is called a k-normal element if deg(gcd(xn − Pn−1 qi n−1−i 1, i=0 α x )) = k. By analogy with the case of normal polynomials, a monic irreducible polynomial P (x) ∈ Fq [x] of degree n is called a k-normal polynomial (or Nk -polynomial) over Fq if its roots are k-normal elements of Fqn over Fq . Here, P (x) has n distinct conjugate roots, of which (n − k) are linearly / Fq v independent. Recall that an element α ∈ Fqn is called a proper element of Fqn over Fq if α ∈ for any proper divisor v of n. So, the element α ∈ Fqn is a proper k-normal element of Fqn over Fq if α is a k-normal and proper element of Fqn over Fq . Using the above mention, a normal polynomial (or element) is a 0-normal polynomial (or element). Since the proper k-normal elements of Fqn over Fq are the roots of a k-normal polynomial of degree n over Fq , hence the k-normal polynomials of degree n over Fq is just another way of describing the proper k-normal elements of Fqn over Fq . Some results regarding constructions of spacial sequences of k-normal polynomials over Fq , in the cases k = 0 and 1 can be found in [2, 4, 5, 10, 11] and [6], respectively. In this paper, a recursive method for constructing the k-normal polynomials of higher degree from a given k-normal polynomial of degree n over Fq for each 0 ≤ k ≤ n − 1 is given. 1 2 Preliminary notes We use the definitions, notations and results given by Huczynska [8], Gao [7] and Kyuregyan [10, 11], where similar problems are considered. We need the following results for our further study. Pn−1 i The trace of α in Fqn over Fq , is given by T rFqn |Fq (α) = i=0 αq . For convenience, T rFqn |Fq is denoted by T rqn |q . Proposition 2.1. [6] Let n = n1 pe , for some e ≥ 1 and a, b ∈ F∗q . Then the element α is a proper k-normal element of Fqn over Fq if and only if a + bα is a proper k-normal element of Fqn over Fq . Let p denote the characteristic of Fq and let n = n1 pe = n1 t, with gcd(p, n1 ) = 1 and suppose that xn − 1 has the following factorization in Fq [x] : xn − 1 = (ϕ1 (x)ϕ2 (x) · · · ϕr (x))t , (1) where ϕi (x) ∈ Fq [x] are the distinct irreducible factors of xn − 1. For each s, 0 ≤ s < n, let there is a us > 0 such that Rs,1 (x), Rs,2 (x), · · · , R s (x) are all of the s degree polynomials dividing Qs,u r xn − 1. So, from (1) we can write Rs,i (x) = j=1 ϕj tij (x), for each 1 ≤ i ≤ us , 0 ≤ tij ≤ t. Let φs,i (x) = xn − 1 , Rs,i (x) (2) for 1 ≤ i ≤ us . Then, there is a useful characterization of the k-normal polynomials of degree n over Fq as follows. Proposition 2.2. [6] Let F (x) be an irreducible polynomial of degree n over Fq and α be a root of it. Let xn − 1 factor as (1) and let φs,i (x) be as in (2). Then F (x) is a Nk -polynomial over Fq if and only if, there is j, 1 ≤ j ≤ uk , such that Lφk,j (α) = 0, and also Lφs,i (α) 6= 0, for each s, k < s < n, and 1 ≤ i ≤ us , where us is the number of all s degree polynomials dividing xn − 1 and Lφs,i (x) is the linearized polynomial defined by Lφs,i (x) = n−s X v tiv xq if φs,i (x) = v=0 n−s X tiv xv . v=0 The following propositions are useful for constructing Nk -polynomials over Fq . PropositionP2.3. [3] Let xp − δ2 x + δ0 and xp − δ2 x + δ1 be relatively prime polynomials in Fq [x] n and P (x) = i=0 ci xi be an irreducible polynomial of degree n ≥ 2 over Fq , and let δ0 , δ1 ∈ Fq , δ2 ∈ F∗q , (δ0 , δ1 ) 6= (0, 0). Then  p  x − δ2 x + δ0 p n F (x) = (x − δ2 x + δ1 ) P xp − δ2 x + δ1 q−1 is an irreducible polynomial of degree np over Fq if and only if δ2 p−1 = 1 and    P ′ (1) 1 6= 0, (δ1 − δ0 ) − nδ1 T rq|p Ap P (1) where Ap−1 = δ2 , for some A ∈ F∗q . 2 Proposition 2.4. [1] Let xp − x + δ0 and xp − x + δ1 be relatively prime polynomials in Fq [x] and let P (x) be an irreducible polynomial of degree n ≥ 2 over Fq , and 0 6= δ1 , δ0 ∈ Fp , such that δ0 6= δ1 . Define F0 (x) = P (x) p tk−1 Fk (x) = (x − x + δ1 ) Fk−1  xp − x + δ0 xp − x + δ1  , k≥1 where tk = npk denotes the degree of Fk (x). Suppose that T rq|p  (δ1 − δ0 )F0′ (1) − nδ1 F0 (1) F0 (1)  · T rq|p (δ1 − δ0 )F0′ ( δδ01 ) + nδ1 F0 ( δδ01 ) F0 ( δδ01 ) ! 6= 0. Then (Fk (x))k≥0 is a sequence of irreducible polynomials over Fq of degree tk = npk , for every k ≥ 0. Lemma 2.5. Let γ be a proper element of Fqn and θ ∈ F∗p , where q = pm , (m ∈ N). Then we have p−1 X 1 1 =− p . (3) γ + jθ γ −γ j=0 Proof. By observing that p−1 X j=0 it is enough to show that   p−1 1 1 X γ p − γ  , = p γ + jθ γ − γ j=0 γ + jθ p−1 p X γ −γ j=0 γ + jθ (4) (5) = −1. We note that p−1 X j=0 p−1  X γp − γ p−1 (γ + jθ) −1 = γ + jθ j=0 = p−1 X (γ + jθ)p−1 j=0 p−1 X !   p−1 X p−1 j θ = i , j j=1 i=1 where j   (p − 1)! p−1 = , j (p − 1 − j)!j! (6) j ∈ F∗p . On the other side, we know that p−1 X i=1 j i = ( 0 (mod p), if p-1 ∤ j −1 (mod p), if p-1 | j and also θp−1 = 1. Thus by (6) and (7), the proof is completed. 3 (7) 3 Recursive construction Nk -polynomials In this section we establish theorems which will show how propositions 2.2, 2.3 and 2.4 can be applied to produce  infinite sequences of Nk -polynomials over Fq . Recall that, the polynomial P ∗ (x) = xn P x1 is called the reciprocal polynomial of P (x), where n is the degree of P (x). In the case k = 0, some similar results of the following theorems has been obtained in [2], [4] and ([5], Theorems 3.3.1 and 3.4.1). We use of an analogous technique to that used in the above results, where similar problems are considered. Pn Theorem 3.1. Let P (x) = i=0 ci xi be an Nk -polynomial of degree n over Fq , for each n = rpe , where e ∈ N and r equals 1 or is a prime different from p and q a primitive element modulo r. Suppose that δ ∈ F∗q and p n F (x) = (x − x + δ) P ∗  xp − x xp − x + δ  (8) . Then F ∗ (x) is an Nk -polynomial of degree np over Fq if k < pe and ! ′ P ∗ (1) 6= 0. T rq|p δ ∗ P (1) Proof. Since P ∗ (x) is an irreducible polynomial over Fq , so Proposition 2.3 and theorem’s hypothesis imply that F (x) is irreducible over Fq . Let α ∈ Fqn be a root of P (x). Since P (x) is an Nk -polynomial of degree n over Fq by theorem’s hypothesis, then α ∈ Fqn is a proper k-normal element over Fq . Since q is a primitive modulo r, so in the case r > 1 the polynomial xr−1 + · · · + x + 1 is irreducible over Fq . Thus xn − 1 has the following factorization in Fq [x]: xn − 1 = (ϕ1 (x) · ϕ2 (x))t , (9) where ϕ1 (x) = x − 1, ϕ2 (x) = xr−1 + · · · + x + 1 and t = pe . Letting that for each 0 ≤ s < n and 1 ≤ i ≤ us , Rs,i (x) is the s degree polynomial dividing xn − 1, where us is the number of all s degree polynomials dividing xn − 1. So, from (9), we s s can write Rs,i (x) = (x − 1) 1,i · (xr−1 + · · · + x + 1) 2,i , where s = s1,i + s2,i · (r − 1) for each 0 ≤ s1,i , s2,i ≤ t, except when s1,i = s2,i = t. So, we have φs,i (x) = n−s X xn − 1 xn − 1 = = ts,i,v xv . s1,i s2,i r−1 Rs,i (x) (x − 1) · (x + · · · + x + 1) v=0 (10) Since P (x) is an Nk -polynomial of degree n over Fq , so by Proposition 2.2, there is a j, 1 ≤ j ≤ uk , such that (11) Lφk,j (α) = 0, and also (12) Lφs,i (α) 6= 0, ∗ for each k < s < n and 1 ≤ i ≤ us . Further, we proceed by proving that F (x) is a k-normal polynomial. Let α1 be a root of F (x). Then β1 = α11 is a root of its reciprocal polynomial F ∗ (x). Note that by (9), the polynomial xnp − 1 has the following factorization in Fq [x]: pt xnp − 1 = (ϕ1 (x) · ϕ2 (x)) , (13) where ϕ1 (x) = x − 1, ϕ2 (x) = xr−1 + · · · + x + 1 and t = pe . Letting that for each 0 ≤ s′ < np and 1 ≤ i′ ≤ u′s′ , Rs′ ′ ,i′ (x) is the s′ degree polynomial dividing xnp − 1, where u′s′ is the number of all s′ degree polynomials dividing xnp − 1. So, from 4 s′ ′ (13) we can write Rs′ ′ ,i′ (x) = (x − 1)s1,i′ · (xr−1 + · · · + x + 1) 2,i′ , where s′ = s′1,i′ + s′2,i′ · (r − 1) for each 0 ≤ s′1,i′ , s′2,i′ ≤ pt, except when s′1,i′ = s′2,i′ = pt. Therefore by considering Hs′ ′ ,i′ (x) = xnp − 1 , Rs′ ′ ,i′ (x) (14) and Proposition 2.2, F ∗ (x) is an Nk -polynomial of degree np over Fq if and only if there is a j ′ , 1 ≤ j ′ ≤ u′k , such that ′ LHk,j (β1 ) = 0, ′ and also LHs′ ′ ,i′ (β1 ) 6= 0, for each k < s′ < np and 1 ≤ i′ ≤ u′s′ . Consider xnp − 1 Rs,i (x) Hs,i (x) =   p−1 X x −1  xjn  , = Rs,i (x) j=0 n (15) for each 0 ≤ s < n and 1 ≤ i ≤ us . By (10) we obtain     p−1 p−1 n−s X X X Hs,i (x) = φs,i (x)  xjn  = xjn+v  . ts,i,v  v=0 j=0 It follows that LHs,i (β1 ) = pmv  p−1 X jmn p  , (β1 ) ts,i,v  n−s X v=0 or LHs,i (β1 ) = LHs,i  1 α1 j=0   mv pjmn p p−1  X 1  = ts,i,v  . α 1 v=0 j=0 n−s X  α1 p −α1 +δ α1 p −α1 From (8), if α1 is a zero of F (x), then that j=0 (16) is a zero of P (x), and therefore it may assume α1 p − α1 + δ , α1 p − α1 α= or α−1 = (α1 p − α1 )−1 . (17) δ Now, by (17) and observing that P (x) is an irreducible polynomial of degree n over Fq , we obtain mn α−1 p α−1 =( ) δ δ mn+1 = (α1 p mn − α1 p ) −1 . (18) It follows from (17) and (18) that mn+1 (α1 p mn − α1 p −1 ) = (α1 p − α1 ) −1 . (19) Also observing that F (x) is an irreducible polynomial of degree np over Fq , we have (α1 p − α1 ) 6= 0 mn+1 mn and (α1 p − α1 p ) 6= 0. Hence by (19) mn (α1 p p mn − α1 ) = (α1 p 5 − α1 ). (20) mn It follows from (20) that α1 p 2mn α1 p mn − α1 = θ ∈ F∗p . Hence α1 p mn = (α1 + θ)p mn = α1 p mn + θp = α1 + θ and = α1 + θ + θ = α1 + 2θ. It is easy to show that jmn α1 p or  1 α1 = α1 + jθ, f or 1 ≤ j ≤ p − 1, pjmn = 1 , f or 1 ≤ j ≤ p − 1. α1 + jθ (21) From (16) and (21), we immediately obtain LHs,i (β1 ) = n−s X v=0  p−1 X ts,i,v  j=0 Thus, by (17), (22) and Lemma 2.5 we have LHs,i (β1 ) = = n−s X ts,i,v v=0 n−s X 1 δ  pmv 1  α1 + jθ 1 − p α1 − α1 (22) . pmv mv ts,i,v (1 − α)p v=0 = Lφs,i  1−α δ  (23) . Since α is a zero of P (x), then α will be a k-normal element in Fqn over Fq . Thus according to will also be a k-normal element. Proposition 2.1, the element 1−α δ since 1−α is a root of P (−δx + 1), so by (23) and Proposition 2.2, there is a j, 1 ≤ j ≤ uk , δ such that LHk,j (β1 ) = 0, and also LHs,i (β1 ) 6= 0, ′ for each s, k < s < n and 1 ≤ i ≤ us . So, there is a j ′ , 1 ≤ j ′ ≤ u′k , such that, LHk,j (β1 ) = ′ ′ ′ ′ LHk,j (β1 ) = 0. On the other side, by (14) and (15), for each s , k < s < np and 1 ≤ i ≤ u′s′ , there is s, k < s < n and 1 ≤ i ≤ us such that Hs′ ′ ,i′ (x) divide Hs,i (x). It follows that LHs′ ′ ,i′ (β1 ) 6= 0, for each s′ , k < s′ < np and 1 ≤ i′ ≤ u′s′ . The proof is completed. In the following theorem, a computationally simple and explicit recurrent method for constructing higher degree Nk -polynomials over Fq starting from an Nk -polynomial is described. Theorem 3.2. Let P (x) be an Nk -polynomial of degree n over Fq , for each n = rpe , where e ∈ N and r equals 1 or is a prime different from p and q a primitive element modulo r. Define F0 (x) = P ∗ (x) npu−1 Fu (x) = (xp − x + δ) 6 Fu−1  xp − x p x −x+δ  , (24) where δ ∈ F∗p . Then (Fu∗ (x))u≥0 is a sequence of Nk -polynomials of degree npu over Fq if k < pe and ! ! ′ ′ P ∗ (1) P ∗ (0) · T rq|p 6= 0, T rq|p P ∗ (0) P ∗ (1) ′ ′ where P ∗ (0) and P ∗ (1) are the formal derivative of P ∗ (x) at the points x = 0 and x = 1, respectively. Proof. By Proposition 2.4 and hypotheses of theorem for each u ≥ 1, Fu (x) is an irreducible polynomial over Fq . Consequently, (Fu∗ (x))u≥0 is a sequence of irreducible polynomials over Fq . The proof of k-normality of the irreducible polynomials Fu∗ (x), for each u ≥ 1 is implemented by mathematical induction on u. In the case u = 1, by Theorem 3.1 F1 ∗ (x) is a k-normal polynomial. For u = 2 we show that F2 ∗ (x) is also a k-normal polynomial. To this end we need to show that the hypothesis of Theorem 3.1 are satisfied. By Theorem 3.1, F2 ∗ (x) is a k-normal polynomial if  ′  F1 (1) T rq|p 6= 0, F1 (1) since δ ∈ F∗p . We apply (24) to compute Fu (0) = Fu (1) = δ un P ∗ (0), u = 1, 2, . . . . (25) We calculate the formal derivative of F1′ (x) at the points x = 0 and x = 1. According to (24) the first derivative of F1 (x) is   ′ ′ xp − x n−1 p F0 F1 (x) = −n(x − x + δ) xp − x + δ ! (pxp−1 − 1)(xp − x + δ) − (pxp−1 − 1)(xp − x) n p + (x − x + δ) · 2 (xp − x + δ)   ′ xp − x · F0 xp − x + δ   ′ xp − x = −δ(xp − x + δ)n−2 · P ∗ , xp − x + δ and at the points x = 0 and x = 1 ′ ′ ′ (26) F1 (0) = −F1 (1) = −δ n−1 P ∗ (0)  ′  ∗ (0) which is not equal to zero by the condition T rq|p PP ∗ (0) 6= 0 in the hypothesis of theorem, since δ ∈ F∗p . From (26) and (25) T rq|p  F1′ (1) F1 (1)  ′ −δ n−1 P ∗ (0) = T rq|p δ n P ∗ (0) ! ′ 1 P ∗ (0) = − T rq|p , δ P ∗ (0) ! (27) which is not equal to zero by hypothesis of theorem. Hence the polynomial F2∗ (x) is a k-normal polynomial. If induction holds for u − 1, then it must hold also for u, that is by assuming that ∗ Fu−1 (x) is a k-normal polynomial, we show that Fu∗ (x) is also a k-normal polynomial. Let u ≥ 3. By Theorem 3.1, Fu∗ (x) is a k-normal polynomial if   ′ Fu−1 (1) 6= 0, T rq|p Fu−1 (1) 7 ′ since δ ∈ F∗p . We calculate the formal derivative of Fu−1 (x) at the points 1 and 0. By (24) the first derivative of Fu−1 (x) is ! p−1 p p−1 p u−2 (px − 1)(x − x + δ) − (px − 1)(x − x) np ′ Fu−1 (x) = (xp − x + δ) 2 (xp − x + δ)   xp − x ′ · Fu−2 xp − x + δ   xp − x npu−2 −2 ′ = −δ(xp − x + δ) Fu−2 , xp − x + δ and at the point x = 0 and x = 1 u−2 ′ ′ Fu−1 (0) = Fu−1 (1) = −δ np −1 So we have ′ ′ Fu−2 (0) = −δ n−1 Fu−2 (0). (28) u−2 (n−1)(u−2) ′ ′ Fu−1 (0) = Fu−1 (1) = (−1) F1′ (0), (29)  ′  ∗ (0) 6= 0 in the hypothesis of which is not equal to zero by (26) and the condition T rq|p PP ∗ (0) δ theorem, since δ ∈ F∗p . Also T rq|p  ′ Fu−1 (1) Fu−1 (1)  u−2 = (−1) 1 δ (u−2) T rq|p  F1′ (1) F1 (1)  , which is not equal to zero by (27) and hypothesis of theorem. The theorem is proved. References [1] S. Abrahamyan, M. K. Kyureghyan, A recurrent method for constructing irreducible polynomials over finite fields, proceeding of the 13th international conference on computer algebra in scientific computing, 2011, 1-9. [2] S. Abrahamyan, M. K. Kyureghyan, New recursive construction of normal polynomials over finite fields, proceeding of the 11th international conference on finite fields and their applications, 2013, 1-10. [3] S. Abrahamyan, M. Alizadeh, M. K. Kyureghyan, Recursive constructions of irreducible polynomials over finite fields, Finite Fields Appl., 18 (2012), 738-745. [4] M. Alizadeh, S. Abrahamyan, S. Mehrabi, M. K. Kyuregyan, Constructing of N -polynomials over finite fields, International Journal of Algebra, Vol. 5, No. 29, 2011, 1437-1442. [5] M. Alizadeh, Construction of Irreducible and Normal Polynomials over Finite Fields, Ph.D. Thesis, National Academy of Sciences of Armenia, Yerevan, 2013. [6] M. Alizadeh, Some notes on the k-normal elements and k-normal polynomials over finite fields, J. Algebra Appl., DOI:10.1142/S0219498817500062, 2016. [7] S. Gao, Normal bases over finite fields, Ph.D. Thesis, Waterloo, 1993. [8] S. Huczynska, G. L. Mullen, D. Panario and D. Thomson, Existence and properties of k-normal elements over finite fields, Finite Fields Appl., 24 (2013), 170-183. [9] D. Jungnickel, Finite Fields: Structure and Arithmetics, Wissenschaftsverlag, (Mannheim) 1993. 8 [10] M. K. Kyuregyan, Iterated construction of irreducible polynomials over finite fields with linearly independent roots, Finite Fields Appl., 10 (2004) 323-341. [11] M. K. Kyuregyan, Recursive construction of N-polynomials over GF (2s ), Discrete Applied Mathematics, No. 156, 2008, 1554-1559. [12] H. W. Lenstra and R. Schoof, Primitive normal bases for finite fields, Mathematics of Computation, 48 (1987), 217-231. [13] S. Schwartz, Irreducible polynomials over finite fields with linearly independent roots, Math. Slovaca, Vol. 38, 1988, 147-158. 9
0math.AC
A partial characterization of Hilbert quasi-polynomials in the non-standard case arXiv:1607.05468v2 [math.AC] 21 Jul 2016 Massimo Caboara∗1 , Carla Mascia∗2 ∗1 Department of Mathematics, University of Pisa, Italy ∗2 Department of Mathematics, University of Trento, Italy Email addresses: [email protected], [email protected] July 22, 2016 Abstract The Hilbert function, its generating function and the Hilbert polynomial of a graded ring K[x1 , . . . , xk ] have been extensively studied since the famous paper of Hilbert: Ueber die Theorie der algebraischen Formen [Hil90]. In particular, the coefficients and the degree of the Hilbert polynomial play an important role in Algebraic Geometry. If the ring grading is non-standard, then its Hilbert function is not eventually equal to a polynomial but to a quasi-polynomial. It turns out that a Hilbert quasi-polynomial P of degree n splits into a polynomial S of degree n and a lower degree quasi-polynomial T . We have completely determined the degree of T and the first few coefficients of P . Moreover, the quasi-polynomial T has a periodic structure that we have described. We have also implemented a software to compute effectively the Hilbert quasi-polynomial for any ring K[x1 , . . . , xk ]/I. Keywords: Non-standard gradings, Hilbert quasi-polynomial. 1 Introduction In this section, we provide a very short overview of Hilbert function, HilbertPoincaré series and Hilbert polynomial of graded rings, omitting details and proofs, which can be found in any introductory commutative algebra book (i.e. [KR05]). From now on, K will be a field and (R/I, W ) stands for the polynomial ring R/I, where R := K[x1 , . . . , xk ] is a quotient ring graded by W := [d1 , . . . , dk ] ∈ Nk+ and I is a W -homogeneous ideal of R, that is αk 1 deg(xα 1 · · · xk ) := d1 α1 + · · · + dk αk with the usual definition for the n-graded component of R/I. Due to Macaulay’s lemma, we can suppose that I is a monomial ideal. Recall that if W = [1, . . . , 1] the grading is called standard. W The Hilbert function HR/I : N → N of (R/I, W ) is defined by W (n) := dimK ((R/I)n ) HR/I 1 and the Hilbert-Poincaré series of (R/I, W ) is given by X W W (t) := (n)tn ∈ NJtK HPR/I HR/I n∈N When the grading given by W is clear from the contest, we denote respectively the Hilbert function and the Hilbert-Poincaré series of (R/I, W ) by HR/I and HPR/I . The following two well-known results characterize the Hilbert-Poincaré series and the Hilbert function, but the latter holds only for standard grading. Theorem 1 (Hilbert-Serre) The Hilbert-Poincaré series of (R/I, W ) is a rational function, that is for suitable h(t) ∈ Z[t] we have that h(t) HPR/I (t) = Qk i=1 (1 − td i ) ∈ ZJtK The polynomial h(t) which appears in the denominator of HPR/I is called hvector and we denote it by < I >. Definition 2 Let R be a polynomial standard graded ring and I a homogeneous ideal of R. Then there exists a polynomial PR/I (x) ∈ Q[x] such that HR/I (n) = PR/I (n) ∀ n ≫ 0 This polynomial is called Hilbert polynomial of R/I. 2 Hilbert quasi-polynomials As we will see, in the case of non-standard grading, the Hilbert function of W (R/I, W ) is definitely equal to a quasi-polynomial PR/I instead of a polynomial. W The main aim of this section is to investigate the structure of PR/I , such as its degree, its leading coefficient and proprieties of its coefficients. 2.1 Existence of the Hilbert quasi-polynomials We recall that a function f : N → N is a (rational) quasi-polynomial of period s if there exists a set of s polynomials {p0 , . . . , ps−1 } in Q[x] such that we have f (n) = pi (n) when n ≡ i mod s. Let d := lcm(d1 , . . . , dk ). We are going to show that the Hilbert function of (R/I, W ) is definitely equal to a quasi-polynomial of period d. Proposition 3 Let (R/I, W ) be as above. There exists a unique quasi-polynomial W W PR/I := {P0 , . . . , Pd−1 } of period d such that HR/I (n) = PR/I (n) for all n ≫ 0, that is HR/I (n) = Pi (n) ∀i ≡ n mod d and ∀n ≫ 0 W PR/I is called the Hilbert quasi-polynomial associated to (R/I,W). Proof. From the Hilbert-Serre theorem, we know that the Hilbert-Poincaré series of R/I can be written as a rational function HPR/I (t) = Qk h(t) i=1 (1 2 − td i ) ∈ Z[|t|] Let ζ be a primitive dth root of unity, so we can write k Y (1 − tdi ) = i=1 d−1 Y (1 − ζ j t)αj , for some αj ∈ N such that d−1 X αj = j=0 j=0 k X di i=1 By using this relation and partial fractions, we have HPR/I (t) = Qd−1 h(t) j=0 (1 − ζ j t)αj = d−1 X j=0 Qj (t) (1 − ζ j t)αj (1) where QjP (t) ∈ C[t] is a polynomial of degree nj for all j = 0, . . . , d − 1, namely nj ajh th . Qj (t) := h=0 We are going to consider individually any addend in (1), so ! nj X Qj (t) 1 h · = ajh t (1 − ζ j t)αj (1 − ζ j t)αj h=0  !  nj X X n + αj − 1 = ajh th ·  ζ jn tn  n n≥0 h=0 " nj #   X X n + αj − h − 1 j(n−h) n X = ζ t = bjn tn ajh n−h n≥0 n≥0 h=0 where bjn := nj X h=0   n + αj − h − 1 j(n−h) ajh ζ n−h We can rewrite the Hilbert-Poincaré series in the following way:   d−1 d−1 d−1 X X X X X Qj (t)  = bjn tn = bjn  tn HPR/I (t) = j t)αj (1 − ζ j=0 j=0 j=0 n≥0 n≥0 and, therefore, for all n ≥ max{nj }, we have j HR/I (n) = d−1 X bjn = j=0 nj d−1 XX ajh j=0 h=0 where Sj (n) := nj X h=0  ajh  d−1 n + αj − h − 1 j(n−h) X Sj (n)ζ jn ζ = n−h j=0   n + αj − h − 1 −jh ζ n−h So, given n ≥ max{nj }, let i be an integer such that 0 ≤ i ≤ d − 1 and j i ≡ n mod d, the Hilbert function evaluated at n is equal to the evaluation at n of the polynomial Pi (x) := S0 (x) + S1 (x)ζ i + · · · + Sd−1 (x)ζ (d−1)i 3 W By the proof, we find out that HR/I (n) = PR/I (n) for all n ≥ max{nj }, where j nj are the degrees of the polynomials Qj (t) which appear in Equation (1) of the Hilbert-Poincaré series. Remark 4. Proposition 3 asserts that the Hilbert quasi-polynomial consists of d polynomials, but it doesn’t assure that they are all distinct. Actually, it can happen that some of them are equal to each other, a trivial example is given for gcd(d1 , . . . , dk ) 6= 1, as we will see. Remark that the proof of proposition yields a way to compute the Hilbert quasi-polynomial of (R/I, W ), when the Hilbert-Poincaré series is known. W Remark 5. All the polynomials of the Hilbert quasi-polynomial PR/I have rational coefficients. In fact, we recall that if a polynomial P (x) ∈ C[x] of degree n is such that P (xi ) ∈ Z for some x0 , . . . , xn ∈ Z, then P (x) ∈ Q[x]. By definition, Pi (n) ∈ N for all sufficiently large n ∈ N such that i ≡ n mod d. Due to the following result, we can restrict our study to the case (R, W ) where W is such that d = 1. Proposition P 6 Let W ′ := a · W = [d′1 , . . . , d′k ] for some a ∈ N+ and let r j j=0 aj t . Then it holds: HPR/I (t) = Qk di i=1 (1 − t ) Pr W (n) = j=0 aj PRW (n − j) ∀ n ≫ 0 (i) PR/I ′ ′ (ii) PRW = {P0′ , . . . , Pad−1 } is such that ( 0 ′ Pi (x) = P ai Proof. x a (i) Since HPR (t) = X n≥0 we have HPR/I (t) = Qk = X n≥0 HR (n)tn = Qk   − td i ) r X j=0 1 i=1 (1 h(t) i=1 (1 if a ∤ i if a | i   = X n≥0 − td i )   r X a j tj  HR (n)tn   j=0  aj HR (n − j) tn with the convention HR (n) = 0 for all n < 0. Therefore, for all n ≥ r, Pr W HR/I (n) = j=0 aj HR (n − j) . Given that HR (n) = PR (n) for all W sufficiently large n, then Pr HR (n − j) = PR (n − j) for all sufficiently large n and so HR/I (n) = j=0 aj PRW (n − j) for all sufficiently large n. The statement follows. (ii) Let i be a positive integer such that a doesn’t divide i. We observe that W′ HR (n) = 0 for all n ∈ N such that n ≡ i mod ad. Indeed, assume that 4 ′ W HR (n) 6= 0 for some n ≡ i mod ad. Then there exist a1 , . . . , ak ∈ N such that a1 d′1 + · · · + ak d′k = n. By hypothesis, a divides d′1 , . . . , d′k , hence a divides n and so a divides i, which is a contradiction. Since W′ Pi′ (n) = HR (n) for all sufficiently large n such that n ≡ i mod a, then Pi′ has an infinitive number of roots and so Pi′ = 0. Let i be a positive integer such that a divides i. Recall that for all sufficiently large n such that n ≡ i mod d, we have W Pi (n) = HR (n) = #{(a1 , . . . , ak ) ∈ Nk |a1 d1 + . . . ak dk = n} Then, ′ W Pi′ (n) = HR (n) = #{(b1 , . . . , bk ) ∈ Nk | ab1 d1 + · · · + abk dk = n} = #{(b1 , . . . , bk ) ∈ Nk | b1 d1 + · · · + bk dk = n/a}   n W n = P ai = HR a a To avoid endlessly repeating these hypothesis, we shall use W to denote a weight vector [d1 , . . . , dk ] such that gcd(d1 , . . . , dk ) = 1, throughout the remainder of this section. 2.2 Degree and leading coefficient of the Hilbert quasipolynomial In this subsection, we investigate some proprieties of the Hilbert quasi-polynomial of (R, W ). First of all, we introduce the following notation which will help us to rewrite the denominator of the Hilbert-Poincaré series of (R, W ) in a suitable way. Given d1 , . . . , dk ∈ N+ , with d := lcm(d1 , . . . , dk ), we define • δ := max{|I| | gcd(di )i∈I 6= 1 and I ⊆ {1, . . . , k}}, • dˆs := d ds , • Ms := {dˆs , 2dˆs , . . . , (ds − 1)dˆs } for all s = 1, . . . , k, ! \ [ for all r = 1, . . . , k. • Tr := Ms J⊆{1,...,k} |J|=r s∈J S Observe that Tr is the set of the elements p ∈ ki=1 Mi which belong to exactly r sets Mi . Now we’ll analyse the denominator of the Hilbert-Poincaré series of (R, W ), which we denote by g(t). Let ζ := ζd be a primitive dth root of unity. We ˆ remark that ζdj = ζ dj for all j = 1, . . . , k. Then we can write 5 g(t) = k Y (1 − tdi ) = (1 − t)k k h i Y ˆ (1 − ζ di t) · · · (1 − ζ (di −1)d̂i t) i=1 i=1 k = (1 − t) = (1 − t)k Y j (1 − ζ t) · · · Y (1 − ζ j t) j∈M1 j∈Mk Y Y (1 − ζ j t)k · · · j∈Tk (2) (1 − ζ j t) j∈T1 We are now going to show some lemmas concerning the sets Ms and Tr . Lemma 7 Let d1 , . . . , dk ∈ N+ . For any subset {j1 , . . . , jr } ⊆ {1, . . . , k}, it holds Mj1 ∩ · · · ∩ Mjr =  d d ,2 · ,... gcd(dj1 , . . . , djr ) gcd(dj1 , . . . , djr )  d . . . , (gcd(dj1 , . . . , djr ) − 1) · gcd(dj1 , . . . , djr ) Proof. We use induction on r, the number of intersected subsets. The case r = 1 is trivial. Suppose r ≥ 2 and consider, without loss of generality, the subsets M1 , . . . , Mr instead of Mj1 , . . . , Mjr . By induction hypothesis, we have  d d ,2 · ,... M1 ∩ · · · ∩ Mr−1 = gcd(d1 , . . . , dr−1 ) gcd(d1 , . . . , dr−1 )  d . . . , (gcd(d1 , . . . , dr−1 ) − 1) · gcd(d1 , . . . , dr−1 ) We observe that M1 ∩ · · · ∩ Mr−1 has the same structure of Ma , where a is equal to gcd(d1 , . . . , dr−1 ) (without loss of generality we can suppose that a is one of the given integers). Therefore M1 ∩ · · · ∩ Mr = Ma ∩ Mr and, by using again the induction hypothesis, we obtain   d d d M1 ∩ · · · ∩ Mr = ,2· , . . . , (gcd(a, dr ) − 1) · gcd(a, dr ) gcd(a, dr ) gcd(a, dr ) and since a = gcd(d1 , . . . , dr−1 ), we are done. Lemma 8 Let d1 , . . . , dk ∈ N+ . Then Tδ+1 = · · · = Tk = ∅. Proof. We assume that Th 6= ∅ for some h = δ + 1, . . . , k. Consider p ∈ Th and suppose, without loss of generality, that p ∈ M1 ∩ · · · ∩ Mh . By lemma 7, p = p1 · gcd(d1d,...,dh ) with 1 ≤ p1 ≤ gcd(d1 , . . . , dh ) − 1. Since δ < h, we must have gcd(d1 , . . . , dh ) = 1. Therefore p is a multiple of d, which is a contradiction because of p < d. By lemma 8, in Equation (2) the set Tδ+1 , . . . , Tk are empty, so ultimately we have 6 g(t) = k Y i=1  (1 − tdi ) = (1 − t)k  Y j∈Tδ   (1 − ζ j t)δ  · · ·  Y j∈T1  (1 − ζ j t) (3) and we obtain the following useful expression for the Hilbert-Poincaré series HPR (t) = X Qj(δ) (t) X Q(1) Q0 (t) 1 j (t) + + · · · + = k j δ g(t) (1 − t) (1 − ζ t) (1 − ζ j t) j∈Tδ (4) j∈T1 Remark 9. We have already seen in the proof of Proposition 3 that any addend Pnj Qj (t) ajh th , can be written in the following of HPR (t), with Qj (t) = h=0 (1−ζ j t)αj way # " nj   X X n + αj − h − 1 j(n−h) n Qj (t) t (5) = ζ ajh (1 − ζ j t)αj αj − 1 n≥0 h=0 Q (t) Then the rational function (1−ζjj t)αj corresponds to a power series in t where the nth coefficient depends on n in a polynomial way through the binomial  n+αj −h−1 and its degree in n is αj − 1. αj −1 We consider the equation (4) of the Hilbert-Poincaré series and, by using partial fractions, we get HPR (t) = Ak A1 A2 1 + ···+ + = + g(t) 1 − t (1 − t)2 (1 − t)k " # (6) " # (δ) (δ) (1) X X Bj,δ Bj,1 Bj,1 + + ···+ + ···+ 1 − ζj t (1 − ζ j t)δ 1 − ζj t j∈Tδ j∈T1 (r) for some Ai , Bj,h ∈ Q. Remark 10. By multiplying both sides of Equation (6) by g(t), we get   k Y Y X At (1 − t)k−t · (1 − ζ j t)δ · · · 1= (1 − ζ j t) + t=1 + + .. . + + X      j∈Tδ   j∈T1 j∈Tδ (1 − t)k · " δ−1 Y Y i=1 r∈Ti (1 − ζ j t)i #    k X  (δ) Y  s δ−m   (1 − ζ t) · Bj,m ·  +  m=1 s∈Tδ   s6=j   Y Y X  (1) Y  B (1 − t)k · (1 − ζ r t)δ · · · (1 − ζ r )2 (1 − ζ s t)  j,1  j∈T1 r∈Tδ r∈T2 7 s∈T1 s6=j (7) Remark 11. By Equation (6), we have Q0 (t) = A1 (1 − t)k−1 + A2 (1 − t)k−2 + · · · + Ak (8) Proposition 12 Let (R, W ) and PRW be as above. The degree of Pi is equal to k − 1 for all i = 0, . . . , d − 1 and its leading coefficient lc(Pi ) is such that lc(Pi ) = 1 Qk (k − 1)! i=1 di Proof. Since δ < k by hypothesis and thanks to Equation (4) and remark 9, it suffices to analyse the term " # X k−1 X n − h + k − 1 Q0 (t) = tn ah (1 − t)k k−1 n≥0 h=0 where ah := a0,h for all h = 0, . . . , k − 1.  Pk−1 We observe that h=0 ah n−h+k−1 = S0 (n) and then the degree of Pi is less k−1 or equal to k − 1. It remains to show that the coefficient of nk−1 is not 0. In particular, we wish to show that it is equal to (k−1)! 1Qk d . i=1 i Suppose n ≥ k − 1, then the nth coefficient of HPR (t) is equal to S0 (n) = k−1 X ah   n−h+k−1 k−1 ah (n − h + k − 1)(n − h + k − 2) · · · (n − h + 1) (k − 1)! h=0 = k−1 X h=0 = k−1 X h=0 ah · nk−1 + terms of degree in n lower than (k − 1) (k − 1)! Then the leading coefficient of S0 (n) is k−1 X 1 Ak 1 Q0 (1) = = ah = Q (k − 1)! (k − 1)! (k − 1)! (k − 1)! ki=1 di h=0 (9) where the last equality in (9) follows by the Lemma 13. Lemma 13 The constant Ak which appears in Equation (6) and (8) is such that 1 Ak = Qk . i=1 di Proof. By evaluating Equation (7) at t = 1, we get Y Y (1 − ζ j ) 1 = Ak · (1 − ζ j )δ · · · j∈Tδ j∈T1 8 Q Q Q If we prove that j∈δ (1 − ζ j )δ · · · j∈T1 (1 − ζ j ) is equal to ki=1 di , we are done. For this purpose, we consider the following two equations, the first of which derives from equation (3): Y Y g(t) = (1 − ζ j t)δ · · · (1 − ζ j t) k (1 − t) j∈Tδ j∈T1 k Y k Y g(t) 1 − td j (1 + t + · · · + tdj −1 ) = = k (1 − t) 1 − t j=1 j=1 Then, it holds Y (1 − ζ j t)δ · · · j∈Tδ Y (1 − ζ j t) = k Y (1 + t + · · · + tdj −1 ) (10) j=1 j∈T1 By evaluating both sides of Equation (10) at t = 1, the statement follows. Now, we’ll give a degree bound for the Hilbert quasi-polynomial of (R/I, W ), when I 6= (0). W Proposition 14 Let I 6= (0) a W -homogeneous ideal of R and let PR/I the Hilbert quasi-polynomial of (R/I, W ). Then the degree of Pi is less or equal to k − 2. In order to prove Proposition 14, we need the following results. Let I = 6 (0) be a homogeneous monomial ideal and consider the Hilbert-Poincaré series f (t) (t) HPR/I (t) = Qk f(1−t di ) = g(t) of (R/I, W ). Let f (t) := q(t)g(t) + r(t), where i=1 q(t), r(t) ∈ Q(t) and deg r < deg g. Then, we can write  f (t) Ck r(t) C2 C1 + ···+ + = q(t) + = q(t) + + 2 g(t) g(t) 1 − t (1 − t) (1 − t)k  " # " # (δ) (δ) (1) X X Dj,δ Dj,1 Dj,1  + + ···+ + ··· + 1 − ζj t (1 − ζ j t)δ 1 − ζj t  HPR/I (t) = j∈Tδ j∈T1 (11) (r) for some Ci , Dj,h ∈ Q. Lemma 15 The constant Ck which appears in Equation (11) is zero. Proof. By Equation (11), we get 9 r(t) = k X t=1 + + .. . +    X  Ct (1 − t)k−t · (1 − t)k ·  j∈Tδ   + Y j∈Tδ " δ−1 Y Y i=1 (1 − ζ j t)δ · · · j∈T1 (1 − ζ j t)i r∈Ti Y #  (1 − ζ j t) +    k  X  (δ) Y  s δ−m   · D (1 − ζ t) · j,m   +  m=1 s∈Tδ   s6=j   Y X  (1) Y Y  r δ r 2 s  D (1 − t)k · (1 − ζ t) · · · (1 − ζ ) (1 − ζ t) j,1   r∈Tδ j∈T1 r∈T2 (12) s∈T1 s6=j By evaluating Equation (12) at t = 1, we have Y Y (1 − ζ j ) r(1) = Ck · (1 − ζ j )δ · · · j∈Tδ j∈T1 Qk Q Q We already know that j∈Tδ (1 − ζ j )δ · · · j∈T1 (1 − ζ j ) = i=1 di , then we have to show that r(1) = 0. Actually, it suffices to prove that f (1) = 0, because f (1) = q(1)g(1) + r(1) and f (1) = g(1) = 0 imply r(1) = 0. We prove that f (1) = 0 by induction on the cardinality s of a minimal set of generators of I. Suppose s = 1, since I 6= (0) there exists m ∈ I such that I = (m). Then f (t) =< I >= 1 − tdegW (m) , so obviously f (1) = 0. If s ≥ 2, let {m1 , . . . , ms } a minimal set of generators of I, then I = (m1 , . . . , ms ) and, by using proprieties of the h-vector, we have f (t) = < (m1 , . . . , ms ) > = < (m1 , . . . , ms−1 ) > −tdegW (ms ) < (m1 , . . . , ms−1 ) : (ms ) > and we can conclude by induction hypothesis. We can now demonstrate that for all i = 0, . . . , d − 1 it holds deg(Pi ) ≤ k − 2. Proof of Proposition 14. We consider the following expression for Hilbert-Poincaré series, which we have already seen in Equation (11)  Ck r(t) C2 f (t) C1 + ···+ + = q(t) + = q(t) + + HPR/I (t) = g(t) g(t) 1 − t (1 − t)2 (1 − t)k " # " # (δ) (δ) (1) X X Dj,δ Dj,1 Dj,1  + + ···+ + ··· + 1 − ζj t (1 − ζ j t)δ 1 − ζj t  j∈Tδ j∈T1 Since δ < k, and by lemma 15, which asserts that Ck = 0, we have that the maximum power of t in the denominator of HPR/I is at most k − 1. Therefore, 10 by recalling the construction of Hilbert quasi-polynomial done in the proof of proposition 3, we write HPR/I (t) = d−1 X j=0 Pnj Qj (t) (1 − ζ j t)αj for some polynomials Qj (t) := h=0 ajh th ∈ C[t] of degree nj with αj ≤ k − 1 for all j = 0, . . . , d − 1. Then, for all n ≥ maxj {nj }, we have  nj  d−1 X X n + αj − h − i −jh Sj (n)ζ jn where Sj (n) := ζ HR/I (n) = αj − 1 j=0 h=0 Observe that Sj is a polynomial in n of degree αj − 1. Finally, we get Pi (x) := S0 (x) + S1 (x)ζ i + · · · + Sd−1 (x)ζ (d−1)i and, by our previous considerations, every Sj has degree less or equal to k − 2 and the statement follows. 2.3 Proprieties of the coefficients of the Hilbert quasipolynomial In this subsection, we present some proprieties of the coefficients of Hilbert quasi-polynomials. In particular, we show that a Hilbert quasi-polynomial of degree n splits into a polynomial of degree n and a lower degree quasi-polynomial which have a periodic structure that we will describe. Before showing our results, we present an example. Example 16. Consider R = Q[x1 , . . . , x5 ] graded by W = [1, 2, 3, 4, 6]. We have k = 5 and d = 12 and the Hilbert quasi-polynomial PRW = {P0 , . . . , P11 } is P0 (x) P1 (x) P2 (x) P3 (x) P4 (x) P5 (x) P6 (x) P7 (x) P8 (x) P9 (x) P10 (x) P11 (x) = = = = = = = = = = = = 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 1/3456x4 + + + + + + + + + + + + 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 1/108x3 + + + + + + + + + + + + 5/48x2 19/192x2 5/48x2 19/192x2 5/48x2 19/192x2 5/48x2 19/192x2 5/48x2 19/192x2 5/48x2 19/192x2 + + + + + + + + + + + + 1/2x 43/108x 25/54x 5/12x 13/27x 41/108x 1/2x 43/108x 25/54x 5/12x 13/27x 41/108x + + + + + + + + + + + + 1 1705/3456 125/216 75/128 20/27 1001/3456 7/8 1705/3456 19/27 75/128 133/216 1001/3456 We have 12 polynomials of degree 4 with leading coefficient equal to 1/3456, that’s just what we expected. As can be seen by comparing polynomials, the following facts hold: • The coefficient of the term of degree 3 is the same for all polynomials. • The coefficient of the term of degree 2 has periodicity 2, i.e. 5/48 is the coefficient of the term of degree 2 of all Pi (x) such that i ≡ 0 mod 2 and 19/192 is the coefficient of the term of degree 2 of all Pi (x) such that i ≡ 1 mod 2. 11 • The coefficient of the term of degree 1 has periodicity 6, i.e. 1/12 is the coefficient of the term of degree 1 of all Pi (x) such that i ≡ 0 mod 6, 43/108 is the coefficient of the term of degree 1 of all Pi (x) such that i ≡ 1 mod 6, 5/48 is the coefficient of the term of degree 1 of all Pi (x) such that i ≡ 2 mod 6 and so on. • The constant term seems not to have any kind of regularity. The goal of next two results is to see if we can predict which and how coefficients change. We use δ to denote max{|I| | gcd(di )i∈I 6= 1 and I ⊆ {1, . . . , k}}. Proposition 17 Let (R, W ) and PRW be as above. Then PRW (x) = Q(x) + R(x) where Q(x) ∈ Q[x] is a polynomial of degree k − 1, whereas R(x) is a quasipolynomial with rational coefficients of degree δ − 1. Proof. Recall that due to Lemma 8 we can write the Hilbert-Poincaré series of (R, W ) as HPR (t) = X Qj(δ) (t) X Q(1) Q0 (t) j (t) + + · · · + k j δ (1 − t) (1 − ζ t) (1 − ζ j t) j∈Tδ (13) j∈T1 Thanks to remark 9, we have that the coefficients of the terms of degrees δ, . . . , k − 1 don’t change and the result follows. Let us return to example 24. In that case, δ is equal to 3. By proposition 17, the coefficients of the terms of degree δ, . . . , k − 1, that is the 3th and 4th coefficient, don’t change and this is exactly what happens in the example. Proposition 18 Let (R, W ) and PRW be as above. The rth coefficient of PRW , for r = 0, . . . , k − 1, has periodicity equal to δr := lcm ( gcd(di )i∈I | |I| = r + 1, I ⊆ {1, . . . , k}) Formally, the proposition asserts that if we denote the rth coefficient of Pi (x) by air , then ajr = air when j = i + δr mod d. Proof. Let δ = max{|I| | gcd(di )i∈I 6= 1 and I ⊆ {1, . . . , k}} be as usual. Then δr = 1 for δ ≤ r ≤ k − 1 and, by proposition 17, the assertion follows. Let r ≤ δ − 1. that Pi (x) = S0 (x) + S1 (x)ζ i + · · · + Sd−1 (x)ζ (d−1)i , where PnRecall j j −h−1 ζ −jh . Note that each Sj (x) doesn’t depend on i Sj (x) = h=0 ajh x+α αj −1 and its degree is equal to αj − 1. Therefore the rth coefficient of Pi (x) is the rth coefficient of S0 (x) + Sj1 (x)ζ i·j1 + · · · + Sjv (x)ζ i·jv with {j1 , . . . , jv } = [ s≥r+1 12 Ts = [ r+1≤s≤δ Ts (14) where the second equality holds because of Tδ+1 = · · · = Tk = ∅. We recall that   [ d d , . . . , (gcd(di )i∈I − 1) · Ts = gcd(di )i∈I gcd(di )i∈I I⊆{1,...,k},|I|=s gcd(di )i∈I 6=1 To prove that the rth coefficient of S0 (x) + Sj1 (x)ζ i·j1 + · · · + Sjv (x)ζ i·jv has period δr we use the induction on number N of non-empty sets Ts in Equation (14). Let N = 1, then r = δ − 1. We observe that ζ δr ·jt = 1 for all t = 1, . . . , v, (in fact, jt can be written as a· gcd(ddi )i∈I for some integer 1 ≤ a ≤ (gcd(di )i∈I −1), with |I| = r + 1; since gcd(di )i∈I divides δr , then d divides δr · jt ). So we have S0 (x) + Sj1 (x)ζ i·j1 + · · · + Sju (x)ζ i·jv = S0 (x) + Sj1 (x)ζ (i+δr )·j1 + · · · + Sjv (x)ζ (i+δr )·jv and we are S done. Let N ≥ 2, then r ≤ δ − 2, and let us suppose that the thesis is true for r′ ≤s≤δ Ts , with r′ > δ − N , which means that the r′ th coefficient has period equal to δr′ . We can order the set {j1 , . . . , ju , ju+1 , . . . , jv } in such a way that • j1 , . . . , ju ∈ Ts , with s > r + 1, and ji ∈ / Tr+1 , for all i = 1, . . . , u; • ju+1 , . . . , jv ∈ Tr+1 . Let γ := lcm(gcd(di )i∈I | |I| > r + 1), then by induction hypothesis we have S0 (x) + Sj1 (x)ζ i·j1 + · · · + Sju (x)ζ i·ju = S0 (x) + Sj1 (x)ζ (i+γ)·j1 + · · · + Sju (x)ζ (i+γ)·ju Since γ divides δr , it follows S0 (x) + Sj1 (x)ζ i·j1 + · · · + Sju (x)ζ i·ju = S0 (x) + Sj1 (x)ζ (i+δr )·j1 + · · · + Sju (x)ζ (i+δr )·ju In addition, since ζ δr ·jt = 1 for all t = u + 1, . . . , v, we have Sju+1 (x)ζ i·ju+1 + · · · + Sjv (x)ζ i·jv = Sju+1 (x)ζ (i+δr )·ju+1 + · · · + Sjv (x)ζ (i+δr )·jv and then, by putting together the two equations above, we are done. Remark 19. In some particular cases, for example when k >> δ or if the periods δr are quite small, knowing the period of the coefficients could be exploited to reduce the cost of computation for the Hilbert quasi-polynomials. Return to example 24. We already know that δ = 3, then δr = 1 for r = 3, 4. Consider the other cases: for r = 2, δr is exactly equal to 2 and for r = 1, δr is exactly equal to 6. 13 2.4 Formulas for the other coefficients of the Hilbert quasipolynomial In this subsection, we give formulas to recover the (k − 2)th and (k − 3)th coefficient of the Hilbert quasi-polynomial from the weights d1 , . . . , dk , and we illustrate how recover the others. We have already shown that if δ ≤ k−2 (δ ≤ k−3 respectively) then the (k−2)th ((k − 3)th respectively) coefficient is the same for all Pi , i = 0, . . . , d − 1. For this reason, we suppose that δ is small enough to guarantee that the considered coefficient is equal for all Pi . Proposition 20 Let (R, W ) and PRW be as above. If δ ≤ k − 2, we denote the (k − 2)th coefficient of Pi , for all i = 0, . . . , d − 1, by ck−2 . Then, it holds ck−2 = Pk i=1 2 · (k − 2)! · di Qk i=1 di Proof. Let Pi (x) = S0 (x) + S1 (x)ζ i + · · · + Sd−1 (x)ζ i·(d−1) be as usual, where Sj (n) = nj X h=0   n + αj − h − 1 −jh ζ . ajh αj − 1 Since δ ≤ k − 2 and by remark 9, the (k − 2)th coefficient of Pi is given by the (k − 2)th coefficient of S0 (n). Let ai := a0i , then we have         n−1 n n+k−2 n+k−1 = + ak + · · · + ak−1 + a1 S0 (n) = a0 k−1 k−1 k−1 k−1 = a0 · (n + k − 1) · · · (n + 1) (n + k − 2) · · · (n) + a1 · + (k − 1)! (k − 1)! k−1 + · · · + ak−1 · (n) · · · (n − k + 2) (n − 1) · · · (n − k + 1) X ci ni (15) + ak · = (k − 1)! (k − 1)! i=0 By this equation, we get ck−2 = a0 =     (k − 1) + (k − 2) + · · · + 1 (k − 2) + (k − 3) + · · · + 1 + a1 + (k − 1)! (k − 1)!   (−1) + (−2) + · · · + (−k + 1) + · · · + ak = (k − 1)! a0 k(k − 1) a1 (k − 1)(k − 2) ak (−k)(k − 1) · + · +···+ · = (k − 1)! 2 (k − 1)! 2 (k − 1)! 2 = 1 [ka0 + (k − 2)a1 + · · · + (k − 2k)ak ] = 2(k − 2)! # " k k X X 1 (i · ai ) ai − 2 k = 2(k − 2)! i=0 i=0 14 (16) We observe that k X ai = Q0 (1) and k X i · ai = Q′0 (1) (17) i=0 i=0 Since Q0 (t) = A1 (1 − t)k−1 + A2 (1 − t)k−2 + · · ·+ Ak−1 (1 − t)+ Ak , by evaluating Q0 (t) and Q′0 (t) at t = 1 and by putting together Equation (16) and Equation (17), we have ck−2 = 1 1 [k · Q0 (1) − 2 · Q′0 (1)] = [k · Ak + 2 · Ak−1 ] . 2(k − 2)! 2(k − 2)! By the following lemma and by recalling that Ak = proved. Qk 1 i=1 di , the proposition is Lemma 21 The constant Ak−1 which appears in Equation (6) of the expression of Q0 (t) is such that Pk di − k Ak−1 = i=1 Qk 2 · i=1 di Proof. In order to obtain an expression for Ak−1 , evaluating at t = 1 the derivative of the Equation (7) is a good strategy. Before doing it, we observe that the evaluation at t = 1 of the derivative of the equation gives 0 except for the terms in the first summation for t = k − 1 and t = k. For this reason, we’ll consider only these addends and we’ll calculate only their derivatives.   Y Y ∂  0= (Ak−1 (1 − t) + Ak ) · (1 − ζ j t)δ · · · (1 − ζ j t) ∂t j∈Tδ j∈T1 t=1 0 = −Ak−1 · Y (1 − ζ j )δ · · · + Ak · ∂  ∂t Y (1 − ζ j )+ j∈T1 j∈Tδ  Y (1 − ζ j t)δ · · · j∈Tδ Y j∈T1  (1 − ζ j t) t=1 We already know that Ak = Qk 1 i=1 and di Y (1 − ζ j )δ · · · j∈Tδ Y (1 − ζ j ) = j∈T1 k Y di . i=1 So, we have Ak−1   Y ∂ Y = Qk (1 − ζ j t)δ · · · (1 − ζ j t) · ( i=1 di )2 ∂t j∈Tδ j∈T1 1 15 (18) t=1 i h Q ∂ Q j j δ and it remains to calculate ∂t (1 − ζ t) and evaluate (1 − ζ t) · · · j∈T1 j∈Tδ it at t = 1. Consider the following equations     Y Y g(t) = (1 − ζ j t)δ  · · ·  (1 − ζ j t) (1 − t)k j∈Tδ j∈T1 k k Y Y  1 − td j g(t) 1 + t + · · · + tdj −1 = = k (1 − t) 1−t j=1 j=1 Then, it holds     k Y Y  ∂ Y ∂  1 + t + · · · + tdj −1  = (1 − ζ j t) = (1 − ζ j t)δ · · · ∂t ∂t j=1 j∈Tδ j∈T1   k Y X    = 1 + t + · · · + tdj −1  1 + 2t + · · · + (di − 1)tdi −2 i=1 j6=i Finally, we have   Y ∂ Y (1 − ζ j t) (1 − ζ j t)δ · · · ∂t = i=1 di · i=1 j∈T1 j∈Tδ k Y = k X di − 1 i=1 2 ! k X t=1   Y j6=i   d (d − 1) i i = dj  2 # " k k X 1 Y di − k di · = · 2 i=1 i=1 and by substituting this expression in Equation (18), we are done. Now, we give a similar formula for the (k − 3)th coefficient of PRW , omitting the proof for lack of space, and we refer to [Mas14] for all the details. Proposition 22 Let (R, W ) and PRW be as above. If δ ≤ k − 3, we denote by ck−3 the (k − 3)th coefficient of Pi , for all i = 0, . . . , d − 1. Then, it holds 3 ck−3 = P k 2 P − ki=1 d2i Qk 24(k − 3)! i=1 di i=1 di So far we have given formulas for the leading coefficient, (k − 2)th and (k − 3)th coefficient of Hilbert quasi-polynomials. Unfortunately, we haven’t found an explicit correlation between the formulas for these coefficients, meaning that we are not able to define a recurrence relation to obtain all coefficients of PRW . On the other hand, we can sketch a strategy to calculated formulas for any coefficient of Hilbert quasi-polynomials. Let us see in detail the necessary steps to compute the rth coefficient of PRW , for 1 < r ≤ k − 1, with the assumption that δ ≤ r. 16 First of all, let Pi (x) = S0 (x) + S1 (x)ζ i + · · · + Sd−1 (x)ζ i·(d−1) as usual, where Sj (n) = nj X h=0 ajh   n + αj − h − 1 −jh ζ . αj − 1 Since δ ≤ r and by remark 9, the rth coefficient of Pi is given exactly by the rth coefficient of S0 (n), which we denote by cr . Let us recall the following useful expression for the Hilbert-Poincaré series X Qj(δ) (t) X Q(1) Q0 (t) 1 j (t) + + ··· + = HPR (t) = g(t) (1 − t)k (1 − ζ j t)δ (1 − ζ j t) j∈Tδ j∈T1 where Q0 (t) = A1 (1 − t)k−1 + A2 (1 − t)k−2 + · · · + Ak ∈ Q[t]. The coefficient cr depends only on k and Ar+1 , . . . , Ak . So, we need to compute the constants Ai , for i = r + 1, . . . , k, in order to get a suitable expression for cr . To compute Ai , we evaluate at t = 1 the ith derivative of the equation shown in (7). We observe that this evaluation gives 0 except for the terms in the first summation for i ≤ t ≤ k. For this reason, it needs to calculate only the derivatives of these addends. 3 How to compute Hilbert quasi-polynomials In this section we present an algorithm for an efficient calculation of Hilbert quasi-polynomials. We have written Singular procedures to compute the Hilbert quasi-polynomial for rings K[x1 , . . . , xk ]/I. These procedures can be downloaded from the website www.dm.unipi.it/~caboara/Research/HilbertQP 3.1 The algorithm Let (R/I, W ) be as usual, we wish to compute its Hilbert quasi-polynomial W PR/I := {P0 , . . . , Pd−1 }. Since we know degree bounds for Hilbert quasipolynomials, we can compute them by means of interpolation. First off, let us consider I = (0). Each Pj has degree equal to k − 1, so, given j = 0, . . . , d − 1, we want to calculate Pj (x) := a0 + a1 x + · · · + ak−1 xk−1 such that W Pj (n) = HR (n) for all n ≥ k − 1 and such that n ≡ j mod d Therefore, let β := min{m ∈ N | j + md ≥ k − 1} and we consider the following k positive integers congruent to j + βd modulo d xr := j + βd + rd, for r = 0, . . . , k − 1 W By construction, we have Pj (xr ) = HR (xr ), which means that the polynomial W Pj (x) interpolates the points (xr , HR (xr )). Since we know the leading coefficient ck−1 , we can reduce the number of data points xr . Actually, if δ ≤ k − 3, we can also exploit the formulas for ck−2 and 17 ck−3 . In the latter case, we get a system of linear equations in the coefficients ai , with i = 0, . . . , k − 4. The system in matrix-vector form reads  Pk−1     W HR (x0 ) − i=k−3 ci xi0 1 x0 . . . x0k−4 a0 1    H W (x1 ) − Pk−1 ci xi  x1 . . . x1k−4   1 R i=k−3    a1    (19) . .. .. ..   ..  =  .   . . . . . .  .    . Pk−1 k−4 W ak−4 1 xk−4 . . . xk−4 HR (xk−4 ) − i=k−3 ci xik−4 We observe that this algorithm requires the computation of k − 3 values of the Hilbert function, the construction of a Vandermonde matrix of dimension W k − 3 and its inversion. We have not yet shown how to calculate HR (xr ), for r = 0, . . . , k − 3. W Let n ∈ N. The problem of calculating HR (n) is equivalent to the problem of determining the number of partitions of an integer into elements of a finite set S := {d1 , . . . , dk }, that is, the number of solutions in non-negative integers, α1 , . . . , αk , of the equation α1 d1 + · · · + αk dk = n This problem was solved in the nineteenth century ([Syl82], [Gla09]) and the solution is the coefficient of xn in −1  (1 − xd1 ) · · · (1 − xdk ) (20) We are going to give an efficent method for getting the coefficient of xn in the power series expansion of Equation (20). We refer to [Lee92] for a in-depth analysis on the power series expansion of a rational function. Let g(x) = k Y (1 − λi x)αi and f (x) = i=1 l Y (1 − λi x)αi i=k+1 be any polynomials with constant coefficient 1, where λi are distinct and nonzero and the degree of f (x) is less than that of g(x). Lemma 23 Let f (x) X = b(n)xn g(x) n≥0 the power series expansion of f (x)/g(x). Then, nb(n) = k n X X r=1 αi λri − i=1 l X i=k+1 αi λri ! b(n − r) Proof. Since    X l k X αi λi f (x) αi λi ∂ − log = ∂x g(x) 1 − λ x 1 − λi x i i=1 i=k+1 we have 18 X n≥0  nb(n)xn−1 =  k X X r≥1 αi λri − i=1 l X αi λri i=k+1 !  xr−1   X s≥0  b(s)xs  and the result follows by picking out the coefficient of xn−1 on the right. Let ζ := ζd be a primitive dth root of unity. Since k Y Y Y (1 − ζ j x)k · · · (1 − xdi ) = (1 − x)k (1 − ζ j x) i=1 j∈Tk j∈T1 Q we can apply Lemma (23) with g(x) := ki=1 (1 − xdi ) and f (x) = 1. Since by our assumptions, the di are coprime, then surely Tk = ∅. We define T̃i := Ti for all i = 1, . . . , k − 1 and T˜k := {0} and thus we obtain the following recursive W formula for computing HR (n)    n k X X X 1 W W  HR (n) = i ζ jr  HR (n − r) (21) n r=1 i=1 j∈T˜i W HR (i) It follows that if we know for all i = 1, . . . , n − 1, we can easily compute W HR (n) by means of equation (21). Given an equation α1 d1 + · · · + αk dk = n the problem of counting the number of non-negative integer solutions α1 , . . . , αk could be solved also using brute force. W But, given n ∈ N, to compute HR (n) with brute force needs O(nk ) operations, whereas the procedure which we have implemented has a quadratic cost in n, in fact it needs O(kn2 ) operations. Up to now we have shown how to calculate PRW . For computing a quasiW polynomial PR/I = {P0 , . . . , Pd−1 }, for any vector W and any homogeneous ′ ideal I of R, the procedure computes first PRW , where W ′ is obtained by dividW ing W by gcd(d1 , . . . , dk ), and then it produces PR/I starting from PRW , using ′ W the relation between PRW and PR/I showed in propositions (6). 3.2 Some example Example 24. Let R = Q[x1 , . . . , x5 ] be the polynomial ring graded by the integer vector W = [1, 2, 3, 4, 6] as in Example 16. We have already described PRW . Let us consider the ring R/I with I = (x31 , x2 x3 ). The Hilbert quasi-polynomial 19 W PR/I is given by P0 (x) P1 (x) P2 (x) P3 (x) P4 (x) P5 (x) P6 (x) P7 (x) P8 (x) P9 (x) P10 (x) P11 (x) = = = = = = = = = = = = 1/16x2 1/24x2 1/16x2 1/24x2 1/16x2 1/24x2 1/16x2 1/24x2 1/16x2 1/24x2 1/16x2 1/24x2 + + + + + + + + + + + + 1/2x 1/3x 1/2x 1/3x 1/2x 1/3x 1/2x 1/3x 1/2x 1/3x 1/2x 1/3x + + + + + + + + + + + + 1 5/8 3/4 5/8 1 7/24 3/4 5/8 1 5/8 3/4 7/24 W is less than 1 second. The time of computation for all PRW and PR/I i Example 25. Let R := Q[x, y, z, t, u] be graded by W := [2, 4, 8, 16, 32]. We have computed PRW = {P0 , . . . , P31 } and also in this case the time of computation is less than 1 second. The odd indexed polynomials are equal to 0, while the even indexed are P0 (x) P2 (x) P4 (x) P6 (x) P8 (x) P10 (x) P12 (x) P14 (x) P16 (x) P18 (x) P20 (x) P22 (x) P24 (x) P26 (x) P28 (x) P30 (x) = = = = = = = = = = = = = = = = 1/393216x4 + 1/3072x3 + 43/3072x2 + 11/48x + 1 1/393216x4 + 5/16384x3 + 595/49152x2 + 725/4096x + 4875/8192 1/393216x4 + 1/3072x3 + 169/12288x2 + 167/768x + 455/512 1/393216x4 + 5/16384x3 + 583/49152x2 + 681/4096x + 4147/8192 1/393216x4 + 1/3072x3 + 43/3072x2 + 11/48x + 35/32 1/393216x4 + 5/16384x3 + 595/49152x2 + 725/4096x + 5643/8192 1/393216x4 + 1/3072x3 + 169/12288x2 + 161/768x + 455/512 1/393216x4 + 5/16384x3 + 583/49152x2 + 649/4096x + 4275/8192 1/393216x4 + 1/3072x3 + 43/3072x2 + 11/48x + 5/4 1/393216x4 + 5/16384x3 + 595/49152x2 + 725/4096x + 6923/8192 1/393216x4 + 1/3072x3 + 169/12288x2 + 167/768x + 583/512 1/393216x4 + 5/16384x3 + 583/49152x2 + 681/4096x + 6195/8192 1/393216x4 + 1/3072x3 + 43/3072x2 + 11/48x + 35/32 1/393216x4 + 5/16384x3 + 595/49152x2 + 725/4096x + 5643/8192 1/393216x4 + 1/3072x3 + 169/12288x2 + 161/768x + 327/512 1/393216x4 + 5/16384x3 + 583/49152x2 + 649/4096x + 2227/8192 In this example, we have k = 5, δ = 2, δ4 = 2, δ3 = 4, δ2 = 8, δ1 = 16 and δ0 = 32. We can easily check that PRW satisfies all proprieties that we have illustrated in the previous sections. 4 Conclusions and further work In this work, we have produced a partial characterization of Hilbert quasipolynomials for the Nk+ -graded polynomial rings. It should be of interest to complete this characterization, finding closed formulas for as many as possible coefficients of the Hilbert quasi-polynomial, periodic part included. As a side effect, this will allow us to write more efficient procedures for the computation of Hilbert quasi-polynomials. Actually, in section 2 we have sketched a strategy to recover coefficients for the fixed part, but a limit of this method is the difficulty of simplifying compu20 tations. Familiarity with combinatoric tools could be of great help to obtain formulas easy to read and to use, like those we have already found out. To compute the rth coefficient of PRW , we have supposed δ ≤ r. We can ask what is the behaviour of the coefficients without any assumptions about δ. In section 2, we have proved that they keep repeating with a certain period δr . We are interesting in understanding if it is possible to find formulas also in the general case. We have analysed some numerical experiments, and we have observed that there is a sort of regularity in the expression of the coefficients. Describing completely the coefficients of PRW requires considerable effort, but it is an interesting topic for future work. Moreover, we want to extend our work to Nk+ -graded quotient rings K[x1 , . . . , xk ]/I, starting with simple cases (e.g. when the ideal I is generated by a regular sequence). References [BI07] Winfried Bruns and Bogdan Ichim. On the coefficients of Hilbert quasipolynomials. Proceedings of the American Mathematical Society, 135(5):1305–1308, 2007. [Cir14] Luca Cirillo. Proprietà e calcolo dei polinomi di Hilbert in graduazione non standard. Bachelor thesis, University of Pisa, Department of Mathematics, 2014. [Gla09] JWL Glaisher. Formulae for partitions into given elements, derived from Sylvester’s theorem. Quart. J. Math, 40:275–348, 1909. [Hil90] David Hilbert. Über die theorie der algebraischen formen. Mathematische annalen, 36(4):473–534, 1890. [KR00] Martin Kreuzer and Lorenzo Robbiano. Computational commutative algebra 1. Springer Science & Business Media, 2000. [KR05] Martin Kreuzer and Lorenzo Robbiano. Computational commutative algebra 2. Springer Science & Business Media, 2005. [Lee92] DV Lee. On the power-series expansion of a rational function. Acta Arithmetica, 62(3):229–255, 1992. [Mas14] Carla Mascia. On the Hilbert quasi-polynomials of non-standard graded rings. Master’s thesis, University of Pisa, Department of Mathematics, 2014. [Syl82] James J Sylvester. On subvariants, ie semi-invariants to binary quantics of an unlimited order. American Journal of Mathematics, 5(1):79–136, 1882. [Vas04] Wolmer Vasconcelos. Computational methods in commutative algebra and algebraic geometry, volume 2. Springer Science & Business Media, 2004. 21
0math.AC
xx Acceleration of a Full-scale Industrial CFD Application with OP2 arXiv:1403.7209v1 [cs.CE] 27 Mar 2014 István Z. Reguly, Oxford e-Research Centre, University of Oxford Gihan R. Mudalige, Oxford e-Research Centre, University of Oxford Carlo Bertolli, Department of Computing, Imperial College London Michael B. Giles, Oxford e-Research Centre, University of Oxford Adam Betts, Department of Computing, Imperial College London Paul H.J. Kelly, Department of Computing, Imperial College London David Radford, Rolls Royce plc. Hydra is a full-scale industrial CFD application used for the design of turbomachinery at Rolls Royce plc. It consists of over 300 parallel loops with a code base exceeding 50K lines and is capable of performing complex simulations over highly detailed unstructured mesh geometries. Unlike simpler structured-mesh applications, which feature high speed-ups when accelerated by modern processor architectures, such as multi-core and many-core processor systems, Hydra presents major challenges in data organization and movement that need to be overcome for continued high performance on emerging platforms. We present research in achieving this goal through the OP2 domain-specific high-level framework. OP2 targets the domain of unstructured mesh problems and follows the design of an active library using source-to-source translation and compilation to generate multiple parallel implementations from a single high-level application source for execution on a range of back-end hardware platforms. We chart the conversion of Hydra from its original hand-tuned production version to one that utilizes OP2, and map out the key difficulties encountered in the process. To our knowledge this research presents the first application of such a high-level framework to a full scale production code. Specifically we show (1) how different parallel implementations can be achieved with an active library framework, even for a highly complicated industrial application such as Hydra, and (2) how different optimizations targeting contrasting parallel architectures can be applied to the whole application, seamlessly, reducing developer effort and increasing code longevity. Performance results demonstrate that not only the same runtime performance as that of the hand-tuned original production code could be achieved, but it can be significantly improved on conventional processor systems. Additionally, we achieve further acceleration by exploiting many-core parallelism, particularly on GPU systems. Our results provide evidence of how high-level frameworks such as OP2 enable portability across a wide range of contrasting platforms and their significant utility in achieving near-optimal performance without the intervention of the application programmer. Categories and Subject Descriptors: C.4 [Performance of Systems]: Design Studies General Terms: Design, Performance Additional Key Words and Phrases: Unstructured Mesh Applications, Domain Specific Language, Active Library, OP2, OpenMP, GPU, CUDA, CFD Author’s addresses: I.Z. Reguly, G.R. Mudalige and M.B. Giles are with the Oxford e-Research Centre at the University of Oxford, 7, Keble Road, Oxford OX1 3QG, UK. Email: {istvan.reguly, gihan.mudalige}@oerc.ox.ac.uk, [email protected]. C. Bertolli (Current address) is with the IBM TJ Watson Research Centre, New York, USA. Email:[email protected]. A. Betts and P.H.J. Kelly are with the Dept. of Computing, Imperial College London UK. Email:{a.betts,p.kelly}@imperial.ac.uk. D. Radford is with Rolls Royce plc. Derby UK. Email:[email protected] Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies show this notice on the first page or initial screen of a display along with the full citation. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any component of this work in other works requires prior specific permission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 2 Penn Plaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or [email protected]. c 2013 ACM 1539-9087/2013/10-ARTxx $15.00 DOI:http://dx.doi.org/10.1145/0000000.0000000 ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:2 I.Z. Reguly et al. ACM Reference Format: István Z. Reguly, Gihan R. Mudalige, Carlo Bertolli, Michael B. Giles, Adam Betts, Paul H. J. Kelly, and David Radford, 2013. Acceleration of a Full-scale Industrial CFD Application with OP2. ACM Trans. Parallel. Comput. xx, xx, Article xx (October 2013), 35 pages. DOI:http://dx.doi.org/10.1145/0000000.0000000 1. INTRODUCTION High Performance Computing (HPC) is currently experiencing a period of enormous change. For many years, increased performance was achieved through higher clock frequencies giving an almost free boost to the speed and throughput of applications without the need to re-write software for each new generation of processors. However, within the last decade, further increase of clock frequencies and in turn higher performance was severely curtailed due to the rapid increase in energy consumption. This phenomenon, commonly referred to as the end of Dennard’s scaling [Bohr 2007], has become significant as we reach the physical limits of the current CMOS based microprocessor technologies. The only clear direction in gaining further performance improvements now appears to be through increased parallelism, where multiple processor units are utilized to increase throughput. As a result, modern and emerging microprocessors feature multiple homogeneous core optionally augmented with many simpler processing cores on a single piece of silicon; ranging from a few cores to thousands, depending on the complexity of individual processing elements. For example, traditional mainstream processors from Intel and AMD are continuing to be designed with more and more homogeneous cores. Each of these cores, usually operating at a high clock frequency, in turn consists of increasingly large vector units (e.g. Intel’s AVX extensions) that simultaneously carry out operations on larger blocks of data. At the same time, there is an emergence of co-processors designed to act as “accelerators” for augmenting the performance of certain types of computations in combination with traditional processors. Examples of such co-processors range from discrete (e.g. NVIDIA GPUs [NVIDIA GPUs 2013], Intel MIC [Skaugen 2011]) or integrated (e.g. AMD APUs [AMD 2013]) SIMD type co-processors to more specialized DSP type compute engines [TI 2013] or FPGA based accelerators [Convey 2013; Lindtjorn et al. 2011]. The SIMD type accelerators currently consist of about 16-64 functional units, each in turn consisting of a number of processor cores operating at a lower clock frequency that together can perform a larger number of operations in parallel. Other HPC systems designs include the utilization of custom-built large networks of relatively small but energy-efficient CPUs as in the IBM Blue Gene [Haring et al. 2012] systems. In the future, we may also see developments further motivated by energyefficient designs from companies such as ARM [Rajovic et al. 2011] who have achieved significant energy efficiency for mobile and embedded applications, and are now targeting HPC which increasingly shares similar energy goals. In light of these developments, an application developer faces a difficult problem. Optimizing an application for a target platform requires more and more low-level hardware-specific knowledge and the resulting code is increasingly difficult to maintain. Additionally, adapting to new hardware may require a major re-write, since optimisations and languages vary widely between different platforms. At the same time, there is considerable uncertainty about which platform to target: it is not clear which approach is likely to “win” in the long term. Application developers would like to benefit from the performance gains promised by these new systems, but are concerned about the software development costs involved. Furthermore, it can not be expected of domain scientists to gain platform-specific expertise in all the hardware they wish to use. This is especially the case with industrial applications that were developed many years ago, often incurring enormous costs not only for development and maintenance ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:3 but also for validating and maintaining accurate scientific outputs from the application. Since these codes usually consist of tens or hundreds of thousands of lines of code, frequently porting them to new hardware is infeasible. Recently, Active libraries [Czarnecki et al. 2000; Veldhuizen and Gannon 1998] and Domain Specific Languages (DSLs) have emerged as a pathway offering a solution to these problems. The key idea is to allow scientists and engineers to develop applications by providing higher-level, abstract constructs that make use of domain specific knowledge to describe the problem to be solved. At the same time, appropriate code generation and compiler support will be provided to generate platform specific code, from the higher-level source, targeting different hardware with tailored optimisations. Within such a setting a separate lower implementation level is created to provide opportunities for parallel programming experts to apply radically aggressive and platform specific optimizations when implementing the required solution on various hardware platforms. The correct abstraction will pave the way for easy maintenance of a higher-level application source with near optimal performance for various platforms and make it possible to easily integrate support for any future novel hardware. Much research [Howes et al. 2009; DeVito et al. 2011; Muranushi 2012; Orchard et al. 2010; Brandvik and Pullan 2010; Lee et al. 2011] has been carried out on such high-level abstraction methods targeting the development of scientific simulation software. However, there has been no conclusive evidence, so far, for the applicability of active libraries or DSLs in developing full scale industrial production applications, particularly demonstrating the viability of the high-level abstraction approach and its benefits in terms of performance and developer productivity. Indeed, it has been the lack of such an exemplar that has made these high level approaches confined to university research labs and not a mainstream HPC software development strategy. This paper presents research addressing this open question by detailing our recent experiences in the development and acceleration of such an industrial application with the OP2 ( [Giles et al. 2012; Giles et al. 2013]) active library framework. We focus on the industrial application Hydra, used at Rolls Royce plc. for the simulation of turbomachinery components of aircraft engines. Hydra is a highly complex and configurable CFD application, capable of accommodating different simulations that can be applied to any mesh. With the initial development carried out over 15 years ago, Hydra has been continuously evolving ever since. It is written in Fortran 77, and it is parallelized to utilize a cluster of single threaded CPUs using message passing. Simulations implemented in Hydra are typically applied to large meshes, up to tens of millions of edges, with execution times ranging from a few minutes up to a few weeks. Hydra uses a design based on a domain specific abstraction for the solution of unstructured mesh problems; the abstraction is simply achieved with an API and its implementation is through a classical software library called OPlus (Oxford Parallel Library for Unstructured Solvers) [Burgess et al. 1994]. OPlus implements the API calls targeting a cluster of single threaded CPUs. OP2, the second iteration of OPlus, was designed to retain the same domain specific abstraction but develops an active library framework with code generation to exploit parallelism on modern heterogeneous multi-core and many-core architectures. With OP2, a single application code written using its API can be transformed (through source-to-source translation tools) into multiple parallel implementations which can then be linked against the appropriate parallel library (e.g. OpenMP, CUDA, MPI, OpenCL etc.) enabling execution on different back-end hardware platforms. At the same time, the generated code and the OP2 platform specific back-end libraries are highly optimized utilizing the best low-level features of a target architecture to make an OP2 application achieve near-optimal performance including high computational efficiency and minimized memory traffic. In previous works, we have presented ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:4 I.Z. Reguly et al. OP2’s design and development [Giles et al. 2012; Giles et al. 2013] and its performance on heterogeneous systems [Mudalige et al. 2012]. These works investigated the performance through a standard unstructured mesh finite volume computational fluid dynamics (CFD) benchmark, called “Airfoil”, written in C using the OP2 API and parallelized on a range of multi-core and many-core platforms; our results showed considerable performance gains could be achieved on a diverse set of hardware. In this paper we chart the conversion of Hydra from its original version, based on OPlus, to one that utilizes OP2, and present key development and optimisation strategies that allowed us to gain near-optimal performance on modern parallel systems. A key goal of this research is to investigate whether high-level frameworks such as OP2 could be used to develop large-scale industrial applications and at the same time achieve performance on par with a hand-tuned implementation. Specifically, we make the following contributions: (1) Deployment: We present the conversion of Hydra to utilize OP2, mapping out the key difficulties encountered in the conversion of the Hydra application (designed and developed over 15 years ago) to OP2. Our work demonstrates the clear advantages in developing future-proof and performant applications through a high-level abstractions approach. Hydra, to our knowledge, is the first industrial application to successfully demonstrate the viability of such high-level frameworks. (2) Optimisations: We present key optimisations that incrementally allowed Hydra to gain near optimal performance on modern parallel systems, including conventional multi-core processors, many-core accelerators such as GPUs as well their heterogeneous combinations. The optimisations are radically different across the range of platforms under study, but through OP2, we are able to easily apply each new optimisation demonstrating portability and increased developer productivity. (3) Performance: A range of performance metrics are collected to explore the performance of Hydra with OP2, including runtime, scalability and achieved bandwidth. The performance is compared to that of the original version of Hydra, contrasting the key optimisations that lead to performance differences. Benchmarked systems include a large-scale distributed memory Cray XE6 system, and a distributed memory Tesla K20 GPU cluster interconnected by QDR InfiniBand. The OP2 design choices and optimisations are explored with quantitative insights into their contributions to performance on these systems. Additionally, performance bottlenecks of the application are isolated by breaking down the runtime and analyzing the factors constraining total performance. We use highly-optimized code generated through OP2 for all system back-ends, using the same application code, allowing for direct performance comparison. Our work demonstrates how Hydra, through OP2, is developed to match the performance of the original and then further outperform it with platform specific optimisations for modern multi-core and accelerator systems. Re-enforcing our previous findings, this research demonstrates that an application written once at a high-level using the OP2 framework is easily portable across a wide range of contrasting platforms, and is capable of achieving near-optimal performance without the intervention of the application programmer. The rest of this paper is organized as follows: Section 2 introduces the Hydra CFD application; Section 3 present the transformations made to Hydra enabling it to utilize OP2; Section 4 details performance and optimisations charting the effort to reach near optimal performance for Hydra. Section 5 presents preliminary results from a hybrid CPU-GPU execution scheme. Section 6 briefly compares related work and Section 7 concludes the paper. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:5 2. HYDRA The aerodynamic performance of turbomachinery is a critical factor in engine efficiency of an aircraft, and hence is an important target of computer simulations. Historically, CFD simulations for turbomachinery design were based on structured meshes, often resulting in a difference between simulation results and actual experiments performed on engine prototypes. While the initial hypothesis for the cause was the poor quality of the turbulence model, the use of unstructured meshes showed that the ability to model complex physical geometries with highly detailed mesh topologies is essential in achieving correct results. As a result, unstructured mesh based solutions are now used heavily to achieve accurate predictions from such simulations. Significant computational resources are required for the simulation of these highly detailed three-dimensional meshes. Usually the solution involves iterating over millions of elements (such as mesh edges and/or nodes) to reach the desired accuracy or resolution. Furthermore, unlike structured meshes, which utilize a regular stencil, unstructured mesh based solutions use the explicit connectivity between elements during computation. This leads to very irregular patterns of data access over the mesh, usually in the form of indirect array accesses. These data access patterns are particularly difficult to parallelize due to data dependencies resulting in race conditions. Rolls Royce’s Hydra CFD application is such a full-scale industrial application developed for the simulation of turbomachinery. It consists of several components to simulate various aspects of the design including steady and unsteady flows that occur around adjacent rows of rotating and stationary blades in the engine, the operation of compressors, turbines and exhausts as well as the simulation of behavior such as the ingestion of ground vortexes. The guiding equations which are solved are the ReynoldsAveraged Navier-Stokes (RANS) equations, which are second-order PDEs. By default, Hydra uses a 5-step Runge-Kutta method for time-marching, accelerated by multigrid and block-Jacobi preconditioning [P. Moinier and Giles 2002; M.C. Duta and Campobasso 2002; Giles et al. 2003; Lapworth 2008]. The usual production meshes are in 3D and consist of tens of millions of edges, resulting in long execution times on modern CPU clusters. Hydra was originally designed and developed over 15 years ago at the University of Oxford and has been in continuous development since, it has become one of the main production codes at Rolls Royce. Hydra’s design is based on a domain specific abstraction for unstructured mesh based computations [Burgess et al. 1994], where the solution algorithm is separated into four distinct parts: (1) sets, (2) data on sets, (3) connectivity (or mapping) between the sets and (4) operations over sets. This leads to an API through which any mesh or graph problem solution can be completely and abstractly defined. Depending on the application, a set can consist of nodes, edges, triangular faces, quadrilateral faces, or other elements. Associated with these sets are data (e.g. node coordinates, edge weights, velocities) and mappings between sets defining how elements of one set connect with the elements of another set. All the numerically intensive computations can be described as operations over sets. Within an application code, this corresponds to loops over a given set, accessing data through the mappings (i.e. one level of indirection), performing some calculations, then writing back (possibly through the mappings) to the data arrays. The above API was implemented with the creation of a classical software library called OPlus, which provided a concrete distributed memory parallel implementation targeting clusters of single threaded CPUs. OPlus essentially carried out the distribution of the execution set of the mesh across MPI processes, and was responsible for all data movement while also taking care of the parallel execution without violating data ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:6 I.Z. Reguly et al. do while(op_par_loop(ncells, istart, iend)) call op_access_r8(’r’,areac,1,ncells, & null,0,0,1,1) call op_access_r8(’u’,arean,1,nnodes, & ncell,1,1,1,3) do ic = istart, iend i1 = ncell(1,ic) i2 = ncell(2,ic) i3 = ncell(3,ic) arean(i1) = arean(i1) + areac(ic)/3.0 arean(i2) = arean(i2) + areac(ic)/3.0 arean(i3) = arean(i3) + areac(ic)/3.0 end do end while Fig. 1: A Hydra loop written using the OPlus API dependencies. As an example, consider the code in Figure 1 of a loop in Hydra over a set of triangular cells as illustrated in Figure 2: The op par loop API call returns the loop bounds of the execution set, in this case triangular cells, while the calls to op access r8 update the halos at the partition boundary by carrying out MPI communications. The actual numerical computation consists of distributing the area of each cell, areac, to the three nodes that make up the cell. This is achieved by looping over each cell and accessing the nodes making up each cell indirectly through the mapping ncell which points from the cell to its three nodes. The distributed memory parallel implementation of the above loop is carried out by partitioning and distributing the global execution set on to each MPI process. A single threaded CPU, assigned with one MPI process, will be sequentially iterating over its execution set, from istart to iend to complete the computation. However, data dependencies at the boundaries of the mesh partitions need to be handled to obtain the correct results. OPlus handles this by creating suitable halo elements such that contributions from neighboring MPI processes are received to update the halo elements. The implementation follows the standard MPI mesh partitioning and halo creation approach commonly found in distributed memory MPI parallelizations. As it can be seen from the above loop, Hydra based on OPlus is tailored for execution on distributed memory single threaded CPU clusters. However, as CPUs are increasingly designed with multiple processor cores and each with increasingly large vector units, simply assigning an MPI process per core may not be a good long-term strategy if the full capabilities of the processors are to be used. Moreover, based on experiences in attempting to exploit the parallelism in emerging SIMD-type architectures such the Xeon Phi [Skaugen 2011] or GPUs, relying only on coarse-grained message-passing is not going to be a viable or scalable strategy. Thus at least a thread-level, shared memory based parallelism is essential if Hydra is to continue to perform well on future systems. On the other hand further performance improvements appear to be obtainable with the use of accelerator based systems such as clusters of GPUs. Directly porting the Hydra code to a multi-threaded implementation (e.g. with OpenMP or pthreads) is not straightforward. Consider parallelizing the above loop with OpenMP. Simply adding a !omp pragma parallel for the loop from istart to iend will not give correct results, due to the data races introduced by the indirect data accesses through the ncell mapping. If higher performance is required more optimisations tailored to OpenMP are needed. Thus, further substantial implementationspecific modifications will be required to achieve good thread-level parallelism. A much ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:7 more significant re-write would be required if we were to get this loop running on a GPU, say using CUDA. Again the application code base would be changed with significant implementation specific code making it very hard to maintain. Porting to any future parallel architectures in this manner would yet again involve significant software development costs. Considering that the full Hydra source consists of over 300 loops written in Fortran 77, “hand-porting” in the above manner is not a viable strategy for each new type of parallel system. The design of the OP2 framework was motivated to address this issue. 3. OP2 While the initial motivation was to enable Hydra to exploit multi-core and many-core parallelism, OP2 was designed from the outset to be a general high-level active library framework to express and parallelize unstructured mesh based numerical computations. OP2 retains the OPlus abstraction but provides a more complete high-level API (embedded in C/C++ and Fortran) to the application programmer which for code development appears as an API of a classical software library. However, OP2 uses a source-to-source translation layer to transform the application level source to different parallelizations targeting a range of parallel hardware. This stage provides the opportunity to provide the necessary implementation specific optimisations. The code generated for one of the platform-specific parallelizations can be compiled using standard C/C++/Fortran compilers to generate the platform specific binary executable. 3.1. The OP2 API The first step in getting Hydra to exploit multi-core and many-core parallelism through OP2 is to convert it to use the OP2 API. Continuing from the previous OPlus example, consider the unstructured mesh illustrated in Figure 2. The mesh consists of three sets - nodes (vertices), edges and triangular cells. There are nn = 14 nodes and nc = 17 cells. The OP2 API allows to declare these sets and connectivity between the sets together with any data held on the sets (see Figure 3). In op decl map each element belonging to the set nodes is mapped to three different elements in the set cells. The op map declaration defines this mapping where ncell has a dimension of 3 and thus the 1D array index 1,2 and 3 maps to nodes 1,3 and 10, index 4,5 and 6 maps to nodes 1,2 and 3 and so on. When declaring a mapping we first pass the source set (e.g. cells) then the destination set (e.g. nodes). Then we pass the dimension (or arity) of each map entry (e.g. 3; as ncell maps each cell to 3 nodes). Note that those literal numbers filling up the mapping array are purely for description purposes only as OP2 supports input from disk (e.g. using HDF5 files). Once the sets are defined, data can be associated with the sets through op decl dat statements. Note that here a single double precision value per set element is declared. A vector of a number of values per set element could also be declared (e.g. a vector with three doubles per node to store coordinates). In the case of Hydra, there are op dats with over 6 values per set element. Any loop over the sets in the mesh is expressed through the op par loop, API call similar in purpose to the OPlus API call in Figure 1 for a loop over cells. However, OP2 enforces a separation of the per set element computation aiming to de-couple the declaration of the problem from the implementation. Thus, the same loop can be expressed as detailed in Figure 4 using the OP2 API. The subroutine distr() is called a user kernel in the OP2 vernacular. Simply put, the op par loop describes the loop over the set cells, detailing the per set element computation as an outlined “kernel” while making explicit indication as to how each argument to that kernel is accessed (OP READ - read only, OP INC - increment) and the mapping, ncell (cells to nodes) with the specific indices are used to indirectly acACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:8 I.Z. Reguly et al. 2 1 2 1 5 5 4 4 3 6 6 7 10 3 11 11 9 10 9 8 8 7 17 16 13 12 15 14 12 14 13 Fig. 2: An example unstructured mesh integer(4),dimension(:),allocatable:: c_to_n real(8),dimension(:),allocatable:: ca_data real(8),dimension(:),allocatable:: na_data allocate ( c_to_n ( 3 * nc ) ) allocate ( ca_data ( nc ) ) allocate ( na_data ( nn ) ) c_to_n = /1,3,10, 1,2,3, 3,9,10, 2,3,4, .../ ca_data = /.../ na_data = /.../ call op_decl_set(nn,nodes,’nodes’) call op_decl_set(ne,edges,’edges’) call op_decl_set(nc,cells,’cells’) call op_decl_map & (cells,nodes,3,c_to_n,ncell,’pcell’) call & call & op_decl_dat (cells,1,’r8’,ca_data,areac,’c_area’) op_decl_dat (nodes,1,’r8’,na_data,arean,’n_area’) Fig. 3: Declaring sets, maps and dats using the OP2 API cessing the data (arean, areac) held on each node. With this separation, the OP2 design, gives a significantly larger degree of freedom in implementing the loop with different parallelization strategies. The one-off conversion of all the Hydra parallel loops to OP2’s API simply involved extracting “user-kernels” from each loop and then putting them in separate Fortran 90 modules. In this manner, the whole of Hydra was converted consistently to use only the OP2 API. The conversion process was relatively straightforward due to the similarities of the OPlus and OP2 APIs. Such a straightforward conversion may not have been possible if we were to convert a different unstructured mesh application to use OP2. However, we believe that such a development cost is imperative for most applications attempting to utilize the benefits of DSLs or Active Library frameworks. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:9 subroutine distr(areac,arean1,arean2,arean3) real(8), intent(in) :: areac real(8), intent(inout) :: arean1, & arean2, arean3 arean1 = arean1 + areac/3.0 arean2 = arean2 + areac/3.0 arean3 = arean3 + areac/3.0 end subroutine op_par_loop(cells, distr, & op_arg_dat(areac,-1,OP_ID,1,’r8’,OP_READ), & op_arg_dat(arean,1,ncell,1,’r8’,OP_INC), & op_arg_dat(arean,2,ncell,1,’r8’,OP_INC), & op_arg_dat(arean,3,ncell,1,’r8’,OP_INC)) Fig. 4: A Hydra loop written using the OP2 API As we will show in this paper, the advantages of such frameworks far outweigh the costs, by significantly improving the maintainability of the application source, while making it possible to also gain near optimal performance and performance portability across a wide range of hardware. 3.2. Code Generation and Parallel Build An application written with the OP2 API in the above manner can be immediately debugged and tested for accuracy by including OP2’s “sequential” header file (or its equivalent Fortran module if the application is written in Fortran). This, together with OP2’s sequential back-end library, implements the API calls for a single threaded CPU and can be compiled and linked using conventional (platform specific) compilers (e.g. gcc, icc, ifort) and executed as a serial application. OP2’s CPU back-end libraries are implemented in C. To support applications developed with the Fortran API, such as Hydra, the build process uses standard Fortran-to-C bindings, available since Fortran 2003. The Fortran application code passes a Fortran procedure pointer and arguments to the op par loop. The module structure for the sequential build is illustrated in Figure 5. In this illustration, the application consists of an op par loop that calls a Fortran 90 module called FLUX. The module is in a separate file (flux.F90) and consists of the user kernel as a subroutine called flux user kernel. The Fortran application code passes the flux user kernel procedure pointer and arguments to the op par loop. The sequential implementation of the op par loop is provided in the OP2 back-end library in the OP2 Fortran Reference module. The calls to op decl set, op decl map and op decl dat give OP2 full ownership of mappings and the data. OP2 holds them internally as C arrays and it is able to apply optimizing transformations in how the data is held in memory. Transformations include reordering mesh elements [Burgess and Giles 1997], partitioning (under MPI) and conversion to an array-of-structs data layout (for GPUs [Giles et al. 2013]). These transformations, and OP2’s ability to seamlessly apply them internally is key to achieving a number of performance optimisations. Once the application developer is satisfied with the validity of the results produced by the sequential application, parallel code can be generated. The build process to obtain a parallel executable is detailed in Figure 6. In this case the API calls in the application are parsed by the OP2 source-to-source translator which will produce a modified main program and back-end specific code. These are then compiled using a conventional compiler (e.g. gcc, icc, nvcc) and linked against platform specific OP2 back-end libraries to generate the final executable. The mesh data to be solved is input ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:10 I.Z. Reguly et al. ! in file flux.F90 module FLUX subroutine flux_user_kernel(x, ...) real(8) x(3) ... end subroutine end module FLUX ! in file flux app.F90 program flux_app use OP2_Fortran_Reference use OP2_CONSTANTS use FLUX ... call op_decl_set (nodes, ..) call op_decl_map (..) call op_decl_dat (x, ..) ... call op_par_loop(nodes, flux_user_kernel, & op_arg_dat(x,-1,OP_ID,3,’r8’,OP_READ), & ...) ... end program flux_app Fig. 5: Modules structure for a sequential build with OP2 at runtime. The source-to-source code translator is written in Python and only needs to recognize OP2 API calls; it does not need to parse the rest of the code. OP2 currently supports parallel code generation to be executed on (1) multi-threaded CPUs/SMPs using OpenMP, (2) single NVIDIA GPUs, (3) distributed memory clusters of single threaded CPUs using MPI, (4) cluster of multi-threaded CPUs using MPI and OpenMP and (5) cluster of GPUs using MPI and CUDA. Race conditions that occur during shared-memory execution on both CPUs (OpenMP) and GPUs (CUDA) are handled through multiple levels of coloring while for the distributed memory (MPI) parallelization, an owner-compute model [Mudalige et al. 2013] similar to that used in OPlus is implemented. More details on the various parallelization strategies and their performance implications can be found in previous papers [Giles et al. 2012; Giles et al. 2013; Mudalige et al. 2012]. For each parallelization, the generated modified main program and back-end specific code follow the general module and procedure structure given in Figure 7. A modified application program is generated in a new file called flux app op.F90 which now uses the OP2 back-end specific libraries implemented in OP2 FORTRAN DECLARATIONS and OP2 Fortran RT Support modules. In this case the op par loop API call is converted to a subroutine named flux host kernel, which is implemented in a module called FLUX HOST. The parallel implementation of the op par loop in the flux host kernel subroutine differs for each parallelization (e.g MPI, OpenMP, CUDA etc.). As such the subroutine flux host kernel is placed in a separate file flux seqkernel.F90, flux kernel.F90 or flux kernel.CUF depending on whether we are generating a single threaded CPU cluster parallelization (with MPI), multi-threaded CPU cluster parallelization (with OpenMP and MPI) or cluster of GPUs parallelization (with CUDA and MPI). The flux host kernel subroutine in turn calls the user kernel flux user kernel. In the code illustration in Figure 7 we have shown the MPI only parallelization. The calls to c f pointer are necessary to bind the C pointers, which point to the C data and ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:11 Fig. 6: OP2 build hierarchy !in file flux seqkernel.F90 or flux kernel.F90 or flux kernel.CUF module FLUX_HOST use FLUX subroutine flux_host_kernel(arg1, ...) real(8), dimension(:), pointer :: arg1Ptr call c_f_pointer(arg1%CPtr, arg1Ptr, ...) ... ! platform specific parallelisation do i = 0,nelems-1,1 call flux_user_kernel(arg1Ptr(i*3+1,i*3+3), & ...) ... end subroutine end module FLUX_HOST !in file flux app op.F90 program flux_app_op use OP2_FORTRAN_DECLARATIONS use OP2_Fortran_RT_Support use OP2_CONSTANTS use FLUX_HOST ... call flux_host_kernel(nodes, & op_arg_dat(x,-1,OP_ID,3,’r8’,OP_READ), & ...) ... end program flux_app_op Fig. 7: Modules structure for a parallel build with OP2 mapping arrays held internally by OP2, to Fortran pointers in order to pass them to ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:12 I.Z. Reguly et al. Table I: Benchmark systems specifications System Node Architecture Memory/Node Num of Nodes Interconnect O/S Compilers Compiler flags Ruby (Development machine) 2×Tesla K20c GPUs+ 2×6-core Intel Xeon E5-2640 2.50GHz 5GB/GPU + 64GB 1 shared memory Red Hat Linux 6.3 PGI 13.3, ICC 13.0.1, OpenMPI 1.6.4, CUDA 5.0 -O2 -xAVX -Mcuda=5.0,cc35 HECToR (Cray XE6) 2×16-core AMD Opteron 6276 (Interlagos)2.3GHz 32GB 128 Cray Gemini CLE 3.1.29 Cray MPI 8.1.4 -O3 -h fp3 -h ipa5 Jade (NVIDIA GPU Cluster) 2×Tesla K20m GPUs+ Intel Xeon E5-1650 3.2GHz 5GB/GPU 8 FDR InfiniBand Red Hat Linux 6.3 PGI 13.3, ICC 13.0.1, OpenMPI 1.6.4, CUDA 5.0 -O2 -xAVX -Mcuda=5.0,cc35 the user kernel. This allows OP2 to use the user kernels without modification by the code generator. One final step that was required to get the Fortran API working with the OP2 backend was the handling of global constants. The original Hydra code with OPlus used common blocks to declare and hold global constants where their value is set during an initialization phase and then used throughout the code. With the move to use F90 in OP2, all constants were declared in a separate module OP2 CONSTANTS. For the GPU implementation, in order to separate constants held in the device (i.e. GPU) and the host CPU the constant keyword in the variable type qualifiers (alternatively device if the array is too large) and the OP2CONSTANT suffix was added to the names of constant variable. In Hydra, all global variables that use common blocks are defined in a number of header files, thus we were able to implement a simple parser that extracts variable names and types, and generates the required constants module. At this stage, the conversion of Hydra to utilize the OP2 framework was complete. The application was validated to check that the correct scientific results were obtained. The open question now then was whether the time and effort spent in the conversion of Hydra to utilize an active library such as OP2 is justified. Specifically the key questions were: (1) whether the conversion to OP2 gave Hydra any performance improvements compared to the original OPlus version, (2) whether further performance gains are achievable with modern multi-core/many-core hardware (3) what optimisations can be applied to improve performance for different parallel platforms and (4) how the OP2 framework facilitate the deployment of such optimisations. In the next section we analyze Hydra’s performance with OP2 and present work assessing these issues. 4. PERFORMANCE AND OPTIMISATIONS We begin by initially benchmarking the runtime of Hydra with OP2 on a single node. Exploring performance on a single node is not only motivated by the need to understand intra-node performance but also due to the fact that Hydra is regularly run on single node systems by CFD engineers for preliminary design purposes. Key specifications of the single node system are detailed in column 1 of Table I. The system is a two socket Intel Xeon E5-2640 system with 64GB of main memory. The processors are based on Intel’s latest Sandy Bridge architecture. The compiler flags that give the best runtimes are listed. This system, named Ruby, also consists of two NVIDIA Tesla K20c GPUs, each with 5 GB of graphics memory. We use CUDA 5.0 in this study. Table I also details the large cluster systems used later in the benchmarking study. These will be used to explore the distributed memory scaling performance of Hydra. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:13 Fig. 8: Mach contours for NASA Rotor 37. As mentioned previously, Hydra consists of several components [Lapworth 2008] and in this paper we report on the non-linear solver configured to compute in double precision floating point arithmetic. Hydra can also be used with multi-grid simulations, but for simplicity of the performance analysis and reporting we utilize experiments with a single grid (mesh) level. The configuration and input meshes of Hydra in these experiments model a standard application in CFD, called NASA Rotor37 [Denton 1997]. It is a transonic axial compressor rotor widely used for validation in CFD. Figure 8 shows a representation of the Mach contours for this application on a single blade passage. The mesh used for the single node performance benchmarking consists of 2.5 million edges. Figure 9a presents the performance of Hydra with both OPlus and OP2 on up to 12 cores (and 24 SMT threads) on the Ruby single node system using the message passing (MPI) parallelization. This is a like-for-like comparison where the same mesh is used by both versions. The partitioning routine used in both cases is a recursive coordinate bisection (RCB) mesh partitioning [Simon 1991] where the 3D coordinates of the mesh are repeatedly split in the x, y and z directions respectively until the required number of partitions (where one partition is assigned to one MPI process) is achieved. The timings presented are for the end-to-end runtime of the main timemarching loop for 20 iterations. Usual production runs solving this mesh would take hundreds of iterations to converge. We see that the OP2 version (noted as OP2 initial) is about 50% slower than the hand coded OPlus version. The generated code from OP2 appears to be either missing a performance optimisation inherent in the original Hydra code and/or the OP2 generated code and build structure is introducing new bottlenecks. By simply considering the runtime on a single thread we see that even without MPI communications the OP2 (initial) version performs with the same slowdown. Thus it was apparent that some issue was affecting single threaded CPU performance. One plausible explanation was that the generated files and the separation of the user kernel is inhibiting function in-lining optimizations. As a solution, the code generator was modified to generate code that simply places the user kernel and the encompassing loop over set elements into the same source file, adding compiler pragmas to ensure the inlining of the user ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:14 I.Z. Reguly et al. 512 OPlus OP2 (initial) OP2 Time (seconds) 256 128 64 32 16 1 6 12 Number of threads 24 (a) OPlus vs OP2 (MPI only) 40 OPlus OP2 +PTScotch +renum 35 Time (seconds) 30 25 20 15 10 5 0 6 12 Number of threads 24 (b) OPlus vs OP2 (with PTSotch and renumbering) Fig. 9: Single node performance on Ruby (NASA Rotor 37, 2.5M edges, 20 iterations) kernel. The resulting code indeed improved performance over the OP2 (initial) version on average by about 25%. To analyze the performance further, we ran Hydra through the Intel VTune [VTune 2013] profiler. The aim was to investigate the performance of each subroutine that is called when executing an op par loop. As Hydra consists of more than 300 parallel loops, we focused on one of the most time consuming op par loops called edgecon. The profiling revealed that a significant overhead (up to 40% of the total instruction count for the loop) occurs at the call to the user kernel; for example, the call to the flux user kernel subroutine in Figure 7. Further investigation revealed that the cause is a low level Fortran specific implementation issue [ISO/IES 2012] related to how arrays are represented internally in Fortran. The pointer arg1Ptr in Figure 7, results in an “assumed shape” array which is represented by an internal struct called a “dope vector” in Fortran. The dope vector contains the starting pointer of the array but also bounds and stride information. The extra information facilitates strided array sections and features such as bounds checking. However computing the memory address of an array element held in the struct causes a complex indexing calculation. Thus, directly using this array pointer and passing it as an argument to the flux user kernel subroutine causes the indexing calculation to occur for each and every iteration in the do i = 0,nelems-1,1 loop. The resolution is to force the complex index calculation to occur only once. After some experimentation, a modified module and subroutine structure as illustrated in Figure 10 was generated. The new structure introduces a wrapper subroutine flux wrap that is initially called by flux kernel by passing the arg1Ptr pointer. At this point the complex indexing calculation is carried out, just once. Then flux wrap works with an ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:15 module FLUX_GENSEQ subroutine flux_user_kernel(x, ...) real(8) x(3) ... end subroutine subroutine flux_wrap(arg1data,...,nelems) real(8), arg1data(3,*) do i = 0,nelems-1,1 call flux_user_kernel(x(1,i+1), & ...) enddo end subroutine subroutine flux_kernel(arg1, ...) real(8), dimension(:), pointer :: arg1Ptr ... call c_f_pointer(arg1%CPtr, arg1Ptr, ...) ... call flux_wrap(arg1Ptr,...) ... end subroutine end module FLUX_GENSEQ !in file flux app op.F90 program flux_app_op use OP2_FORTRAN_DECLARATIONS use OP2_Fortran_RT_Support use OP2_CONSTANTS use FLUX_GENSEQ ... call flux_kernel(nodes, & op_arg_dat(x,-1,OP_ID,3,’r8’,OP_READ), & ...) ... end program flux_app_op Fig. 10: Optimized modules structure for OP2 “assumed shape array” and calls the user kernel flux user kernel with a simple offset that is cheap to calculate. To apply the modification to all parallel loops we simply modified the code generator to generate code with this new subroutine structure. None of the application level code with the OP2 API was affected. The performance of the resulting code is presented by the third bar in Figure 9a. The OP2 based Hydra application now matches the performance of the original version. These results by themselves provide enormous evidence of the utility of OP2, particularly (1) showing how an optimization can be applied to the whole industrial application seamlessly through code generation, reducing developer effort and (2) demonstrating that the same runtime performance as that of a hand-tuned code could be achieved through the high-level framework. A number of new features implemented in OP2 allow further improvements for the MPI parallelization. Firstly, the OP2 design allows the underlying mesh partitioner for distributing the mesh across MPI processes to be changed. During the initial input, OP2 distributes the sets, maps and data assuming a trivial block partitioning, ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:16 I.Z. Reguly et al. Table II: Hydra single node performance with 24 MPI processes, showing data requirements per set element as number of double precision values read and written either directly or indirectly (NASA Rotor 37, 0.8M nodes, 2.5M edges, 20 iterations). Loop accumedges edgecon ifluxedge invjacs srck srcsa updatek vfluxedge volap wffluxedge wvfluxwedge Time (sec) 1.32 1.08 1.49 0.17 0.35 1.32 0.98 6.52 0.43 0.23 0.21 % runtime 7.83 6.56 8.96 1.03 1.86 7.60 5.83 38.58 2.58 1.38 1.24 Direct R/W 3/0 3/0 3/0 27/27 30/6 34/6 53/6 3/0 29/24 7/0 4/0 Indirect R/W 74/52 68/48 34/12 0/0 0/0 0/0 0/0 92/12 0/0 72/12 45/6 where consecutive blocks of set elements are assigned to consecutive partitions. As this trivial partitioning is not optimized for distributed memory performance, a further repartitioning is carried out (in parallel) with the use of state-of-the-art unstructured mesh partitioners such as ParMetis [ParMETIS 2013] or PTScotch [PT-Scotch 2013]. For the purposes of comparison with the original OPlus code, as shown in Figure 9a, we have also implemented the recursive coordinate bisection algorithm in OP2 allowing it to generate the exact same partitioning as the original Hydra application. Secondly, OP2 allows the ordering or numbering of mesh elements in an unstructured mesh to be optimized. The renumbering of the execution set and related sets that are accessed through indirections has an important effect on performance [Burgess and Giles 1997]: cache locality can be improved by making sure that data accessed by elements which are executed consecutively are close, so that data and cache lines are reused. OP2, implements a renumbering routine that can be called to convert the input data meshes based on the Gibbs-Poole-Stockmeyer algorithm in Scotch [PT-Scotch 2013]. The results in Figure 9b show the effect of the above two features. The use of PTScotch resulted in about 8% improvement over the recursive coordinate bisection partitioning, on Ruby. However, renumbering resulted in about 17% gains for Hydra solving the NASA Rotor 37 mesh. Overall, partitioning with PTScotch gave marginally better performance than ParMetis (not shown here). In the results presented in the rest of the paper we make use of OP2’s mesh renumbering capability, unless stated otherwise. Breakdowns for some of the most time-consuming loops are shown in Table II when all the above optimisations are applied; observe how only 6 loops make up 75% of the total runtime. The table also shows the data requirements per set element; the number of double precision numbers read and written, either directly or indirectly, ignoring temporary memory requirements due to local variables. The results suggest that the memory system is under considerable pressure, especially when large amounts of data is accessed indirectly, but also shows that performance depends on the computations carried out within the user kernel. Further benchmarks exploring different aspects of performance are presented in Section 4.2 on large-scale systems. 4.1. Multi-core and Many-core Performance OP2 supports parallel code generation for execution on multi-threaded CPUs or SMPs using OpenMP and on NVIDIA GPUs using CUDA. The generated OpenMP code uses the same subroutine, module and file structure illustrated in Figure 10. At the time of ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:17 writing, CUDA and NVIDIA’s compiler, nvcc only supports code development in C/C++, so OP2 utilizes PGI’s CUDA FORTRAN compiler to support code generated for the GPU via the Fortran API. To exploit shared memory parallelization techniques, OP2 segments the execution set on a partition into blocks or mini-partitions and each mini-partition is assigned to an OpenMP thread (or a CUDA thread block) for execution in parallel [Giles et al. 2012; Mudalige et al. 2012]. However, to avoid race conditions due to indirectly accessed data the blocks are colored such that adjacent blocks are given different colors. When executing the computations per block, only blocks of the same color are executed in parallel; furthermore, on the GPU, a subsequent coloring of set elements within each block is necessary to avoid race conditions when one set element is assigned to one GPU thread. All these form an execution plan that is created for each loop when it is first encountered and then reused during subsequent executions. 4.1.1. OpenMP Performance. Figure 11 presents the runtime performance of the OpenMP parallel back-end. The experiments varied from running a fully multithreaded version of the application (OpenMP only), to a heterogeneous version using both MPI and OpenMP. We see that executing Hydra with 24 OpenMP threads (i.e. OpenMP only) resulted in significantly poorer performance than when using only the MPI parallelization, on this two socket CPU node. We have observed similar performance with the Airfoil CFD benchmark code [Mudalige et al. 2013]. The causes for MPI outperforming OpenMP on SMPs/CMPs have been widely discussed in literature. These mainly consist of the nonuniform memory access issues (NUMA [Lameter 2013; Jr. and Ellis 1991]) discussed in further detail below, and thread creation and tear down overheads [Lindberg 2009]. In our case, an additional cause may also be the reduced parallelism due to coloring for blocks that avoid data races. The hybrid MPI+OpenMP parallelization provided better performance but was still about 10% slower than the pure MPI version; again the overhead of shared-memory multi-threading techniques may be causing performance bottlenecks. To explore the causes further, in Figure 12 and Table III we present the variation in the runtime and the number of block colors for different block sizes for a number of combinations of MPI processes and OpenMP threads. The number of colors and blocks per color are automatically output by OP2 for each op par loop and we have presented here a range of numbers taken from the most time consuming loops in Hydra. With the shared memory parallelism execution scheme employed by OP2, we reason that the size of the block determines the amount of work that a given thread carries out uninterrupted. The bigger it is, the higher data reuse within the block with better cache and prefetch engine utilization. At the same time, some parallelism is lost due to the colored execution. In other words, only those blocks that have the same color can be executed at the same time by different threads, with an implicit synchronization step between colors. This makes the execution scheme prone to load imbalances, especially when the number of blocks with a given color is comparable to the number of threads that are available to execute them. The above two causes have given rise to the runtime behavior we see from each MPI and OpenMP combination in Figure 12. The average number of colors (nc) and the average number of blocks (nb) in Table III supports this reasoning where, overall we see a reduction in runtime as the block size is increased but only until there are enough blocks per color (nb/nc) to achieve good load balancing in parallel. We also experimented by using OpenMP’s static and dynamic load balancing functionality but did not obtain any significant benefits as all the blocks executed (except for the very last one) have the same size. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:18 I.Z. Reguly et al. OPlus (24 MPI) 24 OMP 12 OMP x 2 MPI 4 OMP x 6 MPI 2 OMP x 12 MPI 24 MPI CUDA (initial) CUDA (+ SoA) CUDA (+ block opt) 1 MPI x CUDA (best) 2 MPI X CUDA (best) 30 Time (seconds) 25 20 15 10 5 0 - Fig. 11: OP2 Hydra Multi-core/Many-core performance on Ruby (NASA Rotor 37, 2.5M edges, 20 iterations) with PTScotch partitioning 30 64 128 Time (seconds) 25 256 512 1024 2048 20 15 10 5 0 24OMP 12OMPx2MPI 4OMPx6MPI 2OMPx12MPI Number of threads Fig. 12: Hydra OpenMP and MPI+OpenMP performance for different block sizes on Ruby (NASA Rotor 37, 2.5M edges, 20 iterations) with PTScotch partitioning The overall poor performance of the pure OpenMP runtimes (24OMP) for any block size, compared to the other MPI+OpenMP runs, appears to be due to Non-Uniform Memory Accesses (NUMA) issues. On multiple-socket machines system memory is connected to different sockets, and so when a thread on one socket has to access memory connected to another socket there is a significant overhead [Lameter 2013; Jr. and Ellis 1991]. As OP2 does a colored execution, and the colors are dynamically determined at runtime and may vary between different loops, statically determining which thread processes which blocks is not possible, thus allocating memory close to the thread/core that will execute a block is not feasible. Thus, the pure OpenMP version gets affected, preventing further performance gains from increased block size. When executing in an MPI+OpenMP hybrid setting, processes and threads are pinned to specific sockets, thereby circumventing this issue. Thus it is important to use a sensible MPI and OpenMP process and thread combination for the given node/socket architecture. Finally we conclude that the above effects, particularly the lost parallelism with colored execution, combined with thread creation and tear down overheads [Lindberg 2009] may account for the slightly worse performance of the hybrid MPI+OpenMP approach on a single node compared to the MPI only runtime. Table IV details the achieved bandwidth for the most time consuming loops of Hydra with OpenMP (6 MPI × 4 OMP). These loops together take up about 90% of the ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 Block size 64 128 256 512 1024 2048 24 nb nc (K) 39 14 20 15 10 14 5 12 2.5 10 1 9 OMP × MPI 12×2 4×6 nb nc nb nc (K) (K) 20 16 6.8 16 10 17 3.4 17 5 14 1.7 15 2.5 14 0.8 14 1 11 0.4 11 0.6 11 0.2 11 xx:19 2×12 nb nc (K) 3 16 1.7 15 0.8 14 0.4 12 0.2 11 0.1 10 Table III: Hydra single node performance, Number of blocks (nb) and number of colors (nc) (K = 1000): 2.5M edges, 20 iterations Table IV: Hydra single node performance, 6 MPI x 4 OMP with PTScotch: 2.5M edges, 20 iterations Loop accumedges edgecon ifluxedge invjacs srck srcsanode updatek vfluxedge volapf wffluxedge wvfluxedge Time (sec) 1.46 2.00 1.88 0.16 0.47 1.34 0.94 7.05 0.47 0.26 0.26 GB/sec 28.57 58.40 48.88 67.37 81.72 31.62 68.67 16.11 72.19 25.24 16.81 % runtime 7.99 10.95 10.32 0.90 2.57 7.38 5.14 38.70 2.57 1.41 1.41 total runtime. The achieved bandwidths are reported through code generated by OP2 for performance reporting. The bandwidth figure was computed by counting the useful amount of data bytes transferred from/to global memory during the execution of a parallel loop and dividing it by the runtime of the loop. The achieved bandwidth by a majority of the key loops on Ruby is over or close to 60% of the advertised peak bandwidth of the Sandy Bridge processors (2×42.6 GB/s [SandyBridge 2013]). The best performing loops, such as srck, updatek and volapf, are direct loops that only access datasets defined on the set being iterated over, hence they achieve a very high fraction of the peak bandwidth, due to trivial access patterns to memory. Indirect loops use mapping tables to access memory, and they often require colored execution in order to avoid data races; both of these factors contribute to lower bandwidth achieved by loops such as accumedges, ifluxedge and edgecon. Additionally some loops are also compute and control-intensive, such as vfluxedge. Finally, loops over boundary sets, such as wvfluxedge, have highly irregular access patterns to datasets and generally much smaller execution sizes, leading to a lower utilization of resources. Our experiments also showed that the trends on achieved bandwidth utilization remain very similar to the observed results from previous work [Giles et al. 2012; Mudalige et al. 2012] for the Airfoil benchmark application. 4.1.2. GPU Performance. The Ruby development machine contains two Tesla K20 GPUs, using which we investigate Hydra’s performance on GPUs. Many aspects of the generated CUDA code had been optimized from our previous work [Giles et al. 2012; Giles et al. 2013] targeting the older generation of NVIDIA GPUs based on their Fermi ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:20 I.Z. Reguly et al. architecture. Thus, we re-evaluated the generated CUDA code targeting the Tesla K20 which are based on NVIDIA’s latest Kepler architecture. In a way similar to the code generation for the CPUs, we use Fortran to C bindings to call functions in the OP2 back-end and to connect C pointers to Fortran pointers. The same plan construction that was described in previous papers [Giles et al. 2013] is retained. Previously, indirect data from GPU global memory were loaded into each SMs shared memory space forming a local mini-partition. Each mini-partition was assigned to an SM (Streaming multi-processor) and executed in parallel. The SM executes the mini-partition by utilizing a number of threads (called a thread block). However, we observed that this staging of indirectly accessed data is not beneficial for Hydra contrary to the results we observed with the Airfoil benchmark [Giles et al. 2013] on previousgeneration hardware. This is due to the fact that the large amounts of data moved by parallel loops in Hydra would require excessive amounts of shared memory, which in turn would severely degrade multiprocessor occupancy (the number of threads resident in a multiprocessor at the same time) and performance. Therefore, we eliminated the staging in shared memory by directly loading the data from global memory into SMs, and rely on the increased L2 and texture cache size to speed up memory accesses that have spatial and temporal locality. The performance achieved by the CUDA application generated by OP2 with such a parallel implementation is presented in Figure 11. However, this initial code on a single GPU ran about 45% slower than the best CPU performance on Ruby (2 CPUs, 24 MPI processes). Running the generated CUDA code through the NVIDIA Visual Profiler [?] revealed more opportunities for optimizations. It appeared that the switch to directly loading data from global memory (without staging in shared memory) has made most parallel loops in Hydra limited by bandwidth utilization. Further investigation showed that a high amount of cache contention is caused by the default data layout of op dats. This layout, called Array-of-Structs (AoS), was found to be the best layout for indirectly accessed data in our previous work [Giles et al. 2013] on Fermi GPUs. However without staging in shared memory it was damaging performance in Hydra as many of Hydra’s op dats have a large number of components (dimensions) for each set element (typically related to the number of PDEs ≥ 6). Thus, adjacent threads are accessing memory that are far apart, resulting in high numbers of cache line loads (and evictions, since the cache size is limited). OP2 has the ability to effectively transpose these datasets and use a Struct-of-Arrays (SoA) layout, so when adjacent threads are accessing the same data components, they have a high probability of being accessed from the same cache line. This is facilitated by either the user annotating the code or by telling the OP2 framework to automatically use the SoA layout for datasets above a given dimension. The above optimisation resulted in an increase of about 40% to the single GPU performance as shown in Figure 11. To improve performance further, two other aspects of GPU performance were investigated. The goal was to allow as many threads to be active simultaneously so as to hide the latency of memory operations. The first consideration is to limit the number of registers used per thread. A GPU’s SM can hold at most 2048 threads at the same time, but it has only a fixed number of registers available (65k 32-bit registers on Kepler K20 GPUs). Therefore kernels using excessive amounts of registers per thread decrease the number of threads resident on an SM, thereby reducing parallelism and performance. Limiting register count (through compiler flags) can be beneficial to occupancy and performance if the spilled registers can be contained in the L1 cache. Thus for the most time-consuming loops in Hydra, we have manually adjusted register count limitations so as to improve occupancy. The second consideration is to adjust the number of threads per block. Thread block size not only affects occupancy, but also has non-trivial effects on performance due ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:21 Table V: Hydra single GPU performance: NASA Rotor 37, 2.5M edges, 20 iterations Loop accumedges edgecon ifluxedge invjacs srck srcsa updatek vfluxedge volap wffluxedge wvfluxwedge Time (sec) 2.07 2.46 1.03 0.41 0.34 0.34 0.54 2.32 0.23 0.11 0.08 GB/sec 13.87 33.55 71.90 25.94 108.09 121.72 115.91 53.82 142.85 31.55 25.69 % runtime 19.30 22.87 9.59 3.85 3.20 3.15 5.01 21.62 2.14 1.00 0.77 to synchronization overheads, cache locality, etc. that are difficult to predict. We used auto-tuning techniques described in a previous work [Giles et al. 2013] to find the best thread block size for different parallel loops, and stored them in a look-up table. This optimisation can be carried out once for different hardware, but performance is unlikely to vary significantly when solving different problems. Together with the SoA optimisation, the use of tuned block sizes and limited register counts provided a further 10% performance improvement. In the case of several Hydra loops that are bandwidth-intensive and do little computation, the thread coloring technique (that avoids write conflicts) introduces a significant branching overhead, due to adjacent edges (mapped to adjacent threads) having different colors, and execution over colors getting serialized. The negative effect on performance can be mitigated by sorting edges in blocks by color, ensuring that threads in a warp have the same color (or at least fewer colors), which in turn reduces branching within the warps. However, this solution degrades the access patterns to directly accessed data in memory, as adjacent threads are no longer processing adjacent set elements. Thus, we only apply it to the Hydra loops that are limited by branching overhead. The final best runtime on a single K20 GPU and on both the K20 GPUs on Ruby is presented in the final two bars of Figure 11. A single K20 GPU achieves about 1.8× speedup over the original OPlus version of Hydra on Ruby and about 1.5× over the MPI version of Hydra with OP2. However, considering the full capabilities of a node, the best performance on Ruby with GPUs (2 GPUs with MPI) is about 2.34× speedup over the best OP2 runtime with CPUs (2 CPUs, 24 MPI processes) and about 2.89× speedup over the best OPlus runtime with CPUs (2 CPUs, 24 MPI processes). Table V notes the achieved memory bandwidth utilization on a K20 GPU. A majority of the most time consuming loops achieve 20 - 50 % of the advertised peak bandwidth of 208 GB/s on the GPU [K20 2012]. Bandwidth utilization is particularly significant during the direct loops srck, updatek and volapf. As it can be seen from the above effort, a range of low-level features had to be taken into account and a significant re-evaluation of the GPU optimizations had to be done to gain optimal performance even when going from one generation of GPUs by the same vendor/designer to the next. In our case the previous optimizations implemented for the Fermi GPUs had to be considerably modified to achieve good performance on the next generation Kepler GPUs. However, as the code was developed under the OP2 framework, radical changes to the parallel code could be easily implemented. In contrast, a directly hand-ported application would cause the application programmer significant difficulties to maintain performance for each new generation of GPUs, not to mention new processor architectures. This shows that the use of OP2 has indeed led ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:22 I.Z. Reguly et al. Table VI: Halo sizes : Av = average number of MPI neighbors per process, Tot. = average number total elements per process, %H = average % of halo elements per process (a) Strong Scaling nodes 1 2 4 8 16 32 64 128 MPI procs. 32 64 128 256 512 1024 2048 4096 Av 7 8 9 10 10 10 10 10 PTScotch Tot %H 111907 5.12 56922 6.74 29175 9.02 14997 11.52 7765 14.55 4061 18.32 2130 22.16 1134 26.98 Av 9 10 11 11 12 12 13 13 RCB Tot 117723 61208 32138 17074 9211 4949 2656 1425 Av 8 9 10 11 12 RCB Tot 73486 78934 73794 78396 75224 %H 9.81 13.27 17.41 22.28 27.97 32.98 37.58 41.89 (b) Weak Scaling nodes 1 2 4 8 16 MPI procs. 32 64 128 256 512 Av 8 9 10 12 13 PTScotch Tot %H 70084 6.00 73527 6.69 79009 6.09 73936 7.33 78671 6.94 %H 10.35 11.07 12.26 12.98 13.76 to a near optimal GPU back-end for Hydra that is significantly faster than the CPU back-end, with very little change to the original source code. 4.2. Distributed Memory Scaling Performance The industrial problems simulated by Hydra require significantly larger computational resources than what is available today on single node systems. An example design simulation such as a multi-blade-row unsteady RANS (Reynolds Averaged Navier Stokes) computation where the unsteadiness originates from the rotor blades moving relative to the stators, would need to operate over a mesh with about 100 million nodes. Currently with OPlus, Hydra can take more than a week on a small CPU cluster to reach convergence for such a large-scale problem. Future turbomachinery design projects aim to carry out such simulations more frequently, such as on a weekly or on a daily basis, and as such the OP2 based Hydra code needs to scale well on clusters with thousands to tens of thousands of processor cores. In this section we explore the performance on such systems. Table I lists the key specifications of the two cluster systems we use in our benchmarking. The first system, HECToR [HECToR 2013], is a large-scale proprietary Cray XE6 system which we use to investigate the scalability of the MPI and MPI+OpenMP parallelizations. The second system, JADE [JADE 2013] is a small NVIDIA GPU (Tesla K20) cluster that we use to benchmark the MPI+CUDA execution. 4.2.1. Strong Scaling. Figure 13(a) reports the run-times of Hydra at scale, solving the NASA Rotor 37 mesh with 2.5M edges in a strong-scaling setting. The x-axis represents the number of nodes on each system tested, where a HECToR node consists of two Interlagos processors, a JADE node consists of two Tesla K20 GPUs. The run-times (on the y-axis) are averaged from 5 runs for each node count. The standard deviation in run times was always less than 10%. MPI+OpenMP results were obtained by assigning ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:23 32 OPlus OP2 MPI (RCB) OP2 MPI+OMP (RCB) OP2 MPI (PTScotch) OP2 MPI+OMP (PTScotch) OP2 MPI+CUDA (PTScotch) Runtime (Seconds) 16 8 4 2 1 0.5 0.25 1 2 4 8 16 32 64 128 Nodes (a) Strong Scaling (2.5M edges) 16 Runtime (Seconds) 8 4 OPlus OP2 MPI (PTScotch) OP2 MPI (RCB) OP2 MPI+OMP (PTScotch) OP2 MPI+OMP (RCB) OP2 MPI+CUDA (PTScotch) 2 1 1 2 4 Nodes 8 16 (b) Weak Scaling (0.5M edges per node) Fig. 13: Scaling performance on HECToR (MPI, MPI+OpenMP) and Jade (MPI+CUDA) on the NASA Rotor 37 mesh (20 iterations) four MPI processes per HECToR node, each MPI process consisting of eight OpenMP threads. This is due to the NUMA architecture of the Interlagos processors [Interlagos 2011] which combines two cores to a “module” and packages 4 modules with a dedicated path to part of the DRAM. Here we were able to leverage the job scheduler to exactly place and bind one MPI process per memory region (or die) reducing inter-die communications. Other combinations of processes and threads were also explored, but the above provided the best performance. On HECToR, we see that the overall scaling of Hydra with OP2 is significantly better than that with OPlus. OP2’s MPI-only parallelization scales well up to 128 nodes (4096 cores). At 32 nodes (1024 cores) the MPI-only parallelization partitioned with PTScotch gives about 2x speedup over the runtime achieved with OPlus. As with all message passing based parallelizations, one of the main problems that limits the scalability is the over-partitioning of the mesh at higher machine scale. This leads to an increase in redundant computation at the halo regions (compared to the non-halo elements per partition) and an increase in time spent during halo exchanges. Evidence for this explanation can be gained by comparing the average number of halo elements and the average number of neighbors per MPI process reported by OP2 after ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:24 I.Z. Reguly et al. Table VII: Hydra strong scaling performance on HECToR, Number of blocks (nb) and number of colors (nc) for MPI+OpenMP and time spent in communications (comm) and computations (comp) for the hybrid and the pure MPI implementation: 2.5M edges, 20 iterations Num of nodes MPI+OMP nb nc 1 2 4 8 16 32 64 128 9980 4950 2520 1260 630 325 165 86 17 16 17 15 14 13 10 12 MPI+OMP comm comp (sec.) (sec.) 1.33 16.6 1.04 7.8 0.57 3.3 0.52 1.42 0.26 0.81 0.28 0.4 0.32 0.21 0.52 0.11 MPI comm comp (sec.) (sec.) 1.2 13.2 0.83 6.5 0.36 3.14 0.23 1.48 0.21 0.68 0.13 0.38 0.12 0.2 0.15 0.12 partitioning with PTScotch and RCB (see Table VI). We noted these results from runs on HECToR, but the halo sizes and neighbors are only a function of the number of MPI processes (where one MPI process is assigned to one partition) as the selected partitioner gives the same quality partitions for a given mesh for the same number of MPI processes on any cluster. Column 4 and 7 of Table VI(a) details the average total number of nodes and edges per MPI process when partitioned with PTScotch and RCB respectively. Columns 5 and 8 (%H) indicate the average proportion of halo nodes and edges out of the total number of elements per MPI process while Columns 3 and 6 (Av) indicate the average number of communication neighbors per MPI process. With PTScotch, the proportion of the halo elements out of the average total number of elements held per MPI process ranged from about 5% (at 32 MPI processes) to about 27% (at 4096 MPI processes). The average number of MPI neighbors per MPI process ranged from 7 to 10. The halo sizes with RCB were relatively large, starting at about 10% at 32 MPI processes to about 40% at 4096 processes. Additionally the average number of neighbors per MPI process was also greater with RCB. These causes point to better scaling with PTScotch which agrees with the results in Figure 13(a). The above reasoning, however, goes contrary to the relative performance difference we see between OP2’s MPI only and MPI+OpenMP parallelizations. We expected MPI+OpenMP to perform better at larger machine scales as observed in previous performance studies using the Airfoil CFD benchmark[Mudalige et al. 2013]. The reason was that larger partition sizes per MPI process gained with MPI+OpenMP in turn resulting in smaller proportionate halo sizes. But for Hydra, adding OpenMP multithreading has caused a reduction in performance, where the gains from better halo sizes at increasing scale have not manifested into an overall performance improvement. Thus, it appears that the performance bottlenecks discussed in Section 4.1.1 for the single node system are prevalent even at higher machine scales. To investigate whether this is indeed the case, Table VII presents the number of colors and blocks for the MPI+OpenMP runs at increasing scale on HECToR. The size of a block (i.e. a mini-partition) was tuned from 64 to 1024 for each run, but at higher scale (from upwards of 16 nodes) the best runtimes were obtained by a block size of 64. As can be seen, the number of blocks (nb) reduces by two orders of magnitude when scaling from 1 node up to 128 nodes. However within this scale the number of colors remains between 10 to 20. These numbers provide evidence similar to the ones we observed on the Ruby single node system in Section 4.1.1 where a ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:25 reduced number of blocks per color results in poor load balancing. The time spent computing and communicating during each run at increasing scale shows that although the computation time reduces faster for the MPI+OpenMP version, its communication times increase significantly, compared to the pure MPI implementation. Profiled runs of MPI+OpenMP indicate that the increase in communications time is in fact due to time spent in MPI Waitall statements where due to poor load balancing, MPI processes get limited by their slowest OpenMP thread. Getting back to Figure 13(a), comparing the performance on HECToR to that on the GPU cluster JADE, reveals that for the 2.5M edge mesh problem the CPU system gives better scalability than the GPU cluster. We believe that similar to the Airfoil code’s GPU cluster performance [Mudalige et al. 2012], this comes down to GPU utilization issues: the level of parallelism during execution. Since the GPU is more sensitive to these effects than the CPU (where the former relies on increased throughput for speedups and the latter depends on reduced latency), the impact on performance is more significant due to reduced utilization at increasing scale. Along with the reduction in problem size per partition, the same fragmentation as we observed with the MPI+OpenMP implementation due to coloring is present. Colors with only a few blocks have very low GPU utilization, leading to a disproportionately large execution time. This is further complemented by the different number of colors on different partitions for the same loop, leading to faster execution on some partitions and then the idling at implicit or explicit synchronization points waiting for the slower ones to catch up. We further explore these issues and how they affect performance of different types of loops in Hydra later in Section 4.2.3. 4.2.2. Weak Scaling. Weak scaling of a problem investigates the performance of the application at both increasing problem and machine size. For Hydra, we generated a series of NASA rotor 37 meshes such that a near-constant mesh size per node (0.5M vertices) is maintained at increasing machine scale. The results are detailed in Figure 13(b). The largest mesh size benchmarked across 16 nodes (512 cores) on HECToR consists of about 8 million vertices and 25 million edges in total. Further scaling could not be attempted due to the unavailability of larger meshes at the time of writing. With OPlus, there is about 8-13% increase in the runtime of Hydra each time the problem size is doubled. With OP2, the pure MPI version with PTScotch partitioning shows virtually no increase in runtime, while the RCB partitioning slows down 37% every time the number of processes and problem size is doubled. One reason for this is the near constant halo sizes resulting from PTScotch, but with RCB giving 710% larger halos. The second reason is the increasing cost of MPI communications at larger scale, especially for global reductions. Similar to strong scaling, the MPIonly parallelization performs about 10-15% better than the MPI+OpenMP version. The GPU cluster, JADE, gives the best runtimes for weak scaling, with a 4-8% loss of performance when doubling problem size and processes. It roughly maintains a 2× speedup over the CPU implementations at increasing scale. Adjusting the experiment to compare one HECToR node to one GPU (instead of a full JADE node with 2 GPUs) still shows a 10-15% performance advantage for the GPU. The above scaling results give us considerable confidence in OP2’s ability to give good performance at large machine sizes even for a complex industrial application such as Hydra. We see that the primary factor affecting performance is the quality of the partitions: minimizing halo sizes and MPI communication neighbors. These results illustrate that, in conjunction with utilizing state-of-the-art partitioners such as PTScotch, the halo sizes resulting from OP2’s owner-compute design for distributed memory parallelization provide excellent scalability. We also see that GPU clusters ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:26 I.Z. Reguly et al. vfluxedge ifluxedge edgecon period Run time (milliseconds) 4096 1024 srcsa accumedges updatek periodicity 256 64 16 4 1 1 2 4 8 Nodes 16 32 64 128 (a) Strong Scaling (2.5M edges) Run time (milliseconds) 4096 1024 256 64 16 accumedges ifluxedge updatek period 4 edgecon srcsa vfluxedge periodicity 1 1 2 4 Nodes 8 16 (b) Weak Scaling (0.5M edges per node) Fig. 14: Scaling performance per loop runtime breakdowns on HECToR (NASA Rotor 37, 20 iterations) are much less scalable for small problem sizes and are best utilized in weak-scaling executions. 4.2.3. Performance Breakdown at Scale. In this section we delve further into the performance of Hydra in order to identify limiting factors. The aim is to break down the scaling performance to gain insights into how the most significant loops in the application scale on each of the two cluster systems. Figure 14a shows the timing breakdowns for a number of key loops when, for the MPI only version (partitioned with PTScotch). Note how the loops vfluxedge, edgecon and srcsa at small scale account for most of total runtime. However as they are loops over either interior vertices or edges, that do not include any global reductions, they have near-optimal scaling. The loop updatek contains global reductions, and thus at scale, it is bound by the latency of communications. At 128 nodes (4096 cores) it becomes the single most expensive loop. Loops over boundary sets, such as period and periodicity scale relatively worse than loops over interior sets, since fewer partitions carry out operations over elements in those sets. Per-loop breakdowns when strong scaling on the Jade GPU cluster are shown in Figure 15a. Observe how the performance of different loops is much more spread out compared to those on the CPU cluster scaling (as shown in Figure 14a). Also note how boundary loops such as period and periodicity are not so much faster than loops over interior sets, which is again due to GPU utilization. While the loop with reductions (updatek) was showing good scaling on the CPU up to about 512 cores, perACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 Run time (milliseconds) 2048 1024 512 256 128 64 32 16 8 4 2 1 edgecon accumedges updatek period Run time (milliseconds) 1 vfluxedge ifluxedge srcsa periodicity 2 4 Nodes (a) Strong Scaling (2.5M edges) 2048 1024 512 256 128 64 32 16 8 4 2 1 edgecon accumedges updatek period 1 xx:27 2 8 vfluxedge ifluxedge srcsa periodicity 4 Nodes (b) Weak Scaling (0.5M edges per node) 8 Fig. 15: Scaling performance per loop runtime breakdowns on JADE (NASA Rotor 37, 20 iterations) formance stagnates beyond 4 GPUs which is a result of the near-static overhead of on-device reductions and the transferring of data to the host, all of which are primarily latency-limited. Most other loops, such as vfluxedge, ifluxedge, accumedges and srcsa, scale with 65-80% performance gain when the number of GPUs are doubled, however edgecon only shows a 48-60% increase due to the loop being dominated by indirect updates of memory and an increasingly poor coloring at scale. Figure 14b shows timing breakdowns for the same loops when weak scaling on HECToR, with very little increase in time for loops over interior sets and a slight reduction in time for boundary loops, as a result of the boundary (surface) of the problem becoming smaller relative to the interior. Similar results can be observed in Figure 15b when weak scaling on the GPU cluster. Here, some of the bigger loops gets relatively slower, due to the load imbalance between different GPUs. In this case some partitions need more colors than others for execution, which in turn slows down execution. Boundary loops such as period and periodicity become slower as more partitions share elements of the boundary set forcing halo exchanges that are limited by latency. 5. FULL HYBRID GPU-CPU EXECUTION Most related work published on many-core acceleration, and GPU acceleration in particular, focuses on migrating the entire code base to the GPU and then comparing performance with the CPU. However, modern GPU supercomputers, such as Titan at Oak Ridge NL [?], consist of roughly the same number of GPUs and CPU sockets, and ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:28 I.Z. Reguly et al. often pricing is only calculated on a per-node basis. Thus, if an application only exploits the computational resources of the GPUs, then the CPUs are idling, even though they might have considerable computational power themselves; this is a waste of energy and resources. Several papers address this issue by employing different techniques, where the CPU and the GPU either have the same “rank”, such as in the case of shared task-queues [Agulleiro et al. 2012], or where the GPU computes on the bulk of the workload and the CPU handles the parts where the GPU would be underutilized, such as the boundary in domain decomposition systems [Yang et al. 2013; Bilel et al. 2012; GROMACS 2013]. In this section we present preliminary results on OP2’s support for what we call full-hybrid execution where both the CPUs and the GPUs on a node is used for mesh computations. Again, the possibility of seamlessly integrating such a fully-hybrid parallelization to Hydra is only possible due to the high-level abstraction approach implemented through OP2. The natural approach to enable hybrid CPU-GPU execution in OP2 is to assign some processes to execute on the GPU and others to execute on the CPU. This hardware selection happens at runtime: on a node with N GPUs, the first N processes assigned to it pick up a GPU and the rest become CPU processes. To enable hybrid execution, the generated kernel files include code for execution with both MPI+CUDA and MPI+OpenMP, thus at runtime the different MPI processes assigned to different hardware can call the appropriate one. The most important challenge with hybrid execution in general, not just for Hydra, is to appropriately load balance between different hardware so that both are utilized as much as possible. From our results in the previous sections, the importance of load balancing, even for executing computations the CPU only, was evident. Finding such a balance for simple applications where one computational phase (such as a single loop) dominates the runtime may not be difficult. One only needs to compare execution times on the CPU and the GPU separately and assign proportionally sized partitions to the two. However, for an application such as Hydra consisting of several phases of computations, such a load balancing is not trivial: the performance difference between the CPU and the GPU varies widely for different loops, as shown in Table IV and Table V. For example the loop vflux is about 3 times faster on the GPU, but the loop edgecon is 25% faster on the CPU. Load balancing for each computational loop is infeasible as it would require repartitioning the mesh and transferring large amounts of data between different processes from one loop to another, losing any performance benefit it might offer. Thus in OP2 we have to come up with a static load balance upfront, which implies that some loops will be executed faster on the GPU than the CPU and vice versa, leading to the faster one waiting for the slower one to catch up whenever a halo exchange is necessary between them. This can severely restrict the potential performance gains expected from a fully hybrid execution. We perform hybrid tests on the Ruby development machine, using a single GPU and both CPU sockets, each running OpenMP with 10 threads. Partitioning is carried out using the heterogeneous load balancing feature of ParMetis. Figure 16 shows performance while adjusting the static load balance between the work assigned to the CPU and the GPU. For example a partition size balance of 2.5 implies that the GPU executes a partition that is 5 times larger than a single CPU (i.e. 2.5 times larger than the combined size of the partitions assigned to both of the CPUs on Ruby). The first guess for the static load balance would be based on single GPU execution time and MPI+OpenMP execution time on Ruby, yielding a balance of about 1.5, giving a 9% performance improvement over single GPU runtime. We have carried out an autotuning run for the value of the static load balance, yielding the data points in Figure 16, registering the execution times of different loops on the CPU and the GPU. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:29 18 Run time (seconds) 16 1xGPU 1xGPU + 2xCPUs 14 12 10 8 accumedges 6 srcsa ifluxedge 4 vfluxedge edgecon 2 0 0.5 1 1.5 2 2.5 3 3.5 4 Partition size balance Fig. 16: Hybrid CPU-GPU performance at different load balancing values, marking perfect balance for different loops on Ruby (NASA Rotor 37, 2.5M edges, 20 iterations) with ParMetis partitioning The figure marks load balance values where different loops are in perfect balance (i.e. the execution time on the GPU and the two CPUs are approximately the same); it is obvious that there is a big variation, but the trends show that it is best to shift the balance towards loops where the GPU has a significant speedup over the CPU, such as ifluxedge, vfluxedge or srcsa. This increases the performance gain from hybrid execution up to 15%. 6. RELATED WORK There are several well established conventional libraries supporting unstructured mesh based application development on traditional distributed memory architectures. These include the popular PETSc [PETSc 2013], Sierra [Stewart and Edwards 2004] libraries as well as others such as Deal.II [Deal.II 2013], Dune [DUNE 2013] and FEATFLOW [FEATFLOW 2013]. Recent research in this area include unstructured mesh frameworks that allows extreme scaling (up to 300K cores) on distributed memory CPU clusters [Zhou et al. 2012] while libraries such as PETSc have also implemented hand tuned back-ends targeting solvers on distributed memory clusters of GPUs. Other related work include RPI’s FMDB [FMDB 2013] and LibMesh [Kirk et al. 2006]. A major goal of the LibMesh library is to provide support for adaptive mesh refinement (AMR) computations. There are also conventional applications such as computational fluid dynamics (CFD) solvers TAU [Jägersküpper and Simmendinger 2011], OpenFOAM [OpenCFD 2013] or Fluent [ANSYS 2011] that support GPU acceleration of parts of the simulation, however these take the approach of having separate hand-written implementations for different hardware. In contrast to these libraries, OP2’s objective is to support multiple back-ends (particularly aimed at emerging multicore/many-core processor systems) for the solution of mesh-based applications without the intervention of the application programmer. OP2 can be viewed as an instantiation of the AEcute (access-execute descriptor) [Howes et al. 2009] programming model that separates the specification of a computational kernel with its parallel iteration space, from a declarative specification of how each iteration accesses its data. The decoupled Access/Execute specification in turn creates the opportunity to apply powerful optimizations targeting the underlying hardware. A number of research projects have implemented similar or related programming frameworks. Liszt [DeVito et al. 2011] and FEniCS [Ølgaard et al. 2011] specifically target mesh based computations. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:30 I.Z. Reguly et al. The FEniCS [Ølgaard et al. 2011] project defines a high-level language, UFL, for the specification of finite element algorithms. The FEniCS abstraction allows the user to express the problem in terms of differential equations, leaving the details of the implementation to a lower-library. Currently, a runtime code generation, compilation and execution framework that is based on OP2, called PyOP2 [Rathgeber et al. 2012], is being developed at Imperial College London to enable UFL declarations to use similar back-end code generation strategies to OP2. Thus, the performance results in this paper will be directly applicable to the performance of code generated by FEniCS in the future. While OP2 uses an active library approach utilizing code transformation, Delite [Lee et al. 2011] and Liszt [DeVito et al. 2011] from Stanford University take the external approach to domain specific languages that require advanced compiler technology, but offer more freedom in implementing the language. Liszt targets unstructured grid applications; the aim, as with OP2, is to exploit information about the structure of data and the nature of the algorithms in the code and to apply aggressive and platform specific optimizations. Performance results from a range of systems (a single GPU, a multi-core CPU, and an MPI based cluster) executing a number of applications written using Liszt have been presented in [DeVito et al. 2011]. The Navier-Stokes application in [DeVito et al. 2011] is most comparable to OP2’s Airfoil benchmark [Giles et al. 2011] and shows similar speed-ups to those gained with OP2 in our work. Application performance on heterogeneous clusters such as on clusters of GPUs is not considered in [DeVito et al. 2011] and is noted as future work. There is a large body of work that develops higher-level frameworks for explicit stencil based applications (structured mesh applications) including Paraiso [Muranushi 2012], Ypnos [Orchard et al. 2010], SBLOCK [Brandvik and Pullan 2010], SDSL [Henretty et al. 2013], the HIPAcc framework [Membarth et al. 2012], Pochoir [Tang et al. 2011], Patus [Christen et al. 2011], Mint [Unat et al. 2011], Kranc [Husa et al. 2006], and others [Cohen et al. 2013; Holewinski et al. 2012]. In a structured mesh, the mesh is regular and the connectivity is implicit, where computations are performed based on a stencil that define a regular access pattern. Based on the stencil, the required computation (or a kernel) is used to compute a new element value from the current element value and neighboring elements. Ypnos [Orchard et al. 2010] is a functional, declarative domain specific language, embedded in Haskell and extends it for parallel structured grid programming. The language introduces a number of domain specific abstract structures, such as grids (representing the discrete space over which computations are carried out), grid patterns (stencils) etc. in to Haskell, allowing different back-end implementations, such as C with MPI or CUDA. Similarly, Paraiso [Muranushi 2012] is a domain-specific language embedded in Haskell, for the automated tuning of explicit solvers of partial differential equations (PDEs) on GPUs, and multicore CPUs. It uses algebraic concepts such as tensors, hydrodynamic properties, interpolation methods and other building blocks in describing the PDE solving algorithms. In contrast, most other projects, such as SBLOCK [Brandvik and Pullan 2010], SDSL [Henretty et al. 2013], HIPAcc [Membarth et al. 2012] and Pochoir [Tang et al. 2011] express computations as kernels applied to elements of a set and use compiler technologies and automatic source code generation to accelerate execution. We are not aware of research into the applicability of the above DSLs to large-scale or industrial applications. Recently, directive based approaches have emerged as a much publicized solution to programming heterogeneous systems. Most notable of these, OpenACC [OpenACC 2013] attempts to follow the accessibility and success of OpenMP in programming parallel systems but specifically targets accelerator based systems. Our experience ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:31 suggests a range of extensive language and compiler-technology improvements would be needed to enable applications with significant non-affine array accesses (such as unstructured mesh applications with indirect array accesses) to provide the best performance in a directive-based programming framework. The alternative, in which a significant effort is made by application developers to explicitly optimize their code, is not a viable solution for an industrial code, due to its size and complexity. The abstractions provided by the OP2 library (particularly the op par loop construct) can be seen as encompassing not only the “parallel regions” of a directive based program that can be accelerated, but also an explicit description of how each data item within the parallel region is accessed, modified and synchronized with respect to the unstructured mesh data and computation it represents. With such an explicit access-descriptor, OP2 allows for optimization and parallel programming experts to choose significantly more radical implementations for very specific hardware in order to gain near-optimal performance. 7. CONCLUSIONS Rolls Royce’s Hydra is a full-scale industrial CFD application currently in regular production use. Porting it to exploit multi-core and many-core parallelism presents a major challenge in data organization and movement requiring the utility of a range of low-level platform specific features. The research presented in this paper illustrates how the OP2 high-level domain specific abstraction framework can be used to futureproof this key application for continued high performance on such emerging processor systems. We charted the conversion of Hydra from its original hand-tuned production version to one that utilizes OP2, and mapped out the key difficulties encountered in the process. Over the course of this process OP2 enabled the application of increasingly complex optimisations to the whole code to achieve near optimal performance. The paper provides evidence of how OP2 significantly increases developer productivity in this task. Performance results for the code generated with OP2 demonstrate that not only could the same runtime performance as that of the hand-tuned original production code be achieved, but it can be significantly improved on conventional processor systems as well as further accelerated by exploiting many-core parallelism. We see that OP2’s MPI and MPI+OpenMP parallelizations achieve about 2 × speedup when strong-scaled and maintain 15-30% speedup when weak-scaled over the original implementation on a large distributed memory cluster system. Running on NVIDIA GPUs, OP2’s CUDA implementation achieves about 2 to 3 × speedups over the latest Intel Sandy Bridge x86-64 processors and maintains a similar performance advantage over the CPU cluster implementations when weak-scaling over a GPU cluster. We also demonstrate that executing Hydra on both the CPUs and GPUs in a fully-hybrid setting provides up to 15% speedup over the purely GPU execution and is primarily bound by load-balancing issues. Some of the key optimisations that affect all backend implementations are the use of improved partitioning methods, mesh renumbering for improved cache locality and partial halo exchanges. Furthermore, for shared memory parallelism techniques, we have shown the importance of optimizing the mini-partition size so as to have a balance of parallelism and data locality, and we presented further techniques involving data layout transformations and the fine-tuning of resource usage to improve performance on the GPU. We develop a deeper understanding of execution efficiency by investigating performance characteristics of the major computational loops in Hydra. We show how nearoptimal performance is achieved in most loops and identify bottlenecks due to MPI ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:32 I.Z. Reguly et al. collectives or inefficiencies in the execution scheme that are going to be a subject of future research. We believe that the future of numerical simulation software development is in the specification of algorithms translated to low-level code by a framework such as OP2. Such an approach will, we believe, offer revolutionary potential in delivering performance portability and increased developer productivity. This, we predict, will be an essential paradigm shift for addressing the ever-increasing complexity of novel hardware/software technologies. The full OP2 source and example benchmark applications are available as open source software [OP2 2011; OP2-GIT 2013] and the developers would welcome new participants in the OP2 project. ACKNOWLEDGMENTS This research has been funded by the UK Technology Strategy Board and Rolls-Royce plc. through the Siloet project, the UK Engineering and Physical Sciences Research Council projects EP/I006079/1, EP/I00677X/1 on “Multi-layered Abstractions for PDEs” and the “Algorithms, Software for Emerging Architectures“ (ASEArch) EP/J010553/1 project. The authors would like to acknowledge the use of the University of Oxford Advanced Research Computing (ARC) facility in carrying out this work. The authors would like to thank PGI and Brent Leback for their proactive support in improving their CUDA Fortran compiler and Maxim Milakov of NVIDIA for his help and advice on GPU optimizations. We are thankful to Leigh Lapworth, Paolo Adami and Yoon Ho at Rolls-Royce plc. for providing access to the Hydra CFD application, Gr aham Markall, Fabio Luporini, David Ham and Florian Rathgeber, at Imperial College London, Lawrence Mitchell at theUniversity of Edinburgh for their contributions to the OP2 project and Endre László, András Oláh and Zoltán Nagy at PPKE Hungary. REFERENCES J.I. Agulleiro, F. Vázquez, E.M. Garzón, and J.J. Fernández. 2012. Hybrid computing: CPU+GPU coprocessing and its application to tomographic reconstruction. Ultramicroscopy 115, 0 (2012), 109 – 114. DOI:http://dx.doi.org/10.1016/j.ultramic.2012.02.003 AMD 2013. AMD Fusion APUs. (2013). http://fusion.amd.com/. ANSYS. 2011. ANSYS FLUENT Theory Guide. http://www.springerlink.com/content/u13552/#section= 800779&#38; page=21&#38; locus=97 B.R. Bilel, N. Navid, and M.S.M. Bouksiaa. 2012. Hybrid CPU-GPU Distributed Framework for Large Scale Mobile Networks Simulation. In Distributed Simulation and Real Time Applications (DS-RT), 2012 IEEE/ACM 16th International Symposium on. 44–53. M. Bohr. 2007. A 30 Year Retrospective on Dennard’s MOSFET Scaling Paper. Solid-State Circuits Society Newsletter, IEEE 12, 1 (2007), 11–13. T. Brandvik and G. Pullan. 2010. SBLOCK: A Framework for Efficient Stencil-Based PDE Solvers on Multicore Platforms. In Proceedings of the 2010 10th IEEE International Conference on Computer and Information Technology (CIT ’10). IEEE Computer Society, Washington, DC, USA, 1181–1188. D. A. Burgess, P. I. Crumpton, and M. B. Giles. 1994. A Parallel Framework for Unstructured Grid Solvers. In Computational Fluid Dynamics’94:Proceedings of the Second European Computational Fluid Dynamics Conference, S. Wagner, E.H. Hirschel, J. Periaux, and R. Piva (Eds.). John Wiley and Sons, 391–396. D. A. Burgess and M. B. Giles. 1997. Renumbering unstructured grids to improve the performance of codes on hierarchical memory machines. Adv. Eng. Softw. 28 (April 1997), 189–201. Issue 3. M. Christen, O. Schenk, and H. Burkhart. 2011. PATUS: A Code Generation and Autotuning Framework for Parallel Iterative Stencil Computations on Modern Microarchitectures. In Parallel Distributed Processing Symposium (IPDPS), 2011 IEEE International. 676–687. DOI:http://dx.doi.org/10.1109/IPDPS.2011.70 A. Cohen, T. Grosser, P. H. J. Kelly, J. Ramanujam, P. Sadayappan, and S. Verdoolaege. 2013. Split Tiling for GPUs: Automatic Parallelization Using Trapezoidal Tiles to Reconcile Parallelism and Locality, avoiding Divergence and Load Imbalance. In GPGPU 6 - Sixth Workshop on General Purpose Processing Using GPUs. Houston, États-Unis. Convey 2013. The Convey HC-1 Computer. (2013). http://www.conveycomputer.com/Resources/ ConveyArchitectureWhiteP.pdf. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:33 K. Czarnecki, U. W. Eisenecker, R. Glück, D. Vandevoorde, and T. L. Veldhuizen. 2000. Generative Programming and Active Libraries. In Selected Papers from the International Seminar on Generic Programming. Springer-Verlag, London, UK, 25–39. Deal.II 2013. Deal.II: A Finite Element Differential Equations Analysis Library. (2013). http://www.dealii. org/. J. D. Denton. 1997. Lessons from rotor 37. Journal of Thermal Science 6, 1 (1997), 1–13. Z. DeVito, N. Joubert, F. Palacios, S. Oakley, M. Medina, M. Barrientos, E. Elsen, F. Ham, A. Aiken, K. Duraisamy, E. Darve, J. Alonso, and P. Hanrahan. 2011. Liszt: a domain specific language for building portable mesh-based PDE solvers. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC ’11). ACM, New York, NY, USA, Article 9, 12 pages. DUNE 2013. DUNE - Distributed and Unified Numerics Environment. (2013). http://www.dune-project.org/. FEATFLOW 2013. FEATFLOW - High Performance Finite Elements. (2013). http://www.featflow.de/en/ index.html. FMDB 2013. Flexible Distributed Mesh DataBase. (2013). http://www.scorec.rpi.edu/FMDB/. M. B. Giles, M. C. Duta, J. D. Muller, and N. A. Pierce. 2003. Algorithm Developments for Discrete Adjoint Methods. AIAA Journal 42, 2 (2003), 198–205. M. B. Giles, G. R. Mudalige, Z. Sharif, G. Markall, and P. H. J. Kelly. 2011. Performance analysis of the OP2 framework on many-core architectures. SIGMETRICS Perform. Eval. Rev. 38, 4 (March 2011), 9–15. M. B. Giles, G. R. Mudalige, Z. Sharif, G. Markall, and P. H. J. Kelly. 2012. Performance Analysis and Optimization of the OP2 Framework on Many-Core Architectures. Comput. J. 55, 2 (2012), 168–180. M. B. Giles, G. R. Mudalige, B. Spencer, C. Bertolli, and I. Reguly. 2013. Designing OP2 for GPU Architectures. J. Parallel and Distrib. Comput. 73 (November 2013), 1451–1460. Issue 11. GROMACS 2013. Hybrid-CPU/GPU execution mode with GROMACS. (2013). http://www.scalalife.eu/ content/hybrid-cpu-gpu-execution-mode-gromacs. R.A. Haring, M. Ohmacht, T.W. Fox, M.K. Gschwind, D.L. Satterfield, K. Sugavanam, P.W. Coteus, P. Heidelberger, M.A. Blumrich, R.W. Wisniewski, A. Gara, G.L.-T. Chiu, P.A. Boyle, N.H. Chist, and Changhoan Kim. 2012. The IBM Blue Gene/Q Compute Chip. Micro, IEEE 32, 2 (2012), 48–60. HECToR 2013. HECToR - Hardware. (2013). http://www.hector.ac.uk/service/hardware/. T. Henretty, R. Veras, F. Franchetti, L Pouchet, J. Ramanujam, and P. Sadayappan. 2013. A stencil compiler for short-vector SIMD architectures. In Proceedings of the 27th international ACM conference on International conference on supercomputing (ICS ’13). 13–24. DOI:http://dx.doi.org/10.1145/2464996.2467268 J. Holewinski, L. Pouchet, and P. Sadayappan. 2012. High-performance code generation for stencil computations on GPU architectures. In Proceedings of the 26th ACM international conference on Supercomputing (ICS ’12). 311–320. DOI:http://dx.doi.org/10.1145/2304576.2304619 L. W. Howes, A. Lokhmotov, A. F. Donaldson, and P. H. J. Kelly. 2009. Deriving Efficient Data Movement from Decoupled Access/Execute Specifications. In Proceedings of the 4th International Conference on High Performance Embedded Architectures and Compilers (HiPEAC ’09). Springer-Verlag, Berlin, Heidelberg, 168–182. S. Husa, I. Hinder, and C. Lechner. 2006. Kranc: a Mathematica package to generate numerical codes for tensorial evolution equations. Computer Physics Communications 174, 12 (2006), 983 – 1004. DOI:http://dx.doi.org/10.1016/j.cpc.2006.02.002 Interlagos Nov 2011. How to make best use of the AMD Interlagos processor. (Nov 2011). www.hector.ac.uk/ cse/reports/interlagos whitepaper.pdf. ISO/IES. 2012. Further Interoperability of Fortran with C. ISO SO/IEC TS 29113:2012. International Organization for Standardization and International Electrotechnical Commission, Geneva, Switzerland. JADE 2013. Oxford Supercomputing Center. (2013). http://www.osc.ox.ac.uk/content/services. J. Jägersküpper and C. Simmendinger. 2011. A Novel Shared-Memory Thread-Pool Implementation for Hybrid Parallel CFD Solvers. In Euro-Par 2011 Parallel Processing, Emmanuel Jeannot, Raymond Namyst, and Jean Roman (Eds.). Lecture Notes in Computer Science, Vol. 6853. Springer Berlin / Heidelberg, 182–193. R. P. LaRowe Jr. and C. S. Ellis. 1991. Page placement policies for {NUMA} multiprocessors. J. Parallel and Distrib. Comput. 11, 2 (1991), 112 – 129. DOI:http://dx.doi.org/10.1016/0743-7315(91)90117-R K20 2012. Tesla Kepler GPU Accelerators. (2012). http://www.nvidia.co.uk/content/tesla/pdf/ Tesla-KSeries-Overview-LR.pdf. B. S. Kirk, J. W. Peterson, R. H. Stogner, and G. F. Carey. 2006. libMesh: A C++ Library for Parallel Adaptive Mesh Refinement/Coarsening Simulations. Engineering with Computers 22, 3–4 (2006), 237–254. http: //dx.doi.org/10.1007/s00366-006-0049-3. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. xx:34 I.Z. Reguly et al. C. Lameter. 2013. An overview of non-uniform memory access. Commun. ACM 56, 9 (Sept. 2013), 59–54. L. Lapworth. Sept, 2008. The Challenges for Aero-Engine CFD. (Sept, 2008). Invited Lecture, ICFD 25th Anniversary Meeting, Oxford, UK. www.icfd.rdg.ac.uk/ICFD25/Talks/LLapworth.pdf. H. Lee, K. J. Brown, A. K. Sujeeth, H. Chafi, K. Olukotun, T. Rompf, and M. Odersky. 2011. Implementing Domain-Specific Languages For Heterogeneous Parallel Computing. IEEE Micro 31 (2011), 42–52. P. Lindberg. 2009. Basic OpenMP Threading Overhead. Technical Report. Intel. http://software.intel.com/ en-us/articles/basic-openmp-threading-overhead. O. Lindtjorn, R. Clapp, O. Pell, H. Fu, M. Flynn, and Haohuan Fu. 2011. Beyond Traditional Microprocessors for Geoscience High-Performance Computing Applications. Micro, IEEE 31, 2 (March - April 2011), 41 –49. M.B. Giles M.C. Duta and M.S. Campobasso. 2002. The harmonic adjoint approach to unsteady turbomachinery design. International Journal for Numerical Methods in Fluids 40 (2002), 323–332. Issue 3-4. R. Membarth, F. Hannig, J. Teich, and H. Kostler. 2012. Towards Domain-Specific Computing for Stencil Codes in HPC. In High Performance Computing, Networking, Storage and Analysis (SCC), 2012 SC Companion:. 1133–1138. DOI:http://dx.doi.org/10.1109/SC.Companion.2012.136 G.R. Mudalige, M.B. Giles, J. Thiyagalingam, I. Reguly, C. Bertolli, P.H.J. Kelly, and A.E. Trefethen. in press 2013. Design and Initial Performance of a High-level Unstructured Mesh Framework on Heterogeneous Parallel Systems. Journal of Parallel Computing (in press 2013). G. R. Mudalige, I. Reguly, M. B. Giles, C. Bertolli, and P. H. J. Kelly. 2012. OP2: An Active Library Framework for Solving Unstructured Mesh-based Applications on Multi-Core and Many-Core Architectures.. In Proceedings of Innovative Parallel Computing (InPar ’12). IEEE, San Jose, CA. US. T. Muranushi. 2012. Paraiso : An Automated Tuning Framework for Explicit Solvers of Partial Differential Equations. Computational Science & Discovery 5, 1 (2012), 015003. NVIDIA GPUs 2013. What is GPU Computing. (2013). http://www.nvidia.com/object/ what-is-gpu-computing.html. K. B. Ølgaard, A. Logg, and G. N. Wells. 2011. Automated code generation for discontinuous Galerkin methods. CoRR abs/1104.0628 (2011). OP2 2011. OP2 for Many-Core Platforms. (2011). http://www.oerc.ox.ac.uk/research/op2. OP2-GIT 2013. OP2 GitHub Repository. (2013). https://github.com/OP2/OP2-Common. OpenACC 2013. OpenACC: Directives For Accelerators. (2013). http://www.openacc-standard.org/. OpenCFD. 2013. OpenFOAM - The Open Source CFD Toolbox - User’s Guide (2.2 ed.). OpenCFD Ltd., United Kingdom. D. A. Orchard, M. Bolingbroke, and A. Mycroft. 2010. Ypnos: Declarative, Parallel Structured Grid Programming. In Proceedings of the 5th ACM SIGPLAN workshop on Declarative aspects of multicore programming (DAMP ’10). ACM, New York, NY, USA, 15–24. J.-D. Muller P. Moinier and M.B. Giles. 2002. Edge-based multigrid and preconditioning for hybrid grids. AIAA Journal 40 (2002), 1954–1960. Issue 10. ParMETIS 2013. ParMETIS. (2013). http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview. PETSc 2013. PETSc. (2013). http://www.mcs.anl.gov/petsc/petsc-as/. PT-Scotch 2013. Scotch and PT-Scotch. (2013). http://www.labri.fr/perso/pelegrin/scotch/. N. Rajovic, N. Puzovic, L. Vilanova, C. Villavieja, and A. Ramirez. 2011. The low-power architecture approach towards exascale computing. In Proceedings of the second workshop on Scalable algorithms for large-scale systems (ScalA ’11). ACM, New York, NY, USA, 1–2. DOI:http://dx.doi.org/10.1145/2133173.2133175 F. Rathgeber, G. R. Markall, L. Mitchell, M. Loriant, D. A. Ham, C. Bertolli, and P. H. J. Kelly. 2012. PyOP2: A High-Level Framework for Performance-Portable Simulations on Unstructured Meshes. In High Performance Computing, Networking, Storage and Analysis, 2012 SC Companion (SCC). 1116–1123. SandyBridge 2013. Intel Xeon Processor E5-2640. (2013). http://ark.intel.com/products/64591/ Intel-Xeon-Processor-E5-2640-15M-Cache-2 50-GHz-7 20-GTs-Intel-QPI. H. D. Simon. 1991. Partitioning of Unstructured Problems for Parallel Processing. Technical Report RNR-91008. National Aeronautics and Space Administration, Ames Research Center Moffett Field, California 94035-1000. www.nas.nasa.gov/assets/pdf/techreports/1991/rnr-91-008.pdf K. Skaugen. June 2011. Petascale to Exascale: Extending Intel’s HPC Commitment. (June 2011). ISC 2010 keynote. http://download.intel.com/pressroom/archive/reference/ISC 2010 Skaugen keynote.pdf. J. R. Stewart and H. C. Edwards. 2004. A framework approach for developing parallel adaptive multiphysics applications. Finite Elem. Anal. Des. 40 (July 2004), 1599–1617. Issue 12. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013. Acceleration of a Full-scale Industrial CFD Application with OP2 xx:35 Y. Tang, R. A. Chowdhury, B. C. Kuszmaul, C. Luk, and C. E. Leiserson. 2011. The pochoir stencil compiler. In Proceedings of the 23rd ACM symposium on Parallelism in algorithms and architectures (SPAA ’11). 117–128. DOI:http://dx.doi.org/10.1145/1989493.1989508 TI 2013. Texas Instruments Multi-core TMS320C66x Processor. (2013). http://www.ti.com/c66multicore. D. Unat, X. Cai, and S. B. Baden. 2011. Mint: realizing CUDA performance in 3D stencil methods with annotated C. In Proceedings of the international conference on Supercomputing (ICS ’11). 214–224. DOI:http://dx.doi.org/10.1145/1995896.1995932 T. L. Veldhuizen and D. Gannon. 1998. Active Libraries: Rethinking the roles of compilers and libraries. In In Proceedings of the SIAM Workshop on Object Oriented Methods for Inter-operable Scientific and Engineering Computing (OO98). SIAM Press. VTune 2013. Intel VTune Product Page. (2013). http://software.intel.com/en-us/intel-vtune-amplifier-xe. C. Yang, W. Xue, H. Fu, L. Gan, L. Li, Y. Xu, Y. Lu, J. Sun, G. Yang, and W. Zheng. 2013. A peta-scalable CPU-GPU algorithm for global atmospheric simulations. In Proceedings of the 18th ACM SIGPLAN symposium on Principles and practice of parallel programming (PPoPP ’13). ACM, New York, NY, USA, 1–12. DOI:http://dx.doi.org/10.1145/2442516.2442518 M. Zhou, O. Sahni, T. Xie, M. S. Shephard, and K. E. Jansen. 2012. Unstructured Mesh Partition Improvement for Implicit Finite Element at Extreme Scale. J. Supercomput. 59, 3 (March 2012), 1218–1228. ACM Transactions on ACM Transactions on Parallel Computing, Vol. xx, No. xx, Article xx, Publication date: October 2013.
5cs.CE
A Numerical Optimization Algorithm Inspired by the Strawberry Plant1 F. Merrikh-Bayat Department of electrical and computer engineering, University of Zanjan, Zanjan, Iran. Tel.: +98 24 3305 4061, E-mail address: [email protected] Abstract: This paper proposes a new numerical optimization algorithm inspired by the strawberry plant for solving complicated engineering problems. Plants like strawberry develop both runners and roots for propagation and search for water resources and minerals. In these plants, runners and roots can be thought of as tools for global and local searches, respectively. The proposed algorithm has three main differences with the trivial nature-inspired optimization algorithms: duplication-elimination of the computational agents at all iterations, subjecting all agents to both small and large movements from the beginning to end, and the lack of communication (information exchange) between agents. Moreover, it has the advantage of using only three parameters to be tuned by user. This algorithm is applied to standard test functions and the results are compared with GA and PSO. The proposed algorithm is also used to solve an open problem in the field of robust control theory. These simulations show that the proposed algorithm can very effectively solve complicated optimization problems. Keywords: meta-heuristic optimization, nature inspired, numerical, strawberry, robust control. 1 Please be advised that this is the draft of a paper submitted to a journal for possible publication. The final version may have differences with this one according to the changes made during the review process. 1. Introduction During the past four decades nature had been the source of inspiration for developing new optimization algorithms for solving complicated engineering problems. The first attempts to find a cybernetic solution to a practical problem can be found in the works of Rechenberg [1]. However, the first general-purpose and well-explained algorithm of this type is probably the genetic algorithm (GA) developed by Holland [2]. At this time, various nature-inspired optimization algorithms are available, among them the GA, Particle Swarm Optimization (PSO) [3,4], Ant Colony Optimization (ACO) [5,6], Artificial Bee Colony (ABC) algorithm [7,8], Simulated Annealing (SA) [9,10], Firefly Algorithm (FA) [11], Bacterial Foraging Optimization (BFO) [12], Artificial Immune System (AIS) [13,14], shuffled frog-leaping algorithm [15], Differential Evolution (DE) [16,17], and Imperialist Competitive Algorithm (ICA) [18], have attracted more attentions. It is a well-known fact that meta-heuristic optimization algorithms are capable of solving many complicated engineering problems whose solutions cannot effectively be obtained by using classical (often, gradient-based) optimization algorithms. Numerous successful applications of these algorithms can be found in the literature (see for example [19][21]). Although the source of inspiration is different in nature-inspired optimization algorithms, they still have many similarities. The main relationships between various nature-inspired optimization algorithms are: application of random variables, ability of dealing with uncertain and nondifferentiable cost functions, simultaneous application of more than one computational agent for searching the domain of problem (except SA which applies only one agent), existing a kind of communication scheme between computational agents (e.g., the crossover operator in GA, the social term in PSO, pheromone trail in ACO, dancing of artificial bees in ABC, the light emission in FA, etc.), application of the objective function itself rather than its derivative for performing the search, and elimination of weak solutions at every iteration. In brief, it can be said that all of these algorithms perform a kid of memory stochastic search, which aims to optimize a certain objective function. More precisely, all algorithms of this type model the behavior of a (colony of) certain living thing or a certain physical phenomena by performing a kind of optimization. The procedure of modeling is always iterative and makes use of random variables, but the method is not wholly stochastic and has a kind of memory to remember the good solutions of previous iterations and provide the fittest agents of the colony with a more chance to survive and reproduce. Clearly, every meta-heuristic optimization algorithm has its own advantages and disadvantages, and actually, it is pointless to look for the best algorithm [22]. For example, any algorithm of this type has some tuning parameters, which are often adjusted by trial and error. As a general rule, smaller the number of tuning parameters, more advantageous the algorithm is. Using this tradition, the Intelligent Water Drops (IWD) algorithm [23] is not so favorite since it applies too many parameters to be tuned without providing a rigorous method for this purpose. PSO is fast but sometimes (in the standard version) accuracy of solutions is not improved by increasing the number of iterations, and moreover, when it is trapped in a local optimum it has a small chance to escape and continue the search. High sensitivity to the initial guess and low probability of finding the global best solution are the main drawbacks of SA. GA is often slow and the solutions have a limited accuracy (according to the coding issue) but, compared to PSO, it has the advantage that never leads to a solution outside the region defined by the boundary values of variables. A similar discussion goes on other optimization algorithms. In general, algorithms with smaller number of parameters (to be adjusted by user by trial and error), faster convergence and higher probability of skipping from local optimums are identified as more effective algorithms (the accuracy can be improved by performing a complementary search after the original algorithm stops). It is also important to note that the effectiveness of a certain algorithm strictly depends on the problem it is going to solve. In other words, it may happen that a certain algorithm be very successful in dealing with a problem while it is rather unsuccessful in dealing with another one. For this reason researchers apply different algorithms to a certain problem to find the best method suited to solve it. The aim of this paper is to propose a numerical optimization algorithm inspired by the strawberry plant for solving continuous multi-variable problems. One main difference between the proposed algorithm and other nature-inspired optimization algorithms is that in this algorithm the number of computational agents is not (uniformly) constant from the beginning to end. In fact, at every iteration the number of computational agents is duplicated in an appropriate manner and then half of the weakest agents are subjected to death. The other difference between the proposed algorithm and others is that in our algorithm any computational agent is subjected to both small and large movements repeatedly from the beginning to end, which makes it possible to perform both the local and global searches simultaneously. Moreover, unlike other meta-heuristic algorithms, in the proposed algorithm the computational agents do not communicate with each other, and the above mentioned duplication-elimination procedure combined with a kind of stochastic sift motivates the agents toward the global best solution. The rest of this paper is organized as the following. In Section 2 we briefly review the method of propagation of the strawberry plant, as well as many others, in nature. Based on these results we present the proposed strawberry algorithm (SBA) in Section 3. Numerical simulations are presented in Section 4, and a practical problem is solved using this method in Section 5. Finally, Section 6 concludes the paper. 2. Strawberry Plant in Nature Animals can tolerate environmental changes much better than plants since they have muscle and brain and can decide to move to places with better conditions whenever it is needed. Probably, the most famous examples of this type are the birds which immigrate to warmer places when the weather gets cold. But, the plants are connected to the earth through their roots and cannot move to places with desired conditions anyway. However, some grasses and plants (such as strawberry) can be propagated through the so-called runner (or stolon) as shown in Fig. 12 (vegetative propagation). The runner is a creeping stalk produced in the leaf axils and grows out from the mother (parent) plant. At the second node of runner a new plant, called daughter plant, is formed and then again a new runner arises on the daughter plant to generate another new daughter (see Fig. 1(a)). Initially, runner plants produce fewer roots but thereafter put forth excessive fibrous roots and when acquired sufficient growth and roots, the daughter plants can be separated from the mother plant and continue their life individually as the new mother plants. Reproduction of strawberry (as well as other similar plants as shown in Fig. 1) can be though of as a kind of plant movement since both the mother and daughter plant have exactly the same genes and they are actually a same plant. However, the mother plant commonly dies sooner than the daughter plant provided that the daughter does not arrive at a location with a very bad condition by chance. 2 The authors of Figs. 1(a)-(c) are Jessica Reeder, Arne Hückelheim, and Macleay Grass Man, respectively. Permitted use. (a) (b) (c) (d) Fig. 1 (a) Strawberry plant, (b) Desmoschoenus spiralis, (c) Chloris gayana, (d) spider plant. Fig. 1(c) shows the function of runners and roots for global and local search, respectively. From the mathematical point of view, the plants with runners (such as strawberry) perform a kind of optimization. More precisely, such plants simultaneously perform both the global and local search to find resources like water and minerals by developing runners and roots (as well as root hairs), respectively. Both the runners and roots are developed almost randomly, but when a runner or a root (hair) arrives at a place with more water resources, the corresponding daughter plant generates more roots and runners, which affects the growth of the whole plant as well. Obviously, in order to arrive at a numerical optimization algorithm inspired by the strawberry plant we need to model the behavior of this plant by simple and still explicit rules. In this paper it is assumed that the behavior of strawberry plant can effectively be modeled through the following three facts: • Each strawberry mother plant is propagated through the runners which rise randomly (global search for resources). • Each strawberry mother plant develops roots and root hairs randomly (local search for resources). • Strawberry daughter plants which have access to richer resources grow faster and generate more runners and roots, and on the other hand, the runners and roots which move toward poor resources are more probable to die. According to the above discussion, in the proposed SBA first we randomly generate certain number of points (computational agents) in the domain of problem, each of them can be though of as a mother plant (it will be shown later that the objective function does not need to be evaluated at the locations of mother plants). Then, at each iteration any mother plant generates one root and one runner (daughter plant); the first one in its vicinity and the other one in a relatively farther location. In fact, in SBA it is assumed that the computational agents consist of runners and roots which move with large and small random steps in the domain of problem, respectively. Next, the objective function is evaluated at the points referred to by runners and roots, and half of these points (which probably have higher fitness values) are selected by, e.g., the roulette wheel or elite selection and considered as the mother plants of next iteration and the remaining half are subjected to death. This procedure is repeated until a predetermined termination condition is satisfied. Figure 2 shows the flowchart of SBA as described above. Fig. 2 Flowchart of the strawberry algorithm. 3. Mathematical Explanation of the Strawberry Algorithm In this section we discuss on finding the solution of the following unconstrained optimization problem x l ≤ x ≤ xu , min f (x), where f : m → (1) is the m –variable objective (cost) function to be minimized, x ∈ solution vector to be calculated, and xl , xu ∈ m m is the are two vectors indicating the lower and upper bounds of the variables. According to the previous discussion, in order to solve the above problem first we randomly generate N points in the domain of problem, each called a mother plant. Then, at each iteration each mother plant generates two random points: one very close to itself and another one faraway from it. The close and far points model the roots and runners (daughter plants) in nature, respectively. The roots are used to search around the locations of mother plants and the runners are used to search the locations considerably farther from them. Hence, the runners play the very important role of jumping over the local minimums, which effectively helps the algorithm to avoid trapping in these points (the function of runners in SBA is somehow similar to the tunneling property of particles in Quantum Annealing (QA) [24]). In SBA, assuming that x j (i ) ∈ m stands for the location of the j-th mother plant ( j = 1,…, N ) at the i-th iteration, the matrix containing the locations of the corresponding runners and roots at this iteration, X prop (i ) , is calculated as follows: X prop (i ) = [ X root (i ) X runner (i ) ] = [ X(i ) X(i ) ] + [ d root r1 d runner r2 ] , (2) where X(i ) = [x1 (i ) x 2 (i ) … x N (i )] , X prop (i ) = [ x1, prop (i ) x 2, prop (i ) … x 2 N , prop (i )] , X root (i ) ∈ m× N and X runner (i ) ∈ m× N are matrices containing the locations of roots and runners as the following X root (i ) = [ x1,root (i ) x 2,root (i ) … x N , root (i )] , (3) X runner (i ) = [ x1,runner (i ) x 2,runner (i ) … x N ,runner (i )] , (4) r1 , r2 ∈ m× N are random matrices whose entries are independent random numbers with uniform distribution (or any other distribution) in the range [−0.5,0.5] (of course, the range is arbitrary), d root and d runner are two scalars representing the distance of roots and runners from the mother plant, respectively (often we have d runner d root ), and N is the number of mother plants. Note that according to (2) two points are generated for every mother plant: one very close to it (i.e., the root) and another one considerably faraway from it (i.e., the runner). Hence, application of (2) duplicates the number of computational agents, that is, X prop (i ) has 2N columns (potential solutions to the problem) while X(i) had only N columns. After calculation of X prop (i ) , we use some sort of selection scheme (such as roulette wheel) to select N columns (among the 2N columns) of X prop (i ) based on their performance such that better vectors have a higher chance to be selected (the selected vectors will be considered as the mother plants of the next iteration). In practice it is observed that a combination of elite and random selection leads to the best results. More precisely, in the proposed SBA half of the required N mother plants are selected by elite-selection (which are exactly equal to the best vectors of X prop (i ) ) and the other half are selected by roulette wheel among the columns of X prop (i ) . Before applying roulette wheel, first the fitness of the j th column of X prop (i ) , denoted as fit (x j , prop (i )) , is calculated through the following equation (which is similar to ABC): 1 ⎧ ⎪ a + f (x j , prop (i )) fit (x j , prop (i )) = ⎨ ⎪a + f (x j , prop (i )) ⎩ f (x j , prop (i )) > 0 , j = 1,… , N , (5) f (x j , prop (i )) ≤ 0 where f (.) is the cost function to be minimized and a ≥ 0 is a parameter considered equal to zero in the simulations of this paper (this parameter can be used to adjust the selectivity property of the roulette wheel). After calculation of the fitness values, the probability of choosing the j th column, p j , is calculated as follows pj = fit (x j , prop (i )) N ∑ fit (x k =1 k , prop . (6) (i )) The selected vectors will be considered as the mother plants of the next iteration. Note that many other methods can also be used instead of (5) for calculating the fitness of solution vectors (see [25] for a comprehensive survey of fitness approximation in evolutionary computation). For example, in the so-called ranking method (often used in GA) first we sort the solution vectors in descendent order such that the worst and best vectors stand at positions 1 and N, respectively. Then, the fitness of the solution standing at position pos , fit ( pos) , is calculated as follows fit ( pos ) = 2 − SP + 2( SP − 1) × pos − 1 , N −1 (7) where SP ∈ [1, 2] is an arbitrarily chosen constant ( SP = 2 leads to the most possible difference between the fitness of solutions, while SP = 1 makes no difference between the worst and best solutions). Figure 3 shows the above mentioned procedure for N = 3 in a typical simulation. In this picture the black, red, and blue arrows and points refer to the first, second, and third iterations, respectively. First consider the black points and arrows (the first iteration). The points denoted as x1 (0) , x2 (0) and x3 (0) are the initial data points generated randomly in the domain of problem. As it is observed, two arrows are connected to each initial random point: one with the root index in the vicinity of the corresponding point and the other with runner index in a farther location from it. These arrows show that any initial random point generates two points, which are located at the end of the corresponding arrows with root and runner indices (here, totally 6 new points are generated). The elite-selection and roulette-wheel select 3 out of these 6 points based on pure talent and chance, respectively (the arrows which refer to the points not selected are shown by dashed line and the corresponding points are omitted). The selected points, which are shown by red circles, are the points that will be used in the next iteration for further search. As it can be observed in this figure, the runners of x1 (0) and x2 (0) , and the root of x3 (0) are selected as the initial points to be used in Iteration 1. These points are denoted as x1 (1) , x2 (1) and x3 (1) . Again, in Iteration 1 two arrows and points are generated for each of the selected points of previous iteration, and 3 out of them are selected by using the selection scheme. The selected points are shown by blue circles. This procedure is repeated again until a predetermined termination condition is satisfied. Note that the indices of points in Fig. 3 may be subjected to changes during iterations. For example, it is observed that in the second iteration neither the root nor the runner of x1 (1) is selected by roulette wheel or elite selection, and consequently, x1,root (2) is not generated from x1 (1) . In fact, at each iteration of SBA the algorithm may decide to continue the search either around the roots, or runners, or a combination of the roots and runners of the previous iteration. Small and large circles in Fig. 3 represent the radius of local and global searches, respectively. The pseudocode of SBA is presented in Table 1. Note that when the scale of variables is very different, position of mother plants can be calculated as the following X prop (i ) = [ X root (i ) X runner (i ) ] = [ X(i ) X(i )] + [d root r1 d runner r2 ] , (8) where d root , d runner ∈ m at each dimension, is the Hadamard (element by element) matrix product operator, and other are the deterministic vectors representing the length of runners and roots parameters are defined as before. Fig. 3 Schematic explanation of the strawberry algorithm. The algorithm develops both runners (long arrows) and roots (small arrows) at every iteration for global and local search, respectively. Table 1. The pseudocode of SBA. Initialize d root , d runner , and N . Set i:=0 Randomly initialize N vectors (mother plants) in the domain of problem. Consider each of these random vectors as a column of X(0) . WHILE (the termination conditions are not met) For each vector (mother plant) calculate a runner (daughter plant) and a Duplication: root from (2) and consider each of the resulted vectors as a column of X prop (i ) . Elimination: Calculate the fitness of runners and roots (i.e., the fitness of columns of X prop (i ) ) from (5), and then use elite selection and roulette wheel to select N vectors (mother plants of the next iteration) among these 2N runners and roots. The selected vectors are considered as the columns of X(i + 1) . Set i:=i+1 END WHILE Here, it should be emphasized that unlike most of the other algorithms, in SBA the agents do not share any information about their solutions and the duplication-elimination procedure guarantees the movement of particles toward the optimum point. Of course, the lack of communication between agents reduces the computational cost of algorithm; however, 2N function evaluations are needed at each iteration. Another advantage of the proposed algorithm is that it has only three parameters to tune: d root , d runner , and N , which can often be selected by an easy trial and error. As a rule of thumb, d root should be selected sufficiently large such that the runners can jump over the hills. In fact, some algorithms (such as the standard PSO, ACO, ABC, and FA) have the property that all computational agents eventually converge to a single point (local or global optima), and after that the algorithm has a very small chance to escape from the local optima and find a better solution. On the other hand in of some the algorithms (such as GA and electromagnetism-like algorithm (EM)) the agents never converge to a single point, and consequently, continuing the iterations is always helpful for finding possible better solutions. SBA belongs to the second category. 3.1 Possible Modifications to the Proposed SBA In this section we propose some possible modifications to the SBA presented in previous section, which may be used to generate, possibly more powerful, new explanations of this algorithm. These proposed modifications are not examined by the author and can be considered as the subjects of future studies. The first point is that it is not necessary to keep the values of d root and d runner constant during the simulation; that is, the radius of local and global searches can be subjected to changes. As a general fact, most of the algorithms begin their job with a kind of global search and then, by increasing the number of iterations, they are intended to do more and more local searches. For example, in PSO the speed of particles is monotonically decreased by increasing the number of iterations (the particles with high and low speeds are suitable for global and local searches, respectively). Similarly, in GA (as it is implemented in the optimization toolbox of Matlab), amplitude of the changes caused by mutation is decreased by increasing the number of iterations. The proposed SBA performs both the local and global searches simultaneously from the beginning to end with two constant radiuses. This kind of search is the advantage of SBA, however, more effective algorithms may be obtained by varying the radius of these two searches in an appropriate manner. For example, in nature it is observed that a mother plant located in a very good place generates more runners and roots compared to another one that is not located in such a good place (in nature each strawberry mother plant may generate up to 30-40 runners). It is also observed that a plant which is located in a good place is more probable to generate longer runners than usual. These observations motivate us to modify SBA such that the mother plants with larger fitness values generate more runners and roots, or equivalently, the length of runners and roots can be increased after certain number of successive iterations in which no improvement is occurred. Another possible modification to SBA is that we can perform the duplication-elimination procedure with a multiple rather than two (regardless of the fitness value of agents). It means that each mother plant can generate n runners and n roots (instead of one), and then the algorithm selects N mother plants among them. 4. Application of SBA to Classical Test Functions In the following, we apply SBA to find the minimum of two classical test functions of different dimensions, and briefly compare the results with those obtained by using PSO and GA. It should be emphasized that the aim of these comparisons is not to conclude that SBA works better than other algorithms, and these are used just to convince the reader about the applicability of SBA to real world problems. Detailed comparison of different algorithms is a tricky task which is not discussed in this paper and can be found in the literature (see, for example [26]). The Matlab codes of the following simulations, as well as many others, can be downloaded from https://drive.google.com/file/d/0Bwl6hPor5o61OElmMWhtbEJadkU/edit?usp=sharing . Example 1. The n-dimensional Rastrigin function is defined through the following equation n f (x) = 10n + ∑ ⎡⎣ xi2 − 10 cos (2π xi ) ⎤⎦ , (9) i =1 where xi ∈ [−5.12,5.12] ( i = 1, 2,… , n ). This function has a global minimum at x = 0 for which we have f (0) = 0 . The main reason for the difficulty of finding the global minimum of this function is that it is surrounded by many local minimums where each local minimum has a very small difference (from the objective function value point of view) with the other one in its vicinity. Figure 4 shows the locations of the mother plants generated by SBA during 100 iterations in a typical simulation of the two dimensional Rastrigin function assuming d root = 0.2 , d runner = 2.5 , and N = 5 (note that many points are plotted in almost the same point in this figure). In this simulation the best solution is obtained as ( x1∗ , x2∗ ) = (−9 × 10−4 , −4.4 × 10−3 ) which is fairly close to the global best solution. Figure 5 shows the minimum, maximum and mean values obtained for the two dimensional Rastrigin function using SBA versus iteration number (the results are averaged over 100 runs assuming d root = 0.2 , d runner = 2.5 , and N = 5 ). This figure clearly shows the very fast convergence of SBA. Fig. 4 Locations of mother plants in a simulation of two dimensional Rastrigin function. Fig. 5 Mean, minimum, and maximum of two dimensional Rastrigin function when SBA is applied (the results are averaged over 100 runs assuming d root = 0.2 , d runner = 2.5 , and N = 5 ). Figure 6 compares SBA with the standard GA and PSO when they are applied to the four dimensional Rastregin function (the results are averaged over 100 runs assuming d root = 0.2 , d runner = 2.5 , and N = 5 ). Note that since the number of function evaluations in SBA is two times the number of mother plants, the number of individuals and particles in GA and PSO (in the simulation of Fig. 6) is considered equal to 10 to make sure that all of these algorithms apply the same number of function evaluations. Note also that we have applied SBA, GA and PSO assuming certain values for the parameters used in these algorithms and better results may be obtained by changing these values (however, we did our best to obtain the best results in each case). More precisely, in dealing with GA, 60%, 30%, and 10% of individuals are generated by crossover, reproduction, and mutation operators, respectively, and each variable is coded with a 10 bit binary string. In addition, in all cases the fitness of computational agents is calculated through (5) assuming a = 0 . Finally, it should be noted that since the initial random population in GA is generated directly by using binary strings, in the following simulations the curves corresponding to GA begin from different initial points compared to SBA and PSO. However, as it is expected, the rate of decreasing the value of objective function is smaller when GA is applied. Fig. 6 Results of applying GA, PSO, and SBA to the four dimensional Rastrigin function. Figure 7 shows the simulation results for the 20 dimensional Rastrigin function when GA, PSO, and SBA are applied (the results are averaged over 100 runs). In this figure, the number of individuals, particles, and mother plants in GA, PSO, and SBA is considered equal to 100, 100, and 50, respectively ( d root = 0.2 and d runner = 2.5 is applied in SBA). The high performance of SBA can be explained through the effect of runners, which help to algorithm to jump over the hills. Fig. 7 Results of applying GA, PSO, and SBA to the 20 dimensional Rastrigin function. Example 2. The n variable Griewank function is defined as the following f ( x) = 1 n 2 n ⎛ x ⎞ xi − ∏ cos ⎜ i ⎟ , ∑ 4000 k =1 ⎝ k⎠ k =1 (10) where xi ∈ [−600, 600] ( i = 1, 2,… , n ). This function has a global minimum at x = 0 for which we have f (0) = 0 . As a well-known fact, the number of local minimums of this function is exponentially increased by increasing the value of n (see [27] for more information about the number of local minimums of this function). According to the huge number of local minimums, which are very similar and close to each other, finding the global minimum of this function is a challenging task even for n = 2 . Figure 8 shows the locations of mother plants in a typical simulation when SBA with d root = 10 , d runner = 400 , and N = 5 is applied to the two dimensional Griewank problem (the simulation stops after 1000 iterations). Any blue point in this figure indicates the position of a mother plant in some iteration. As it can be observed in this figure, the overall trend of mother plants is toward the global minimum at origin. Note that each circle in Fig. 8 itself consists of a huge number of local minimums and the region between any two circles is also full of almost identical local minimums (that is why this region looks white in this plot). Figure 9 shows Fig. 8 when focused around the origin. This figure clearly shows the tremendous number of local minimums around the global minimum at the origin and also the concentration of mother plants around this point. Here it is worth to emphasize that at the beginning of SBA the mother plants pass through the local minimums mainly by means of their runners and when they became closer to the origin they do this task mainly through their roots. Fig. 8 Positions of mother plants in the simulation of two dimensional Griewank function. The mother plants jump over the local minimums faraway from the origin through their runners. Fig. 9 Figure 8 focused around the origin. The mother plants jump over the local minimums around the origin through their roots. Figure 10 shows the mean, maximum and minimum value of the two dimensional Griewank function versus iteration number when SBA with d root = 10 , d runner = 400 , and N = 5 is applied (the results are averaged over 100 runs). Figure 11 shows the average value of this function versus the iteration number when GA, PSO, and SBA are applied (GA and PSO are applied using 10 computational agents and again the results are averaged over 100 runs). Fig. 10 Mean, minimum, and maximum of the two dimensional Griewank function when SBA is applied (the results are averaged over 100 runs assuming d root = 10 , d runner = 400 , and N = 5 ). Fig. 11 Results of applying GA, PSO, and SBA to the two dimensional Griewank function (the results are averaged over 100 runs). Figure 12 shows the results of applying GA, PSO, and SBA to the 20 dimensional Griewank function. The results are averaged over 100 iterations and the parameters used in algorithms are considered similar to the previous simulation. This figure clearly shows the high performance of SBA in dealing with this high dimensional problem. Fig. 12 Results of applying GA, PSO, and SBA to the 20 dimensional Griewank function (the results are averaged over 100 runs). 5. Application of SBA for Solving an Open Problem in the Field of Robust Control Theory In this example we introduce an unsolved problem in the field of robust control theory and provide a numerical solution for it using SBA. Consider the single-input single-output (SISO) feedback system shown in Fig. 13 where the uncertainty of process is modeled with the full multiplicative input uncertainty ( Δ I ∞ ≤ 1 ) [28]. In this figure assuming that the process nominal transfer function, G ( s ) , and uncertainty weight, wI ( s ) , are stable and known, the controller which simultaneously satisfies nominal performance (NP), robust stability (RS), and robust performance (RP) is obtained by solving the following H ∞ -norm inequality [28]: | wP S | + | wI T | ∞ < 1, (11) where S = (1 + KG ) −1 , T = KG (1 + KG )−1 , K is the unknown controller, and wP is the stable weight function used to determine the desired performance (i.e., it is assumed that the nominal feedback system with Δ I = 0 has a desired performance if and only if we have | S |<| wP |−1 ). Fig. 13 A feedback system with multiplicative uncertainty at the process input. Note that the only unknown parameter in (11) is the transfer function of controller, K . As a classical result [28], the controller which satisfies (11) also guarantees NP, RS, and RP, but the nominal stability (NS) is not guaranteed in this case, i.e., the controller obtained by solving (11) may result in an unstable feedback system. Hence, any solution for (11) must also be checked from the NS point of view. In the following, we will consider the NS condition as a constraint for a minimization problem. At this time there is no method available to find a K which simultaneously satisfies (11) and guarantees the stability of nominal feedback system [28]. Instead, algorithms like hinfsyn in Matlab, find K such that the following closely related mixed sensitivity H ∞ condition is satisfied wp S wI T = max | wp S |2 + | wI T |2 < 1 . ∞ (12) ω Although the above condition is within a factor of at most 2 to condition (11), they are not representing exactly the same conditions [28]. Note that similar to (11), the NS is not included in (12). The very important point in relation to (12) (as well as (11)) is that it may or may not have a solution. However, when it has, often it is not unique (infinity many solutions exist in general). For that reason, this problem is often formulated as a minimization problem in which γ | wP S | + | wI T | ∞ wp S (or γ wI T ) is minimized by suitable choice of the (stabilizing) K . ∞ According to the above discussion it is obvious that the robust control problem under consideration really has a solution if for some stabilizing K we have γ = | wP S | + | wI T | ∞ < 1. The aim of this example is to calculate K directly from (12). For this purpose we find K by solving the following constrained minimization problem: min γ = | wP S | + | wI T | K ∞ s.t. 1 + KG ≠ 0, Re{s} ≥ 0 , (13) where the constraint 1 + KG ≠ 0 , Re{s} ≥ 0 represents the stability of the nominal closed-loop system. A classical approach for solving constrained optimization problems is to express the problem as an equivalent one without constraint (a survey of techniques used for handing the constraints can be found in [29]). As the simplest method, the solution of (13) can be obtained by solving the following unconstrained optimization problem min F (x) | wP S | + | wI T | ∞ + λ 〈 g (x)〉 , (14) where x is a vector containing the unknown parameters of controller, λ > 0 is the penalty factor, g (x) is equal to the real part of the rightmost pole of the nominal closed-loop system (i.e., the system of Fig. 13 when Δ I = 0 ), and 〈.〉 is the bracket function defined as the following 〈 g (x)〉 ⎧ g ( x) ⎨ ⎩0 g ( x) ≥ 0 g ( x) < 0 . (15) Note that according to (14) and (15), when the candidate solution x does not violate the stability condition, the real part of the rightmost pole of the nominal closed-loop system is negative, and consequently, the cost function is simply equal to F (x) = | wP S | + | wI T | ∞ . But, when the stability condition is violated, the second term in the right hand side of (14) puts an extra force on the algorithm to obtain solutions that lead to stable feedback systems. Clearly, larger the value of λ , higher the force on algorithm to find the solutions that stabilize the feedback system. In the following we apply the above procedure to find a controller for a process with nominal transfer function G ( s ) = 1000 / (0.1s 2 + s) assuming wI = 0.2 and wP = (0.2s + 1) / ( s + 0.001) . In this example G ( s ) is the approximate model of a DC motor and wI = 0.2 represents the fact that this model has 20% uncertainty at each frequency. Considering the fact that the order of K is at least equal to the order of process plus the weights wI and wP [29], the transfer function of controller is considered as the following K ( s) = b2 s 2 + b1s + b0 , s 3 + a2 s 2 + a1s + a0 where ai , bi ∈ ( i = 0,1, 2 ) are unknown parameters of the controller to be determined by solving (14) (note that here we have x = [a0 a1 a2 b0 b1 b2 ] ). Assuming λ = 105 , N = 50 , (16) d runner = 1010 , d root = 108 , a = 0 , and xu = − xl = 1010 , and after few runs the solution of (14) using SBA is obtained as K ( s) = 9.8371×108 s 2 + 5.5818 ×109 s + 1.9011×108 , s 3 + 2.2109 × 104 s 2 + 5.0171× 1010 s − 8.6854 × 108 for which we have γ = | wP S | + | wI T | ∞ (17) = 0.2799 and g (x∗ ) = −0.0343 (since the solutions that lead to unstable feedback systems are quite useless in practice, the value of λ is considered very large to make sure that such solutions are abandoned rapidly by SBA). Figure 14 shows | wP S | + | wI T | versus frequency (in log scale) for the controller given in (17). As it is observed, the plot is under 0dB at all frequencies which guarantees NP, RS, and RP (the NS is achieved by the negative value obtained for g (x∗ ) ). Figure 15 shows the objective function value (as defined in (14)) versus the iteration number in this example (the results are averaged over 20 runs). It is concluded from this figure that the maximum value of objective function becomes smaller than unity in less than 50 iterations, which means that the algorithm is able of finding a solution for this problem in about 50 iterations. Figure 16 shows the unit step response of the closed-loop system under consideration for 30 different random Δ ’s. As it is observed, the closed-loop system with the controller given in (17) exhibits a very good robust performance. Fig. 14 Plot of | wP S | + | wI T | versus frequency. Fig. 15 Value of the cost function given in (14) versus iteration number. Fig. 16 Unit step response of the feedback system for 30 different random uncertainties. Conclusion A numerical optimization algorithm inspired by the strawberry plant is presented in this paper. The proposed algorithm has the property that simultaneously applies local and global searches to find the global best solution. This algorithm is applied to two test functions and the results show that it is capable of finding the optimum point of non-convex cost functions with a high efficiency. Moreover, the proposed algorithm is successfully used to solve an open problem in the field of robust control theory. Acknowledgment The author is indebted to F. Hojjati-Parast for pointing out the role of roots in plants as tools for local search for water resources and minerals. References [1] I. Rechenberg, Cybernetic solution path of an experimental problem, In Royal Aircraft Establishment Translation No. 1122, B. F. Toms, Trans., August 1965. [2] J.H. Holland, Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence, University of Michigan Press, Oxford, England, 1975. [3] R.C. Eberhart, Y. Shi, Particle swarm optimization: developments, applications and resources, in Proceedings of the 2001 Congress on Evolutionary Computation, 27-30 May 2001, Seoul, vol. 1, pp. 81- 86. [4] R.C. Eberhart, J. Kennedy, A new optimizer using particle swarm theory, in Proceedings of the Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, 1995, pp. 39-43. [5] M. Dorigo, M. Birattari, Ant colony optimization, in: C. Sammut, I.G. Webb (Eds.), Encyclopedia of Machine Learning, Springer, 2010, pp. 36-39. [6] M. Dorigo, M. Birattari, T. Stutzle, Ant colony optimization, IEEE Computational Intelligence Magazine 1(4) (2006) 28-39. [7] D. Karaboga, B. Basturk, On the performance of artificial bee colony (ABC) algorithm, Applied Soft Computing 8(1) (2008) 687-697. [8] D. Karaboga, B. Basturk, A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm, Journal of Global Optimization 39(3) (2007) 459-471. [9] V. Cerny, A thermodynamical approach to the travelling salesman problem: An efficient simulation algorithm, Journal of Optimization Theory and Applications 45 (1985) 41-51. [10] S. Kirkpatrick, C.D. Gellat, M.P. Vecchi, Optimization by simulated annealing, Science, New Series 220(4598) (1983) 671-680. [11] X.-S. Yang, Firefly algorithm: stochastic test functions and design optimisation, International Journal of Bio-Inspired Computation 2(2) (2010) 78-84. [12] K.M. Passino, Biomimicry of bacterial foraging for distributed optimization and control, IEEE Control Systems Magazine 22(3) (2002) 52-67. [13] J.O. Kephart, A biologically inspired immune system for computers, in Proceedings of Artificial Life IV: The Fourth International Workshop on the Synthesis and Simulation of Living Systems, MIT Press, 1994, pp. 130–139. [14] L.N. De Castro, J. Timmis, Artificial Immune Systems: A New Computational Intelligence Approach, Springer, 2002, ISBN 978-1-85233-594-6. [15] M.M. Eusuff, K.E. Lansey, Optimization of water distribution network design using the shuffled frog leaping algorithm, Journal of Water Resources Planning and Management, 129 (2003) 210-225. [16] R. Storn, K. Price, Differential evolution–A simple and efficient heuristic for global optimization over continuous spaces, Journal of Global Optimization 11(4) (1997) 341-359. [17] R. Mallipeddi, P.N. Suganthan, Q.K. Pan, M.F. Tasgetiren, Differential evolution algorithm with ensemble of parameters and mutation strategies, Applied Soft Computing 11(2) (2011) 1679-1696. [18] E. Atashpaz-Gargari, C. Lucas, Imperialist competitive algorithm: An algorithm for optimization inspired by imperialistic competition, in Proceedings of the IEEE Congress on Evolutionary Computation, 25-28 September 2007, Singapore, pp. 4661- 4667. [19] Y. del Valle, G.K. Venayagamoorthy, S. Mohagheghi, J.-C. Hernandez, R.G. Harley, Particle swarm optimization: Basic concepts, variants and applications in power systems, IEEE Transactions on Evolutionary Computation 12(2) (2008) 171-195. [20] M.R. AlRashidi, M.E. El-Hawary, A survey of particle swarm optimization applications in electric power systems, IEEE Transactions on Evolutionary Computation 13(4) (2009) 913-918. [21] P.J. Fleming , R.C. Purshouse, Evolutionary algorithms in control systems engineering: a survey, Control Engineering Practice 10(11) (2002) 1223-1241. [22] C.A. Coello Coello, A comprehensive survey of evolutionary-based multiobjective optimization techniques, Knowledge and Information Systems 1 (1999) 269-308. [23] H. Shah-Hosseini, Problem solving by intelligent water drops, in Proceedings of the IEEE Congress on Evolutionary Computation, 25-28 September 2007, Singapore, pp. 3226- 3231. [24] D.A. Battaglia, G.E. Santoro, E. Tosatti, Optimization by quantum annealing: Lessons from hard satisfiability problems, Physical Review E 71(6) (2005) 066707 doi: 10.1103/PhysRevE.71.066707 [25]Y. Jin, A comprehensive survey of fitness approximation in evolutionary computation, Soft Computing 9(1) (2005) 3-12. [26] E. Elbeltagi, T. Hegazy, D. Grierson, Comparison among five evolutionary-based optimization algorithms, Advanced Engineering Informatics 19 (2005) 43-53. [27] H. Cho, F. Olivera, S.D. Guikema, A derivation of the number of minima of the Griewank function, Applied Mathematics and Computation 204(2) (2008) 694-701. [28] S. Skogestad, I. Postlethwaite, Multivariable Feedback Control, second ed., John Wiley & Sons, UK, 2005. [29] C.A. Coello Coello, Theoretical and numerical constraint-handling techniques used with evolutionary algorithms: a survey of the state of the art, Computer Methods in Applied Mechanics and Engineering 191(11-12) (2002) 1245-1287.
9cs.NE
Shortest Paths and Distances with Differential Privacy Adam Sealfon arXiv:1511.04631v2 [cs.CR] 20 Apr 2016 MIT [email protected] Abstract We introduce a model for differentially private analysis of weighted graphs in which the graph topology (V, E) is assumed to be public and the private information consists only of the edge weights w : E → R+ . This can express hiding congestion patterns in a known system of roads. Differential privacy requires that the output of an algorithm provides little advantage, measured by privacy parameters ǫ and δ, for distinguishing between neighboring inputs, which are thought of as inputs that differ on the contribution of one individual. In our model, two weight functions w, w′ are considered to be neighboring if they have ℓ1 distance at most one. We study the problems of privately releasing a short path between a pair of vertices and of privately releasing approximate distances between all pairs of vertices. We are concerned with the approximation error, the difference between the length of the released path or released distance and the length of the shortest path or actual distance. For the problem of privately releasing a short path between a pair of vertices, we prove a lower bound of Ω(|V|) on the additive approximation error for fixed privacy parameters ǫ, δ. We provide a differentially private algorithm that matches this error bound up to a logarithmic factor and releases paths between all pairs of vertices, not just a single pair. The approximation error achieved by our algorithm can be bounded by the number of edges on the shortest path, so we achieve better accuracy than the worst-case bound for pairs of vertices that are connected by a low-weight path consisting of o(|V|) vertices. For the problem of privately releasing all-pairs distances, we show that for trees we can release all-pairs distances with approximation error O(log 2.5 |V|) for fixed privacy parameters. For arbitrary bounded-weight pgraphs with edge weights in [0, M ] we can release all distances with approximation error Õ( |V|M ). Contents 1 Introduction 1.1 Differential privacy and our model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Our results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Previous work on graphs and differential privacy . . . . . . . . . . . . . . . . . . . . 1 1 1 3 2 The privacy model 5 3 Preliminaries 6 4 Computing distances 7 4.1 Distances in trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 Distances in bounded-weight graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5 Finding shortest paths 13 5.1 Lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2 Upper bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 A Distances in the path graph 18 B Other graph problems 19 B.1 Almost-minimum spanning tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 B.2 Low-weight matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1 1.1 Introduction Differential privacy and our model Privacy-preserving data analysis is concerned with releasing useful aggregate information from a database while protecting sensitive information about individuals in the database. Differential privacy [DMNS06] provides strong privacy guarantees while allowing many types of queries to be answered approximately. Differential privacy requires that for any pair of neighboring databases x and y, the output distributions of the mechanism on database x and database y are very close. In the traditional setting, databases are collections of data records and are considered to be neighboring if they are identical except for a single record, which is thought of as the information associated with a single individual. This definition guarantees that an adversary can learn very little about any individual in the database, no matter what auxiliary information the adversary may possess. A new model We introduce a model of differential privacy for the setting in which databases are weighted graphs (G, w). In our setting, the graph topology G = (V, E) is assumed to be public, and only the edge weights w : E → R+ must be kept private. Individuals are assumed to have only bounded influence on the edge weights. Consequently, two weight functions on the same unweighted graph are considered to be neighbors if they have ℓ1 distance at most one. The model is well suited to capture the setting of a navigation system which has access to current traffic data and uses it to direct drivers. The travel times along routes provided by the system should be as short as possible. However, the traffic data used by the system may consist of private information. For instance, navigation tools such as Google Maps and Waze estimate traffic conditions based on GPS locations of cars or based on traffic reports by users. On the other hand, the topology of the road map used by the system is non-private, since it is a static graph readily available to all users. We would like to provide information about paths and distances in the network without revealing sensitive information about the edge weights. In this paper we introduce a variant of differential privacy suitable for studying network routing, and provide both algorithms and lower bounds. 1.2 Our results We will consider two classic problems in this model which are relevant for routing. First, we are interested in finding short paths between specified pairs of vertices. We cannot hope always to release the shortest path while preserving privacy, but we would like to release a path that is not much longer than the shortest path. Here the approximation error is the difference in length between the released path and the shortest path. Second, we would like to release distances between pairs of vertices. The approximation error here is the absolute difference between the released distance and the actual distance. As we discuss below, releasing an accurate distance estimate for a single pair of vertices in our model is a straightforward application of the Laplace mechanism of [DMNS06]. We focus on the more difficult problem of releasing all-pairs distances privately with low error. Interestingly, all of our error bounds are independent of the sum of the edge weights kwk1 , which corresponds most naturally to the size of the database under the usual setting for differential privacy. Instead, they depend only on the number of vertices |V| and edges |E| in the graph and the privacy parameters ǫ and δ. Our error bounds constitute additive error. Consequently, if the edge weights are large, the error will be small in comparison. 1 Approximate shortest paths We consider the problem of privately releasing an approximate shortest path. We provide a strong reconstruction based lower bound, showing that in general it is not possible under differential privacy to release a short path between a pair of vertices with additive error better than Ω(|V|). Our lower bound is obtained by reducing the problem of reconstructing many of the rows of a database to the problem of finding a path with low error. We also show that a simple ǫ-differentially private algorithm based on the Laplace mechanism of [DMNS06] comes close to meeting this bound. If the minimum-weight path between a pair of vertices s, t consists of at most k edges, then the weight of the path released by our algorithm is greater by at most O(k log |V|)/ǫ. Since k < |V|, the weight of the released path is O(|V| log |V|)/ǫ greater than optimal. Note that when the edge weights are large, the length of a path can be much larger than (|V| log |V|)/ǫ, in which case our algorithm provides a good approximation. Moreover, for many networks we would expect that shortest paths should be compact and consist of few vertices, in which case the accuracy obtained will be much greater. The algorithm releases not only a single path but short paths between every pair of vertices without loss of additional privacy or accuracy. Approximate all pairs distances For the problem of privately releasing all-pairs distances, standard techniques yield error O(|V| log |V|)/ǫ for each query under ǫ-differential privacy. We obtain improved algorithms for two special classes of graphs, trees and arbitrary graphs with edges of bounded weight. For trees we show that a simple recursive algorithm can release all-pairs distances with error O(log2.5 |V|)/ǫ. Implicitly, the algorithm finds a collection C of paths with two properties. Every edge is contained in at most log |V| paths, and the unique path between any pair of vertices can be formed from at most 4 log |V| paths in C using the operations of concatenation and subtraction. The first property implies that the query consisting of the lengths of all of the paths in C has global ℓ1 sensitivity log |V|, so we can release estimates of the lengths of all paths in C with error roughly log |V| using the standard Laplace mechanism [DMNS06]. The second property implies that we can use these estimates to compute the distance between any pair of vertices without too much increase in error. We first reduce the approximate all-pairs distances problem to the problem of approximating all distances from a single fixed vertex. We then solve the single-source problem recursively, repeatedly decomposing the tree into subtrees of at most half the size. In the special case of the path graph, releasing approximate all-pairs distances is equivalent to query release of threshold functions on the domain X = E. The results of [DNPR10] yield the same error bound that we obtain for computing distances on the path graph. Consequently our algorithm for all-pairs distances on trees can be viewed as a generalization of a result for private query release of threshold functions. For bounded-weight graphs we show that we can generate a set of vertices Z ⊂ V such that distances between all pairs of vertices in Z suffice to estimate distances between all pairs of vertices in V. The required property on Z is that every vertex v ∈ V is connected to a vertex zv ∈ Z by a path consisting of few vertices. Since we can always find a set Z that is not too large, we can release distances between all pairs of vertices in Z with relatively small error. The distance between a pair of vertices u, v ∈ V can then be approximated by the distance between nearby vertices zu , zv ∈ Z. 1 < M ǫ < |V|, then we can release all pairs shortest In general, if edge weights are in [0, M ] for |V| p −1 paths with an additive error of Õ( |V|M ǫ log(1/δ)) per path under (ǫ, δ)-differential privacy for any ǫ, δ > 0. Note that the distance between a pair of vertices can be as large as |V| · M , so this 2 error bound is nontrivial. For specific graphs we can obtain better bounds by finding a smaller set Z satisfying the necessary requirements. Additional problems We also consider two other problems in this model, the problem of releasing a nearly minimal spanning tree and the problem of releasing an almost minimum weight perfect matching. For these problems, the approximation error is the absolute difference in weight between the released spanning tree or matching and the minimum-weight spanning tree or matching. Using a similar argument to the shortest path results of Section 5, we provide lower bounds and algorithms for these problems. Through a reduction from the problem of reconstructing many rows in a database, we show that it is not possible under differential privacy to release a spanning tree or matching with error better than Ω(|V|). Using a simple algorithm based on the Laplace mechanism of [DMNS06], we can privately release a spanning tree or matching with error roughly (|V| log |V|)/ǫ. These results are presented in Appendix B. Future directions In this work we describe differentially private algorithms and lower bounds for several natural graph problems related to network routing. We would like to explore how well our algorithms perform in practice on actual road networks and traffic data. We would also like to develop new algorithms for additional graph problems and to design improved all-pairs distance algorithms for additional classes of networks. In addition, lower bounds for accuracy of private all-pairs distances would be very interesting. Scaling Our model requires that we preserve the indistinguishability of two edge weight functions which differ by at most 1 in ℓ1 norm. The constant 1 here is arbitrary, and the error bounds in this paper scale according to it. For instance, if a single individual can only influence edge weights by 1/|V| rather than 1 in ℓ1 norm, then we can privately find a path between any pair of vertices whose length is only O(log |V|)/ǫ longer than optimal rather than O(|V| log |V|)/ǫ. The other results in this paper can be scaled similarly. 1.3 Previous work on graphs and differential privacy Why a new model? The two main models which have been considered for applying differential privacy to network structured data are edge and node differential privacy [HLMJ09, BBDS13, KNRS13, KRSY11]. Under edge differential privacy, two graphs are considered to be neighbors if one graph can be obtained from the other by adding or removing a single edge. With node differential privacy, two graphs are neighbors if they differ only on the set of edges incident to a single vertex. However, the notions of edge and node differential privacy are not well suited to shortest path and distance queries. Consider an algorithm that releases a short path between a specified pair of vertices. Any useful program solving this problem must usually at least output a path of edges which are in the graph. But doing so blatantly violates privacy under both the edge and node notions of differential privacy, since the released edges are private information. Indeed, an algorithm cannot release subgraphs of the input graph without violating both edge and node differential privacy because this distinguishes the input from a neighboring graph in which one of the released edges is removed. What if we simply want to release the distance between a pair of vertices? In general it is not possible to release approximate distances with meaningful utility under edge or node differential 3 privacy, since changing a single edge can greatly change the distances in the graph. Consider the unweighted path graph P and any pair of adjacent vertices x, y on the path. Removing edge (x, y) disconnects the graph, increasing the distance between x and y from 1 to ∞. Even if the graph remains connected, the removal of an edge does not preserve approximate distances. Consider any pair of adjacent vertices x, y on the cycle graph C. Here, removing edge (x, y) increases the distance between x and y from 1, the smallest possible distance, to |V| − 1, the largest possible distance. Hence, the edge and node notions of differential privacy do not enable the release of approximate distances. This inadequacy motivates the new notion of differential privacy for graphs introduced in this work. A histogram formulation A database consisting of elements from a data universe U can be described by a vector D ∈ N|U |, where the ith component of the vector corresponds to the number of copies of the ith element of U in the database. More generally, we can allow the database to be a point in R|U | , which corresponds to allowing a fractional number of occurrences of each element. Since an edge weight function w is an element of R|E| and the notions of sensitivity coincide, we can rephrase our model in the standard differential privacy framework. Consequently, we can use existing tools for privately answering low sensitivity queries to yield incomparable results to those presented in this paper for the problem of releasing all-pairs distances with low error. If all edge weights are integers and the sum kwk1 of the edge weights is known, we can release all-pairs distances with additive error p Õ( kwk1 · log |V| log1.5 (1/δ)/ǫ) except with probability δ using the (ǫ, δ)-differentially private boosting mechanism of [DRV10]. The assumption that kwk1 is known is not problematic, since we can privately release a good approximation. We can also extend the algorithm to noninteger edge weights for the queries in our setting, although we obtain a worse error bound. We do this by modifying the base synopsis generator of [DRV10] to produce a database in (τ N)|E| whose fractional counts are integer multiples of τ = α/(2|V|), where α will be the obtained additive approximation. The modified algorithm p releases all-pairs distances with error Õ( 3 kwk1 · |V| log4/3 (1/δ)/ǫ2/3 ). This error bound has a better dependence on |V| than the algorithms for all-pairs distances in general and weighted graphs described in Section 4. However, it has a substantial dependence on kwk1 , while the error bound for all algorithms in the remainder of this paper are independent of kwk1 . In addition, the running time of the algorithm of [DRV10] is exponential in the database size, while all algorithms described below run in polynomial time. Additional related work While the private edge weight model explored in this work is new, a few previous works have considered problems on graphs in related models. Nissim, Raskhodnikova and Smith [NRS07] consider the problem of computing the cost of the minimum spanning tree of a weighted graph. They introduce the notion of smooth sensitivity, which they use to compute the approximate MST cost. In their work, edge weights are bounded, and each weight corresponds to the data of a single individual. In contrast, we allow unbounded weights but assume a bound on the effect an individual can have on the weights. Hsu et al. [HHR+ 14] consider the problem of privately finding high-weight matchings in bipartite graphs. In their model, which captures a private version of the allocation problem, two weightings of the complete bipartite graph are neighbors if they differ only in the weights assigned to the edges 4 incident to a single left-vertex, which correspond to the preferences of a particular agent. They show that the problem is impossible to solve under the standard notion of differential privacy. They work instead under the relaxed notion of “joint differential privacy,” in which knowledge of the edges of the matching which correspond to some of the left-vertices cannot reveal the weights of edges incident to any of the remaining left-vertices. A series of works has explored the problem of privately computing the size of all cuts (S, S) in a graph. Gupta, Roth and Ullman [GRU12] show how to answer cut queries with O(|V|1.5 ) error. Blocki et al. [BBDS12] improve the error for small cuts. Relatedly, Gupta et al. [GLM+ 10] show that we can privately release a cut of close to minimal size with error O(log |V|)/ǫ, and that this is optimal. Since the size of a cut is the number of edges crossing the cut, it can also be viewed as the sum of the weights of the edges crossing the cut in a {0, 1}-weighting of the complete graph. Consequently the problem can be restated naturally in our model. As we have discussed, the problem of approximating all threshold functions on a totally ordered set is equivalent to releasing approximate distances on the path graph. In addition to the work of Dwork et al. [DNPR10] described above, additional bounds and reductions for query release and learning of threshold functions are shown in Bun et al. [BNSV15]. 2 The privacy model Let G = (V, E) denote an undirected graph with vertex set V and edge set E, and let w : E → R+ be a weight function. (The shortest path results in Section 5 also apply to directed graphs.) Let V = |V| and E = |E| be the number of vertices and edges, respectively. Let Pxy denote the set P of paths between a pair of vertices x, y ∈ V. For any path P ∈ Pxy , the weight w(P ) is the sum e∈P w(e) of the weights of the edges of P . The distance dw (x, y) from x to y denotes the weighted distance minP ∈Pxy w(P ). We will denote the unweighted or hop distance from x to y by h(x, y) = minP ∈Pxy ℓ(P ), where the hop length ℓ(P ) of path P = (v0 , . . . , vℓ ) is the number ℓ of edges on the path. Let the shortest path SPw (x, y) denote a path from x to y of minimum possible weight w(SPw (x, y)) = dw (x, y). We now formally define differential privacy in the private edge weight model. Definition 2.1. For any edge set E, two weight functions w, w′ : E → R+ are neighboring, denoted w ∼ w′ , if X |w(e) − w′ (e)| ≤ 1. kw − w′ k1 = e∈E Definition 2.2. For any graph G = (V, E), let A be an algorithm that takes as input a weight function w : E → R+ . A is (ǫ, δ)-differentially private on G if for all pairs of neighboring weight functions w, w′ and for all sets of possible outputs S, we have that Pr[A(w) ∈ S] ≤ eǫ Pr[A(w′ ) ∈ S] + δ. If δ = 0 we say that A is ǫ-differentially private on G. For a class C of graphs, we say that A is (ǫ, δ)-differentially private on C if A is (ǫ, δ)-differentially private on G for all G ∈ C. We now define our accuracy criteria for the approximate shortest paths and distances problems. 5 Definition 2.3. For the shortest path problem, the error of a path P ∈ Pxy between vertices x, y is the difference w(P ) − dw (x, y) between the length of P and the length of the shortest path between x and y. Definition 2.4. For the approximate distances problem, the error is the absolute difference between the released distance between a pair of vertices x, y and the actual distance dw (x, y). 3 Preliminaries We will now introduce a few basic tools which will be used throughout the remainder of this paper. A number of differential privacy techniques incorporate noise sampled according to the Laplace distribution. We define the distribution and state a concentration bound for sums of Laplace random variables. Definition 3.1. The Laplace distribution with scale b, denoted Lap(b), is the distribution with probability density function given by p(x) = 1 exp(−|x|/b). 2b If Y is distributed according to Lap(b), then for any t > 0 we have that Pr[|Y | > t · b] = e−t . Lemma 3.1 (Concentration of Laplace random variables [CSS10]). P Let X1 , . . . , Xt be independent random variables distributed according to Lap(b), and let X = i Xi . Then for all γ ∈ (0, 1) we have that with probability at least 1 − γ, √ √ |X| < 4b t ln(2/γ) = O(b t log(1/γ)). One of the first and most versatile differentially private algorithms is the Laplace mechanism, which releases a noisy answer with error sampled from the Laplace distribution with scale proportional to the sensitivity of the function being computed. Definition 3.2. For any function f : X → Rk , the sensitivity ∆f = max kf (w) − f (w′ )k1 w,w′ ∈X w∼w ′ is the largest amount f can differ in ℓ1 norm between neighboring inputs. In our setting we have X = (R+ )E . Lemma 3.2 (Laplace mechanism [DMNS06]). Given any function f : X → Rk , the Laplace mechanism on input w ∈ X independently samples Y1 , . . . , Yk according to Lap(∆f /ǫ) and outputs Mf,ǫ (w) = f (w) + (Y1 , . . . , Yk ). The Laplace mechanism is ǫ-differentially private. Finally, we will need the following results on the composition of differentially private algorithms. 6 Lemma 3.3 (Basic Composition, e.g. [DKM+ 06]). For any ǫ, δ ≥ 0, the adaptive composition of k (ǫ, δ)-differentially private mechanisms is (kǫ, kδ)-differentially private. Lemma 3.4 (Composition [DRV10, DR13]). For any ǫ, δ, δ′ ≥ 0, the adaptive composition of k (ǫ, δ)-differentially private mechanisms is (ǫ′ , kδ + δ′ )-differen-tially private for p ǫ′ = 2k ln(1/δ′ ) · ǫ + kǫ(eǫ − 1) p which is O( k ln(1/δ′ ) · ǫ) provided k ≤ 1/ǫ2 . In particular, if ǫ′ ∈ (0, 1), δ, δ′ ≥ 0, the composition of k (ǫ, δ)-differentially private mechanisms is (ǫ′ , kδ + δ′ )-differentially private for ǫ = p O(ǫ′ / k ln(1/δ′ )). 4 Computing distances In this section we consider the problem of releasing distance oracle queries in the private edge weights model. Since neighboring weight functions differ by at most 1 in ℓ1 norm, the weight of any path also changes by at most 1. Consequently, a single distance oracle query is sensitivity-1, and so we can use the Laplace mechanism (Lemma 3.2) to answer it privately after adding noise proportional to 1/ǫ. However, what if we would like to learn all-pairs distances privately? There are V 2 pairs (s, t) of vertices, so we can achieve ǫ-differential privacy by adding to each query Laplace noise proportional to V 2 /ǫ. We can do better using approximate differential privacy (δ > 0) and Lemma 3.4 (Composition). Adding Laplace noise proportional to 1/ǫ′ to each query p ′ ′ results in a mechanism that is (V ǫ 2 ln(1/δ) + V 2 ǫ′ (eǫ − 1), δ)-differentially private for any δ > 0. p Taking ǫ′ = p ǫ/O(V ln 1/δ) for ǫ < 1, we obtain a mechanism that is (ǫ, δ)-differentially private by adding O(V ln 1/δ)/ǫ noise to each query. The other natural approach is to release an ǫ-differentially private version of the graph by adding Lap(1/ǫ) noise to each edge. This will be the basis for our approach in Algorithm 3 for computing approximate shortest paths. With probability 1 − γ, all E Laplace random variables will have magnitude (1/ǫ) log(E/γ), so the length of every path in the released synthetic graph is within (V /ǫ) log(E/γ) of the length of the corresponding path in the original graph. Therefore with probability 1 − γ we have that all pairs distances in the released synthetic graph will be within (V /ǫ) log(E/γ) of the corresponding distances in the original graph. Both of these approaches result in privately releasing all pairs distances with additive error roughly V /ǫ. It is natural to ask whether this linear dependance on V is the best possible. In the remainder of this section we present algorithms which substantially improve on this bound for two special classes of graphs, trees and arbitrary graphs with edges of bounded weight. For trees we can obtain all-pairs distances with error polylog(V )/ǫ, and for graphs with edges in [0, M ] we can p obtain all-pairs distances with error roughly V M/ǫ. 4.1 Distances in trees For trees it turns out to be possible to release all-pairs distances with far less error. We will first show a single-source version of this result for rooted trees, which we will then use to obtain the full result. The idea is to split the tree into subtrees of at most half the size of the original tree. As long as we can release the distance from the root to each subtree with small error, we can then recurse on the subtrees. 7 ··· T0 v0 T1 v1 T2 v2 ··· ··· ··· v∗ ··· ··· .. . Tt vt ··· Figure 1: The partition used in Algorithm 1 to separate a tree into subtrees of size at most V /2. The problem of privately releasing all-pairs distances for the path graph can be restated as the problem of privately releasing threshold functions for a totally ordered data universe of size E = V − 1. Dwork et al. [DNPR10] showed that we can privately maintain a running counter for T timesteps, with probability 1 − γ achieving additive accuracy of O(log(1/γ) log 2.5 T /ǫ) at each timestep. This algorithm essentially computes all threshold queries for a totally ordered universe of size T , which is equivalent to computing the distance from an endpoint to each other vertex of the path graph. We match the accuracy of the [DNPR10] algorithm and generalize the result to arbitrary trees. In Appendix A we provide an alternate algorithm for the path graph which achieves the same asymptotic bounds. This result can be viewed as a restatement of the [DNPR10] algorithm. Theorem 4.1 (Single-source distances on rooted trees). Let T = (V, E) be a tree with root vetex v0 , and let ǫ > 0. Then there is an algorithm that is ǫ-differentially private on T that on input edge weights w : E → R+ releases approximate distances from v0 to each other vertex, where with probability 1 − γ the approximation error on each released distance is O(log1.5 V · log(1/γ))/ǫ for any γ ∈ (0, 1). Proof. Given the tree T and root v0 , we will partition V into subtrees of size at most V /2 as shown in Figure 1 and recursively obtain distances in each subtree. There exists some vertex v ∗ such that the subtree rooted at v ∗ contains more than V /2 vertices while the subtree rooted at each child of v ∗ has at most V /2 vertices. The topology of the graph is public, so we can release vertex v ∗ . Let v1 , . . . , vt be the children of v ∗ , and let Ti = (Vi , Ei ) be the subtree rooted at vi for each i ∈ [t]. Let T0 = (V0 , E0 ) be the subtree rooted at v0 consisting of the remaining vertices V \ (V1 ∪ · · · ∪ Vt ). We can compute and release distances between the following pairs of vertices, adding Lap(log V /ǫ) noise to each distance: 8 Algorithm 1: Rooted tree distances Inputs: Tree T = (V, E), root v0 ∈ V, edge weights w : E → R+ , and number of vertices n of original tree. 1. Let v ∗ be the unique vertex such that the subtree rooted at v ∗ has more than V /2 vertices while the subtree rooted at each child of v ∗ has at most V /2 vertices. 2. Let v1 , . . . , vt be the children of v ∗ . 3. Let Ti be the subtree rooted at vi for i ∈ [t], and let T0 = T \ {T1 , . . . , Tt }. 4. Sample Xv∗ ,T ← Lap(log V /ǫ) and let d(v ∗ , T ) = dw (v0 , v ∗ ) + Xv∗ ,T . 5. Let d(v0 , T ) = 0. 6. For each i ∈ [t], sample Xvi ,T ← Lap(log V /ǫ) and let d(vi , T ) = d(v ∗ , T ) + w((v ∗ , vi )) + Xvi ,T . 7. Recursively compute distances in each subtree T0 , . . . , Tt . 8. For each vertex v ∈ V, if v ∈ Ti , then let d(v, T ) = d(vi , T ) + d(v, Ti ). 9. Release d(v, T ) for all v ∈ V. • (v0 , v ∗ ) • (v ∗ , vi ) for each i ∈ [t] Since v ∗ is the parent of v1 , . . . , vt in the tree rooted at v0 , the path from v0 to v ∗ in T contains none of the edges (v ∗ , vi ) for i ∈ [t], so the function which releases these t + 1 distances is sensitivity-1. We then recursively repeat the procedure on each subtree T0 , . . . , Tt until we reach trees containing only a single vertex, adding Lap(log V /ǫ) noise to each released value. Each subtree has size at most V /2, so the depth of recursion is bounded by log V . The subtrees T0 , . . . , Tt are also disjoint. Consequently the function which releases all of the distances at depth d in the recursion has sensitivity 1 for any d. Therefore the function which releases all distances queried in this recursive procedure has sensitivity at most log V . Since we add Lap(log V /ǫ) noise to each coordinate of this function, the algorithm outlined above is an instantiation of the Laplace mechanism (Lemma 3.2) and is ǫ-differentially private. We now show how these queries suffice to compute the distance from root vertex v0 to each other vertex with small error. The algorithm samples at most 2V Laplace random variables distributed according to Lap(log V /ǫ), so by a union bound, with probability 1 − γ all of these have magnitude O(log V log(V /γ))/ǫ. Consequently to obtain an error bound of roughly O(log3 V )/ǫ it suffices to show that any distance in T can be represented as a sum of O(log V ) of the noisy distances released in the algorithm. We will use Lemma 3.1 to obtain a slightly better bound on the error terms. 9 Let set Q consist of the pairs of vertices corresponding to distance queries made by the algorithm above. We prove the following statement by induction. For any vertex u ∈ V, there is a path from v0 to u in the graph (V, Q) consisting of at most 2 log V edges. The base case V = 1 is vacuous. For V > 1, note that since subtrees T0 , . . . , Tt partition the vertex set, u must lie in one of them. If u ∈ Ti , then by the inductive assumption on Ti , there is a path from vi to u in (V, Q) consisting of at most 2 log(V /2) = 2 log V − 2 edges. If i = 0 this already suffices. Otherwise, if i > 0, note that (v0 , v ∗ ) ∈ Q and (v ∗ , vi ) ∈ Q. Consequently there is a path in (V, Q) from v0 to u consisting of at most 2 log V edges. This means that there is a set of at most 2 log V distances queried such that the distance from v0 to u consists of the sum of these distances. Consequently by adding these distances we obtain an estimate for the distance from v0 to u whose error is the sum of at most 2 log V independent random variables each distributed according to Lap(log V /ǫ). By Lemma 3.1, we have that with probability at least 1 − γ, we compute an estimate of dw (v0 , u) with error O(log1.5 V · log(1/γ))/ǫ for any γ ∈ (0, 1). Since differentially private mechanism are preserved under post-processing, this algorithm satisfies ǫ-differential privacy and computes distances from v ∗ to each other vertex in T , where with probability at least 1 − γ each distance has error at most O(log1.5 V · log(1/γ))/ǫ. We now extend this result to obtain all-pairs distances for trees. Theorem 4.2 (All-pairs distances on trees). For any tree T = (V, E) and ǫ > 0 there is an algorithm that is ǫ-differentially private on T and on input edge weights w : E → R+ releases all-pairs distances such that with probability 1 − γ, all released distances have approximation error O(log2.5 V · log(1/γ))/ǫ for any γ ∈ (0, 1). For each released distance, with probability 1 − γ the approximation error is O(log1.5 V · log(1/γ))/ǫ. Proof. Arbitrarily choose some root vertex v0 . Use the ǫ-differentially private algorithm of Theorem 4.1 to obtain approximate distances from v0 to each other vertex of T . We now show that this suffices to obtain all-pairs distances. Consider any pair of vertices x, y, and let z be their lowest common ancestor in the tree rooted at v0 . Then dw (x, y) = dw (z, x) + dw (z, y) = dw (v0 , x) + dw (v0 , y) − 2dw (v0 , z). Since with probability 1 − 3γ we can compute each of these three distances with error O(log1.5 V · log(1/γ)/ǫ), it follows that we can compute the distance between x and y with error at most four times this, which is still O(log1.5 V · log(1/γ))/ǫ. By a union bound, for any γ ∈ (0, 1), with probability at least 1 − γ each error among the V (V − 1)/2 all-pairs distances released is at most O(log1.5 V · log(V /γ))/ǫ = O(log2.5 V · log(1/γ))/ǫ. 4.2 Distances in bounded-weight graphs Theorem 4.3. For all G, δ, γ, M , and ǫ ∈ (0, 1), if 1/V < M ǫ < V then there is an algorithm A that is (ǫ, δ)-differentially private on G such that for all w : E → [0, M ], with probability 1 − γ, 10 Algorithm 2: Bounded-weight distances Inputs: G = (V, E), w : E → R+ , k, M, γ, ǫ′ > 0, k-covering Z. 1. For all y, z ∈ Z, sample Xy,z ← Lap(|Z|/ǫ′ ) and output ay,z := dw (y, z) + Xy,z . 2. For v ∈ V , let z(v) ∈ Z denote a vertex in Z with h(v, z(v)) ≤ k. 3. The approximate distance between vertices u, v ∈ V is given by az(u),z(v) . A(w) outputs approximate all-pairs distances with additive error p  O V M ǫ−1 · log(1/δ) · log(V M ǫ/γ) per distance. For any ǫ > 0, G, γ, M , if 1/V < M ǫ < V 2 then there is an algorithm B that is ǫ-differentially private on G such that for all w : E → [0, M ], with probability 1 − γ, B(w) outputs approximate all-pairs distances with additive error   O (V M )2/3 ǫ−1/3 log(V M ǫ/γ) per distance. To achieve this result, we will find a small subset Z of V such that every vertex v ∈ V is near some vertex z ∈ Z. We will need the following definition, introduced in [MM75]. Definition 4.1. A subset Z ⊂ V of vertices is a k-covering if for every v ∈ V there is some z ∈ Z such that h(v, z) ≤ k, where h is the hop-distance. A k-covering is sometimes called a k-dominating set (e.g. in [CN82]). The following lemma shows that we can find a sufficiently small k-covering for any graph G. Lemma 4.4. [MM75] If V ≥ k + 1, then G has a k-covering of size at most ⌊V /(k + 1)⌋. Proof. Consider any spanning tree T of G and any vertex x ∈ V that is an endpoint of one of the longest paths in T . For 0 ≤ i ≤ k, let Zi be the subset of V consisting of vertices whose distance from x in T is congruent to i modulo k + 1. It can be shown that each Zi is a k-covering of T and therefore of G. But the k+1 sets Zi form a partition of V. Therefore some Zi has |Zi | ≤ ⌊V /(k+1)⌋, as desired. Theorem 4.5. For any G = (V, E), k, δ > 0, and γ, ǫ ∈ (0, 1), let Z be a k-covering of G, and let Z = |Z|. Then there is an algorithm A which is (ǫ, δ)-differentially private on G such that for any edge weight function w : E → [0, M ], with probability 1 − γ, A(w) releases all-pairs distances with approximation error   p O kM + Zǫ−1 log(Z/γ) log(1/δ) per distance. 11 Proof. There are Z 2 pairwise distances between vertices in Z. We can compute and release noisy versions of each of these distances, adding Lap(Z/ǫ′ ) noise to each. For any γ ∈ (0, 1), with proba′ ) log(Z 2 /γ). bility 1 − γ we have that each of these Z 2 noise variables has magnitude at most (Z/ǫp ′ By Lemma 3.4, for any δ > 0 releasing this is (ǫ, δ)-differentially private for ǫ = O(ǫ/ ln 1/δ ). But this information allows the recipient to compute approximate distances between any pair of vertices x, y ∈ V, as follows. Since Z is a k-covering of G, we can find zx , zy ∈ Z which are at most k vertices from x and y. Since the maximum weight is M , the weight of the shortest path between x and zx is at most kM , and similarly for y and zy . Consequently |dw (x, y) − dw (zx , zy )| ≤ 2kM. But we have released an estimate of dw (zx , zy ) with noise distributed according to Lap(Z/ǫ). Consequently with probability 1 − γ each of these estimates differs from dw (zx , zy ) by at most (Z/ǫ) log(Z 2 /γ). We obtain a slightly weaker result under pure differential privacy. Theorem 4.6. Let G = (V, E). For any k > 0 and γ ∈ (0, 1), if Z is a k-covering of G of size Z, then there is an algorithm A that is ǫ-differentially private on G such that for any w : E → [0, M ], with probability 1 − γ, A(w) releases all-pairs distances with approximation error O(kM + Z 2 ǫ−1 log(Z/γ)) per distance. Proof. There are at most Z 2 pairwise distances between vertices in Z, so we can release approximations of each distance, adding Lap(Z 2 /ǫ) noise to each distance. With probability 1 − γ each of these Z 2 noise variables has magnitude at most (Z 2 /ǫ) log(Z 2 /γ). By Lemma 3.3, releasing these distances is ǫ-differentially private. As above, since Z is a k-covering of G, we can find zx , zy ∈ Z which are at most k vertices from x and y. Consequently dw (x, zx ) ≤ kM and dw (y, zy ) ≤ kM , so |dw (x, y) − dw (zx , zy )| ≤ 2kM. But the released estimate for dw (zx , zy ) has noise distributed according to Lap(kM ), so with probability 1 − γ each of these estimates differs from dw (x, y) by at most O(Z 2 ǫ−1 log(Z 2 /γ)), as desired. We now conclude the proof of Theorem 4.3. p Proof of Theorem 4.3. Combine Lemma 4.4 with Theorem 4.5 for k = ⌊ V /(M ǫ) ⌋, and combine Lemma 4.4 with Theorem 4.6 for k = ⌊V 2/3 /(M ǫ)1/3 ⌋. Note that if we are only interested in the V − 1 distances from a single source, then directly releasing noisy distances and applying Lemma 3.4 yields (ǫ, δ)-differential privacy with error disp tributed according to Lap(b) for b = O( V log 1/δ )/ǫ, which has the same dependence on V as the bound provided by the theorem for releasing all pairs distances. For some graphs we may be able to find a smaller k-covering than that guaranteed by Lemma 4.4. Then we can use Theorems 4.5 and 4.6 to obtain all-pairs distances with lower error. For instance, we have the following. 12 (1) e1 (0) e1 (1) e2 (0) e2 (1) e3 (0) e3 (1) (1) e4 ··· (0) e4 (1) en−1 en (0) en en−1 (0) Figure 2: The graph used for the lower bound of Lemma 5.2. √ √ Theorem 4.7. Let G be the V × V grid. Then for any ǫ, γ ∈ (0, 1) and δ > 0, we can release with probability 1 − γ all-pairs distances with additive approximation error   p V 1/3 · O M + ǫ−1 log(V /γ) log 1/δ while satisfying (ǫ, δ)-differential privacy. √ √ Proof. Let V = [ V ] × [ V ], and let Z ⊂ V consist of vertices (i, j) ∈ V with i, j both one less than a multiple of V 1/3 . Then Z is a 2V 1/3 -covering of G, and also |Z| ≤ V 1/3 . Consequently Theorem 4.5 implies the desired conclusion. 5 5.1 Finding shortest paths Lower bound In this section we present a lower bound on the additive error with which we can privately release a short path between a pair of vertices. The argument is based on a reduction from the problem of reconstructing a large fraction of the entries of a database. We show that an adversary can use an algorithm which outputs a short path in a graph to produce a vector with small Hamming distance to an input vector, which is impossible under differential privacy. To that end, we exhibit a “hard” graph G = (V, E) and a family of weight functions, and provide a correspondence between inputs x ∈ {0, 1}n and weight functions w : E → {0, 1}. Theorem 5.1. There exists a graph G = (V, E) and vertices s, t ∈ V such that for any algorithm A that is (ǫ, δ)-differentially private on G, there exist edge weights w : E → {0, 1} for which  the 1−(1+eǫ )δ expected approximation error of the path A(w) from s to t is at least α = (V − 1) · . In 1+e2ǫ particular, for sufficiently small ǫ and δ, α ≥ 0.49(V − 1). Consequently, any differentially private algorithm for approximate shortest paths must on some inputs have additive error proportional to the number of vertices. Let G = (V, E) be the (n + 1)(0) (1) vertex graph with vertex set V = {0, . . . , n} and two parallel edges ei and ei between each pair of consecutive vertices i − 1, i, as shown in Figure 2. (For simplicity we have defined this is a multigraph, but it can be transformed into a simple graph with the addition of n extra vertices, changing the bound obtained by a factor of 2.) Lemma 5.2. Let G = (V, E) be the graph defined in the previous paragraph. For any α, let A be an algorithm that is (ǫ, δ)-differentially private on G that on input edge weights w : E → {0, 1} produces a path from vertex s = 0 to vertex t = n with expected approximation error at most α. 13 Then there exists a (2ǫ, (1 + eǫ )δ)-differentially private algorithm B which on input x ∈ {0, 1}n produces y ∈ {0, 1}n such that the expected Hamming distance dH (x, y) is at most α. (x ) Proof. Given an input x ∈ {0, 1}n , the corresponding edge weight function wx is given by wx (ei i ) = (1−x ) 0 and wx (ei i ) = 1. That is, for each pair of consecutive vertices i−1, i, one of the edges between them will have weight 0 and the other will have weight 1 as determined by the ith bit of the input x. The algorithm B is as follows. On input x ∈ {0, 1}n , apply A to (G, wx ), and let P be the path (0) produced. Define y ∈ {0, 1}n as follows. Let yi = 0 if ei ∈ P and yi = 1 otherwise. Output y. We first show that this procedure is differentially private. Given neighboring inputs x, x′ ∈ {0, 1}n which differ only on a single coordinate xi 6= x′i , we have that the associated weight functions (0) (1) wx and wx′ have ℓ1 distance 2, since they disagree only edges ei and ei . Consequently, since A is (ǫ, δ)-differentially private, we have that for any set of values S in the range of A, Pr[A(wx ) ∈ S] ≤ eǫ (eǫ Pr[A(wx′ ) ∈ S] + δ) + δ = e2ǫ Pr[A(wx′ ) ∈ S] + (1 + eǫ )δ . But algorithm B only accesses the database x through A. Consequently by the robustness of differential privacy to post-processing, we have that B is (2ǫ, (1 + eǫ )δ)-differentially private. We now show that the expected number of coordinates in which y disagrees with x is at most α. The shortest path from s to t in G has length 0, so the expected length of the path P produced (1−x ) by A is at most α. Consequently in expectation P consists of at most α edges ei i . But yi 6= xi (1−x ) only if ei i ∈ P, so it follows that the expected Hamming distance dH (x, y) ≤ α. We will now prove two simple and standard lemmas concerning the limits of identifying rows of the input of a differentially private algorithm. In the first lemma, we show that a differentially ǫ +δ private algorithm cannot release a particular row of its input with probability greater than e1+e ǫ. In essence, for δ = 0 this can be interpreted as a statement about the optimality of the technique of randomized response [War65]. Lemma 5.3. If algorithm B : {0, 1}n → {0, 1} is (ǫ, δ)-differentially private, then if we uniformly sample a random input X ← Un , we have that for all i, Pr[B(X) 6= Xi ] ≥ 1−δ 1 + eǫ Proof. We have that Pr[B(X) = Xi ] is given by 1 1 Pr[B(X−i , 0) = 0] + Pr[B(X−i , 1) = 1] 2 2 eǫ ≤ · (Pr[B(X−i , 1) = 0] + Pr[B(X−i , 0) = 1]) + δ 2 = eǫ Pr[B(X) 6= Xi ] + δ so since Pr[B(X) = Xi ] = 1 − Pr[B(X) 6= Xi ], Pr[B(X) 6= Xi ] ≥ 14 1−δ . 1 + eǫ This immediately implies the following result. Lemma 5.4. If algorithm B : {0, 1}n → {0, 1}n is (ǫ, δ)-differentially private, then for some x ∈ {0, 1}n we have that the expected Hamming distance dH (B(x), x) is at least n(1−δ) 1+eǫ . Proof. By Lemma 5.3, projecting onto any coordinate i, the probability that Pr[B(X)i 6= Xi ] for 1−δ uniformly random X ← Un is at least 1+e ǫ . Consequently the expected number of coordinates on which B(X) differs from X is E(dH (B(X), X)) ≥ n(1−δ) 1+eǫ . Since this holds for X uniformly random, in particular we have that there exists some x ∈ {0, 1}n such that E(dH (B(x), x)) ≥ n(1 − δ) . 1 + eǫ We now conclude the proof of Theorem 5.1. Proof of Theorem 5.1. Assume that there is some algorithm which is (ǫ, δ)-differentially private on G and always produces a path of error at most α between s and t. Then by Lemma 5.2 we have that there is a (2ǫ, (1 + eǫ )δ)-differentially private algorithm B which for all x ∈ {0, 1}n produces y ∈ {0, 1}n such that the expected Hamming distance dH (x, y) is less than α. But by ǫ )δ) Lemma 5.4, for some x the expected Hamming distance E(dH (x, y)) ≥ n(1−(1+e = α, yielding a 1+e2ǫ contradiction. 5.2 Upper bound In this section we show that an extremely simple algorithm matches the lower bound of the previous section up to a logarithmic factor, for fixed ǫ, δ. Consider a direct application of the Laplace mechanism (Lemma 3.2), adding Lap(1/ǫ) noise to each edge weight and releasing the resulting values. With high probably all of these E < V 2 noise variables will be small, providing a bound on the difference in the weight of any path between the released graph and the original graph. Consequently we can show that if we take the shortest path in the released graph, with 99% probability the length of the same path in the original graph is O(V log V )/ǫ longer than optimal. This straightforward application of the Laplace mechanism almost matches the lower bound of the previous section. Surprisingly, with the same error bound it releases not just a short path between a single pair of vertices but short paths between all pairs of vertices. One drawback of this argument is that the error depends on the size of the entire graph. In practice we may expect that the shortest path between most pairs of vertices consist of relatively few edges. We would like the error to depend on the number of hops on the shortest path rather than scaling with the number of vertices. We achieve this with a post-processing step that increases the weight of all edges, introducing a preference for few-hop paths. We show that if there is a short path with only k hops, then our algorithm reports a path whose length is at most O(k log V /ǫ) longer. Theorem 5.5. For all graphs G and γ ∈ (0, 1), Algorithm 3 is ǫ-differentially private on G and computes paths between all pairs of vertices such that with probability 1 − γ, for all pairs of vertices s, t ∈ V, if there exists a k-hop path of weight W in (G, w), the path released has weight at most W + (2k/ǫ) log(E/γ). 15 Algorithm 3: Private shortest paths Inputs: G = (V, E), w : E → R+ , γ > 0. For each edge e ∈ E, do the following: 1. Sample Xe ← Lap(1/ǫ) 2. Let w′ (e) = w(e) + Xe + (1/ǫ) log(E/γ), where E = |E| Output w′ . The approximate shortest path between a pair of vertices x, y ∈ V is taken to be the shortest path SPw′ (x, y) in the weighted graph (G, w′ ). In particular, if the shortest path in G has k hops, then Algorithm 3 releases a path only (2k/ǫ) log(E/γ) longer than optimal. This error term is proportional to the number of hops on the shortest path. Noting that the shortest path between any pair of vertices consists of fewer than V hops, we obtain the following corollary. Corollary 5.6. For any γ ∈ (0, 1), with probability 1− γ Algorithm 3 computes paths between every pair of vertices with approximation error at most (2V /ǫ) log(E/γ). Proof of Theorem 5.5. Each random variable Xe is distributed according to Lap(1/ǫ), so with probability 1 − γ we have that |Xe | ≤ (1/ǫ) log(1/γ) for any γ ∈ (0, 1). By a union bound, with probability 1 − γ all E < V 2 of these random variables have magnitude at most (1/ǫ) log(E/γ). Conditioning on this event, for each edge e ∈ E, the modified weight computed by the algorithm satisfies w(e) ≤ w′ (e) ≤ w(e) + (2/ǫ) log(E/γ). Therefore, for any k-hop path P we have that w(P) ≤ w′ (P) ≤ w(P) + (2k/ǫ) log(E/γ). For any s, t ∈ V, if Q is the path from s to t produced by the algorithm and Q′ is any path from s to t, then we have that Q is a shortest path under w′ , so w(Q) ≤ w′ (Q) ≤ w′ (Q′ ) ≤ w(Q′ ) + (2ℓ(Q′ )/ǫ) log(E/γ). Acknowledgments I am grateful to Salil Vadhan and Shafi Goldwasser for their guidance and encouragement throughout this project. Thanks to Jon Ullman, Tommy MacWilliam and anonymous referees for helpful suggestions. This work was supported by a DOE CSGF Fellowship, NSF Frontier CNS-1413920, DARPA W911NF-15-C-0236, and the Simons Foundation (agreement dated 6-5-12). 16 References [BBDS12] Jeremiah Blocki, Avrim Blum, Anupam Datta, and Or Sheffet. The johnsonlindenstrauss transform itself preserves differential privacy. In Foundations of Computer Science (FOCS), 2012 IEEE 53rd Annual Symposium on, pages 410–419. IEEE, 2012. [BBDS13] Jeremiah Blocki, Avrim Blum, Anupam Datta, and Or Sheffet. Differentially private data analysis of social networks via restricted sensitivity. In Proceedings of the 4th conference on Innovations in Theoretical Computer Science, pages 87–96. ACM, 2013. [BNSV15] Mark Bun, Kobbi Nissim, Uri Stemmer, and Salil Vadhan. Differentially private release and learning of threshold functions. arXiv preprint arXiv:1504.07553, 2015. [CN82] GJ Chang and GL Nemhauser. The k-domination and k-stability problem on graphs. Techn. Report, 540, 1982. [CSS10] TH Hubert Chan, Elaine Shi, and Dawn Song. Private and continual release of statistics. In Automata, Languages and Programming, pages 405–417. Springer, 2010. [DKM+ 06] Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Advances in Cryptology-EUROCRYPT 2006, pages 486–503. Springer, 2006. [DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of cryptography, pages 265–284. Springer, 2006. [DNPR10] Cynthia Dwork, Moni Naor, Toniann Pitassi, and Guy N Rothblum. Differential privacy under continual observation. In Proceedings of the forty-second ACM symposium on Theory of computing, pages 715–724. ACM, 2010. [DR13] Cynthia Dwork and Aaron Roth. The algorithmic foundations of differential privacy. Theoretical Computer Science, 9(3-4):211–407, 2013. [DRV10] Cynthia Dwork, Guy N Rothblum, and Salil Vadhan. Boosting and differential privacy. In Foundations of Computer Science (FOCS), 2010 51st Annual IEEE Symposium on, pages 51–60. IEEE, 2010. [GLM+ 10] Anupam Gupta, Katrina Ligett, Frank McSherry, Aaron Roth, and Kunal Talwar. Differentially private combinatorial optimization. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1106–1125. Society for Industrial and Applied Mathematics, 2010. [GRU12] Anupam Gupta, Aaron Roth, and Jonathan Ullman. Iterative constructions and private data release. In Theory of Cryptography, pages 339–356. Springer, 2012. [HHR+ 14] Justin Hsu, Zhiyi Huang, Aaron Roth, Tim Roughgarden, and Zhiwei Steven Wu. Private matchings and allocations. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 21–30. ACM, 2014. 17 [HLMJ09] Michael Hay, Chao Li, Gerome Miklau, and David Jensen. Accurate estimation of the degree distribution of private networks. In Data Mining, 2009. ICDM’09. Ninth IEEE International Conference on, pages 169–178. IEEE, 2009. [KNRS13] Shiva Prasad Kasiviswanathan, Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. Analyzing graphs with node differential privacy. In Theory of Cryptography, pages 457– 476. Springer, 2013. [KRSY11] Vishesh Karwa, Sofya Raskhodnikova, Adam Smith, and Grigory Yaroslavtsev. Private analysis of graph structure. Proceedings of the VLDB Endowment, 4(11):1146–1157, 2011. [MM75] A Meir and JW Moon. Relations between packing and covering numbers of a tree. Pacific J. Math, 61(1):225–233, 1975. [NRS07] Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. Smooth sensitivity and sampling in private data analysis. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 75–84. ACM, 2007. [War65] Stanley L Warner. Randomized response: A survey technique for eliminating evasive answer bias. Journal of the American Statistical Association, 60(309):63–69, 1965. A Distances in the path graph In this section we give an explicit description of the private all-pairs distance algorithm for the path graph P = (V, E) with vertex set V = [V ] and edge set E = {(i, i + 1) : i ∈ [V − 1]}. This result is a restatement of a result of [DNPR10], and is generalized to trees in Section 4.1. This alternate argument for the special case of the path graph is included for illustration. The idea behind the construction is as follows. We designate a small set of hubs and store more accurate distances between consecutive hubs. As long as we can accurately estimate the distance from any vertex to the nearest hub and the distance between any pair of hubs, we can use these distances to obtain an estimate of the distance between any pair of vertices. Given any pair of vertices x, y ∈ V, in order to estimate the distance dist(x, y), we first find the hubs hx and hy nearest to x and y. We estimate the distance dist(x, y) by adding our estimates for the distances dist(x, hx ), dist(hx , hy ), and dist(hy , y). Instead of simply using a single set of hubs, we will use a hierarchical tree of hubs of different levels. There will be many hubs of low level and only a small number of hubs of high level. Each hub will store an estimate of the distance to the next hub at the same level and every lower level. Hubs higher in the hierarchy will allow us to skip directly to distant vertices instead of accruing error by adding together linearly many noisy estimates. In order to estimate the distance between a particular pair of vertices x, y ∈ V, we will only consider a small number of hubs on each level of the hierarchy. Since the total number of levels is not too large, this will result in a much more accurate differentially private estimate of the distance between x and y. Theorem A.1. Let P = (V, E) be the path graph on V vertices. For any ǫ > 0, there is algorithm A that is ǫ-differentially private on P that on input w : E → R+ releases approximate all-pairs distances such that for each released distance, with probability 1 − γ the approximation error is O(log1.5 V log(1/γ))/ǫ for any γ ∈ (0, 1). 18 Proof. For fixed k, define nested subsets V = S0 ⊃ S1 ⊃ . . . ⊃ Sk−1 of the vertex set V = [V ] as follows. Let Si = {x ∈ [V ] : V i/k | x}. That is, S0 consists of all the vertices, and in general Si consists of one out of every V i/k vertices on the path. Then |Si | = V (k−i)/k . Let si,1 , si,2 . . . , si,|Si | denote the elements of Si in increasing order, for each i. Using the Laplace mechanism (Lemma 3.2), release noisy distances between each pair of consecutive vertices si,j , si,j+1 of each set, adding noise proportional to Lap(k/ǫ). Note that since the vertices in each Si are in increasing order, each edge of P is only considered for a single released difference from each set. Consequently the total sensitivity to release all of these distances is k, so releasing these noisy distances is ǫ-differentially private. Using post-processing and these special distances, we will compute approximate all-pairs distances with small error. For any pair of vertices x, y, consider the path P[x, y] in P between x and y, and let i be the largest index such that Si contains multiple vertices of P[x, y]. We must have that Si ∩ P[x, y] < 2V 1/k , since otherwise Si+1 would contain at least two vertices on P[x, y]. Let xi , yi denote the first and last vertices in Si ∩ P[x, y]. For j < i, let xj denote the first vertex in Sj ∩ P[x, xi ] and let yj denote the last vertex in Sj ∩ P[yi , y]. There are at most 1 + V 1/k vertices of Sj in P[xj , xj+1 ], since otherwise this interval would contain another vertex of Sj+1 . Similarly, there are at most 1 + V 1/k vertices of Sj in P[yj+1 , yj ]. Therefore we can express the distance from xj to xj+1 as the sum of at most V 1/k distances which were estimated in Sj , and similarly for the distance from yj+1 to yj . Putting this all together, we can estimate the distance from x = x0 to y = y0 as the sum of at most 2(i+1)V 1/k ≤ 2kV 1/k approximate distances which were released. But each of these distances is released with noise distributed according to Lap(k/ǫ). Consequently the total error on the estimated distance from x to y is the sum of at most 2kV 1/k random variables distribued according to Lap(k/ǫ). Taking k = log V , the error is the sum of at most 4 log V variables distributed according to Lap(log V /ǫ). By Lemma 3.1, with probability at least 1 − γ the sum of these 4 log V variables is bounded by O(log1.5 V log(1/γ))/ǫ for any γ ∈ (0, 1). Consequently this is an ǫ-differentially private algorithm which releases all-pairs distances in the path graph P such that for any γ ∈ (0, 1), with probability at least 1 − γ the error in each released distance is at most O(log1.5 V log(1/γ))/ǫ. B Other graph problems In this section we consider some additional queries on graphs in the private edge weights model. .. . Figure 3: (Left) The graph used in the reduction of Lemma B.2. (Right) A single gadget in the graph used in the reduction of Lemma B.5. 19 B.1 Almost-minimum spanning tree We first consider the problem of releasing a low-cost spanning tree. The work of [NRS07] showed how to privately approximate the cost of the minimum spanning tree in a somewhat related privacy setting. We seek to release an actual tree of close to minimal cost under our model. Using techniques similar to the lower bound for shortest paths from Section 5.1, we obtain a lower bound of Ω(V ) for the error of releasing a low-cost spanning tree, and show that the Laplace mechanism yields a spanning tree of cost O(V log V ) more than optimal. Note that in this section edge weights are permitted to be negative. Theorem B.1. There exists a graph G = (V, E) such that for any spanning tree algorithm A that is (ǫ, δ)-differentially private on G, there exist edge weights w : E → {0, 1} such that the expected weight of the spanning tree A(w) is at least   1 − (1 + eǫ )δ α = (V − 1) · 1 + e2ǫ longer than the weight of the minimum spanning tree. In particular, for sufficiently small ǫ and δ, α ≥ 0.49(V − 1). We first prove a lemma reducing the problem of reidentifying rows in a database to privately finding an approximate minimum spanning tree. Let G = (V, E) be the (n + 1)-vertex graph with (0) (1) vertex set V = {0, . . . , n} and a pair of edges ei and ei between vertex 0 and each vertex i > 0, as shown in Figure 3. (As in Lemma 5.2, this is a multigraph, but we can transform it into a simple graph by adding n extra vertices, changing the bound obtained by a factor of 2.) Lemma B.2. Let G be the graph defined in the previous paragraph, and let ǫ, δ ≥ 0. For any α, let A be an algorithm that is (ǫ, δ)-differentially private on G that on input w : E → {0, 1} produces a spanning tree whose weight in expectation is at most α greater than optimal. Then there exists a (2ǫ, (1 + eǫ )δ)-differentially private algorithm B which on input x ∈ {0, 1}n produces y ∈ {0, 1}n such that the expected Hamming distance dH (x, y) is at most α. Proof. The outline of the proof is the same as that of Lemma 5.2. For input x ∈ {0, 1}n , the (x ) (1−x ) corresponding edge weight function wx is given by wx (ei i ) = 0 and wx (ei i ) = 1, where xi is the ith bit of x. We define algorithm B as follows. On input x ∈ {0, 1}n , apply A to (G, wx ), and let T be the (0) tree produced. Define y ∈ {0, 1}n by setting yi = 0 if ei ∈ T and yi = 1 otherwise. Output y. It is straightforward to verify that B is (2ǫ, (1 + eǫ )δ)-differentially private. We now bound the expected Hamming distance of x and y. The minimum spanning tree in G has weight 0, so the (1−x ) expected weight of T is at most α and T must consist of at most α edges ei i . But yi 6= xi only (1−x ) if ei i ∈ T , so in expectation dH (x, y) ≤ w(T ) ≤ α. We now complete the proof of Theorem B.1. Proof of Theorem B.1. Assume that there is some (ǫ, δ)-differentially private algorithm which on all inputs produces a spanning tree with expected weight less than α more than optimal. By Lemma B.2, there is a (2ǫ, (1 + eǫ )δ)-differentially private algorithm which for all x ∈ {0, 1}n produces y ∈ {0, 1}n with expected Hamming distance less than α. But then Lemma 5.4, for some x the ǫ )δ) = α, yielding a contradiction. expected Hamming distance E(dH (x, y)) ≥ n(1−(1+e 1+e2ǫ 20 We now show that the Laplace mechanism (Lemma 3.2) almost matches this lower bound. Theorem B.3. For any ǫ, γ > 0 and G = (V, E), there is an algorithm A that is ǫ-differentially private on G that on input w : E → R releases with probability 1 − γ a spanning tree of weight at most ((V − 1)/ǫ) log(E/γ) larger than optimal. Proof. Consider the algorithm that adds noise Xe distributed according to Lap(1/ǫ) for each edge e ∈ E and releases the minimum spanning tree on the resulting graph (G, w′ ). This is ǫ-differentially private, since it is post-processing of the Laplace mechanism. We now show that the resulting error is small. By a union bound, with probability 1 − γ we have that |Xe | ≤ (1/ǫ) log(E/γ) for every e ∈ E. Consequently, conditioning on this event, if T is the spanning tree released by the algorithm and T ∗ is the minimum spanning tree, then we have that V −1 · log(E/γ) ǫ V −1 · log(E/γ) ≤ w′ (T ∗ ) + ǫ 2(V − 1) ≤ w(T ∗ ) + · log(E/γ). ǫ w(T ) ≤ w′ (T ) + B.2 Low-weight matching We now consider the problem of releasing a minimum weight matching in a graph in our model. As for the minimum spanning tree problem, a minor modification of the lower bound for shortest paths from Section 5.1 yields a similar result. For comparison, [HHR+ 14] use similar reconstruction techniques to obtain a lower bound for a matching problem on bipartite graphs in a somewhat different model in which all edge weights are in [0, 1] and neighboring graphs can differ on the weights of the edges incident to a single left vertex. We show a lower bound of Ω(V ) for the error of releasing a low-weight matching tree, and show that the matching released by the Laplace mechanism has weight O(V log V ) greater than optimal. The theorems in this section are stated for the problem of finding a minimum weight perfect matching. We can also obtain identical results for the problem of finding a minimum weight matching which is not required to be perfect, and for the corresponding maximum weight matching problems. Our results apply to both bipartite matching and general matching. Note that in this section edge weights are permitted to be negative. Theorem B.4. There exists a graph G = (V, E) such that for any perfect matching algorithm A which is (ǫ, δ)-differentially private on G, there exist edge weights w : E → {0, 1} such that the expected weight of the matching A(w) is at least     1 − (1 + eǫ )δ V · α= 4 1 + e2ǫ larger than the weight of the min-cost perfect matching. In particular, for sufficiently small ǫ, δ, α ≥ 0.12 · V . 21 The following lemma reduces the problem of reidentification in a database to finding a low-cost matching. Let G = (V, E) be the 4n-vertex graph with vertex set V = {(b1 , b2 , c) : b1 , b2 ∈ {0, 1}, c ∈ [n]} and edges from (0, b, c) to (1, b′ , c) for every b, b′ ∈ {0, 1}, c ∈ [n]. That is, G consists of n disconnected hourglass-shaped gadgets as shown in Figure 3. Lemma B.5. Let G = (V, E) be the graph defined in the previous paragraph. For any α, let A be an algorithm that is (ǫ, δ)-differentially private on G that on input w : E → {0, 1} produces a perfect matching of expected weight at most α greater than optimal. Then there exists a (2ǫ, (1 + eǫ )δ)differentially private algorithm B which on input x ∈ {0, 1}n produces y ∈ {0, 1}n with expected Hamming distance to x at most α. Proof. For any input x ∈ {0, 1}n , the corresponding weight function wx assigns weight 1 to the edge connecting vertex (0, 1, i) to (1, 1 − xi , i) for each i ∈ [n], and assigns weight 0 to the other 3n edges. The algorithm B is as follows. On input x ∈ {0, 1}n , apply A to (G, wx ), and let M be the matching produced. Define y ∈ {0, 1}n as follows. Let yi = 0 if the edge from (0, 1, i) to (1, 0, i) is in the matching, and yi = 1 otherwise. Output y. Algorithm B is clearly (2ǫ, (1 + eǫ )δ)-differentially private. We will have that yi 6= xi only if the edge from (0, 1, i) to (1, 1 − xi , i) is in the matching, so the expected Hamming distance is at most the expected size of the matching produced by A, which is at most α. We now conclude the proof of Theorem B.4. Proof of Theorem B.4. The result follows by combining Lemma B.5 with Lemma 5.4. Using the Laplace mechanism (Lemma 3.2), we obtain a nearly-matching upper bound. Theorem B.6. For any ǫ, γ > 0 and G = (V, E) containing a perfect matching, there is an algorithm A that is ǫ-differentially private on G that on input w : E → R releases with probability 1 − γ a perfect matching of weight at most (V /ǫ) log(E/γ) larger than optimal. Proof. Consider the algorithm that adds noise Xe distributed according to Lap(1/ǫ) for each edge e ∈ E and releases the minimum-weight perfect matching on the resulting graph (G, w′ ). This is ǫ-differentially private, since it is post-processing of the Laplace mechanism. We now show that the resulting error is small. With probability 1 − γ we have that |Xe | ≤ (1/ǫ) log(E/γ) for every e ∈ E. Consequently, conditioning on this event, if M is the matching released by the algorithm and M∗ is the minimum-weight matching, then we have that V · log(E/γ) 2ǫ V ≤ w′ (M∗ ) + · log(E/γ) 2ǫ V ≤ w(M∗ ) + · log(E/γ). ǫ w(M) ≤ w′ (M) + 22
8cs.DS
Linear Modeling of a Flexible Substructure Actuated through Piezoelectric Components for Use in Integrated Control/Structure Design J. Alvaro PEREZ ∗ Thomas LOQUEN ∗∗ Daniel ALAZARD ∗∗∗ Christelle PITTET ∗∗∗∗ arXiv:1602.07591v1 [cs.SY] 24 Feb 2016 ∗ ONERA System Control and Flight Mechanics Department, Toulouse, 31000 France (e-mail: Jose-Alvaro.Perez [email protected] ∗∗ ONERA System Control and Flight Mechanics Department, Toulouse, 31000 France (e-mail: [email protected] ∗∗∗ ISAE System Control Department, Toulouse, 31000 France (e-mail: [email protected] ∗∗∗∗ CNES AOCS Department, Toulouse, 31000 France (e-mail: [email protected] Abstract This study presents a generic TITOP (Two-Input Two-Output Port) model of a substructure actuated with embedded piezoelectric materials as actuators (PEAs), previously modeled with the FE technique. This allows intuitive assembly of actuated flexible substructures in large flexible multi-body systems. The modeling technique is applied to an illustrative example of a flexible beam with bonded piezoelectric strip and vibration attenuation of a chain of flexible beams. Keywords: Finite Element, Piezoelectric actuators and sensors (PEAs), Multi-body Flexible Structures, Flexible Structures Control, TITOP modeling 1. INTRODUCTION Piezoelectric actuators and sensors (PEAs) have been widely used in the field of system control design of large flexible structures. However, the design of control systems involving PEAs requires an accurate knowledge of the electro-mechanical behaviour of the system for vibration dynamics, transfers between the inputs and the outputs and non-linear effects such as hysteresis and creep effect. In order to integrate PEAs in the controlled structure, a design procedure including virtual prototyping of piezoelements integrated with the structure needs to be developed. Macroscopic PEAs models are divided in two main categories. In the first category, the behaviour of a PEAs is decoupled in several contributions such as hysteresis, vibration dynamics and creep based on physical laws. The most well-known model structure of PEAs is the electromechanical model proposed in ?, in which all effects are taken into account. In this category, other models only consider vibration dynamics with Finite Element (FE) models (?) or static behaviour (?). The second category does not decouple the different behaviours of the PEA, all effects are considered simoultaneously. However, they are only accurate over small frequency ranges, what seriously limit their usage. This study presents a PEAs modelisation technique that allows considering piezoelectric actuated flexible substructures linked with other substructures. Based on the TITOP approach explained in ?, ? and ?, the method casts in state-space form the FE model of an actuated flexible substructure in order to consider the acceleration-loads transfer within a flexible-multibody system. Section 2 introduces the main equations of a piezoelectric FE model. then, Section 3 explains how to obtain the Two-Input TwoOutput Port(TITOP) model through Component Modes Synthesis (CMS) and the double-port approach. Then, an application for a beam with bonded piezoelectric strip is illustrated. Finally, application to vibration attenuation of a chain of flexible beams is performed and conclusions are stated. 2. FINITE ELEMENT MODELING OF A PIEZOELECTRIC COMPONENT As stated in ?, the constitutive linear equations of an element piezoelectric material read:   T {T } = cE {S} − [e] {E}   {D} = [e] {S} + S {E} (1) (2) where {T } is the stress vector, {S} the deformation vector,{E} the electric field, {D} the electric displacement, [c] the elasticity constants matrix, [] the dielectric constants matrix, [e] the piezoelectric constants, with su- perscripts E , S and and T respectively. T indicating static conditions for E, S The dynamic equations of a piezoelectric continuum can be discretized in elements and written in the finite element formulation as follows: [Mqq ] {q̈} + [Kqq ] {q} + [Kqφ ] {φ} = {f } (3) [Kφq ] {q} + [Kφφ ] {φ} = {γ} (4) " Mnn Mnc Mnr Mcn Mcc Mcr Mrn Mrc Mrr " Knv + Kcv Krv #  v = # (uu ( [Muu ] {ü} + [Kuu ] {u} + [Kuv ] {v} = {F } (5) [Kvu ] {u} + [Kvv ] {v} = {g} (6) where the global coordinates {u}, the global applied voltage {v}, the electric charge {g} and external forces {F } are now related through the global mass matrix, [Muu ], the global stiffness matrix, [Kuu ], the piezoelectric coupling matrix [Kuv ] and the capacitance matrix [Kvv ]. 3. TITOP MODELING OF THE PIEZOELECTRIC COMPONENT The Two-Input Two-Output Port (TITOP) model of the piezoelectric component is obtained through the application of the Component Modes Synthesis (CMS) transformation to Eqns. (5) and (6), then casting the resulting transformation into a state-space representation for the desired inputs-outputs. 3.1 Component Modes Synthesis Transformation The Component Modes Synthesis transformation allows separating the different contributions of elastic body displacements into rigid body, redundant boundaries and internal elastic displacements. The resulting equations are easier to manipulate since rigid-body and elastic displacements appear uncoupled in the transformed stiffness matrix. The fundamentals of Component Modes Synthesis were stated by ? in 1965 and then recalled later by ?, the reader might head to those references if more information about CMS is desired. The global coordinates {u} are then partitioned into three main sets: rigid-body coordinates, r, redundant boundary coordinates, c, and fixed-constraint coordinates, n. Applying this division, Eqns. (5) and (6) result: ) Fn Fc + F̃c Fr + F̃r " Knn Knc Knr + Kcn Kcc Kcr Krn Krc Krr ) # uu ( un uc ur ) + (7)  Kvn Kvc Kvr where the element coordinates {q}, the applied voltage {φ}, the electric charge {γ} and external forces {f } are related through the element mass matrix, [Mqq ], the element stiffness matrix, [Kqq ], the piezoelectric coupling matrix [Kqφ ] and the capacitance matrix [Kφφ ]. Upon carrying out the assembly of each piezoelectric element, we get the global system of equations: ün üc ür ( )  un uc ur  + Kvv  v  = Q (8) where [M ], [K], {u} and {F } have been partitioned into their contributions to rigid-body, redundant boundaries and fixed-boundary displacements. The “tilde” load term, F̃r and F̃c , denotes the force resulting from the connection to adjacent structures at the boundary points. In CMS, physical displacements can be expressed in terms of generalized coordinates by the Rayleigh-Ritz coordinate transformation ?: ( ) ( ) " #( ) un ηn φnn φnc φnr ηn uc = [Φ] ηc = 0cn Icc φcr ηc ur ηr 0rn 0rc Irr ηr (9) where the component-mode matrix [Φ] is a matrix of preselected component modes including: fixed-constraint modes,n, redundant boundary modes, c, and rigid-body T modes, r. Pre-multiplying by [Φ] , substituting Eqn. (9) into Eqns. (7) and (8) and considering that neither interior forces nor external forces apply (Fn = Fc = Fr = 0), Eqn. (7) yields: " M̂nn M̂nc M̂nr M̂cn M̂cc M̂cr M̂rn M̂rc M̂rr " K̂nv + K̂cv K̂rv #  v  = # ηη ( ( ) η̈n η̈c η̈r K̂nn 0nc 0nr + 0cn K̂cc 0cr 0rn 0rc 0rr 0 F̃c F̃r + φT cr F̃c K̂nv K̂cv K̂rv " ) ( )  ηn ηc ηr  + Kvv #  v ηη = ( )  ηn ηc ηr G + (10) (11) with the new coupling matrix coefficients: K̂nv = φnn Knv (12) K̂cv = Kcv + φcn Knv K̂rv = Krv + φrc Kcv + φrn Knv (13) (14) Equations (10) and (11) are the most generalized expression for a FE model of a piezoelectric component transformed through the CMS method. Section 3.2 will show how to take advantage of this form in order to simply model an accurate piezoelectric component for control of flexible multi-body systems. 3.2 Actuated TITOP State-Space Realization The purpose of a TITOP state-space realization of Eqns. (10) and (11) is to model the piezoelectric component as a substructure connected with two different structures in chain-like assembly through two connection points, P üP = g  q̈P θ̈P  üQ =  q̈Q θ̈Q  FQ/A,Q = piezo ~ya fQ/A tQ/A,Q  Q ~xa v P P ~za Equation (16) implies that the rigid motion is supported by point P and the constrained motion of connection point Q is a result of the rigid body motion in P transported to point Q (φcr η̈r ) plus the constrained motion due to flexibility (η̈c ). Q A A  FA/Q,Q =  fA/Q tA/Q,Q  In the same way, loads are received and transmitted by appendage A with the following directions: FA/P,P = −F̃r Figure 1. Illustration of a generic substructure with bonded piezoelectric material and Q. This is useful in order to consider the actuation provoked by the piezoelectric component to the rest of the structure, modeled as a flexible multibody system. As shown in Fig. 1, the flexible piezoelectric component A is linked to the parent structure P at the point P and to a child substructure Q at the point Q. It is assumed that the only external loads applied to A are the interactions with P at point P and with Q at point Q, as hypothesis on Eqn. (10) states. Voltage v can be applied to the piezo in order to provoke a electric field, and the electric charge g is an available measure. The main problem is how to consider the electromechanical coupling between P, A, Q and electric states. The mechanical overlapping between substructures is expressed as an acceleration-load transfer through the common boundaries, called the double-port approach, proposed by ? and ?. With this approach, both points, P and Q, suffer an acceleration-load transfer, in such a way that the acceleration is transferred to the next substructure in the chain (Q in this case) and the load is transmitted to the previous substructure in the chain ( the parent P structure). Using the relations given in Eqns. (16) and (17) in combination with Eqn. (10), a state-space representation can be obtained for the piezoelectric component A:     ( ) η̇n  η       n  FQ/A,Q   η̇c ηc   üP =A +B      η̈n   η̇n    v   η̈c η̇c A GP,Q (s) (18)     ) ( ) ( η n       FQ/A,Q üQ   η c  üP  FA/P,P = C + (D + Dδ )     η̇n   gc v η̇c where A, B, C, D and Dδ are the short hand notation of the following state-space matrices: A= üQ FA/P,P g ) ( )  A  FQ/A,Q üP = GP,Q (s) v üP = η̈r üQ = η̈c + φcr η̈r (16) 0n+c In+c −1 −1 D̂Q K̂Q −M̂Q −M̂Q  (19)   0n+c,c+r+v  B =  −1 0nc −M̂nr −K̂nv  M̂Q Icc −M̂cr −K̂cv i h  −1 −1 [0cn Icc ] −M̂Q D̂Q K̂Q −M̂Q  i  h −1  −1 C=  M̂rn M̂rc M̂Q K̂Q M̂Q D̂Q    K̂vn K̂vc [In+c,n+c 0n+c,n+c ]    −1 0nc −M̂nr −K̂nv I [0 ] M̂ cn cc Q  Icc −M̂cr −K̂cv        D= −1 0nc −M̂nr −K̂nv   M̂rn M̂rc M̂Q I −M̂ −K̂  cc cr cv 0vc 0vr Kvv  (15) Therefore Eqn. (15) relates the accelerations suffered at connection point P , loads at connection point Q and the applied voltage v to the acceleration at connection point Q, transmitted force to the previous substructure P and the measured electric charge g. An assignment of the different degrees of freedom is performed in order to distribute the acceleration-load transfer: rigid-body displacements are those of connection point P and the redundant constraint displacements those of connection point Q. Thus the accelerations read:   A generalization of the double-port approach is presented in this study for the piezoelectric FE CMS transformation. The existing electro-mechanical coupling between loadsaccelerations and voltage-charge is considered through the augmentation of the classic double-port model with an additional electric input, the applied voltage v, and with an additional output, the electric charge, g, such that: ( (17) FQ/A,Q = F̃c with     M̂nn M̂nc K̂nn 0nc ; K̂Q = ; M̂cn M̂cc 0cn K̂cc     0cc φcr 0cv D̂nn 0nc D̂Q = ; Dδ = −φTcr M̂rr K̂rv  ; 0cn D̂cc 0 0 0 (20) (21) (22) M̂Q = vc vr (23) vv Equation (18) with Eqns. (19), (20), (21),  (22) and (23) form the double-port model, GA P,Q (s) , of the flexible piezoelectric component A in chain-like assembly, called actuated Two-Input Two-Output Port (TITOP) v üP Fpiezo/ext,P same geometrical properties as the piezoelectric strip but denoted without the p subindex: t,w,E,ρ and I. Since the üQ piezoelectric laminate is glued to the beam, the mass and Fext/piezo,Q stiffness matrices of a beam element can be obtained as a sum of the contributions of the beam and the piezoelectric material. Thus: GA P,Q(s) gc Figure 2. Block diagram of TITOP modeling of a substructure actuated with piezoelectric materials wp qy1 θy1 qy2 tp θy2 t qx1 l qx2 [Mqq ] = [Mqq ]beam + [Mqq ]piezo (24) [Kqq ] = [Kqq ]beam + [Kqq ]piezo (25) The matrices of Eqns. (24) and (25) are detailed in Appendix A, obtained with classical FE decomposition with beam elements. With further FE decomposition to the piezoelectric strip, the following coupling matrix and capacitance matrix are obtained: w  Figure 3. Beam element with bonded piezoelectric strap model. This model allows to interconnect different flexible substructures in chain-like assembly taking into account flexible motions. A simplified scheme of the TITOP model is shown in Fig. 2. In the 6 degrees of freedom case with one  piezoelectric strip, GA P,Q (s) , of the flexible substructure A is a 13 × 13 transfer matrix (that is, r = 6, v = 1, c = 6, g = 1). It should be noticed that the measured charge is denoted gc and not g because only relative displacement between connection point P and connection point Q is measured for the sake of input/output simplicity. The physical interpretation of Eqn. (18) is as follows. The rigid-body displacements of the appendage A are transmitted by its connection point P through the whole of the appendage, and this excites the fixed-boundary natural modes (the modes obtained when clamping the appendage at point P and the modal participation ma Q) through  trices, M̂rn and M̂rc , and thus the constraint point Q. These natural modes produce a load transmitted to substructure P modifying the load that appendage A will induce to P, which depends on the load received at point Q, FQ/A,P , the acceleration received at point P , {üP } and the natural modes. In addition, voltage v modifies these transfers by increasing or reducing the transferred loads at P and Q, and the measured electric charge g responds to displacements changes either by mechanical interaction (through load application) or by electric field application (voltage). 4. MODELING APPLICATION As an illustrative example, let consider a beam linking two substructures at both ends with a piezoelectric strip which has been appropriately bonded to one side, as seen in Fig. 3. The thickness of the piezoelectric strip is tp , with a width denoted by wp , Young’s modulus Ep , density ρp and cross-section inertia Ip . The piezoelectric strip is used as an actuator by controlling the voltage v applied to the electrodes creating a constant electric field E3 = v/tp across the thickness of the laminate. The beam is modeled with a classic FE decomposition in several beam elements of length l. The beam has the −d31 Ep wp 0     tp    −d31 Ep wp (t + )   2 [Kqv ] =   d31 Ep wp     0  tp  d31 Ep wp (t + ) 2 [Kvv ] = wp l T ( − d231 Ep ) tp 33 (26) (27) where d31 is the piezoelectric constant under constant stress which relates the shrinkage observed in the direction 1 when an electric field E3 is applied along the direction of polarization 3. The coefficient T33 is the dielectric constant of the material. The global mass, stiffness, coupling and capacitance matrices are obtained by appending the elements matrices along the diagonal. Common node points between two points are simply added together. As an example the casting of stiffness matrices is given bellow for a 2 × 2 case:  1 1  k k12 [ Kqq ] = 11 ; 1 1 k21 k22 1  2 2  k k12 [Kqq ] = 11 → 2 2 k21 k22  1  1 k11 k12 0 1 1 2 2  → [Kuu ] = k21 k22 + k11 k12 2 2 0 k21 k22 2 (28) Obtaining the global piezoelectric coupling matrix is more complicated since it depends on the desired profile of voltages for the piezoelectric strips. If the same voltage is applied among all the strips then the assembly is straightforward:  1  k ; [Kqv ] = 1v 1 k2v   1  2  k1v k1v 1 2  [Kqv ] = 2 → [Kuv ] = k2v + k1v k2v 2 k2v (29)  1  1 [Kvv ] = kvv ;  2   1  2 2 [Kvv ] = kvv → [Kvv ] = kvv + kvv (30) 1 2 Transfer Functions Single-Voltage FQ=A ! g Transfer Functions Single-Voltage v ! FA=P From: piez Fe To: piez Char1 From: piez V ol1 To: piezFr y -50 0 y g F Q=A y g M Q=A z F y A=P v M z A=P v -20 -100 Magnitude (dB) Magnitude (dB) -40 -150 -200 -60 -80 -250 -100 -300 10 0 10 1 10 2 10 3 10 4 10 5 10 6 -120 10 0 10 7 10 1 Frequency (Hz) Figure 4. Transfer functions between applied loads at Q (vertical force and torque) and measured electric charge 10 2 10 3  1  1 [Kvv ] = kvv ;  1   2  k1v1 0 k 2 2 1 2  [Kqv2 ] = 1v → [Kuv ] = k2v k1v 2 1 2 k2v 2 2 0 k2v 2 (31)  1   2  kvv 0 2 [Kvv ] = kvv → [Kvv ] = 2 0 kvv (32) In this last case, the applied voltage is a vector containing the different voltages applied along the assembled beam, whereas in the first case voltage is a scalar. The second option might be more suitable when more effectiveness of the actuator is required. After FE assembly, the complete FE model of the beam with bonded piezoelectric material is obtained. CMS is applied to the FE model as seen in Section 3.1 and the TITOP model is obtained following the indications in Section 3.2. Figures 4 and 5 show the frequency response of a beam with piezoelectric strip discretised in 3 elements and properties extracted from the data of Table B.1. The first resonant frequency appears at 68 Hz, fast enough for the majority of large flexible systems. 5. CONTROL APPLICATION As an illustrative example of applications on control of flexible structures, let consider vibration attenuation of two flexible beams in chain-like assembly with the same properties as the one modelised in Section 4. The two flexible beams can be actuated with piezoelectric strips bonded at their surface as seen in Fig. 3, and their TITOP assembly is performed as depicted in Fig. 6. After assembly, vibration attenuation is addressed with a rate feeback between the integration of the acceleration at the end of Beam II, q̈, and the voltage applied at 10 5 10 6 10 7 Figure 5. Transfer functions between applied voltage and loads transmitted at P (vertical force and torque) q̈Base/BeamI FBeamI/Base However, if a different voltage is applied for each strip on each element then one has:  1  k 1 1 [Kqv1 ] = 1v ; 1 k2v 1 10 4 Frequency (Hz) v1 g1 BEAM I q̈BeamI/BeamII Fext/BeamI v2 FBeamII/BeamI BEAM II g2 q̈BeamII/NextSubstructure Fext/BeamII K Figure 6. Assembly of two flexible beams actuated through piezoelectric components with TITOP modeling technique. Rate feedback through K ensures vibration attenuation. the piezoelectric strip in Beam I, v1 . Controller gain is tuned so that the first flexible mode is maximaly damped, which results in 0.2 damping ratio (see Fig. 7). Simulation of the system response to base acceleration excitation shows in Fig. 8 that vibrations at the end of Beam II are adequately attenuated when compared with the open loop response. Other controller inputs are possible, such as electric charges g1 and g2 and Beam I acceleration, but Beam II rate feedback acceleration was chosen since it offered more controllability. Therefore, the actuated TITOP model is a straightforward modeling tool for flexible structure control applications. Indeed, this model is used for piezoelectric component modelization in a Integrated Control/Structure Design of a Large Space Structure in ?. 6. CONCLUSIONS AND PERSPECTIVES This study has introduced a generic model for an actuated flexible structure with piezoelectric components. The model, derived from the finite element formulation, is an ACKNOWLEDGEMENTS Research efforts were supported by the kind financial support of the CNES AOCS Department and ONERA Flight Dynamics Department in Toulouse. 1600 1.5e+03 1400 1200 Appendix A. MASS AND STIFFNESS MATRICES 1e+03 1000 Im(s) Structure 800 600 500 400 Accelerometer 200 Controller 0 −300 −250 −200 −150 Re(s) −100 −50 0 Figure 7. Root locus of the rate feedback of the flexible beams. Control is targeted at mode 1 The mass and stiffness written as:  1 3  0    0 [Mqq ]piezo = ρp Ap l  1  6  0   0 1.2 Open Loop Rate Feedback Tip Acceleration (m/s2 ) [Kqq ]piezo 0.8 0.6 0.4 1 6 0 0 1 3 0 0 0 54 420 13 l 420 0 156 420 22 − l 420 Ap l 2 Ap l 2 0 0 −  I Ip  p  0 12 6l 0  Ep Ip  0 6l 4l2 0 = 3  2  A l Ap l 2 l  p 0 0 − I Ip p   0 −12 −6l 0 0 6l 2l2 0  0  13  − l 420  3 2  − l  420   0   22  − l 420  4 2  l 420 (A.1) 0 −12 −6l 0 12 −6l  0   6l   2l2    0    −6l 4l2 (A.2) t 0.2 0 -0.2 0 0 156 22 l 420 420 22 4 2 l l 420 420 0 0 54 13 l l 420 420 13 3 2 − l − l 420 420  Tip Acceleration repsonse to base acceleration 1 matrices of each piezo element are 0 5 10 15 20 25 30 35 40 45 Time (s) Figure 8. Tip response to base acceleration in open loop and with rate feedback controller extension of the TITOP modeling technique, which allows interconnection with different substructures through acceleration-load transfer among the connection points. Two applications of the actuated TITOP model have been presented: modeling of a beam with bonded piezoelectric strip and vibration attenuation of a chain of actuated flexible beams. The model has resulted useful and straightforward in both applications, modeling and control. Further research must be done in the future to improve the model including other piezoelectric effects such as histeris and creep. Other modules can be added in order to directly detect substructure displacements through electric charge measurement. This model will be used in different Integrated Control/Structure Design of Large Flexible Structures, such as in the study of ?. where Ip = wp tp (t2 + tp t + 2p ). The mass and stiffness matrices of each beam element are written as:   1 1 0 0 0 0 3  6  22 54 13   0 156 l 0 − l  420 420 420 420   22 4 2 13 3 2   l l 0 l − l  0 420 420 420 420  [Mqq ]beam = ρAl  1  1  0 0 0 0  6  3  13 156 22   0 54 l l 0 − l  420 420 420 420   13 3 2 22 4 2  0 − l − l 0 − l l 420 420 420 420 (A.3)  [Kqq ]beam Al2 Al2 0 0 −  I I  12 6l 0  0  EI  0 6l 4l2 0 = 3  2 Al2 Al l  0 0 −  I I  0 −12 −6l 0 0 6l 2l2 0  0 0   −12 6l   −6l 2l2    0 0   12 −6l −6l 4l2 (A.4) Note that the mass and stiffness matrices of the beam element are identical as the ones denoted in Eqs. (A.3) and (A.4) but substituting the piezoelectric strip parameters by those of the beam. Appendix B. BEAM PARAMETERS Table B.1. Beam Parameters Number of Elements Total length Element length Thickness Width Volumetric Density Elastic modulus Symbol n L l = L/n t w ρ E Value 3 0.50 m 0.17 m 9.53 mm 30.00 mm 2600 Kg/m3 60 GPa Piezo Parameters Number of Elements Element length Thickness Width Volumetric Density Elastic modulus Piezoelectric Constant Dielectric Constant Symbol n l = L/n tp wp ρp Ep d31 T 33 Value 0.5 0.17 m 2 mm 30 mm 7600 Kg/m3 50 GPa -150×10−12 m/V 1.59×10−12 F/m
3cs.SY
arXiv:1802.07309v2 [math.ST] 12 Mar 2018 Detection limits in the high-dimensional spiked rectangular model Ahmed El Alaoui∗ Michael I. Jordan† Abstract We study the problem of detecting the presence of a single unknown spike in a rectangular data matrix, in a high-dimensional regime where the spike has fixed strength and the aspect ratio of the matrix converges to a finite limit. This setup includes Johnstone’s spiked covariance model. We analyze the likelihood ratio of the spiked model against an “all noise” null model of reference, and show it has asymptotically Gaussian fluctuations in a region below—but in general not up to—the so-called BBP threshold from random matrix theory. Our result parallels earlier findings of Onatski et al. (2013) and Johnstone and Onatski (2015) for spherical spikes. We present a probabilistic approach capable of treating generic product priors. In particular, sparsity in the spike is allowed. Our approach is based on Talagrand’s interpretation of the cavity method from spin-glass theory. The question of the maximal parameter region where asymptotic normality is expected to hold is left open. This region is shaped by the prior in a non-trivial way. We conjecture that this is the entire paramagnetic phase of an associated spin-glass model, and is defined by the vanishing of the replica-symmetric solution of Lesieur et al. (2015a). 1 Introduction The problem of detecting a signal of low-rank structure buried inside a large noise matrix has received enormous attention in the past decade. Prominent examples of this problem include the so-called spiked or deformed ensembles from random matrix theory (Péché, 2014). It is particularly interesting to study such problems in the high-dimensional setting where the signal strength is comparable to the noise. This models practical situations in modern data analysis where one wishes to make more complex inferences about a fainter signal as the amount of data accrues. In this paper we are concerned with the problem of testing the presence of a single weak spike in the data against an “all-noise” null hypothesis of reference. Concretely we consider the observation of an N × M matrix of the form r β uv ⊤ + W , (1) Y = N where u and v are unknown factors and W is a matrix with i.i.d. noise entries, and we want to test whether β > 0 or β = 0. We will assume the noise is standard Gaussian. The parameter β represents the strength of the spike, and we assume a high-dimensional setting where M/N → α. The case u = v and W symmetric is referred to as the spiked Wigner model. When the factors are independent, model (1) can be viewed as a linear model with additive noise and scalar random design: yj = βvj u + wj , ∗ † Electrical Engineering & Computer Sciences, UC Berkeley, CA. Email: [email protected] Electrical Engineering & Computer Sciences, Statistics, UC Berkeley, CA. 1 p with 1 ≤ j ≤ M , β = β/N . Assuming vj has zero mean and unit variance, this is a model b = 1 PM yj y ⊤ is a of spiked covariance: the mean of the empirical covariance matrix Σ j j=1 M β rank-one perturbation of the identity: IN + N uu⊤ . The introduction of a particular spiked covariance model by Johnstone (2001)—one corresponding to the special case vj ∼ N (0, 1)—has provided the foundations for a rich theory of Principal Component Analysis (PCA), in which the performance of several important tests and estimators is by now well understood (see, e.g., Ledoit and Wolf, 2002; Paul, 2007; Nadler, 2008; Johnstone and Lu, 2009; Amini and Wainwright, 2009; Berthet and Rigollet, 2013; Dobriban, 2017). Parallel developments in random matrix theory have unveiled the existence of sharp transition phenomena in the behavior of the spectrum of the data matrix, where for a spike of strength above a certain spectral threshold, the top eigenvalue separates from the remaining eigenvalues which are packed together in a “bulk” and thus indicates the presence of the spike; below this threshold, the top eigenvalue converges to the edge of the bulk. See Péché (2006); Féral and Péché (2007); Capitaine et al. (2009); Benaych-Georges and Nadakuditi (2011, 2012) for results on low-rank deformations of Wigner matrices, and Baik et al. (2005); Baik and Silverstein (2006); Bai and Yao (2012, 2008) for results on spiked covariance models. More recently, an intense research effort has been undertaken to pin down the fundamental limits for both estimating and detecting the spike. In a series of papers (Korada and Macris, 2009; Krzakala et al., 2016; Barbier et al., 2016; Deshpande et al., 2016; Lelarge and Miolane, 2017; Miolane, 2017), the error of the Bayesoptimal estimator has been completely characterized for additive low-rank models with a separable (product) prior on the spike. In particular, these papers confirm an interesting phenomenon discovered by Lesieur et al. (2015a,b), based on plausible but non-rigorous arguments: for certain priors on the spike, estimation becomes possible—although computationally expensive—below the spectral threshold β = 1. More precisely, the posterior mean overlaps with the spike in regions where the top eigenvector is orthogonal to it. Lesieur et al. (2017) provides a full account of these phase transitions in a myriad of interesting situations, the majority of which still await rigorous treatment. As for the testing problem, Onatski et al. (2013, 2014) and Johnstone and Onatski (2015) considered the spiked covariance model for a uniformly distributed unit norm spike, and studied the asymptotics of the likelihood ratio (LR) of a spiked alternative against a spherical null. They showed that the log-LR is asymptotically Gaussian below the spectral threshold αβ 2 = 1 (which in this setting is known as the BBP threshold, after Baik et al., 2005), while it is divergent above it. However their proof is intrinsically tied to the assumption of a spherical prior. Indeed, by rotational symmetry of the model, the LR depends only on the spectrum, the joint distribution of which is available in closed form. A representation of the LR in terms of a contour integral is then possible (in the single spike case), which can then be analyzed via the method of steepest descent. In a similar but unrelated effort, Baik and Lee (2016, 2017a,b) studied the fluctuations of the free energy of spherical, symmetric and bipartite versions of the Sherrington–Kirkpatrick (SK) model. This free energy coincides with the log-LR associated with the model (1) for a choice of parameters. The sphericity assumption is again key to their analysis, and both approaches require the execution of very delicate asymptotics and appeal to advanced results from random matrix theory. In this paper we consider the case of separable priors: we assume that the entries of u and v are independent and identically distributed from base priors Pu and Pv , respectively, both having bounded support1. We prove fluctuation results for the log-LR in this setting 1 Boundedness is required for technical reasons. This rules out the case where one factor is Gaussian. 2 with entirely different methods than used for spherical priors. In particular, our proof is more probabilistic and operates through general principles. The tools we use come from the mathematical theory of spin glasses (see Talagrand, 2011a,b). Let us further mention that the region of parameters (α, β) we are able to cover with our proof method is optimal when (and only when) Pu and Pv are both symmetric Rademacher. In Section 6, we formulate a conjecture on the maximal region in which the log-LR has asymptotically Gaussian fluctuations. This region is of course below the BBP threshold, but does not extend up to it in general. 2 Main results Throughout this paper, we assume that the priors Pu and Pv have zero mean, unit variance, and supports bounded in radius by Ku and Kv respectively. Let Pβ be the probability distribution of the matrix Y as per (1). Define L(·; β) to be the likelihood ratio, or Radon-Nikodym derivative of Pβ with respect to P0 : L(·; β) ≡ d Pβ . d P0 For a fixed Y ∈ RN ×M , by conditioning on u and v, we can write Z Xr β β 2 2  ⊗N Yij ui vj − u v dPu (u)dPv⊗M (v). L(Y ; β) = exp N 2N i j i,j Our main contribution is the following asymptotic distributional result. Theorem 1. Let α, β ≥ 0 such that Ku4 Kv4 αβ 2 < 1. Then in the limit N → ∞ and M/N → α,     1 1 2 2 log L(Y ; β) N ± log 1 − αβ , − log 1 − αβ , 4 2 where “ ” denotes convergence in distribution. The sign of the mean is + under the null Y ∼ P0 and − under the alternative Y ∼ Pβ . We mention that fluctuations of this sort were first proved by Aizenman et al. (1987) in a seminal paper in the context of the SK model. A consequence of either one of the above statements and Le Cam’s first lemma (Van der Vaart, 2000, Lemma 6.4) is the mutual contiguity2 between the null and the spiked alternative: Corollary 2. For Ku4 Kv4 αβ 2 < 1, the families of distributions P0 and Pβ (indexed by M, N ) are mutually contiguous in the limit N → ∞, M/N → α. Contiguity implies impossibility of strong detection: there exists no test that, upon observing a random matrix Y with the promise that it is sampled either from P0 or Pβ , can tell which is the case with asymptotic certainty in this regime. We also mention that contiguity can be proved through the second-moment method and its conditional variants, as was done by Montanari et al. (2015); Perry et al. (2016); Banks et al. (2017) for closely related models. 2 Two sequences of probability measures (Pn ) and (Qn ) defined on the same (sequence of) measurable space(s) are said to be mutually contiguous if Pn (An ) → 0 is equivalent to Qn (An ) → 0 as n → ∞ for every sequence of measurable sets (An ). 3 However, identifying the right event on which to condition in order to tame the second moment of L is a matter of a case-by-case deliberation. Study of the fluctuations of the log-LR appears to provide a more systematic route: the logarithm has a smoothing effect that kills the wild (but rare) events that otherwise dominate in the second moment. This being said, our result is optimal only in one special case: When Pu and Pv are symmetric Rademacher, Ku = Kv = 1, and Theorem 1 covers the entire (α, β) region where such fluctuations hold. Indeed, for αβ 2 > 1, one can distinguish Pβ from P0 by looking at the top eigenvalue of the empirical covariance matrix Y Y ⊤ (Benaych-Georges and Nadakuditi, 2012). So the conclusion of Theorem 1 cannot hold in light of the above contiguity argument. Beyond this special case, our result is not expected to be optimal. Limits of weak detection Since contiguity implies that testing errors are inevitable, it is natural to aim for tests T : RN ×M 7→ {0, 1} that minimize the sum of the Type-I and Type-II errors: err(T ) = P0 (T (Y ) = 1) + Pβ (T (Y ) = 0) . By the Neyman-Pearson lemma, the test minimizing the above error is the likelihood ratio test that rejects the null iff L(Y ; β) > 1. The optimal error is thus err∗M,N (β) = P0 (log L(Y ; β) > 0) + Pβ (log L(Y ; β) ≤ 0) = 1 − DTV (Pβ , P0 ). The symmetry of the means under the null and the alternative in Theorem 1 implies that the above Type-I and Type-II errors are equal, and that the total error has a limit: Corollary 3. For α, β ≥ 0 such that Ku4 Kv4 αβ 2 < 1, lim err∗M,N (β) N →∞ M/N →α where erfc(x) = √2 π R∞ x =1− lim DTV (Pβ , P0 ) = erfc N →∞ M/N →α   1p − log (1 − αβ 2 ) , 4 2 e−t dt is the complementary error function. Furthermore, our proof of Theorem 1 allows us obtain the convergence of the mean (actually, all moments of log L) under Pβ , which corresponds to the Kullback-Liebler divergence of Pβ to P0 : Proposition 4. For all α, β ≥ 0 such that Ku4 Kv4 αβ 2 < 1,  1 lim DKL (Pβ , P0 ) = − log 1 − αβ 2 . N →∞ 4 M/N →α 3 Replicas, overlaps, Gibbs measures and Nishimori A crucial component of the proof involves understanding the convergence properties of certain overlaps between “replicas.” To embark on the argument let us introduce some important notation and terminology. Let H : RN +M → R be the (random) function, which we refer to as a Hamiltonian, defined as r X β β 2 2 Yij ui vj − u v , (2) − H(u, v) = N 2N i j i,j 4 where Y = (Yij ) comes from Pβ or P0 . Letting ρ denote the product measure Pu⊗N ⊗ Pv⊗M , we have Z L(Y ; β) = e−H(u,v) dρ(u, v). Let us define the Gibbs average of a function f : (RN +M )n 7→ R of n replica pairs (u(l) , v (l) )nl=1 with respect to the Hamiltonian H as R Qn −H(u(l) ,v(l) ) f l=1 e dρ(u(l) , v (l) ) R n . (3) hf i = e−H(u,v) dρ(u, v) This is the mean of f with respect to the posterior distribution of (u, v) given Y : Pβ (·|Y )⊗n . We interpret the replicas as random and independent draws from this posterior. When Y ∼ Pβ we also allow f to depend on the spike pair (u∗ , v ∗ ). For two different replicas (u(l) , v (l) ) and ′ ′ (u(l ) , v (l ) ) (l′ is allowed to take the value ∗) we denote the overlaps of the u and v parts, both normalized by N , as u Rl,l ′ = N 1 X (l) (l′ ) ui ui N and i=1 3.1 v Rl,l ′ = M 1 X (l) (l′ ) vj vj . N j=1 The Nishimori property under Pβ Let’s perform the following experiment: 1. Construct u∗ ∈ RN and v ∗ ∈ RM by independently drawing their coordinates from Pu and Pv respectively. q β ∗ ∗⊤ 2. Construct Y = + W , where Wij ∼ N (0, 1) are all independent. (Y is Nu v distributed according to Pβ .) 3. Draw n + 1 independent random vector pairs, (u(l) , v (l) )n+1 l=1 , from Pβ ((u, v) ∈ ·|Y ). By the tower property of expectations, the following equality of joint laws holds     d Y , (u(1) , v (1) ), · · · , (u(n+1) , v (n+1) ) = Y , (u(1) , v (1) ), · · · , (u(n) , v (n) ), (u∗ , v ∗ ) . (4) u , Rv ) between This in particular implies that under the alternative Pβ , the overlaps (R1,∗ 1,∗ u , Rv ) between two replica and spike pairs have the same distribution as the overlaps (R1,2 1,2 replica pairs. This is a very important property of the planted (spiked) model, which is usually named after Nishimori (2001). It allows for manipulations that are not possible under the null. u )2 i → 0, For instance, to prove the convergence of the overlap between two replicas, Eh(R1,2 u )2 i → 0 since the two quantities are equal. The latter turns out to it suffices to prove Eh(R1,∗ be a much easier task. 3.2 Overlap decay implies super-concentration Let us now explain how the behavior of the overlaps is related to the fluctuations of log L. For concreteness we consider the null model as an example. Let Y ∼ P0 , i.e., Yij ∼ N (0, 1) all independent. The log-likelihood ratio, seen as a function of Y , is a differentiable function, and r β d log L(Y ; β) = hui vj i. dYij N 5 By the Gaussian Poincaré inequality, we can bound the variance by the norm of the gradient as h i   u v E (log L − E log L)2 ≤ E k∇ log Lk2ℓ2 = βN EhR1,2 R1,2 i. (1) (1) (2) (2) The last equality follows from the fact hui vj i2 = hui vj ui vj i. Since our priors have u Rv by M K 2 K 2 , and we deduce that the variance bounded support, we can already bound R1,2 u v 1,2 N is O(N ). In fact, by the Maurey-Pisier inequality (Pisier, 1986, Theorem 2.2), we can control u Rv i. This implies sub-Gaussian the moment generating function of log L by that of N hR1,2 1,2 u Rv i decays, then the concentration of the former. Observe now that if the quantity EhR1,2 1,2 much stronger result var(log L) = O(N ) holds. This behavior of unusually small variance is often referred to as “super-concentration.” See Chatterjee (2014) for more on this topic. In u Rv i decay when α and β are sufficiently small, but it does so our case, not only does EhR1,2 1,2 u Rv i converges to a finite limit, and var(log L) is constant. at a rate of 1/N so that N EhR1,2 1,2 This is a first reason why Theorem 1 should be expected: if anything, the fluctuations must be of constant order. 4 Proof of Theorem 1 It suffices to prove the fluctuations under one of the hypotheses. Fluctuations under the remaining one comes for free as a consequence of Le Cam’s third lemma (or more specifically, the Portmanteau theorem Van der Vaart, 2000, Theorem 6.6). For the reader’s convenience, we present this argument in Appendix A. We choose to treat the planted case Y ∼ Pβ . The reason is that we are able to achieve control on the overlaps and show their concentration under the alternative in a wider region of parameters (α, β) than under the null. This is ultimately due to the (generalized) Nishimori property (4). We will show the convergence of the characteristic function of log L to that of a Gaussian. Let µ = − 41 log(1 − αβ 2 ), σ 2 = − 21 log(1 − αβ 2 ), and let φ be the characteristic function of 2 the Gaussian distribution N (µ, σ 2 ): for s ∈ R and i2 = −1, let φ(s) = exp{isµ − σ2 s2 }. The following is a more quantitative convergence result that implies Theroem 1. Theorem 5. Let s ∈ R and α, β ≥ 0. There such that for √ exists K = K(s, α, β, Ku , Kv ) 2< ∞ 4 M, N sufficiently large and M = αN + O( N ), the following holds. If αβ Ku Kv4 < 1, then i h K EPβ eis log L(Y ;β) − φ(s) ≤ √ . N Our approach is to show that the function i h φN (β) = EPβ eis log L(Y ;β) (for s ∈ R fixed) is an approximate solution to a differential equation whose solution is the characteristic function of the Gaussian. Lemma 6. For all β ≥ 0, it holds that h i is − s2 d u v φN (β) = N E R1,2 R1,2 eis log L . dβ 2 6 (5) Proof. Since Y ∼ Pβ , we can rewrite the Hamiltonian (2) as r X β β 2 2 Yij ui vj − u v , −H(u, v) = N 2N i j i,j r X β β β 2 2 = Wij ui vj + ui vj u∗i vj∗ − u v . N N 2N i j i,j We take a derivative with respect to β:    d dH is log L φN (β) = is E − e dβ dβ i h h i X 1 1 is log L 2 2 is log L √ − E Wij hui vj i e E ui vj e = is 2N 2 βN i,j i 1 X h + is E ui vj u∗i vj∗ eis log L . N i,j ind. u Rv ieis log L ]. As for the first term, since W The last term is equal to isN E[hR1,∗ ij ∼ N (0, 1), 1,∗ we use Gaussian integration by parts to obtain   i h d  is log L is log L hui vj i e =E E Wij hui vj i e dWij r  h i i h i h β E u2i vj2 eis log L − E hui vj i2 eis log L + is E hui vj i2 eis log L . = N Regrouping terms, we get i h i d N h u v u v φN (β) = −is E R1,2 R1,2 eis log L + isN E R1,∗ R1,∗ eis log L dβ 2 i N h u v R1,2 eis log L . + (is)2 E R1,2 2 (6) The first and third terms in (6) contain overlaps between two replicas while the middle term contains an overlap between one replica and the spike vectors. By the Nishimori property (4), we can replace the spike by a second replica in the overlaps appearing in the middle term, and this finishes the proof.  A heuristic argument Let us now heuristically consider what should happen. A rigorous u Rv i concentrates very strongly argument will be presented shortly. If the quantity N hR1,2 1,2 about some deterministic value θ = θ(α, β), we would expect that the Gibbs averages in (5) would behave approximately independently from log L, and we would obtain the following differential equation  1 d φN (β) ≃ is − s2 θφN (β). dβ 2 Rβ Since φN (0) = 1, one obtains φN (β) ≃ exp{ 12 (is − s2 ) 0 θdβ ′ } by integrating over β, and the result would follow. The concentration assumption we used is commonly referred to as replica-symmetry or the replica-symmetric ansatz in the statistical physics literature. Most of the difficulty of the proof lies in showing rigorously that replica symmetry indeed holds. 7 Sign symmetry between Pβ and P0 One can execute the same argument under the null model. Since there is no planted term in the Hamiltonian, the analogue of (6) one obtains does not contain the middle term. Hence the differential equation one obtains is  d 1 φN (β) ≃ −is − s2 θφN (β). dβ 2 This is one way to interpret the sign symmetry of the means of the limiting Gaussians under the null and the alternative: the interaction of one replica with the planted spike under the planted model accounts for twice the contribution of the interaction between two independent replicas, and this flips the sign of the mean. We now replace the above heuristic with a rigorous statement. Recall that Y ∼ Pβ . Proposition 7. For s ∈ R and α, β ≥ 0 such that αβ 2 Ku4 Kv4 < 1, there exist a constant K = K(s, α, β, Ku , Kv ) < ∞ such that h i h i αβ is log L u v E e + δ, N E R1,2 R1,2 eis log L = 1 − αβ 2 √ where |δ| ≤ K/ N . Moreover, K, seen as a function of β, is bounded on any interval [0, β ′ ] when αβ ′2 Ku4 Kv4 < 1. αβ Taking s = 0, we see that θ = 1−αβ 2 . Proposition 7 vindicates replica symmetry, and its proof occupies the majority of the rest of the manuscript. Proof of Theorem 5. Plugging the results of Proposition 7 in the derivative computed in Lemma 6, we obtain   is − s2 αβ d φN (β) = φN (β) + δ, dβ 2 1 − αβ 2 where |δ| ≤ we obtain √K N max{|s|, s2 }, and K is the constant from Proposition 7. Integrating w.r.t. β K′ |φN (β) − φ(s)| ≤ √ , N where K ′ depends on α, β, s and Ku , Kv , and K ′ < ∞ as long as αβ 2 Ku4 Kv4 < 1.  Let us prove in passing the convergence of the KL divergence between the null and alternative. Proof of Proposition 4. Similarly to the computation of the derivative of φN , we can obtain N N d u v u v u v EP log L(Y ; β) = − E R1,2 R1,2 E R1,2 R1,2 + N E R1,∗ R1,∗ , = dβ β 2 2 √ where we used the Nishimori property. By Proposition 7 with s = 0, this derivative is K/ N αβ away from 12 1−αβ  2 . Integration and boundedness of K finishes the proof. 5 Overlap convergence The question of overlap convergence is purely a spin glass problem. We will use the machinery developed by Talagrand to solve it. In particular, a crucial use is made of the cavity method and Guerra’s interpolation scheme. In this section, we present the main underlying ideas. The arguments are technically involved (but conceptually simple) so we delay their full execution to the Appendix. We refer to Talagrand (2007) for a leisurely high-level introduction to these ideas. 8 5.1 Sketch of proof of Proposition 7 The basic idea is to show that the quantities of interest approximately obey a self-consistent (or self-bounding) property, the error terms of which can be controlled. This approach will be used at different stages of the proof. We will show that h i h i h i u v u v N E R1,2 R1,2 eis log L = αβ E eis log L + αβ 2 N E R1,2 R1,2 eis log L + δ, where δ is the error term. This will be achieved in two steps. We first prove h i h i u v v 2 N E R1,2 R1,2 eis log L = N β E (R1,2 ) eis log L + δ, (7) via a cavity on N , i.e., by isolating the effect of the last variable uN on the rest of the variables. We then show h i M h i h i v 2 u v N E (R1,2 ) eis log L = E eis log L + M β E R1,2 R1,2 (8) eis log L + δ, N via a cavity on M , i.e., isolating the effect of vM . In the arguments leading to (7) and (8), we accumulate error terms that are proportional to the third moments of the overlaps: u 3 v 3 δ . N E |R1,2 | + N E |R1,2 | , (9) where we hide constants depending on α and β. These cavity equations impose only a mild 2 restriction on the parameters so that our bounds go in the √ right direction, namely that αβ < 1. This is about to change. We prove that δ = O(1/ N ) with methods that impose the stronger restrictions on (α, β) that ultimately appear in the final result. 5.2 Convergence in the planted model: from crude estimates to optimal rates We prove overlap convergence under the alternative. Let Y ∼ Pβ . Proposition 8. For all α, β ≥ 0 such that Ku4 Kv4 αβ 2 < 1, there exists K = K(α, β) < ∞ such that K u 4 v 4 E (R1,2 ) ∨ E (R1,2 ) ≤ 2. N The proof proceeds as follows. We use the cavity method to show the following selfconsistency equations: u 4 u 4 E (R1,2 ) = αβ 2 E (R1,2 ) + Mu + δu , E v 4 (R1,2 ) 2 = αβ E v 4 (R1,2 ) (10) + Mv + δv , (11) where |Mu |, |Mv | are bounded by sums of expectations of monomials of degree five in the overlaps Ru and Rv : X v u u 3 v u 3 u , + E (R1,2 ) Ra,b Rc,d E (R1,2 ) Ra,b Rc,d |Mu | . a,b,c,d |Mv | . X v 3 v v ) Ra,b Rc,d E (R1,2 a,b,c,d 9 v 3 u u ) Ra,b Rc,d + E (R1,2 , where the sum is over a finite number of combinations (a, b, c, d), and  1   1  1 1 u 2 v 2 δu . E (R1,2 ) +O E (R ) + O , δ . . v 1,2 N N2 N N2 These results hold for all α, β ≥ 0. From here, further progress is unlikely unless one has a priori knowledge that the overlaps are unlikely to be large, so that the fifth-order terms do not overwhelm the main terms. More precisely, suppose that we are able to prove the following crude bound on the overlaps: for ǫ > 0, there is K = K(ǫ, α, β) > 0 such that  v  u ≥ ǫ ≤ Ke−N/K . (12) ≥ ǫ ∨ E 1 R1,2 E 1 R1,2 Then the fifth-order terms can be controlled by fourth-order terms as follows: u 3 v v ) Ra,b Rc,d E (R1,2 u 3 v ) Ra,b ≤ ǫ E (R1,2 + Ku6 Kv4 Ke−N/K ≤ ǫM + Ke−N/K , u )4 i ∨ Eh(Rv )4 i, and the last step is by Hölder’s inequality. This way, M where M = Eh(R1,2 u 1,2 and Mv are controlled. Now it remains to control δu and δv . We could re-execute the cavity argument on the second moment instead of the fourth, and this would allow us to obtain u )2 i ∨ Eh(Rv )2 i ≤ K/N . We instead use a shorter argument based on an elegant Eh(R1,2 1,2 quadratic replica coupling technique of Guerra and Toninelli (2002) to prove this. This is presented in Appendix D.1. Plugging these estimates into (10) and (11), we obtain u 4 u 4 E (R1,2 ) ≤ αβ 2 E (R1,2 ) + KǫM + δ′ , v 4 v 4 E (R1,2 ) ≤ αβ 2 E (R1,2 ) + KǫM + δ′ , where δ′ ≤ K/N 2 + Ke−N/K , and this implies the desired result for ǫ sufficiently small. The a priori bound (12) is proved via an interpolation argument at fixed overlap, combined with concentration of measure, and is presented in Appendices D.2 and D.3. These arguments impose a restriction on the parameters (α, β) that shows up in the final result. Finally, Proposition 8 allow us to √ conclude (via Jensen’s inequality) that the error term δ displayed in (9) is bounded by K/ N . 6 Discussion The limiting factor in our approach to prove LR fluctuations is the need for precise nonu and Rv under the expected Gibbs measure asymptotic control of moments of the overlaps R1,2 1,2 Eh·i. We were able to reach this level of control only in a restricted regime. This is due to the failure of our approach to prove the crude estimate (12) in a larger region. In this section, we formulate a conjecture on the largest region where these fluctuations and overlap decay should occur. In one sentence, this should be the entire annealed or paramagnetic region of the model, as dictated by the vanishing of its replica-symmetric (RS) formula. We shall now be more precise. Let z ∼ N (0, 1), u∗ ∼ Pu and v ∗ ∼ Pv all independent. Define Z √ r  ψu (r) := Eu∗ ,z log exp rzu + ruu∗ − u2 dPu (u), 2 Z √  r ψv (r) := Ev∗ ,z log exp rzv + rvv ∗ − v 2 dPv (v). 2 10 Moreover, define the RS potential as F (α, β, qu , qv ) := ψu (βqv ) + αψv (βqu ) − βqu qv . 2 and finally define the RS formula as φRS (α, β) := sup inf F (α, β, qu , qv ). qv ≥0 qu ≥0 It was argued by Lesieur et al. (2015a) based on the plausibility of the replica-symmetric ansatz, and then proved by Miolane (2017), that in the limit N → ∞, M/N → α, N1 EPβ log L(Y ; β) → φRS (α, β) for all α, β ≥ 0. (See also Barbier et al., 2017, for results in a more general setup.) Of course, by change of measure and Jensen’s inequality, EPβ log L(Y ; β) = EP0 L(Y ; β) log L(Y ; β) ≥ 0, for all M, N ; therefore φRS is always nonnegative. Let Γ = {(α, β) ∈ R+ : φRS (α, β) = 0} . It is not hard to prove the following lemma by analyzing the stability of (0, 0) as a stationary point of the RS potential: Lemma 9. Γ ⊆ {(α, β) ∈ R+ : αβ 2 ≤ 1}. This lemma tells us (unsurprisingly) that Γ is entirely below the BBP threshold. The inclusion may or may not be strict depending on the priors Pu and Pv . For instance, there is equality of the above sets if Pu and Pv are symmetric Rademacher and/or Gaussian respectively. One case of strict inclusion is when Pv is Gaussian N (0, 1) and Pu is a sparse Rademacher prior, ρ2 δ1/√ρ + (1 − ρ)δ0 + ρ2 δ−1/√ρ , for sufficiently small ρ (e.g., ρ = .04). This is a canonical model for sparse principal component analysis. In this case, there is a region of parameters below the BBP threshold where the posterior mean E[u∗ |Y ] (= hui in our notation) has a non-trivial overlap with the spike u∗ , while the top eigenvector of the empirical covariance matrix Y Y ⊤ is orthogonal to it. Estimation becomes impossible only in the region Γ, so the following conjecture is highly plausible: Conjecture 1. Let Γ′ be the interior of Γ. For all (α, β) ∈ Γ′ ,   1 1 2 2 log L(Y , β) N ± log(1 − αβ ), − log(1 − αβ ) , 4 2 where the plus sign holds under the null P0 and the minus sign under the alternative Pβ . Our conjecture is formulated only in the interior of Γ; this is not a superfluous condition since diverging behavior may appear at the boundary. Moreover, this conjecture is about the maximal region in which such fluctuations can take place. This is not difficult to show. By (sub-Gaussian) concentration of the normalized likelihood ratio, we have for ǫ > 0  1 log L(Y ; β) − φRS (α, β) ≤ −ǫ −→ 0, Pβ N where K = K(α, β) < ∞. This already shows that log L must grow with N under the alternative if φRS > 0. As for the behavior under the null, the same sub-Gaussian concentration holds, although the expectation is not known (see Question 1):  1 1 log L(Y ; β) − EP0 log L(Y ; β) ≥ ǫ −→ 0. P0 N N 11 We do know that the above expectation is non-positive, by Jensen’s inequality. Therefore if (α, β) are such that φRS > 0, one can distinguish Pβ from P0 with asymptotic certainty by testing whether N1 log L(Y ; β) is above or below (say) 12 φRS (α, β). This implies that Pβ and P0 are not contiguous outside Γ. This—short of proving that log L grows in the negative direction with N —shows that the fluctuations cannot be of the above form under the null, since this would contradict Le Cam’s first lemma. The difficulty we encountered in our attempts to prove the above conjecture is a loss of u and Rv near the boundary of the set Γ. The interpolation control over the overlaps R1,2 1,2 bound at fixed overlap (between a replica and the spike) we used under the alternative Pβ is vacuous beyond the region αβ 2 < (Ku Kv )−4 . It is possible that the latter bound could be marginally improved by more careful analysis, but this is unlikely to yield the optimal result since no information about φRS is used in the proof. One can imagine refining this technique by constraining two replicas and using an interpolation with broken replica-symmetry, in the spirit of the “2D” Guerra-Talagrand bound (Guerra, 2003; Talagrand, 2011b). Although this strategy is successful in the symmetric model where u = v it is not at all obvious why such an interpolation bound should be true in the bipartite case: in the analysis, certain terms that are hard to control have a sign in the symmetric case, hence they can be dropped to obtain a bound. This is no longer true (or at least not obviously so) in the bipartite case. Another interesting question concerns the LR asymptotics under the null, outside Γ. While under the alternative Pβ , the normalized log-likelihood ratio converges to the RS formula φRS for all (α, β), no such simple formula is expected to hold under the null. Even the existence of a limit seems to be unknown. Question 1. Does 1 N EP0 log L(Y ; β) have a limit for all (α, β)? If so, what is its value? We refer to Barra et al. (2011, 2014) and Auffinger and Chen (2014) for some progress on the replica-symmetric phase, and Panchenko (2015) for progress on the related problem of the “multispecies” SK model at all temperatures. References Aizenman, M., Lebowitz, J. L., and Ruelle, D. (1987). Some rigorous results on the Sherrington– Kirkpatrick spin glass model. Communications in Mathematical Physics, 112(1):3–20. Amini, A. A. and Wainwright, M. J. (2009). High-dimensional analysis of semidefinite relaxations for sparse principal components. Annals of Statistics, 37(5B):2877–2921. Auffinger, A. and Chen, W.-K. (2014). Free energy and complexity of spherical bipartite models. Journal of Statistical Physics, 157(1):40–59. Bai, Z. and Yao, J. (2012). On sample eigenvalues in a generalized spiked population model. Journal of Multivariate Analysis, 106:167–177. Bai, Z. and Yao, J.-f. (2008). Central limit theorems for eigenvalues in a spiked population model. Annales de l’Institut Henri Poincaré, Probabilités et Statistiques, 44(3):447–474. Baik, J., Arous, G. B., and Péché, S. (2005). Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices. Annals of Probability, 33(5):1643–1697. Baik, J. and Lee, J. O. (2016). Fluctuations of the free energy of the spherical Sherrington–Kirkpatrick model. Journal of Statistical Physics, 165(2):185–224. 12 Baik, J. and Lee, J. O. (2017a). Fluctuations of the free energy of the spherical Sherrington–Kirkpatrick model with ferromagnetic interaction. In Annales Henri Poincaré, volume 18, pages 1867–1917. Springer. Baik, J. and Lee, J. O. (2017b). Free energy of bipartite spherical Sherrington–Kirkpatrick model. arXiv preprint arXiv:1711.06364. Baik, J. and Silverstein, J. W. (2006). Eigenvalues of large sample covariance matrices of spiked population models. Journal of Multivariate Analysis, 97(6):1382–1408. Banks, J., Moore, C., Vershynin, R., Verzelen, N., and Xu, J. (2017). Information-theoretic bounds and phase transitions in clustering, sparse PCA, and submatrix localization. In IEEE International Symposium on Information Theory (ISIT), pages 1137–1141. IEEE. Barbier, J., Dia, M., Macris, N., Krzakala, F., Lesieur, T., and Zdeborová, L. (2016). Mutual information for symmetric rank-one matrix estimation: A proof of the replica formula. In Advances in Neural Information Processing Systems (NIPS), pages 424–432. Barbier, J., Krzakala, F., Macris, N., Miolane, L., and Zdeborová, L. (2017). Phase transitions, optimal errors and optimality of message-passing in generalized linear models. arXiv preprint arXiv:1708.03395. Barra, A., Galluzzi, A., Guerra, F., Pizzoferrato, A., and Tantari, D. (2014). Mean field bipartite spin models treated with mechanical techniques. The European Physical Journal B, 87(3):74. Barra, A., Genovese, G., and Guerra, F. (2011). Equilibrium statistical mechanics of bipartite spin systems. Journal of Physics A: Mathematical and Theoretical, 44(24):245002. Benaych-Georges, F. and Nadakuditi, R. R. (2011). The eigenvalues and eigenvectors of finite, low rank perturbations of large random matrices. Advances in Mathematics, 227(1):494–521. Benaych-Georges, F. and Nadakuditi, R. R. (2012). The singular values and vectors of low rank perturbations of large rectangular random matrices. Journal of Multivariate Analysis, 111:120–135. Berthet, Q. and Rigollet, P. (2013). Optimal detection of sparse principal components in high dimension. Annals of Statistics, 41(4):1780–1815. Boucheron, S., Lugosi, G., and Massart, P. (2013). Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford University Press. Capitaine, M., Donati-Martin, C., and Féral, D. (2009). The largest eigenvalues of finite rank deformation of large Wigner matrices: convergence and nonuniversality of the fluctuations. Annals of Probability, pages 1–47. Chatterjee, S. (2014). Superconcentration and Related Topics. Springer. Deshpande, Y., Abbé, E., and Montanari, A. (2016). Asymptotic mutual information for the binary stochastic block model. In IEEE International Symposium on Information Theory (ISIT), pages 185–189. IEEE. Dobriban, E. (2017). Sharp detection in PCA under correlations: all eigenvalues matter. Annals of Statistics, 45(4):1810–1833. Féral, D. and Péché, S. (2007). The largest eigenvalue of rank one deformation of large Wigner matrices. Communications in Mathematical Physics, 272(1):185–228. Guerra, F. (2003). Broken replica symmetry bounds in the mean field spin glass model. Communications in Mathematical Physics, 233(1):1–12. 13 Guerra, F. and Toninelli, F. L. (2002). Quadratic replica coupling in the Sherrington–Kirkpatrick mean field spin glass model. Journal of Mathematical Physics, 43(7):3704–3716. Johnstone, I. M. (2001). On the distribution of the largest eigenvalue in principal components analysis. Annals of Statistics, pages 295–327. Johnstone, I. M. and Lu, A. Y. (2009). On consistency and sparsity for principal components analysis in high dimensions. Journal of the American Statistical Association, 104(486):682–693. Johnstone, I. M. and Onatski, A. (2015). Testing in high-dimensional spiked models. arXiv preprint arXiv:1509.07269. Korada, S. B. and Macris, N. (2009). Exact solution of the gauge symmetric p-spin glass model on a complete graph. Journal of Statistical Physics, 136(2):205–230. Krzakala, F., Xu, J., and Zdeborová, L. (2016). Mutual information in rank-one matrix estimation. In Information Theory Workshop (ITW), pages 71–75. IEEE. Ledoit, O. and Wolf, M. (2002). Some hypothesis tests for the covariance matrix when the dimension is large compared to the sample size. Annals of Statistics, pages 1081–1102. Lelarge, M. and Miolane, L. (2017). Fundamental limits of symmetric low-rank matrix estimation. In Kale, S. and Shamir, O., editors, Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pages 1297–1301, Amsterdam, Netherlands. PMLR (arXiv:1611.03888). Lesieur, T., Krzakala, F., and Zdeborová, L. (2015a). MMSE of probabilistic low-rank matrix estimation: Universality with respect to the output channel. In Communication, Control, and Computing (Allerton), 2015 53rd Annual Allerton Conference on, pages 680–687. IEEE. Lesieur, T., Krzakala, F., and Zdeborová, L. (2015b). Phase transitions in sparse PCA. In IEEE International Symposium on Information Theory (ISIT), pages 1635–1639. IEEE. Lesieur, T., Krzakala, F., and Zdeborová, L. (2017). Constrained low-rank matrix estimation: Phase transitions, approximate message passing and applications. Journal of Statistical Mechanics: Theory and Experiment, 2017(7). Miolane, L. (2017). arXiv:1702.00473. Fundamental limits of low-rank matrix estimation. arXiv preprint Montanari, A., Reichman, D., and Zeitouni, O. (2015). On the limitation of spectral methods: From the gaussian hidden clique problem to rank-one perturbations of gaussian tensors. In Advances in Neural Information Processing Systems, pages 217–225. Nadler, B. (2008). Finite sample approximation results for principal component analysis: A matrix perturbation approach. Annals of Statistics, pages 2791–2817. Nishimori, H. (2001). Statistical physics of spin glasses and information processing: an introduction, volume 111. Clarendon Press. Onatski, A., Moreira, M. J., and Hallin, M. (2013). Asymptotic power of sphericity tests for highdimensional data. Annals of Statistics, 41(3):1204–1231. Onatski, A., Moreira, M. J., and Hallin, M. (2014). Signal detection in high dimension: The multispiked case. Annals of Statistics, 42(1):225–254. Panchenko, D. (2015). The free energy in a multi-species Sherrington–Kirkpatrick model. Annals of Probability, 43(6):3494–3513. 14 Paul, D. (2007). Asymptotics of sample eigenstructure for a large dimensional spiked covariance model. Statistica Sinica, pages 1617–1642. Péché, S. (2006). The largest eigenvalue of small rank perturbations of Hermitian random matrices. Probability Theory and Related Fields, 134(1):127–173. Péché, S. (2014). Deformed ensembles of random matrices. In Proceedings of the International Congress of Mathematicians, Seoul, volume III, pages 1059–1174. ICM. Perry, A., Wein, A. S., Bandeira, A. S., and Moitra, A. (2016). On the optimality and suboptimality of PCA for spiked random matrix models. Annals of Statistics (to appear). arXiv preprint arXiv:1609.05573. Pisier, G. (1986). Probabilistic methods in the geometry of Banach spaces, pages 167–241. Springer, Berlin, Heidelberg. Talagrand, M. (2007). Mean field models for spin glasses: some obnoxious problems. In Spin Glasses, pages 63–80. Springer. Talagrand, M. (2011a). Mean field models for spin glasses. Volume I: Basic examples, volume 54. Springer Science & Business Media. Talagrand, M. (2011b). Mean field models for spin glasses. Volume II: Advanced replica-symmetry and low temperature, volume 55. Springer Science & Business Media. Van der Vaart, A. W. (2000). Asymptotic Statistics. Cambridge University Press. A Fluctuation equivalence We explain in this appendix how the fluctuation result under Pβ implies the corresponding fluctuation result under P0 . This is a consequence of the Portmanteau characterization of convergence in distribution. The argument can be made in the other direction as well. Assume that log L(Y ; β) N (µ, σ 2 ), for Y ∼ Pβ , where µ = 12 σ 2 . By the Portmanteau theorem (Van der Vaart, 2000, Lemma 2.2), this is equivalent to the assertion lim inf EPβ [f (log L)] ≥ E [f (Z)] , (13) where Z ∼ N (µ, σ 2 ) for all nonnegative continuous functions f : R 7→ R+ . On the other hand, by a change of measure (and absolute continuity of P0 w.r.t Pβ ), we have that for such an f ,   h i d P0 f (log L) = EPβ e− log L f (log L) . EP0 [f (log L)] = EPβ d Pβ The function g : x 7→ e−x f (x) is still nonnegative continuous, so by (13), we have   lim inf EP0 [f (log L)] ≥ E e−Z f (Z) . (14) Since µ = 12 σ 2 , Z Z    −Z  2 2 dx dx −x −(x−µ)2 /2σ2 √ = f (x)e−(x+µ) /2σ √ = E f (Z ′ ) , E e f (Z) = f (x)e e 2 2 2πσ 2πσ ′ 2 where Z ∼ N (−µ, σ ). Since (14) is valid for every nonnegative continuous f , the result N (−µ, σ 2 ) log L(Y ; β) under P0 follows. 15 B Notation and useful lemmas We make repeated use of interpolation arguments in our proofs. In this section, we state a few elementary lemmas we subsequently invoke several times. We denote the overlaps between replicas when the last variables are deleted by a superscript “ − ” : u− Rl,l ′ = N −1 1 X (l) (l′ ) ui ui N and v− Rl,l ′ = i=1 M −1 1 X (l) (l′ ) vj vj . N j=1 If {Ht : t ∈ [0, 1]} is a generic family of random Hamiltonians, we let h·it be the corresponding Gibbs average, and νt (f ) = E hf it , where the expectation is over the randomness of Ht . We will often write ν for ν1 . In our executions of the cavity method, we use interpolations that isolate one last variable (either uN or vM ) from the rest of the system. Taking the first case an example, we consider −Ht (u, v) = M r N −1 X X i=1 j=1 + M X j=1 r β β 2 2 β Wij ui vj + ui u∗i vj vj∗ − u v N N 2N i j βt βt 2 2 βt WN j uN vj + uN u∗N vj vj∗ − u v . N N 2N N j Lemma 10. Let f be a function of n replicas (u(l) , v (l) )1≤l≤n . Then β d νt (f ) = dt 2 X n ′ 1≤l6=l′ ≤n n X + βn l=1 v (l) (l ) νt (Rl,l u f) − ′u β X v νt (Rl,n+1 u(l) u(n+1) f ) n 2 l=1 v (l) ∗ v νt (Rl,∗ u u f ) − βnνt (Rn+1,∗ u(n+1) u∗ f ) n(n + 1) v +β νt (Rn+1,n+2 u(n+1) u(n+2) f ). 2 Proof. This is a simple computation based on Gaussian integration by parts, similarly to  Lemma 5. The next lemma allows us to control interpolated averages by averages at time 1. Lemma 11. Let f be a nonnegative function of n replicas (u(l) , v (l) )1≤l≤n . Then for all t ∈ [0, 1] νt (f ) ≤ K(n, α, β)ν(f ). Proof. This is a consequence of Lemma 10, boundedness of the variables ui and vj , and Grönwall’s lemma.  It is clear that Lemma 11 also holds if we switch the roles of u and v and extract vM instead (so that νt is defined accordingly). 16 C Proof of Proposition 7 We make use of two interpolation arguments; the first one extracts the last variable uN from the system, and the second one extracts vM . This allows to establish the self-consistency equations (7) and (8). We will assume decay of the forth moments of the overlaps, i.e., we assume Proposition 8 (which we prove in Appendix D), and this allows us the prove that the error terms emerging from the cavity method converge to zero. Recall that the Nishimori property implies h i h i u v u v E R1,2 R1,2 eis log L = E R1,∗ R1,∗ eis log L . As it turns out, it is more convenient to work with the right-hand side. C.1 Cavity on N By symmetry of the u variables, we have i E h i hD (1) v u v eis log L . E R1,∗ R1,∗ eis log L = E uN u∗N R1,∗ Now we consider the interpolating Hamiltonian M r N −1 X X β β 2 2 β Wij ui vj + ui u∗i vj vj∗ − u v −Ht (u, v) = N N 2N i j i=1 j=1 M r X βt βt 2 2 βt + WN j uN vj + uN u∗N vj vj∗ − u v , N N 2N N j j=1 and let h·it be the associated Gibbs average. We let Z   X(t) = exp is log e−Ht (u,v) dρ(u, v) , and ϕ(t) = N E E i hD (1) v X(t) . uN u∗N R1,∗ t Observe that ϕ(1) is the quantity we seek to analyze. We will use the following error bound on Taylor’s expansion: ϕ(1) − ϕ(0) − ϕ′ (0) ≤ sup |ϕ′′ (t)|, 0≤t≤1 to approximate ϕ(1) by ϕ(0) + ϕ′ (0). Since Pu is centered, we have ϕ(0) = 0. With a computation similar to the one leading to Lemma 6, the time derivative ϕ′ (t) is a sum of terms of the form E i hD (a) (b) v (1) v X(t) , Ra,b N β E uN u∗N uN uN R1,∗ t for (a, b) ∈ {(1, ∗), (2, ∗), (1, 2), (2, 3)}. At t = 0 all terms vanish expect when (a, b) = (1, ∗) and we get h i v 2 ϕ′ (0) = N β E (R1,∗ ) 0 X(0) . Now we wish to replace the time index t = 0 in the above quantity by the time index t = 1. v )2 i X(t)], is a sum of terms of Similarly to ϕ, the derivative of the function t 7→ N β E[h(R1,∗ t the form E hD i (a) (b) v 2 v N β 2 E uN uN (R1,∗ ) Ra,b X(t) . t 17 By boundedness of the u variables and Hölder’s inequality, this is bounded by h i h i v 2 v v 3 N β 2 Ku4 E (R1,∗ ) Ra,b t ≤ N β 2 Ku4 E |R1,∗ | t   v 3 ≤ N β 2 Ku4 K E |R1,∗ | Kβ 2 ≤ √ , N where the second bound is by Lemma 11, and the last bound is a consequence of Proposition 8 (and Jensen’s inequality). Therefore ϕ′ (0) − N β E   K v 2 (R1,∗ ) X(1) ≤ √ . N Similarly, we control the second derivative ϕ′′ . This can be written as a finite sum of terms of the form E i hD (a) (b) (c) (d) v (1) v v X(t) , Rc,d Ra,b N β 2 E uN u∗N uN uN uN uN R1,∗ t which are bounded in the same way by h v v v Ra,b Rc,d N β 2 Ku6 E R1,∗ t i K ≤ β 2 Ku6 √ . N √ Therefore |ϕ′′ | ≤ K/ N . We end up with h i i h u v v 2 N E R1,∗ R1,∗ ) eis log L + δ, eis log L = N β E (R1,∗ (15) √ where |δ| ≤ K/ N whenever (α, β) satisfy the conditions of Proposition 8. C.2 Cavity on M By symmetry of the v variables, i E h i hD (1) ∗ v v 2 eis log L N E (R1,∗ R1,∗ ) eis log L = M E vM vM i hD E M hD (1) ∗ 2 E is log L i (1) ∗ v− = R1,∗ + M E vM vM eis log L . E (vM vM ) e N Now we execute the same argument as above with the roles of u and v flipped to prove that i i h E hD (1) ∗ 2 ) eis log L = E eis log L + δ, E (vM vM and i h hD E i (1) ∗ v− u v R1,∗ vM vM eis log L = M β E R1,∗ R1,∗ eis log L + δ, √ where |δ| ≤ K(M/N 3/2 ∨ 1/ N ). Here we use the interpolating Hamiltonian N r M −1 X X β β β 2 2 −Ht (u, v) = Wij ui vj + ui u∗i vj vj∗ − u v N N 2N i j j=1 i=1 N r X βt βt βt 2 2 ∗ WiM ui vM + ui u∗i vM vM − u v , + N N 2N i M ME i=1 18 R  and similarly define the random variable X(t) = exp is log e−Ht (u,v) dρ(u, v) . After executing the argument, we obtain i h i h i M h u v v 2 E eis log L + M β E R1,∗ R1,∗ eis log L + δ. (16) N E (R1,∗ ) eis log L = N From (15) and (16), we obtain i h h i i M u v u v β E eis log L + M β 2 E R1,∗ R1,∗ eis log L + δ, R1,∗ R1,∗ eis log L = N √ √ where |δ| ≤ K(M/N 3/2 ∨ 1/ N ). For M = αN + O( N ), we arrive at NE h NE h i u v R1,∗ R1,∗ eis log L = √ with |δ| ≤ K/ N , and this finishes the proof. D i h αβ is log L + δ, E e 1 − αβ 2 Proof of Proposition 8 This section is about overlap convergence in the planted model. As explained in the main text, the proof is in several steps. We first present a proof of convergence of the second moment of the overlaps that does not rely on the cavity method, but on a quadratic replica coupling scheme of Guerra and Toninelli (2002). Then we present the interpolation argument as a fixed overlap that will allow us to prove the crude convergence bound (12). Finally we execute a round of the cavity method to prove convergence of the fourth moment. D.1 Convergence of the second moment Proposition 12. For all α, β such that Ku4 Kv4 αβ 2 < 1, there exists K = K(α, β) < ∞ such that K u 2 v 2 E (R1,∗ ) ∨ E (R1,∗ ) ≤ 2. N Of course, by the Nishimori property, this is also a statement about the overlaps between two independent replicas. Proof. Let σu and σv be the sub-Gaussian parameters of Pu and Pv respectively. We since Pu and Pv have unit variance, we have 1 ≤ σu2 ≤ Ku2 and similarly for Pv . We start with the u-overlap. Let us define the function   Z λ 1 u 2 E log exp −H(u, v) + N (R1,∗ ) dρ(u, v). Φu (λ) = N 2 The outer expectation is on Y ∼ Pβ (or equivalently on u∗ , v ∗ and W independently). A simple inspection shows that the above function is convex and increasing in λ, and Φ′u (0) = 1 u 2 E (R1,∗ ) . 2 The convexity then implies for all λ ≥ 0, λ u 2 E (R1,∗ ) ≤ Φu (λ) − Φu (0). 2 19 Of course Φu (0) = N1 EPβ log L(Y ; β) ≥ 0 by Jensen’s inequality, so it remains to upper bound Φu (λ). To this end we consider the interpolation   Z 1 λ u 2 Φu (λ, t) = E log exp −Ht (u, v) + N (R1,∗ ) dρ(u, v), N 2 where −Ht (u, v) = X i,j r βt β βt 2 2 Wij ui vj + ui u∗i vj vj∗ − u v . N N 2N i j Notice that the planted (middle) term in the Hamiltonian is left unaltered. The time derivative is β u 2 ) λ,t ≤ 0, ∂t Φu (λ, t) = − E (R1,2 2 u )2 . Therefore where h·iλ,t is the Gibbs average w.r.t −Ht (u, v) + λ2 N (R1,∗   Z λ 1 u v u 2 E log exp βN R1,∗ R1,∗ + N (R1,∗ ) dρ(u, v) Φu (λ) ≤ Φu (λ, 0) = N 2  2 2  Z 1 αβ σv vb + λ u 2 ≤ E log exp N (R1,∗ ) dPu⊗N (u), N 2 1 PM ∗2 where we have used the sub-Gaussianity of Pv , and let vb = M j=1 vj . (Here, we have abused notation and let α = M N . This will not cause any problems.) Next we introduce an independent r.v. g ∼ N (0, 1), exchange integrals by Fubini’s theorem, and continue:  Z  p 1 u ⊗N 2 2 (αβ σv vb + λ)N R1,∗ g dPu (u) E log Eg exp N    2 2 1 αβ σv vb + λ 2 2 E log Eg exp σu u bg , ≤ N 2 P ∗2 where we use the sub-Gaussianity of Pu , and let u b = N1 N b and vb by Ku2 i=1 ui . We bound u 2 and Kv respectively and integrate on g to obtain the upper bound Φu (λ) ≤ −  1 log 1 − (αβ 2 σv2 Kv2 + λ)σu2 Ku2 , 2N valid as long as (αβ 2 σv2 Kv2 + λ)σu2 Ku2 < 1. Letting λ = (1 − αβ 2 σv2 Kv2 σu2 Ku2 )/(2σu2 Ku2 ) > 0, we obtain K(α, β) u 2 , E (R1,∗ ) ≤ N 2 2 2 2 2 2 2 log((1−αβ σv Kv σu Ku )/2) . with K(α, β) = 2σu Ku (1−αβ 2 σ2 K 2 σ2 K 2 ) v v u u We use the exact same argument for the v-overlaps. We define Φv (λ) in the same way by u )2 by λ N (Rv )2 and obtain replacing the quadratic term λ2 N (R1,∗ 1,∗ 2 Φv (λ) ≤ −  1 log 1 − (β 2 σu2 Ku2 + λ)ασv2 Kv2 . 2N We choose λ = (1−αβ 2 σv2 Kv2 σu2 Ku2 )/(2ασv2 Kv2 ) and use the same convexity argument to obtain v 2 E (R1,∗ ) ≤ with K ′ (α, β) = 2ασv2 Kv2 log((1−αβ 2 σv2 Kv2 σu2 Ku2 )/2) . (1−αβ 2 σv2 Kv2 σu2 Ku2 ) 20 K ′ (α, β) , N  D.2 Interpolation bound at fixed overlap In this section we present and prove an interpolation bound on the free energy of a subpopulation of configurations having a fixed overlap with the planted spike (u∗ , v ∗ ). This is a key step in proving the crude bound (12). Proposition 13. Fix u∗ ∈ RN , v ∗ ∈ RM with ku∗ k2ℓ2 /N ≤ Ku2 and kv ∗ k2ℓ2 /M ≤ Kv2 . Let 2 2 2 2 2 α= M N and ∆ = αβ σu σv Ku Kv − 1. For m ∈ R \ {0}, ǫ ≥ 0, let Au be the event ( u ∈ [m, m + ǫ) if m > 0, R1,∗ Au = u ∈ (m − ǫ, m] if m < 0. R1,∗ Define Av similarly. We have Z 1 ∆ E log 1(Au )e−H(u,v) dρ(u, v) ≤ 2 2 m2 + αβKv2 ǫ, N 2σu Ku (17) Z 1 ∆ E log 1(Av )e−H(u,v) dρ(u, v) ≤ m2 + βKu2 ǫ. N 2ασv2 Kv2 The expectation E is over the Gaussian disorder W . (18) and Proof. We only prove (17). The bound (18) follows by flipping the roles of u and v. We consider the interpolating Hamiltonian r M X βt βt βt 2 2 X ∗ ∗ (1 − t)βmvj vj∗ , Wij ui vj + ui ui vj vj − u v + −Ht (u, v) = N N 2N i j j=1 i,j and let ϕ(t) = 1 E log N We have Z u 1{R1,∗ ∈ [m, m + ǫ)}e−Ht (u,v) dρ(u, v). β u v u v v E R1,2 R1,2 + β E R1,∗ R1,∗ − βm E R1,∗ . t t t 2 u is constrained to be The first term in the above expression is ≤ 0, and since the overlap R1,∗ ϕ′ (t) = − ′ 2 2 u − m)Rv close to m we have E (R1,∗ 1,∗ t ≤ αKv ǫ. So ϕ (t) ≤ αKv ǫ. Moreover, the variables u and v decouple at t = 0 and one can write M i h ∗ 1 1 X log Pr (Au ) + log Ev eβmvvj + Kv2 ǫ. N N j=1 i h 2 2 2 ∗2 ∗ By sub-Gaussianity of the prior Pv we have Ev eβmvvj ≤ eβ σv m vj /2 . On the other hand, for a fixed parameter γ of the same sign as m, we have ϕ(1) ≤ N N 1 1 X ∗ 1 X ∗2 2 2 log Pr (Au ) ≤ −γm + log Eu [eγuui ] ≤ −γm + ui σu γ . N N 2N i=1 i=1 The last inequality uses sub-Gaussianity of Pu . We minimize this quadratic w.r.t γ and obtain M 2 2 2 m2 β σv vbm + αKv2 ǫ, + 2 2σu u b 2N PM ∗2 2 j=1 vj . We upper bound the latter two numbers by Ku  ϕ(1) ≤ − P ∗2 b= where u b = N1 N i=1 ui and v 2 and Kv respectively. 1 M 21 D.3 Overlap concentration (proof of (12)) Here we prove convergence of the overlaps to zero in probability. We first state a useful and standard result of concentration of measure. q β ∗ ∗⊤ u v + W , where the planted vectors u∗ and v ∗ are fixed, and Lemma 14. Let Y = N Wij ∼ N (0, 1). For a Borel set A ⊂ RM +N , let Z e−H(u,v) dρ(u, v). Z= A We have for every t ≥ 0, − Pr (|log Z − E log Z| ≥ N t) ≤ 2e Nt2 2βKu2 Kv2 . (Here Pr and E are conditional on u∗ and v ∗ .) p Proof. We simply observe that the function W 7→ log Z is Lipschitz with constant N βαKu2 Kv2 . The result follows from concentration of Lipschitz functions of Gaussian r.v.’s (this is the Borell-Tsirelson-Ibragimov-Sudakov inequality; see Boucheron et al., 2013, Theorem 5.6).  Proposition 15. Let α, β such that αβ 2 σu2 σv2 Ku2 Kv2 < 1, and ǫ > 0. There exist constants c = c(ǫ, α, β, Ku , Kv ) > 0 and K = K(Ku , Kv ) > 0 such that u v E 1{|R1,∗ | ≥ ǫ} ∨ E 1{|R1,∗ | ≥ ǫ} ≤ K −cN e . ǫ2 Proof. We only prove the assertion for the u-overlap since the argument is strictly the same for the v-overlap. For ǫ, ǫ′ > 0, we can write the decomposition X u u ≥ ǫ′ } = E 1{R1,∗ − ǫ′ ∈ [lǫ, (l + 1)ǫ)} E 1{ R1,∗ l≥0 + X l≥0 u E 1{−R1,∗ + ǫ′ ∈ [lǫ, (l + 1)ǫ)} , where the integer index l ranges over a finite set of size ≤ K/ǫ. We only treat the generic term in the first sum; the second sum can be handled similarly. Fix m > 0, ǫ > 0. We have # "R u ∈ [m, m + ǫ)}e−H(u,v) dρ(u, v) 1{R1,∗ u R . (19) E 1{R1,∗ ∈ [m, m + ǫ)} = E e−H(u,v) dρ(u, v) Let A= 1 EW log N and B= Z u 1{R1,∗ ∈ [m, m + ǫ)}e−H(u,v) dρ(u, v), 1 EW log N Z e−H(u,v) dρ(u, v). By concentration over the Gaussian disorder, Lemma 14, for any u ≥ 0, we simultaneously have Z 1 u log 1{R1,∗ ∈ [m, m + ǫ)}e−H(u,v) dρ(u, v) − A ≤ u, N 22 and 1 log N Z e−H(u,v) dρ(u, v) − B ≥ −u, 2 2 2 with probability at least 1 − 4e−N u /(2βKu Kv ) . On the complement event we simply upper bound the fraction (19) by 1. Therefore, we have i h 2 2 2 u E 1{R1,∗ ∈ [m, m + ǫ)} ≤ Eu∗ ,v∗ eN (A−B+2u) + 4e−N u /(2βKu Kv ) . ∗ ∗ 2 2 By Proposition 13 we have A ≤ 2σ∆ 2 2 m + αβKv ǫ deterministically over u and v . Now it  −N B  u Ku remains to control Eu∗ ,v∗ e .  −N B  Lemma 16. We have Eu∗ ,v∗ e ≤ 2e−N Eu∗ ,v∗ [B] . Moreover, observe that Z 1 E log e−H(u,v) dρ(u, v) Eu∗ ,v∗ [B] = N 1 = EP log L(Y ; β) N β 1 = EP L(Y ; β) log L(Y ; β) ≥ 0. N 0 Positivity is obtained by Jensen’s inequality and convexity of x 7→ x log x. In view of the above, Lemma 16 means that the random variable B is “essentially” positive. Therefore, u E 1{R1,∗ ∈ [m, m + ǫ)} ≤ 2eN (δ+2u) + 4e−N u where δ = ∆ m2 2σu2 Ku2 2 /(2βK 2 K 2 ) u v , + αβKv2 ǫ. We let u = −δ/3 ≥ 0, and m = ǫ′ + lǫ. Since ∆ < 0, ∆m2 ≤ ∆ǫ′2 . Now we let ǫ = − 4αβσ2∆K 2 K 2 ǫ′2 so that δ ≤ u u v 3∆ ǫ′2 4σu2 Ku2 < 0.  Proof of Lemma 16. We abbreviate Eu∗ ,v∗ by E. We have Z +∞ i Z +∞ h et Pr (N (E[B] − B) ≥ t) dt. et Pr (N (E[B] − B) ≥ t) dt ≤ 1 + E eN (E[B]−B) = 0 −∞ Now we bound the lower tail probability. The r.v. B, seen as a function of the vector [u∗ |v ∗ ] ∈ RN +M is jointly convex (the Hessian can be easily shown to be positive semi-definite), and q 2 2 2 Kv Lipschitz with constant βKu Kv αKu +α with respect to the ℓ2 norm. Under the above N conditions, a bound on the lower tail of deviation of B is available; this is (one side of) Talagrand’s inequality (see Boucheron et al., 2013, Theorem 7.12). Therefore, we have for all t≥0 2 2 Pr (B − E[B] ≤ −t) ≤ e−N t /2K , where K 2 = αβ 2 Ku2 Kv2 (Ku2 + αKv2 ). Thus, Z i h E eN (E[B]−B) ≤ 1 + +∞ 2 /(2N K 2 ) et e−t 0 √ N K 2 /2 = 1 + K Ne ≤ 2. Z +∞ √ K N The last inequality is a restatement of the fact Pr(g ≥ t) ≤ 23 dt 2 /2 e−t 2 −t /2 e√ 2πt dt where g ∼ N (0, 1).  D.4 Convergence of the fourth moment In this section we prove that for all α, β such that αβ 2 σu2 σv2 Ku2 Kv2 < 1, we have u 4 v 4 E (R1,2 ) ∨ E (R1,2 ) ≤ K(α, β) . N2 We proceed as follows. Let  u 4 v 4 M = max E (R1,2 ) , E (R1,2 ) . We prove that for ǫ > 0, the following self-boundedness properties hold: u 4 u 4 E (R1,2 ) ≤ αβ 2 E (R1,2 ) + KǫM + δ, v 4 v 4 E (R1,2 ) ≤ αβ 2 E (R1,2 ) + KǫM + δ, (20) (21) where δ ≤ K/N 2 + K/ǫ2 e−c(ǫ)N . This implies the desired result by letting ǫ be sufficiently small (e.g., ǫ = (1−αβ 2 )/2). We prove (20) and (21) using the cavity method, i.e. by isolating the effect of the last variables uN and vM , one at a time. We prove (20) in full detail, then briefly highlight how (21) is obtained in a similar way. By symmetry between the u variables, we have D E (1) u 4 u 3 E (R1,∗ ) = E uN u∗N (R1,∗ )    1 (1) ∗ 3 (1) ∗ u− = E uN uN R1,∗ + uN uN . N u− Expanding the term R1,∗ +  1 (1) ∗ 3 N uN uN we obtain E K4 D D E K6 D E K8 (1) u− 3 u 4 u− 2 u− ) + u E (R1,∗ E (R1,∗ ) ≤ E uN u∗N (R1,∗ + u3 . ) + u2 E R1,∗ N N N (22) u− 2 We have already proved convergence of the second moment (Proposition 12), hence Eh(R1,∗ ) i≤ √ u− 3 u− K/N and Eh|R1,∗ |i ≤ K/ N . Now we need to control the leading term involving (R1,∗ ) . u )4 , plus additional The next proposition shows that this quantity can be related back to (R1,∗ higher-order terms. This is is achieved through the cavity method. Proposition 17. For α, β ≥ 0, there exists a constant K = K(α, β, Ku , Kv ) > 0 such that E D (1) u 3 v u− 3 ) R1,∗ + δ1 , (23) ) = β E (R1,∗ E uN u∗N (R1,∗ where |δ1 | ≤ K X a,b,c,d E D u− 3 v v (R1,∗ ) Ra,b Rc,d E . Moreover, u 3 v u 4 E (R1,∗ ) R1,∗ = αβ E (R1,∗ ) + δ2 , where |δ2 | ≤ K X u 3 u u ) Ra,b Rc,d E (R1,∗ a,b,c,d 24 . (24) From Proposition 17 we deduce E D (1) u 4 u− 3 ) + δ, ) = αβ 2 E (R1,∗ E uN u∗N (R1,∗ where δ = δ1 + δ2 . Plugging into (22), we obtain u 4 u 4 E (R1,∗ ) ≤ αβ 2 E (R1,∗ ) + K + δ. N2 Now we need to control the error term δ, which involves monomials of degree 5 in the overlaps Ru and Rv . This is where the a priori bound on the convergence of the overlaps, Proposition 15, is useful. Since the overlaps are bounded, we can write for any ǫ > 0, v u 3 v E (R1,∗ ) Ra,b Rc,d u 3 v ≤ ǫ E (R1,∗ ) Ra,b u 3 v ) Ra,b = ǫ E (R1,∗ v + Ku6 Kv4 E 1{ Rc,d ≥ ǫ} v + Ku6 Kv4 E 1{ R1,∗ ≥ ǫ} , where the last line is a consequence of the Nishimori property. Now we use Hölder’s inequality on the first term: u 3 v E (R1,∗ ) Ra,b u 4 ≤ E (R1,∗ ) u 4 = E (R1,∗ ) ≤ M. 3/4 3/4 v E (Ra,b )4 v E (R1,∗ )4 1/4 1/4 v | ≥ ǫ}i ≤ Ke−cN /ǫ2 . Therefore, Using Proposition 15, we have Eh1{|R1,∗ |δ1 | ≤ KǫM + K −cN e . ǫ2 It is clear that we can use the same argument to bound δ2 , so we end up with u 4 u 4 E (R1,∗ ) ≤ αβ 2 E (R1,∗ ) + K K + KǫM + 2 e−cN , 2 N ǫ thereby proving (20). To prove (21) we use the same approach. We write E M D (1) ∗ v 3 ) E vM vM (R1,∗ N    1 (1) ∗ 3 (1) ∗ v− = α E vM vM R1,∗ + vM vM . N v 4 E (R1,∗ ) = Then use an equivalent of Proposition 17 in this case, which is obtained by flipping the role of the u and v variables: E D (1) ∗ v 3 u v− 3 ) R1,∗ + δ1 , (R1,∗ ) = β E (R1,∗ E vN vN and v 3 u v 4 E (R1,∗ ) R1,∗ = β E (R1,∗ ) + δ2 , where δ1 and δ2 are similarly bounded by expectations of monomials of degree 5 in the overlaps Ru and Rv . These two quantities are then bounded in exactly the same way. 25 Proof of Proposition 17. The proof uses two interpolations; the first one decouples the variable uN from the rest of the system and allows to obtain (23), and the second one decouples the variable vM and allows to obtain (24). We start with the former. Proof of (23). Consider the interpolating Hamiltonian M r N −1 X X β β 2 2 β Wij ui vj + ui u∗i vj vj∗ − u v −Ht (u, v) = N N 2N i j i=1 j=1 M r X βt βt βt 2 2 + WN j uN vj + uN u∗N vj vj∗ − u v , N N 2N N j j=1 and let h·it be the associated Gibbs average and νt (·) = Eh·it . The idea is to approximate (1) u− 3 ) by ν0 (f ) + ν0′ (f ). Of course one then has to control the second ν1 (f ) where f ≡ uN u∗N (R1,∗ derivative, as dictated by Taylor’s approximation ν1 (f ) − ν0 (f ) − ν0′ (f ) ≤ sup νt′′ (f ) . (25) 0≤t≤1 We see that at time t = 0, the variables uN and u∗N decouple the Hamiltonian, so (1) u− 3 u− 3 ) ) = E[uN ] E[u∗N ]ν0 ((R1,∗ ) ) = 0. ν0 (uN u∗N (R1,∗ (26) (1) u− 3 ) ) is a On the other hand, by applying Lemma 10 with n = 1, we see that ν0′ (uN u∗N (R1,∗ sum of a few terms of the form  (a) (b) (1) u− 3 v ) Ra,b . ν0 uN u∗N uN uN (R1,∗ (a) Since Pu has zero mean, all terms in which a variable uN (for any a) appears with degree 1 vanish. We are thus left with one term where a = 1, b = ∗, and we get (1) (1) u− 3 v u− 3 v u− 3 ) R1,∗ ) = βν0 ((R1,∗ ) R1,∗ ). ) ) = β E[(uN )2 ] E[(u∗N )2 ]ν0 ((R1,∗ ν0′ (uN u∗N (R1,∗ (27) u− 3 v u )3 Rv ) since the last variable u Moreover, we see that ν0 ((R1,∗ ) R1,∗ ) = ν0 ((R1,∗ N has no 1,∗ contribution under ν0 . Now we are tempted to replace the average at time t = 0 by an average at time t = 1 in the last quantity. We use Lemmas 10 and 11 to justify this. Indeed these lemmas and boundedness of the variables uN imply X u 3 v u 3 v u 3 v v ν0 ((R1,∗ ) R1,∗ ) − ν1 ((R1,∗ ) R1,∗ ) ≤ K(α, β) ) ), (28) ν( (R1,∗ ) R1,∗ Ra,b a,b where (a, b) ∈ {(1, 2), (1, ∗), (2, ∗), (2, 3)}. Now we control the second derivative supt νt′′ (·). In (1) u− 3 ) ) creates terms of the view of Lemma 10, we see that taking two derivative of νt (uN u∗N (R1,∗ form   (a) (b) (c) (d) (1) u− 3 v v , ) Ra,b Rc,d νt uN u∗N uN uN uN uN (R1,∗ with a larger (but finite) set of combinations (a, b, c, d). We use Lemma 11 to replace νt by ν1 and use boundedness of variables uN to obtain the bound    X  (1) u− 3 u− 3 v v ) ) ≤ K(α, β) sup νt′′ uN u∗N (R1,∗ ν (R1,∗ . (29) ) Ra,b Rc,d 0≤t≤1 a,b,c,d 26 Now putting the bounds and estimates (25), (26), (27), (28), and (29), we obtain the desired bound (23):  X   (1) u− 3 u− 3 v u 3 v v ν (R1,∗ ) − βν((R1,∗ ν uN u∗N (R1,∗ ) R1,∗ ) ≤ K(α, β) ) Ra,b Rc,d . a,b,c,d Proof of (24). By symmetry of the v variables we have u 3 v E (R1,∗ ) R1,∗ = M D u 3 (1) ∗ E E (R1,∗ ) vM vM . N Now we apply the same machinery. Consider the interpolating Hamiltonian −Ht (u, v) = N r M −1 X X j=1 i=1 + N X i=1 r β β 2 2 β Wij ui vj + ui u∗i vj vj∗ − u v N N 2N i j βt βt 2 2 βt ∗ WiM ui vM + ui u∗i vM vM − u v , N N 2N i M and let h·it be the associated Gibbs average and νt (·) = Eh·it . The exact same argument goes through with the roles of u and v flipped. For instance, when one takes time derivatives, (a) (b) u arise from the Hamiltonian, and one sees that terms of the form vM vM Ra,b Thus we similarly obtain   u 4 u 3 (1) ∗ ) . ν0′ (R1,∗ ) vM vM = βν0 (R1,∗  X    u 3 (1) ∗ u 4 u u 3 u ν (R1,∗ ) vM vM − βν (R1,∗ ) ≤ K(α, β) . ν (R1,∗ ) Ra,b Rc,d a,b,c,d  27
10math.ST
Biologically Inspired Networking and Sensing: Algorithms and Architectures The Dendritic Cell Algorithm for Intrusion Detection Feng Gu University of Nottingham, UK Julie Greensmith University of Nottingham, UK Uwe Aicklein University of Nottingham, UK ABSTRACT As one of the solutions to intrusion detection problems, Artificial Immune Systems (AIS) have shown their advantages. Unlike genetic algorithms, there is no one archetypal AIS, instead there are four major paradigms. Among them, the Dendritic Cell Algorithm (DCA) has produced promising results in various applications. The aim of this chapter is to demonstrate the potential for the DCA as a suitable candidate for intrusion detection problems. We review some of the commonly used AIS paradigms for intrusion detection problems and demonstrate the advantages of one particular algorithm, the DCA. In order to clearly describe the algorithm, the background to its development and a formal definition are given. In addition, improvements to the original DCA are presented and their implications are discussed, including previous work done on an online analysis component with segmentation and ongoing work on automated data preprocessing. Based on preliminary results, both improvements appear to be promising for online anomaly-based intrusion detection. Key Terms: Artificial Immune Systems, Dendritic Cell Algorithm, Danger Theory, Intrusion Detection, Botnet, Signal, Antigen, Deterministic DCA, Negative Selection, Segmentation, Correlation Coefficient, Information Gain, Principal Component Analysis. INTRODUCTION Artificial Immune Systems (AIS) (de Castro and Timmis, 2003) are computer systems inspired by both theoretical immunology and observed immune functions, principles and models, which are applied to real world problems. The human immune system, from which AIS draw inspiration, is evolved to protect the host from a wealth of invading microorganisms. AIS are developed to provide the similar defensive properties within a computing context. Initially AIS were based on simple models of the human immune system. As noted by Stibor et al. (2005), “first generation algorithms”, including negative selection and clonal selection do not produce the same high quality performance as the human immune system. These algorithms, negative selection in particular, are prone to problems with scaling and the generation of excessive false alarms when used to solve problems such as network based intrusion detection. Recent AIS use more rigourous and up-to-date immunology and are developed in collaboration with modellers and immunologists. The resulting algorithms are believed to encapsulate the desirable properties of immune systems including robustness, error tolerance, and self-organisation (de Castro and Timmis, 2003). 1 One such “second generation” AIS is the Dendritic Cell Algorithm (DCA) (Greensmith, 2007), inspired by the function of the dendritic cells (DCs) of the innate immune system. It incorporates the principles of a key novel theory in immunology, termed the “danger theory” (Matzinger, 2002). This theory suggests that DCs are responsible for the initial detection of invading microorganisms, in addition to the induction of various immune responses against such invaders. An abstract model of natural DC behaviour is used as the foundation of the developed algorithm. The DCA has been successfully applied to numerous computer security related, more specific, intrusion detection problems, including port scan detection (Greensmith, 2007), botnet detection (Al-Hammadi et al., 2008) and a classifier for robot security (Oates et al., 2007). According to the results, the DCA has shown not only good performance in terms of detection rate, but also the ability to reduce the rate of false alarms in comparison to other systems, including Self Organising Maps (SOM) (Greensmith et al., 2008). The main aim of this chapter is to demonstrate the reason for why the DCA is a suitable candidate for intrusion detection problems. In order to clearly describe the algorithm, the background and a formal definition are given. In addition, improvements to the original DCA are presented and their implications are discussed. The chapter is organised as follows: firstly, background information about a series of well known AIS algorithms and intrusion detection are described in section 2; secondly, several population AIS approaches for intrusion detection are introduced in section 3; thirdly, the algorithm details and formal definition of the DCA are demonstrated in section 4; fourthly, issues with the current DCA and potential solutions are discussed in section 5; finally, a summary of the work and some future directions are given in section 6. BACKGROUND Intrusion Detection Intrusion detection involves the detection of any disallowed activities in networked computer systems. Based on deployment, intrusion detection systems can be grouped into either hostbased or network-based. Host-based intrusion detection refers to the systems that monitor and collect data from the host machine. Data can be log files that include system information, such as CPU usage, memory usage, incoming/outgoing network traffics, and information of processes that are running on the host. Conversely, network-based intrusion detection refers to the systems that monitor and collect network traffic data among multiple hosts that are required for protection. Each host is a source of monitoring and collecting data, termed ‘sensor’. Generally, network traffic is represented by network packets, which contain information of communications between the sources and destinations, such as IP address, port, service etc. Nowadays, most intrusion detection systems are hybrids of host-based and network-based deployments (Bejtlich, 2005). Another way of categorising intrusion detection systems is based on detection methods, namely signature-based detection and anomaly-based detection (NIST, 2001). Signaturebased detection, also known as misuse detection, distinguishes an intruder by comparing patterns or signatures of the intruder with previously known intrusions. As soon as any matches occur, an alarm is triggered. Whereas, anomaly-based detection involves discriminating between normal and anomalous data, based on the knowledge of the normal data. Thus, firstly the system needs to generate profiles of normality by either training or statistical analysis. During detection, anything that deviates from the normal profile is classified as anomalous, and an alarm is launched. Both signature based and anomaly based 2 detection have different strengths and weaknesses. Signature-based detection produces high detection rate and low rate of false alarms, but it can only recognise the intruders or attacks are previously seen. Anomaly-based detection is capable of novel intruders and attacks that have not been seen before, but it encounter the problem of generating relatively high rate of false alarms. This problem stems from the way in which normal profiles are generated, as in most cases the collected data are just a small sample and thus not representative of the whole problem. Current techniques are often unable to cope with the dynamic changes of normal profile in real world problems and complex systems, such as large computer networks in which massive amount of nodes and uncertainties are presented. AIS Algorithms AIS researchers believe that AIS are intended to perform similar functions to the natural immune, such as defence and maintenance of the host, in a computational context. Unlike genetic algorithms, there is no one archetypal AIS, instead there are four major AIS paradigms, including the Negative Selection Algorithm (NSA) (Hofmeyr &Forrest, 1999), the Clonal Selection Algorithm (CSA) (de Castro &Von Zuben, 2000), the algorithms based on idiotypic networks models (Hart & Timmis, 2008), and the Dendritic Cell Algorithm (DCA) (Greensmith, 2007). These algorithms map the defence function of the immune system, in which certain immune entities and their functions or behaviour are included. Commonly seen immune entities are antigens which are protein particles recognised by the immune system, immune cells that perform certain immune functions individually or collaboratively, and antibodies that are detectors capable of recognising and binding to antigens. These algorithms generally involve generating effective detectors that can recognise the invading intruders and induce reactions against potential threats. The NSA are inspired by the behaviour of a population of immune cells, named “T-cells”, which belong to the adaptive immune system. In order to become functional, natural T-cells undergo “negative selection” for maturation in the thymus. First of all, the immune system generates a population of naive T cells with random specificity. Any naive T-cells that are reactive to self components are then removed from the population during this process. Remaining T-cells should only react to non-self substances, which according self/non-self theory (Coico et al., 2003) are threats to the host. From an algorithmic point view, the NSA has the following steps: 1. The system initialises certain amount of random detectors, named “naive detectors”; 2. The system generates a self set from the training data that only contains normal data instances; 3. The naive detectors are compared with the self set, to produce a population of detectors that only react to intruders, termed “mature detectors”; 4. The data instances in the testing data are compared with each mature detector, and if any detector reacts to the incoming data instance, an alarm is triggered. Comparisons in training and testing (detection) are accomplished by certain matching functions, to assess the affinity of two compared candidates, where an activation threshold is applied. The CSA are based on Burnett’s theory of clonal selection and immune memory (Coico et al., 2003). This includes several adaptive and learning processes. It involves another population of immune cells, named “B-cells”, which produce antibodies capable of detecting diverse and numerous patterns of invading threats. Immune memory is composed of “memory cells” that are able to remember the previously seen threats. The procedures of the CSA are as follows: 3 1. The system initialises certain amount of random solutions to a given problem; 2. These solutions are then being exposed to training; 3. In each generation, the best solutions are selected based on a affinity measure, to reproduce with multiple clones; 4. Current solutions then undergo a mutation process with high frequency, which is proportional to the affinity measure; 5. Optimal solutions are selected in the current population, to form memory cells; 6. The steps above keep repeating until a termination point is reached. In brief, the system also uses pattern recognition mechanism for information processing, to make decisions of selecting the optimal solutions. The probability of a solution being replaced is proportional to its goodness. The better a solution is, the more clones are reproduced. As a result, majority of the population are optimal solutions. Idiotypic network based algorithms are derived from the immune network theory proposed by Jerne (Jerne, 1974). It suggests that the immune system can be seen as a network in which immune entities interact with each other even when antigens are absent. The interactions can be initialised not only between antigens and antibodies, but also between antibodies and antibodies. This induces either stimulating or suppressive immune responses. They result a series of immunological behaviours, including tolerance and memory emergence. There are three major factors that affect the stimulation level of B-cells (Timmis et al., 2008), which are the contribution of the antigen binding, the contribution of neighbouring B-cells, and the suppression of neighbouring B-cells. As the stimulation level of a B-cells increases, the amount of clones it produces increases accordingly. At the population level, this results a diverse set of B-cells. In addition, three mutation mechanisms are introduced, including crossover, inverse and point mutation. In principle, the idiotypic network based algorithms are similar to the CSA, apart from the interactions between solutions in the repertoire, which may result a higher convergence rate. APPLICATIONS OF AIS TO INTRUSION DETECTION Since AIS are designed though mimicking certain properties of the natural immune system, especially the detection mechanism for intruders, obvious applications of AIS can be intrusion detection problems (Kim et al., 2007). However, not all AIS paradigms are applicable, majority of the applications involve the NSA, the idiotypic network based algorithms and the DCA. In this sections, a number of noticeable applications are described. The NSA-based Approaches Initial development of an NSA based intrusion detection system was by Hofmeyr et al. (1999). The system aimed to solve problems that involve detecting malicious connections between one computer in the Local Area Network (LAN) and one external computer. Connections are represented as 49-bit binary strings that include the source IP, destination IP, source port, destination port and service type etc. Detection is performed through string matching between connection string s and detector string d, using r-contiguous bits rule (if s and d have the same symbols in at least r contiguous bits positions). The value r is a threshold that determines the specificity of a detector. The system has a training phase where negative selection mechanism is used. Later on, a real-valued NSA was proposed by González & Dasgupta (2003), in which data representation is changed from binary strings to real-valued numbers. The use of such data representation was intended to speed up detector 4 generation process. As pointed out in (Stibor et al., 2005), the NSA (no matter binary string version or realvalued version) have numerous problems: firstly they cannot avoid the curse of dimensionality, and not applicable to data with high dimensionality; secondly, the detector generation can result holes within the shape-space, so it is difficult to cover just non-self, and it either generates the population of detectors covering both non-self and unseen self (overfit) or only covering partial non-self (under-fit); thirdly, the NSA still take extensive time period to generate the adequately complete set of detectors. Therefore, negative selection is insufficient and not suitable for anomaly detection. The Idiotypic Network Approach Ostaszewski et al (2008) proposed an adaptive and dynamic intrusion detection system based on idiotypic network. This system was designed mainly for the detection of a special type of attacks, namely “denial of service” (DOS). The DAPRA 1999 dataset (MIT Lincoln Lab, 1998 ) was used to test the system. As the aim was to provide comprehensive information of network behaviour, rather than raise alarms whenever inappropriate activities are identified, the evaluation of system performance also considered the amount of information generated during usual events. The proposed system provides a means of gathering information about incoming, or proceeding attack from the very beginning, to take efficient countermeasures against threats. According to the experiments, monitoring activities of the idiotypic network helped to identify DOS attacks in the tested data, and different kinds of attacks showed their own particular impacts on the system. In addition, extra information can be extracted from the idiotypic network to facilitate the identification of anomalies. The Danger Theory Approach The DCA was developed to overcome the problems shown with the NSA. It was initially proposed and developed by Greensmith et al. (2005) where it was applied to a basic and standard machine learning dataset, the UCI Wisconsin Breast Cancer dataset (UCI). For this simple dataset, a classification accuracy of 99% was produced. The DCA was then applied to the ping scan detection (Greensmith et al., 2006) in computer security. The results showed that the algorithm could achieve 100% classification accuracy when appropriate thresholds are used. The DCA was later on applied to SYN scan detection (Greensmith & Aickelin, 2007) where the collected dataset consists of over five million data instances. The detection scenario was that the SYN scan was launched from a victim machine, where the DCA is used to monitor the behaviours of the victim. This scenario represents a scan performed by an insider, who can be a legitimate user of the system doing unauthorised activities. The algorithm produced high true positive rate and low false positive rate, and each experiment could be finished within acceptable time despite the large quantity of data it needs to process. The DCA was also applied to Botnet detection (Al-Hammadi et al., 2008). Botnets are decentralised and distributed networks of subverted machines, controlled by a central commander, namely “botmaster”. A single bot is a malicious piece of program that can transfer victim machines into zombie machines once installed. This work demonstrated the application of the DCA to the detection of a single bot, to assess its performance on this novel problem area. The results indicated that the DCA was able to distinguish the bot from the 5 normal processes on a host machine. The DCA was then applied to a benchmark intrusion detection dataset (Gu et al., 2008), KDD Cup 1999 (Hettich & Bay, 1999). KDD 99 has been widely used and understood, and it is one of the only few labelled datasets that are publicly available in the field of intrusion detection. A preliminary comparison is performed, among the DCA, the real-valued NSA with constant detectors and the C4.5 decision tree algorithm. The results show that the DCA produces reasonably good performance compared to others. The applications of the DCA indicate the strengths of the algorithm as follows: firstly, the DCA does not require a training phase and the knowledge of normality and anomaly is acquired through basic statistical analysis, so the applications may be less time consuming than other supervised learning algorithms; secondly, the DCA performs linear calculations for its computation, making the system low weight and ideally for intrusion detection tasks. Both strengths make the DCA a suitable candidate for intrusion detection tasks, which mainly require high detection speed. In summary, the DCA has shown reasonable detection accuracy in the past applications, and it has the advantage of not having a training phase shortening the application process and low weight in computation improving detection speed. As a result, if one needs a system such that a high requirement of detection speed is more crucial, the DCA can be a suitable solution. THE DENDRITIC CELL ALGORITHM The DCA is a population-based algorithm, designed for tackling anomaly-based detection tasks. It is inspired by functions of natural DCs of the innate immune system, which form part of the body's first line of defence against invaders. DCs have the ability to combine a multitude of molecular information and to interpret this information for the T-cells of the adaptive immune system, to induce appropriate immune responses towards perceived threats. Therefore, DCs can be seen as detectors for different policing sites of the body as well as mediators for inducing a variety of immune responses. Algorithm Overview Signal and antigen are two types of molecular information processed by natural DCs. Signals are collected by DCs from their local environment and consist of indicators of the health of the monitored tissue. DCs exist in one of three states of maturation to throughout their lifespans. In the initial immature state, DCs are exposed to a combination of signals. Based on the concentration of various signals, DCs can differentiate into either a “fully mature” form to activate the adaptive immune system, or a “semi-mature” form to suppress it. During their immature phase DCs also collect debris in the tissue which are subsequently combined with the environmental signals. Some of the “suspicious” debris collected are termed antigens, and they are proteins originating from potential invading entities. DCs combine the “suspect” antigens with evidence in the form of processed signals to correctly instruct the adaptive immune system to respond, or become tolerant to the antigens in question. For more information regarding the underlying biological mechanisms, please refer to (Greensmith, 2007 and Lutz and Schuler, 2002). The DCA incorporates the functionality of DCs including data fusion, state differentiation and information temporal correlation. For the remainder of the chapter the term “DC” will refer to the artificial agent based cell, not the natural DCs. For the DCs in the DCA, as per the natural system, there are two types of input data, signal and antigen. Signals are represented 6 as vectors of real-valued numbers, which are measures of the monitored system's status within certain time periods. We term this information as “system context” data. Antigens are categorical values that can be various states of a problem domain or the entities of interest associated with a monitored system. In real world applications, antigens represent what to be classified within a problem domain. For example, they can be process IDs in computer security problems (Al-Hammadi et al., 2008, Greensmith and Aickelin, 2007), a small range of positions and orientations of robots (Oates et al., 2007), the proximity sensors of online robotic systems (mokhtar2009), or the time stamps of records collected in biometric datasets (Gu et al., 2009). Signals represent system context of a host or a measure of network traffic (Al-Hammadi et al., 2008, Greensmith and Aickelin, 2007), measurements derived from various sensors in robotic systems (Oates et al., 2007, Mokhtar et al., 2009), or the biometric data captured from a monitored automobile driver (Gu et al., 2009). Signals are normally precategorised as “PAMP”, “Danger” or “Safe” in the DCA. The semantics of these signal categories is listed as follows. • PAMP: a measure that increases in value as the observation of anomalous behaviour. It is a confident indicator of anomaly, which usually presented as signatures of the events that can definitely cause damage to the system. • Danger: a measure indicates a potential abnormality. The value increases as the confidence of the monitored system being in abnormal status increases accordingly. • Safe: a measure that increases value in conjunction with observed normal behaviour. This is a confident indicator of normal, predictable or steady-state system behaviour. Increases in the safe signal value suppress the effects of the PAMP and danger signals within the algorithm, as per what is observed in the natural system. This immunological property has been incorporated within the DCA in the form of predefined weights for each signal category, for the transformation from input signals to output signals. The output signals are used to evaluate the status of the monitored system, to determine the presence of anomalies or misbehaviours. A relationship of cause-and-effect is believed to exist between signals and antigens, where signals are the explicit effects that potentially result from the implicit cause of antigens. This is achieved if the input data is correctly mapped to the underlying problem domain. The goal of the DCA is to incorporate such a relationship to identify antigens that are responsible for the anomalies reflected by signals. Therefore, the algorithm operates in two steps, firstly it identifies whether anomalies occurred in the past based on the input data; secondly it correlates the identified anomalies with the potential causes, generating an anomaly scene per suspect. This is achieved by deploying a population of artificial cells, DC objects, which operate in parallel as detectors. Diversity is generated within the DC population through the application of lifespans, which limit the amount of information an individual DC object can process. Different DCs are given different limits for their lifespan, which creates a variable time window effect, with different DC objects processing the signal and antigen data sources during different time periods across the analysed time series (Oates et al., 2008). It is postulated that the combination of signal/antigen temporal correlation and diversity of the DC population are responsible for the detection capability of the DCA. Development Pathway In this section a brief history is given of the development of the DCA and the numerous versions that have appeared over the past few years. An overview of this process is given in Figure 1. 7 Figure 1. Development pathway of the DCA. Following the development of the initial abstract model the applicability of the DCA was first demonstrated in a prototype system (pDCA) (Greensmith, 2007). Here the pDCA was applied to a binary classification problem which demonstrated this population based algorithm was capable of performing two-class discrimination on an ordered dataset, using a timestamp as antigen and a combination of features forming three signal categories. After the encouraging results achieved, the pDCA was further developed into a larger system, combined with the immune-inspired agent based framework libtissue. This version (ltDCA) was stochastic in nature and contained numerous somewhat unpredictable elements including random sampling of incoming antigen, signal decay and randomly assigned migration thresholds. While ltDCA yielded positive results in a number of applications, it contained too many arbitrary and random components, rendering detailed study of its behaviour as an algorithm almost infeasible. Initially the ltDCA was applied to problems in computer and network security including port scan detection and sensor network security. In parallel to the development of ltDCA, this algorithm steadily increased in popularity especially within the AIS community, being applied to a range of problems. This includes its use as a robotic classifier for physical security. To adapt the ltDCA for purpose, to obtain a reasonable mapping of signal and antigen data, a number of modifications were made, including the segmentation of the output information to provide localisation information for a detected anomaly and the integration of a re-implemented ltDCA with a Brookes style ‘subsumption architecture’. This experiment in effect validated the use of the DCA as an anomaly detection technique and transformed its analysis stage into an online process. Despite its successful application in a number of problem domains, several issues arose in particular with understanding the nature of the "signal and antigen" model of input, and how to interface the categories with given input data. Definitions for the data streams, initially heavily reliant on biological metaphors, were never sufficiently clear and the stochastic nature of ltDCA exacerbated this problem. Theoretical analysis implied that the ltDCA was simply an ensemble linear classifier, which contradicted some of the claims made previously about the manner by which the ltDCA functions. In response to this, a large amount of randomness was removed from the algorithm and a 8 simplified version developed, named the deterministic DCA (dDCA). This DCA variant is predictable in its use; one can follow a single antigen element throughout the system, and given a priori knowledge of the signals used and the antigen's relative position to all other antigen it is possible to predict its classification. It is shown that the dDCA does not have impaired performance in comparison to ltDCA, and it is possible to calculate crucial algorithmic information such as its real-time capability and run-time complexity values. Still, the dDCA does not avoid the problems that accompany its interface to underlying datasets, nor does it solve the problem of having a non-adaptive analysis module. We propose that ultimately it is necessary to develop an integrated DCA (iDCA) which can automatically extract and select relevant components of underlying data and can adapt to appropriately produce anomaly discrimination in real time and adapt to changes in the underlying dataset. The difference in the dDCA in comparison to a hypothetical iDCA are numerous, therefore we propose to initially develop an intermediate version extended from the dDCA, termed xDCA which is described and used in this paper. IMPROVEMENTS TO THE ORIGINAL DCA Recently a series of improvements to the original DCA have been made, to respond to some of the criticisms. Firstly, a formal definition of the DCA is given to avoid the potential ambiguities of the algorithm. Secondly, an online analysis component based segmentation approaches is introduced to enable periodic and continuous analysis. Thirdly, automated data preprocessing methods based on dimensionality reduction and statistical inference techniques for automated signal selection and categorisation. Formalisation of the Algorithm One criticism of the DCA is the lack of a formal definition, which results in ambiguity for understanding the algorithm and thus leads to incorrect applications and implementations. A formal definition of the DCA should be provided for clearly presenting the algorithm. In this section, we define data structures of the DCA and formalise the algorithm. We concentrate on specifying the entire DC population using quantitative measures at the functional level, and basic set theory and computational functions such as addition, multiplication and recursion are used for clarity. Data Structures Define Signal ⊆ R 3 and Antigen ⊆ N to be the two types of input data. Within a time period ( Time ⊆ R ), the input data can be defined as S : Time →Signal ∪ Antigen , and S ( t ) is an instance of input data where t ∈ Time . Elements of Signal are corresponding to three signal categories of the DCA as mentioned, which are represented as three-dimensional (3D) vectors and usually normalised into a predefined nonnegative range. Elements of Antigen are categorical values, represented as natural numbers where ordering is ignored. Define the weight matrix of signal transformation as W , a matrix with two rows and three columns, where w ij ∈ R . The weight matrix is used to transform three categories of input signal to two categories output signals. It is usually predefined by users, and kept constant during runtime. The entries are based on empirical results from the underlying immunology. We use the notation List( A) for a list of type A . Let Population be a set of DC objects and 9 N = Population be the population size, a DC object consists of: • a unique index i ∈ {1,2,...,N }; • a lifespan I : Population →R ; • an initial value of its signal profile K : Population →R , which is equal to zero; • a list List(Antigen) for storing its antigen profile. The signal profile is a measure of processed signal instances, whereas the antigen profile is a measure of sampled antigen instances. Each DC object is able to update its internal data structures by calling relevant operations. The output of each DC is stored in a list of N × R . We use lst( j) to denote the jth element of lst, and π1 and π 2 for projection functions to get the first and second dimension of a 2-D vector respectively. Procedural Operations To access the data structures of the DCA, a series of procedural operations are called. These procedural operations describe behaviours of the algorithm at the functional level. They are the most fundamental elements of the algorithm, each of which is executed in one step. The aim of formalising these operations is to present them as simple and clear as possible without losing details. Let Append(x, X) be a generic function of appending an element x (2-D vector) to a list X (a list of 2-D vectors). The type of x determines the type of X , they can be N × R or R × R . It is different from “unite” of sets, as duplicates are not eliminated. The function operates by appending the new element to the current list, so it is executed in one step. At the beginning ( t = 0 ), the algorithm initialises all DC objects in Population by assigning the initial values of I(i) and K (i) , namely “DC initialisation”. The value of I(i) depends on the density function used to generate the initial lifespan of each DC object. Both uniform distribution and Gaussian distribution can be applied. Definition 1 (signal transformation). The signal transformation function is defined as O : Time →R × R.  S(t) • W T , S(t) ∈ Signal; O(t) =  otherwise,  Null, where • is a multiplication operator for two matrixes. This operation is executed whenever S(t) ∈ Signal holds, and it performs a multiplication between a 3-D vector and a transposed 2 × 3 matrix to produce another 2-D vector, which consists of two output signals, namely “CSM” and “K”. In the case that S(t) ∈ Antigen holds, the function returns Null . Definition 2 (lifespan update). The lifespan update function is defined as F : Time × Population →R.  I(i), t = 0;  F(t,i) =  I(i) − π1 (O(t)), F(t −1,i) ≤ 0;   F(t −1,i) − π1(O(t)), otherwise. When t = 0, the initial value of F is I(i) which is the initial lifespan of a DC object. It is repeatedly subtracted by CSM signal until the termination condition, F(t −1,i) ≤ 0 , is reached, and then it is reset to its initial value I(i) . Definition 3 (signal profile update). The signal profile update function is defines as G : Time × Population →R. 10  K(i), t = 0;  G(t,i) =  K(i) + π 2 (O(t)), F(t −1,i) ≤ 0;  G(t −1,i) + π 2 (O(t)), otherwise. When t = 0, the value of G is K(i) = 0 which is the initial signal profile of a DC object. It is repeated added by k signal the termination condition is reached, and the it is reset to its initial value K(i) = 0 . Definition 4 (antigen profile update). The antigen profile update function is defined as H : Time × Population →List(Antigen) .  Append(S(t),H(t −1,i)), S(t) ∈ Antigen; H(t,i) =  Null, otherwise.  Initially H is empty, and when a new antigen instance arrives, it is sampled by a DC object and stored into its list until the termination condition is reached. The index of the DC object selected is defined as i ≡ θ (mod N) , where θ is the number of antigen instances up to time t . This is termed the “sequential sampling” rule. Definition 5 (output record). Let R(t,i) = {(r,a) r = G(t,i) ∧ a ∈ H(t,i)} be the output of a DC object, and the output record function is defined as (F(t,i) ≤ 0) ∧ (t > 0) ⇒ Append(R(t,i),lst) . Where r is the signal profile and a is the antigen profile recorded by a DC object. This function is responsible for appending the output of a DC object (a 2-D vector) into the output list lst when the termination condition is reached. The processed information in lst is used to produce the final detection results in the analysis phase. Definition 6 (antigen counter). The antigen counter function for each antigen type α ∈ Antigen is defined as C : N × N →{0,1}. 1, π1 (lst( j)) = α; C( j, α ) =  otherwise. 0, Definition 7 (signal profile abstraction). The signal profile abstraction function is defined as R : N × N →R. π 2 (lst( j)), π1 (lst( j)) = α ; R( j, α ) =  0, otherwise.  Function C counts the number of instances of antigen type α , and function R calculates the sum of all k values associated with antigen type α . These two operations are performed for every single antigen type, and involve scanning lst in its entirety. Definition 8 (anomaly metric calculation). The anomaly metric calculation function of K(α ) is defined as. n −1 n −1 j =0 j =0 β = ∑ C( j, α ) ∧ γ = ∑ R( j, α ) ⇒ K(α ) = γ β As α is a known antigen type, we have β ≥1. A threshold can be applied for further classification. The value of the threshold depends on the underlying characteristics of the dataset used. If K(α ) is greater than the predefined threshold, it is classified as anomalous, other normal. The procedural operations of the DCA are formally defined in previous section, so by combining them with for or while loops and if statements the algorithm can be presented as the following Pseudocode. foreach DC object do DC initilisation; 11 end while input data do if antigen then antigen profile update; end if signal then signal transformation; foreach DC object do lifespan update; signal profile update; if termination condition then output record; end end end end while ouput list do foreach antigen type do antigen counter; signal profile abstraction; anomaly metric cacluation; end end Online Analysis Component An online analysis component is essential for developing an effective intrusion detection system using the DCA. Such a component performs periodic analysis of the processed information presented by DCs, to continuously identify intrusions during detection. An effective and fully functioning intrusion detection system should be able to identify the intrusions as quickly as possible, as accurately as possible, and hence detection speed and detection accuracy are two major indicators of performance. By detection speed here we meant the time an intrusion detection system takes to identify intrusions or anomalies during detection. Most techniques can produce reasonable detection accuracy, if sufficient time is given. But in most case detection speed is more significant for assessing the performance of an intrusion detection system. If the system fails to identify the intrusions in time, no further responses against the intrusions can be made. This leads to the eventual success of attacks, which is a fatal failure of an intrusion detection system. In other words, if the intrusions are identified too late, even with 100% detection accuracy, it all becomes meaningless in terms of system defence. As a result, we propose integrating online analysis with the DCA, to improve detection speed without compromising detection accuracy. If online analysis is to be performed during detection, one issue needs resolved, namely, when to perform analysis. This could be solved by introducing segmentation to the DCA. It is different from the moving time windows method described in (Gu et al., 2008), which is used in the pre-processing stage to smooth noisy input signals, as segmentation is performed in the post-processing stage for the purpose of periodic and continuous analysis. As the processed information is presented by matured DCs over time, a sequence of processed information is being generated during detection. Segmentation involves partitioning this sequence into relative smaller segments, in terms of the number of data items or time. All the generated segments have the same size, and the analysis is performed within each individual segment. Therefore, in each segment, one set of detection result ( K(α ) per antigen type) is generated, in which intrusions appeared within the duration of this segment can be identified. First of all, segmentation can produce multiple sets of results, rather than one set of results produced by non-segmentation system. This enables the system to perform analysis online not offline, as all segments are processed during detection. In addition, segmentation distributes the analysis process into multiple steps, instead of performing at once. This can reduce the computation power and time required for the analysis process, so segmentation 12 can effectively enhance detection speed. Moreover, as the processed information is presented by matured DCs at different time points over the duration, analysing the sequence of processed information at once ignores the temporal difference of each piece of processed information. As a result, the same antigen type that causes malicious activities at one point but does nothing at another point may be classified as normal rather than an intrusion. This can be avoided by applying segmentation, as it features periodic analysis that can cope with the inherited time differences. Therefore, the system can effectively discriminate malicious activities from normal ones, and hence the detection accuracy can also be improved. The most important and in fact the only factor of segmentation is the segment size. It determines how soon the intrusions can be identified. The smaller the segment size, the sooner the intrusions can be identified, and vice versa. Moreover, the segment size may also influence the sensitivity of the final results. If the segment size is too large, the results can lose the sensitivity and thus the system loses the ability to identify true positives. However, if the segment size is too small, the results may be too sensitive, and the system can generate false positives. In (Gu et al., 2009), the authors have shown that applying segmentation to the DCA makes significant differences to the results. In some cases, the system with segmentation may even produce better performance in terms of detection accuracy. In addition, segmentation enables the system to perform periodic analysis on the processed information presented by the DCs. As a result it can effectively improve detection speed without compromising detection accuracy. Therefore, segmentation is applicable to the DCA. Even though segmentation is not immune inspired, it can still make contribution to the field of AIS, as it can improve the system performance of the DCA. As a result, more effective intrusion detection systems can be developed, by integrating segmentation with the DCA. This method is also applicable to other second generation AIS algorithms. Automated Data Preprocessing The DCA encounters issues that accompany its interface to underlying datasets, as well as have a non-adaptive analysis module. Formal definition and theoretical analysis have shown that the algorithm itself is rather simple, and segmentation enables the DCA to efficiently and effectively process large datasets in terms of data size. However, data size is not the only concern when handling complex datasets, high dimensionality is often a bigger problem. Complexity occurs at the data pre-processing stage of the DCA when dimensionality reduction is required. Previously, the data pre-processing of the DCA is performed manually based on users' expert knowledge of a given problem domain, which is time consuming and sometime difficult to achieve. As a result, it is necessary to automate the data pre-processing stage, which extracts and selects relevant features, and adapts the algorithm to characteristics of the underlying data. Originally the DCA does not rely on training data to define which of the input signals are potentially “dangerous”. But expert knowledge of the problem domain is required to generate proper input data to the DCA during manual data pre-processing. It involves two steps, namely “antigen representation” and “signal selection and categorisation” for generating two types of input to the DCA. Since antigen representation involves identifying the objects to classify as normal or anomalous in the problem, it is usually easy to accomplish and thus does not require automation. The rest of this section is focused on the automation of signal selection and categorisation in the DCA. Signal selection and categorisation involve firstly selecting or extracting the most interesting features from the original feature set of a given dataset, and then categorising these features 13 into one of three signal categories of the DCA. Manual methods are problematic, as whenever the problem is changed, the whole process needs to be redone. Even for the same dataset, if cross-validation is used, the process needs to be performed for every single subset generated. In addition, it is not always possible to acquire adequate expert knowledge for a dataset to effectively perform signal selection and categorisation for the DCA. In order to automate signal selection and categorisation, techniques of dimensionality reduction and statistical inference are used, and an unsupervised “training phase” is introduced to obtain the underlying knowledge regarding normality and anomaly of a problem. Let X = {x 1 ,x 2 ,...,x m } the original feature set of a problem. Dimensionality reduction involves generating a new feature space Y = {y1, y 2,..., y d } ( d < m ), which is supposed to be representative of the problem with minimum redundancy. Feature selection involves selecting a best subset of input features. Feature extraction creates new features based on transformations or combinations of the original features. The choice between feature selection and extraction depends on the problem domain and classifier. The possible techniques are listed as follows. • Correlation Coefficient (with class labels) - feature selection • Information Gain (with class labels) - feature selection • Principal Component Analysis (PCA, without class labels) - feature extraction Preliminary work has been carried out in Gu et al. (2009), in which the authors showed that it was possible to integrate PCA with the DCA for the purpose of automated data preprocessing. The PCA facilitateed the reduction of data dimension of the raw data, to select proper features as the candidates of the input of the DCA. It was also used for the ranking of attributes based on the variability, which is mapped to the ranking of signal categories of the DCA for signal categorisation. In this way, the data preprocessing of the DCA is performed by simply using PCA and basic Min-Max normalisation, without the requirement of any expert knowledge of the problem domain. The results suggested that the integrated system of PCA and the DCA was successful in terms of anomaly detection, as the system can produce relatively high true positive rates and low false positive rates. As a result, the application of PCA to the DCA makes it possible to automatically categorise input data into user-defined signal categories, while still generating useful and accurate classification results. More recently, automated data preprocessing methods based on feature selection/extraction and statistical inference techniques are developed. The idea is to use dimensionality reduction techniques to select the most interesting features from the original feature set as the candidates of input signals to the DCA, then perform greed search to find the best combination of these candidates corresponding to the signals categories where mean square errors (MSE) (Garthwaite et al., 2006) is employed as a performance measure. The new system is tested by a number of datasets, as well as compared with other existing machine learning techniques. The testing datasets include: the UCI Wisconsin Breast Cancer dataset (Blake et al., 1998) consists of 700 data instances and each data item has 10 features; the KDD 99 dataset derived from the DAPRA 98 Lincoln Lab data set for applying data mining techniques to the area of intrusion detection, it consists of about 5 million data instances, each of which has 42 features. Two versions of the KDD 99 dataset are used: a 10% subset whose data items are randomly and proportionally selected from the whole dataset; and the whole dataset. As these two datasets are much more complicated, 10-fold cross validation is performed to generate 10 subsets. For the purpose of baseline comparison, other existing techniques, including K-Nearest-Neighbour (KNN), decision trees, and Support Vector Machine (SVM) algorithms are used. Table 1 shows the true positive rate and false positive rate of all methods applied to the breast cancer dataset. As expected, manual method produces high true positive rate and low false positive rate; PCA based method produces better result since its true positive rate is higher 14 and false positive rate is zero; information gain based method has significantly lower true positive rate but comparable false positive rate; correlation based method has comparable true positive rate but significantly higher false positive rate. Table 1. Results of all methods on the breast cancer dataset. Manual PCA Information Gain Correlation True Positive Rate 0.963 0.985 0.789 0.930 False Positive Rate 0.033 0.000 0.008 0.213 As shown in Figure 2 and Figure 3, the manual method and other existing techniques produce good performance in terms of both true positive rate and false positive rate. Whereas, automated methods produce the results that vary from one subset to another. The PCA based method produces high true positive rate and low false positive rate for most subsets, except one where the true positive rate is significantly lower. The information gain based method produces true positive rates within a relatively large range but still all above the boundary of random classifier (50%), and it keeps the false positive rates at a low level. The correlation based method produces high true positive rates across, but simultaneously high false positive rates across all the subsets. The results show that it is possible to automate the data preprocessing of the DCA to produce useful. However, as this is work in progress, more investigation should be performed. Figure 2. Boxplot of true positive rates of all methods for KDD 10% dataset. Figure 3. Boxplot of false positive rates of all methods for KDD 10% dataset. 15 CONCLUSION AND FUTURE DIRECTIONS In this book chapter, we reviewed some of the most popular AIS algorithms for intrusion detection problems, as well as demonstrating that the DCA is a suitable solution due to its unsupervised learning paradigm and low weight in computation. In order to present the DCA as simply and clearly as possible without losing detail, we used set theory and basic functions to formalise the algorithm. In addition, we demonstrated recent work for introducing an online analysis component to the DCA through segmentation, and the results indicate that the approach is promising especially for intrusion detection problems. Finally, ongoing work of automated data preprocessing of the DCA was described. With the automated data preprocessing, applications of the DCA are not dependent on the expert knowledge of the problem, and they become much less time consuming since manual procedures are replaced. Much of the work regarding the further development of the DCA is still ‘work in progress’. For example, only static segment sizes applied and tested for the online analysis component of the DCA, more adaptive mechanisms where segment size varies according the situations encountered during detection should be investigated. Additionally, only preliminary work has been performed for the automated data preprocessing of the DCA, more techniques of feature selection and feature extraction and more appropriate mechanisms for signal categorisation should be evaluated. REFERENCES Al-Hammadi, Y., Aickelin, U., & Greensmith, J. (2008). DCA for bot detection. In Proceedings of the IEEE World Congress on Computational Intelligence (WCCI 2008. Bejtlich, R. (2005). The Tao of network security monitoring: Beyond intrusion detection. Pearson Education. Blake, C. L., Hettich, S., & Merz, C. J. (1998). UCI repository of machine learning databases. Cohen, R. I. (2007). Real and artificial immune systems: Computing the state of the body. Nature Review Immunology, 7, 569-574. Cohen, R. I. (2004). Tending Adam’s garden: Evolving the cognitive immune self. Paperback edition. Elsevier Academic Press. 16 Coico, R., Sunshine, G., & Benjamini, E. (2003). Immunology: A short course. John Wiley & Sons. de Castro, L. N., & Timmis, J. (2003). Artificial immune systems: A new computational intelligence approach. Springer-Verlag. de Castro, L. N., & Von Zuben, F. J. (2000). The clonal selection algorithm with engineering applications. In Genetic and Evolutionary Computation Conference (GECCO) (pp. 36-37). Las Vegas, USA. Farmer, J. D., Packard, N. H., & Perelson, A. S. (1986). The immune learning, adaptation, and machine learning. Physica D, 4, 187-204. Elsevier. Garthwaite, P. H., Jolliffe, I. T., & Jones, B. (2006). Statistical inference, 2nd edition. Oxford Science Publications. González, F. A., & Dasgupta, D. (2003). Anomaly detection using real-valued negative selection. Genetic Programming and Evolvable Machines, 4, 383-403. Springer. Greensmith, J., Aickelin, U., & Cayzer, S. (2005). Introducing dendritic cells as a novel immune-inspired algorithm for anomaly detection. In Proceedings of the 4th International Conference on Artificial Immune Systems (ICARIS), LNCS 3627, (pp. 153-167). Springer. Greensmith, J., Aickelin, U., & Twycross, J. (2006). Articulation and clarification of the dendritic cell algorithm. In Proceedings of the 5th International Conference on Artificial Immune Systems (ICARIS), LNCS 4163, (pp. 404-417). Springer, Greensmith, J., & Aickelin, U. (2007). Dendritic cells for SYN scan detection. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO) (pp. 4956). London, UK. Greensmith, J. (2007). The dendritic cell algorithm, PhD Thesis, University of Nottingham, UK. Greensmith, J., Feyereisl, J. and Aickelin, U. (2008). The DCA-SOMe comparison: A comparative study between two biologically-inspired algorithms. Evolutionary Intelligence, 1(2), 85–112. Gu, F., Greensmith, J., & Aickelin, U. (2008). Further exploration of the dendritic cell algorithm: Antigen multiplier and moving windows. In Proceedings of 7th International Conference on Artificial Immune Systems (ICARIS 2008), (pp. 54-66). Gu, F., Greensmith, J., Oates, R., & Aickelin, U. (2009). PCA 4 DCA: The application of principal component analysis to the dendritic cell algorithm. In Proceedings of the 9th Annual Workshop on Computational Intelligence (UKCI). Gu, F., Greensmith, J., & Aickelin, U. (2009). Integrating real-time analysis with the dendritic cell algorithm through segmentation. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO), (pp. 1203–1210). Hand, D. J., Manila, H., & Smyth, P. (2001). Principles of data mining. Cambridge, MA: The MIT Press. Harel, D. (2003). Computers Ltd.: What they really can’t do. Revised paperback edition. Oxford University Press. Harel, D., & Feldman, Y. (2004). Algorithmics: The spirit of computing, 3rd edition. Addison Wesley. Hart, E., & Timmis, J. (2008). Application areas of AIS: The past, the present and the future. Applied Soft Computing, 8, 191-201. Hettich, S., & Bay, S. D. (1999). The UCI KDD archive. Technical report. Irvine, CA: University of California, Department of Information and Computer Science. Hofmeyr, S. A., & Forrest, S. (1999). Immunity by design: An artificial immune system. In Proceedings of Genetic and Evolutionary Computation Conference (GECCO1999) (pp. 1289-1296). Orlando, USA. Jerne, N. K. (1974). Towards a network theory of the immune system. Ann. Immunol. (Inst. 17 Pasteur), 125C, 373-389. Ji, Z., & Dasgupta, D. (2006). Applicability issues of the real-valued negative selection algorithms. In Proceedings of Genetic and Evolutionary Computation Conference (GECCO2006) (pp. 111-118). Washington, USA. Kim, J. W. (2002). Integrating artificial immune algorithms for intrusion detection. PhD Thesis. University College London. Kim, J. W., Bentley, P., Aickelin, U., Greensmith, J., Tedesco, G., & Twycross, J. (2007). Immune system approaches to intrusion detection - A review. Natural Computing, 6, 413466. Kornek, B., Storch, M. K., Weissert, R., Wallstroem, E., Stefferl, A., Olsson, T., ... Lassmann, H. (2000). Multiple sclerosis and chronic autoimmune encephalomyelitis: A comparative quantitative study of axonal injury in active, inactive, and remyelinated lesions. American Journal of Pathology, 157, 267-276. Lutz, M. B., & Schuler, G. (2002). Immature, semi-mature and fully mature dendritic cells: Which signals induce tolerance or immunity? Trends in Immunology, 23, 445–449. Matzinger, P. (2002). Danger model: A renewed sense of self. Science, 296, 301-305. Mitchell, T. M. (1997). Machine learning. McGraw-Hill. MIT Lincoln Lab Information System Technology Group (1998). The 1998 intrusion detection off-line evaluation plan. Retrieved from http://www.ll.mit.edu/IST/ideval/data/1998/ Mokhtar, M., Bi, R., Timmis, T., & Tyrrell, A. M. (2009). A modified dendritic cell algorithm for on-line error detection in robotic systems. In Proceedings of the 11th IEEE Congress on Evolutionary Computation (CEC), (pp. 2055–2062). NIST. (2001). Intrusion detection systems. NIST Computer Science Special Reports SP 800– 31, November 2001. Oates, R., Greensmith, J., Aickelin, U., Garibaldi, J., & Kendall, G. (2007). The application of a dendritic cell algorithm to a robotic classifier. In Proceedings of the 6th International Conference on Artificial Immune (ICARIS), (pp. 204–215). Oates, R., Kendall, G., & Garibaldi, J. (2008). Frequency analysis for dendritic cell population tuning: Decimating the dendritic cell. Evolutionary Intelligence, 1(2). Rajewsky, K. (1996). Clonal selection and learning in the antibody system. Nature, 381, 751758. Somayaji, A., Hofmeyr, S., & Forrest, S. (1997). Principles of a computer immune system. In Proceedings of New Security Paradigm Workshop (pp. 75-82), Langdale, Cumbria. Stibor, T., Timmis, J., & Eckert, C. (2005). A comparative study of real-valued negative selection to statistical anomaly detection techniques. In Proceedings of 4th International Conference on Artificial Immune Systems (ICARIS2005). LNCS 3627, (pp. 262-275). Springer. Twycross, J., & Aickelin, U. (2006). Libtissue - Implementing innate immunity. In Proceedings of the IEEE Congress on Evolutionary Computation (CEC2006) (pp. 499-506). Vancouver, Canada. 18
9cs.NE
1 A Massively Parallel Associative Memory Based on Sparse Neural Networks arXiv:1303.7032v2 [cs.AI] 21 Jul 2013 Zhe Yao∗ , Vincent Gripon† and Michael G. Rabbat∗ Abstract—Associative memories store content in such a way that the content can be later retrieved by presenting the memory with a small portion of the content, rather than presenting the memory with an address as in more traditional memories. Associative memories are used as building blocks for algorithms within database engines, anomaly detection systems, compression algorithms, and face recognition systems. A classical example of an associative memory is the Hopfield neural network. Recently, Gripon and Berrou have introduced an alternative construction which builds on ideas from the theory of error correcting codes and which greatly outperforms the Hopfield network in diversity, capacity and efficiency. In this paper we implement a variation of the Gripon-Berrou associative memory on a general purpose graphical processing unit (GPU). The work of Gripon and Berrou proposes two retrieval rules, SUM - OF - SUM and SUM - OF - MAX. The SUM - OF - SUM rule uses only matrix-vector multiplication and is easily implemented on the GPU. The SUM - OF - MAX rule is much less straightforward to implement because it involves non-linear operations. However, the SUM - OF - MAX rule gives significantly better retrieval error rates. We propose a hybrid rule tailored for implementation on a GPU which achieves a 880-fold speedup without sacrificing any accuracy. Index Terms—Associative memory, Recurrent neural networks, Parallel processing, High performance computing, Sparse coding, CUDA, GPGPU using conventional memory systems, resemble associative memories since they map keys (inputs) to values (outputs), but still an explicit address needs to be generated first. Associative memories can be categorized into two types [1]: hetero-associative (e.g., linear associator [2], [3], bidirectional associative memories [4] and Willshaw networks [5]) and auto-associative (e.g., Hopfield networks [6], [7]). Heteroassociative memories associate input with output patterns of possibly distinct nature and formats, whereas auto-associative memories are a special case where input and output patterns coincide. This paper focuses on auto-associative memories. Associative memories have applications in a variety of domains. For instance, in communication networks [8], routers need to quickly determine which port an incoming frame should be forwarded to based on the destination IP address. In signal and image processing [9], one commonly needs to match noisy or corrupted data to a predefined template. Similar tasks appear in database engines [10], anomaly detection systems [11], data compression algorithms [12], face recognition systems [13] and many other machine learning frameworks. A. Historical Background I. I NTRODUCTION We are all familiar with conventional memory systems where the address space and the information content stored in the memory are kept separate. For instance, given a mailbox number, we can fetch the parcels inside, and in a modern computer, the CPU retrieves a stored integer from RAM by accessing a specified 32- or 64-bit hardware address. An associative memory is a device or data structure that maps input patterns to output patterns. It differs from conventional memory systems in that no explicit addresses are constructed. Associative memories store paired patterns. Then, given an input pattern, the associative memory produces the paired output pattern. Since no explicit address is involved in its operation, the content of the input pattern itself associates directly with the paired output pattern, from which the name associative memory originates. Although associative memories could be implemented using conventional memory systems, neural networks have been used as associative memories which retrieve patterns without having to search through the stored pattern space. It is worth noting that hash tables, implemented ∗ Z. Yao and M.G. Rabbat are with the Department of Electrical and Computer Engineering, McGill University, Montréal, QC, Canada. Email: [email protected], [email protected]. † V. Gripon is with the Electronics Department, Télécom Bretagne, Brest, France. Email: [email protected]. Associative memories have a long history within the field of neural networks. Associative memories provide two operations: storing and retrieving. In the storing operation, pairs of patterns are fed into the memory and the internal connections between neurons are modified, forming an aggregated representation of the stored pairs. In the retrieving operation (also referred to as “decoding”), the associative memory is presented with a probe pattern, which may be a corrupted or modified version of the stored pattern, and the memory should retrieve the most relevant pattern that was previously stored in a quick and reliable manner. The linear associator [2], [3] is one of the simplest and earliest associative memory models; see Fig. 1 for an illustration. A linear associator has an input layer and an output layer. Synapses only exist between these two layers, hence the network can be viewed as a bipartite graph. Connections in the network are directed from input to output neurons. The number of neurons in each layer can be different in general, so the linear associator can be used as both an auto-associative and a hetero-associative memory. While storing patterns, the linear associator modifies link weights according to Hebb’s rule [14]. While decoding a pattern, the network is presented with a given input pattern, and the paired output pattern is retrieved from the output layer immediately after one step of feed forward computation. Since the paired pattern depends on 2 output: g j wij i i input: f wij j Fig. 1. An example of a linear associator network. Only the synapses of the first neuron in the input layer are drawn. A weight wij is assigned to the synapse between neuron i and neuron j. a linear combination of the input pattern values, if all the input patterns are pairwise orthogonal, then the linear associator can reconstruct the paired patterns perfectly. However, in most cases the orthogonality does not hold, thus the network diversity (i.e., the number of patterns that the network can store) is extremely low. The first formal analysis of associative memories by Willshaw [5], [15] dates back to early 1970’s. The structure of a Willshaw network is similar to a linear associator; it is a two-layer fully connected network, with the exception that the weights on the synapses are constrained to be 0 or 1. The plausibility of biological neural networks discourages a fully connected network. Therefore, Buckingham and Willshaw [16] study an incomplete connected network and propose several retrieval strategies to recall the patterns. Although simple, the Willshaw network is one of the most efficient model in terms of information stored per bit of memory (0.68 for heteroassociative and half of that for auto-associative [17], [18], compared to 0.14 for a Hopfield network [19]). For the history and interesting developments of the Willshaw network, see the recent survey [20] and the references therein. Hopfield’s seminal work [6], [7] on associative memories brought these structures to the attention of the neural network community in the early 1980’s. Fig. 2 shows an example of a Hopfield network, which is a bidirectional complete graph. Instead of having two layers, Hopfield networks comprise one layer of a bidirectional complete graph, acting as both input and output. Therefore, it can only be used as an autoassociative memory. Retrieval of a pattern from the network proceeds recurrently; i.e., when an impulse enters the network, the (output) values at iteration t serve as the input values at iteration t + 1, and the values iterate until the network reaches its stable configuration if it ever converges. Kosko [4] extends the Hopfield network into a two-layer bidirectional associative memory (BAM). BAMs are different from linear associators because the edges in a BAM are not directed, and the retrieval rule is different. In a BAM, values at the input and output iterate until an equilibrium is reached. Since a BAM incorporates distinct input and output layers, it can be used as both a hetero-associative and an auto-associative memory, filling the gap between the linear associator and Hopfield networks. Fig. 2. An example of a Hopfield network with 6 neurons. wij is the weight associated with the synapse between neuron i and neuron j. B. Related Work The recent work of Gripon and Berrou [21], [22] proposes a new family of sparse neural network architectures for associative memories. We refer to these as Gripon-Berrou neural networks (GBNNs). In short, GBNNs are a variant of the Willshaw networks with a C-partite structure for some C > 0. The GBNN combines the notion of recurrence from Hopfield networks with ideas from the field of error correcting codes, and achieves nearly optimal retrieval performance. A detailed description of the GBNN architecture and operation is given in Section II. The GBNN is not the first attempt to link the associative memory with error correcting codes. For example, Berrou and Gripon [23] successfully introduce a set of Walsh-Hadamard codes in the framework of BAMs. The same authors also consider the use of sparse coding in a Hopfield network. They show that, given the same amount of storage, the GBNN outperforms conventional Hopfield networks in diversity, capacity (i.e., the maximum amount of stored information in bits), and efficiency (i.e., the ratio between capacity and the amount of information in bits consumed by the network when diversity reaches its maximum), while decreasing the retrieval error. In [24], GBNNs are interpreted using the formalism of error correcting codes, and a new retrieval rule is introduced to further decrease the error rate. Jiang et al. [25] modify the GBNN structure to learn long sequences by incorporating directed edges into the network. Aliabadi et al. [26] make the extension to learn sparse messages. The literature mentioned in the paragraphs above focuses on studying theoretical properties of GBNNs. To be useful in many applications, it is also essential to develop fast and efficient implementations of GBNNs. Jarollahi et al. [27] demonstrate a proof-of-concept implementation using the field programmable gate array (FPGA). Due to hardware limitations, their implementation is constrained to have at most 400 neurons. Larras et al. [28] implement an analog version of the same network which consumes 1165× less energy but is 2× more efficient both in the surface of the circuit and speed, compared with an equivalent digital circuit. However, the network size is further constrained to 208 neurons in total. 3 C. Contributions The primary contribution of this paper is to demonstrate an implementation of GBNNs on a GPU using the compute unified device architecture (CUDA). Our massively parallel implementation supports a much larger number of neurons than existing ones, and is 880× faster than a CPU implementation using optimized C++ libraries for linear algebra operations, without any loss of retrieval accuracy. All the existing algorithms can hopefully benefit from the exciting result we present. Towards developing an efficient parallel GBNN implementation, we study two retrieval rules: SUM - OF - SUM and SUM OF - MAX , which have been previously proposed in [22] and [24]. SUM - OF - SUM is fast to implement in CUDA, because it requires only a matrix-vector multiplications, a highly optimized operation. SUM - OF - MAX is slower because it involves non-linear operations, but it gives superior retrieval performance (lower error rates). We illustrate that, although faster, SUM - OF - SUM can lead to problematic oscillations. We also prove that the SUM - OF - MAX rule is guaranteed to converge, and we derive properties of both rules. The tremendous speedup mentioned above comes from two main sources. First, we exploit the highly parallel architecture of the GPU to carry out operations efficiently. Second, we develop a hybrid retrieval scheme using aspects of both SUM OF - SUM and SUM - OF - MAX , which is tailored to parallel decoding architectures. Although we discuss a GPU implementation, we believe the ideas presented here can be used to accelerate associative memory implementations on other parallel architectures. We emphasize that this work neither focuses on the GBNN model itself (see [21], [22]), nor carries out comparative studies with other associative memory implementations, e.g., [29]. Instead, we are interested in developing robust and fast procedures to recall stored information given incomplete probes. As a motivating example, consider recovering messages over an erasure channel, which is a common scenario, especially in the ubiquitous IP-based communications. The errors encountered by the IP packets can be mitigated by checksums and error correcting codes. However, missing packets have to be recovered to avoid time-consuming and unreliable retransmissions. D. Paper Organization The rest of this paper is structured as follows. Section II reviews the GBNN associative memory architecture. Section III reviews the SUM - OF - SUM and SUM - OF - MAX retrieval rules. Section IV presents the proposed acceleration techniques and discusses the customized CUDA kernel functions which implement these techniques. Section V provides theoretical analysis and discussion of some properties of the retrieval rules considered in this work. Section VI proposes the novel hybrid retrieval rule. Section VII presents experimental results demonstrating the significant performance improvements obtained using GPUs. The paper concludes in Section VIII. II. G RIPON -B ERROU N EURAL N ETWORKS (GBNN S ) A. Structure A message (pattern) can be divided into a tuple of smaller symbols. Specifically, we divide the message M into C symbols, M = (m1 , m2 , . . . , mC ), where each symbol mc takes values in a finite set of size L. For example, English words of length 10 characters could be represented as 10 symbols from an alphabet of size 26; alternatively, they could be represented as 5 symbols from an alphabet of size 262 . Similarly, in an image, a symbol could correspond to the intensity of a specific pixel, or to the collective intensities of a patch of pixels. Here we work in the abstract setting of messages and symbols defined above; precisely how the associative memory is used is application-dependent. A GBNN [22] architecture to learn such messages comprises n = CL binary-valued (0 or 1) neurons. The neurons are grouped into C clusters of L neurons each, and edges only exist between different clusters. A message M = (m1 , . . . , mC ) is represented in the network by activating (i.e., setting to 1) one neuron in each cluster corresponding to the value of mc , and setting all other neurons to 0. In this way, the message is naturally encoded as a binary string of length n with exactly C ones. When a network is initialized, all edge weights are set to zero (equivalently, there are no edges in the network). When storing a message, we add edges to the network connecting all pairs of nodes which are activated for the particular message. For example, consider the network depicted in Fig. 3, where each message contains C = 4 symbols and each symbol takes one of L = 16 different values. Let us use the convention that clusters are numbered from left to right and from top to bottom, so that ’s are cluster 1, ’s are cluster 2, and so on; let us use the same convention within each cluster so that the neurons within each cluster are numbered from 1, 2, 3, 4 in the first row, and so on. The message indicated by the bold edges is (9, 4, 3, 10). The edges corresponding to any single message stored in the network thus correspond to a clique, since the neurons connected for that message form a complete sub-graph. The binary code that represents the bold clique in Fig. 3 reads 0000000010000000 0001000000000000 0010000000000000 0000000001000000. For retrieval, the network is presented with an incomplete message as a probe, e.g., (m1 , m2 , ?, ?), and it must determine which (if any) stored message matches this input best. In this paper we focus on the case where only partial messages are presented for retrieval. If the network is presented with an entire message as a probe, then the problem boils down to deciding whether or not this message has been stored. For this case, it has been shown that the missed detection rate is zero (i.e., messages which were previously stored are always recognized by the GBNN), and the false positive rate depends on the number of messages which have been stored in the network [22]. The retrieval rules studied in this paper (Section III) are specifically designed for the case where the probe contains missing values. GBNNs can also be used with inputs which contain errors (e.g., flipped bits), but the decoding rule must 4 of additional materials. The cluster structure again makes the extension straightforward. III. R ETRIEVAL RULES In this section, we review two existing retrieval rules for GBNN, i.e., SUM - OF - SUM and SUM - OF - MAX. A. The SUM - OF - SUM Rule Fig. 3. An example of a network with 4 clusters of 16 neurons each [22]. We number the clusters from left to right and from top to bottom as 1 · · · 4. The same scheme applies for neurons 1 · · · 16 within each cluster. be changed significantly and the decoding rules studied in this paper are no longer applicable. B. Characteristics In a classic Willshaw network model, a unique activation threshold needs to be chosen globally, e.g., either the number of active neurons in the input probe or the maximum number of signals accumulated in output neurons. This global threshold is no longer required in a GBNN, since each cluster can naturally decide for itself. The most closely related model in the literature is that of Shim et al. [30]. However, there are two main advantages of GBNNs, both of which are supported by simulations in Section VII: 1) GBNNs incorporate a self excitation term (see the reinforcement factor γ in Eq. (3) and Eq. (6)). 2) The retrieval rule used in [30] is essentially the same as the SUM - OF - SUM rule. Below we point out fundamental issues with SUM - OF - SUMand we also advocate using the alternative SUM - OF - MAX rule [24] for decoding, which significantly increases the retrieval rate. Sparseness has been heavily exploited to perform machine learning tasks and statistical inferences. One of the most famous example is compressive sensing [31]. Neuroscientists are also aware of the sparseness principle [32], not only because of its practical applications but also the low firing rate of the neurons in biological networks [33]. The cluster structure of GBNN produces an extremely sparse binary code by definition (one active neuron per cluster), which makes the network biologically plausible, and also makes fast implementations possible. It is also mentioned in [34] that the performance of an associative memory is severely affected given correlated patterns. There, an intermediate “grandmother cell” layer is suggested to encode each pair of patterns using a neuron. However, for GBNN, this particular problem can be mitigated by padding messages with extra random symbols at the cost The simplest rule [22] is to add all the signals a neuron receives in the current iteration. When presented with an incomplete message, we initialize the network by deactivating (i.e., setting to 0) all the neurons within the clusters associated with erased symbols. We then repeat the following iterations. First, each neuron compute the sum of all connected neurons which are presently active. Then the neurons within each cluster with the most active connected neurons remain activated at the beginning of the next iteration. Formally, let neuron(c, l) denote the lth neuron in the cth cluster, and let w(cl)(c0 l0 ) denote an indicator variable for whether or not a connection is present between neuron(c, l) and neuron(c0 , l0 ); i.e., ( 1 neuron(c, l) connected to neuron(c0 , l0 ) w(cl)(c0 l0 ) = . 0 otherwise (1) t We also denote by stcl and vcl respectively the score function for the number of signals neuron(c, l) receives and the indicator function for whether or not neuron(c, l) is activated 0 at iteration t, with vcl being the corresponding value for neuron(c, l) in the probe; i.e., ( 1 neuron(c, l) activated in iteration t t vcl = . (2) 0 otherwise As a consequence, the retrieval procedure can be formalized as t stcl = γvcl + C X L X (vct0 l0 w(c0 l0 )(cl) ) (3) c0 =1 l0 =1 stc,max = max stcl 1≤l≤L ( 1 if stcl = stc,max t+1 vcl = , 0 otherwise (4) (5) where γ ≥ 0 is a reinforcement factor. Essentially, Eq. (3) counts the score for each neuron. It involves summing over all clusters and all neurons within each cluster, hence the name SUM - OF - SUM. Eq. (4) finds the value of the neurons with the strongest signal in each cluster, and Eq. (5) keeps them activated. At the retrieval stage, the variables w(cl)(c0 l0 ) are fixed. These binary-valued variables are only changed when storing new messages. The only parameter to be tuned for retrieval using SUM - OF - SUM is γ, which influences the extent to which a neuron’s own value influences its signal at the current iteration. 5 cluster 1 of initializing all neurons associated with erased symbols to be 0 as in SUM - OF - SUM, we initialize them to be 1. In that case, other neurons will definitely receive signals from these missing clusters, L signals per missing cluster, but they will be regulated by Eq. (7). l1 cluster 3 l2 IV. ACCELERATING R ETRIEVAL cluster 2 Fig. 4. Illustration of the SUM - OF - SUM trap. Only the signals flowing into cluster 3 are drawn. B. Problems with the SUM - OF - SUM Rule The SUM - OF - SUM rule, although straightforward and natural, might lead to unnecessary errors. This is due to the fact that during iterations, after evaluating Eq. (5), there might be multiple neurons in one cluster achieving the maximum value stc,max simultaneously. In this case, all these neurons will stay activated and contribute to the signal strengths in the next iteration. Consider the scenario shown in Fig. 4, where two neurons l1 and l2 both receive the same number of signals. Neuron l1 receives two signals from cluster 1, while l2 receives one signal from each cluster. In this case, l2 should be favored, because we know that for any individual pattern that has been stored, only one neuron in each cluster should be activated. A possible but worse situation arises when l1 receives more signals than l2 , since then l1 will be the only activated neuron in this cluster at the beginning of the next iteration, even if l2 was actually the correct neuron in cluster 3. An increasing number of clusters will complicate the problem even further. This can also cause SUM - OF - SUM to diverge see Section V. C. The SUM - OF - MAX Rule To avoid the problem mentioned in the previous subsection, the SUM - OF - MAX rule is proposed in [24]. The rule is formally described as follows: t stcl = γvcl + C X c0 =1 ( t+1 vcl = 1 0 max 0 1≤l ≤L vct0 l0 w(c0 l0 )(cl) if stcl = γ + C − 1 . otherwise  (6) (7) Eq. (6) involves a summation over max operation, hence the name SUM - OF - MAX. The basic idea is that, to retrieve the correct message, the score of a neuron should not be larger if it receives multiple signals from the same cluster, and the maximum taken in Eq. (6) ensures each neuron receives at most one signal from each cluster. Since each stored message corresponds to a clique of C neurons, one in each cluster, a neuron should be activated if it receives exactly C − 1 signals from the other clusters plus some value γ from the self loop. For SUM - OF - MAX to work properly, the network must be initialized appropriately when a probe is presented. Instead In this section, we will first briefly introduce the CUDA architecture. We discuss different approaches to speeding up the GBNN retrieval procedure in general, and then we focus on specific techniques for SUM - OF - SUM and SUM - OF MAX separately. We also illustrate graphically the dedicated CUDA kernel functions for both rules. Note that, although we implement GBNN using CUDA, the accelerating techniques do not depend on any CUDA specific attribute, thus can be easily extended to other architectures. A. CUDA The Compute Unified Device Architecture (CUDA), introduced in 2007, is NVIDIA’s computing platform solution to general purpose computing on graphics processing units (GPGPU), which enables dramatic increases in computing performance by harnessing the massively parallel resources of GPUs. See [35] by Kirk and Hwu for more information. The basic programming pattern in CUDA is as shown in Fig. 5, where CPUs play the role of managers, invoking on the GPUs some computational intensive functions called kernel functions. After the kernel function is executed on the GPU, the CPU collects the results back to the host and then may invoke more kernel functions if necessary. Although a GPU can spawn many threads working simultaneously, each thread must run the same sequence of instructions. Kernel functions, and hence GPU computing in general, fit the category of “single instruction multiple data” (SIMD) [36] parallel computing platforms. The data are transferred back and forth between the CPU and GPU over the (slow) PCI or PCIe bus, one of the performance bottlenecks. Unfortunately, since the code control flow is on the CPU side, the time-costly transfers between the host and the video card are inevitable. Therefore, keeping the transfer of data to a minimum is one of the crucial concerns. B. General Tricks 1) Vectorization: Although GBNN is a recurrent model, conceptually we can treat it as a layered network nevertheless. We repeat each iteration t as one layer, so that the number of layers can grow as large as the network needs to converge. Let T denote the the total number of iterations to be run. The only two constraints to be satisfied are 1 2 T wij = wij = · · · = wij t t and wij = wji , t = 1, 2, · · · , T. The benefit is to borrow the matrix notation from layered networks which is more efficient in the parallel implementation. We map the original clustered structure into a flat space, where neuron(c, l) becomes neuron(i), with i = (c − 1)L + l, 6 CPU GPU bus serial control code data transfer time kernel function 1 more serial code time kernel function 2 even more serial code Fig. 5. Fig. 6. CUDA programming scheme. ranging from 1 to n = CL. Then Eq. (1) and Eq. (2) can be rewritten as ( 1 neuron(i) connects neuron(j) (8) wij = 0 otherwise ( 1 neuron(i) is activated in iteration t . (9) vit = 0 otherwise We consider the edge weights wij as elements of an n × n matrix W and neuron potentials vi as elements of a vector v ∈ {0, 1}n . Taking into account the reinforcement factor γ, we can rewrite Eq. (3) as st = W v t , (10) with W being a symmetric matrix whose diagonal elements are all equal to γ and whose off-diagonal elements are all binary valued; i.e.,   γ w12 · · · w1n  w21 γ · · · w2n    W = . . ..  . .. ..  .. . .  wn1 wn2 ··· γ Thus, the score equation (10) is a matrix-vector product, computed efficiently in parallel on a GPU. 2) Batch Retrieval: A straightforward extension to vectorization is to bundle and process K probes simultaneously. To do so, we collect the K test messages into a value matrix  V t = v t (1) v t (2) · · · v t (K) , with each column v t (k) being a value vector in Eq. (10), so that Eq. (10) becomes St = W V t. (11) Instead of retrieving messages one after another, we aggregate K messages together and feed them into the GPU card at one shot. Speedups are achieved using this approach because it allows us to exploit the SIMD nature of GPUs. It is also more efficient to perform one large I/O transfer over the bus rather than multiple smaller transfers. Parallel reduction operation scheme. Batch retrieval arises naturally in applications where simultaneous retrievals are preferred. For instance, in face recognition, an associative memory can be used to recognize face features even when areas are obstructed by sun glasses or a scarf. If we treat each image as a single message, the hardware requirement is simply prohibitive. A 256-level gray image of the size 512 × 512 requires an adjacency matrix W of (29 ×29 ×28 )2 = 252 elements. Alternatively, we can divide the image into smaller patches, treat each patch as a different message, and process them in parallel. For another example, consider a network anomaly detection algorithm where we are given a batch of IP addresses, and we would like to check whether each belongs to a predefined blacklist. In Section VII below, we will refer to Eq. (11) as parallel decoding and Eq. (10) as serial decoding. 3) Reduction: Reduction refers to an operation that aggregates a vector of elements into a scalar (e.g., sum, max and min). In SUM - OF - SUM, the max operation is needed when evaluating Eq. (4) to determine which neurons remain active in the next iteration. In both rules, when deciding whether or not the retrieval procedure has converged, we need to compare two long vectors v t and v t+1 of length n, and test if all of the neuron values stay unchanged. This reduction operation can be done in an efficient manner as illustrated in Fig. 6, where we invoke n threads in the first step, afterwards halving the number of threads in every successive operation. The time complexity thus decreases from O(n) to O(log2 n). 4) Sparsification: Memory access is an expensive operation on the video card, where both reading from and writing to memory cells are much slower than on the host CPU. In order to combat this inefficiency, we can reduce the number of memory accesses by accounting for the fact that GBNN is actually a sparse network; i.e., for a given message, ideally only one neuron should be activated for each cluster. Typically, the network structure should also be sparse, so we could implement both W and V t as sparse matrices using compressed format, where we only record the nonzero elements and their coordinates. Then evaluating Eq. (3) and Eq. (6) requires many fewer terms. However, the compressed format does not lead to a significant performance gain for both rules — SUM - OF - MAX benefits from the sparsification, while SUM - OF - SUM does not. The reason is that the dense matrix product in Eq. (11) for SUM - OF - SUM is an optimized operation on the GPU, whereas 7 thread 1 thread 2 thread 4 thread 5 thread 2 thread 3 thread 6 vt W vt+1 Fig. 7. Illustration of the kernel function for the SUM - OF - SUM rule. The first two columns of S t are drawn. Each rectangular represents a cluster with L neurons. A thread will determine the maximum value in its cluster and set the corresponding neurons activated. the compressed format deviates from the optimized pattern. Moreover, since V t changes from one iteration to the next, it is not economical to implement V t using compressed format either. On the contrary, W is fixed at the retrieval stage. We use a sparse matrix representation W only for SUM - OF - MAX. Detailed numerical results are presented in Section VII. C. Accelerating the SUM - OF - SUM Rule The pseudocode for the SUM - OF - SUM procedure is given in Algorithm 1. It requires as inputs the maximum number of iterations permitted tmax , the weight matrix W with all of the clique structures preserved during the storing stage, and the message matrix V 0 , with the k th column being the value vector for test message k and the erased clusters deactivated. On Line 4, S t is the score matrix for iteration t, where the k th column is the score vector of length n for test message k. On Line 5, the kernel function takes S t as input and essentially produces V t+1 by evaluating Eq. (4). Algorithm 1 The SUM - OF - SUM retrieval procedure. Input: the maximum number of iterations permitted tmax , the weight matrix W , the message matrix V 0 with each column as a partially erased message for recovery Output: the recovered matrix V t t = -1 repeat t = t+1 St = W V t V t+1 = the kernel function as in Fig. 7 6: until V t+1 == V t or t == tmax 1: 2: 3: 4: 5: The first two columns of S t are drawn in Fig. 7. In this particular example, each message can be divided into C = 3 clusters. In our implementation, a dedicated thread processes one cluster, finding the maximum value in that cluster, and then keeping the neurons that reach the maximum value activated. Assuming that there are K messages to be recovered, a total of CK threads are used. The retrieval procedure terminates when either the network converges or it reaches the maximum number of iterations permitted. D. Accelerating the SUM - OF - MAX Rule The pseudocode for SUM - OF - MAX is almost the same with Algorithm 1, except that Lines 4 and 5 are replaced by another thread n Fig. 8. Illustration of the kernel function for the SUM - OF - MAX rule. A single message retrieval is shown. To update the element vit+1 , we examine both v t and the ith column of W . kernel function illustrated in Fig. 8. In order to better explain the concept, the serial decoding of a single message v t is presented here, where the same number of threads are needed as the number of neurons n in the network. The extension to the parallel decoding scheme of K bundled messages is straightforward, where nK threads are needed. We do not follow strictly Eq. (6) and Eq. (7) to evaluate a max function. Instead, we apply an alternative procedure. Essentially, we check if a neuron receives signals from every cluster; hence, for neuron(i), the ith row of W and v t require examination. Since W is symmetric and the memory storage on the GPU is column major, we check the ith column of W instead to make the computation more pleasant. To update a neuron value vit+1 , a dedicated thread i is required, scanning through both v t and the ith column of W . Thread i loops through cluster c, from 1 to C. • For any positive γ, if neuron(i) belongs to cluster c = t t b i−1 L c+1, we directly set si = si +1. (b·c is the standard floor operator.) • Otherwise, we check within the same cluster, i.e., wji and vjt , where j goes from (c − 1)L + 1 to cL. The first time we encounter wji > 0 and vjt > 0, we set sti = sti + 1, and proceed to the next cluster c + 1 without further investigation. • If cluster c does not contribute any signal to neuron(i), i.e., sti does not change, we stop right away without checking following clusters. We call this procedure BAIL - OUT- EARLY and favor it over Eq. (6) and Eq. (7) for two reasons: 1) It explicitly clarifies the requirement that every cluster should contribute one and only one signal. 2) It proceeds to subsequent clusters or stops processing as quickly as possible so that further expensive memory accesses are avoided. Theorem 1. The BAIL - OUT- EARLY approach is equivalent to SUM - OF - MAX , i.e., for any positive γ, given W and v t , BAIL OUT- EARLY produces the same v t+1 as SUM - OF - MAX . Proof: For cluster c = b i−1 L c + 1, there is only one 8 nonnegative wii = γ > 0, since by design, within the same cluster, a neuron can only receive contributions from itself. BAIL - OUT- EARLY directly sets sti = sti + 1, which effectively makes any positive γ equivalent to γ = 1. For other clusters, wji is either 0 or 1, depending on whether or not a connection exists between neuron(j) and neuron(i). Notice in either case, v t is always a binary vector. Consider {aj = vjt wji }, for j = 1, 2, · · · , L. The BAIL OUT- EARLY approach treats Eq. (6) recursively by implementing the following equation, ( a1 if a1 > 0 , max(a1 , a2 , · · · , aL ) = max(a2 , · · · , aL ) otherwise (12) and treats Eq. (7) by setting γ = 1. For a neuron to be activated, it needs to receive C − 1 signals from the other clusters, plus some self contribution γ from itself. Since any γ > 0 does not affect the dynamic due to Eq. (6) and Eq. (7), we deliberately set γ = 1. The weight matrix W thus becomes binary valued, which can be more efficiently implemented. V. P ROPERTIES In this section, we discuss properties of GBNNs and the two retrieval rules introduced in previous sections. We illustrate these properties via examples and theoretical claims. A. The SUM - OF - SUM Rule May Oscillate We first give an example which illustrates that SUM - OF - SUM may oscillate. Consider a small network with C = 3 clusters, each cluster has L = 3 neurons, i.e., 9 neurons in total. We set γ = 1. There are 4 messages to store: (1, 1, 1), (2, 2, 1), (3, 2, 1) and (1, 3, 1). The test message is (?, ?, 1). Clearly all of the stored messages match the non-erased part of the test message. In such a scenario, we expect that the retrieval rule either returns an arbitrary stored message which matches the input, or returns all of the stored messages matching the input. Unfortunately, SUM - OF - SUM does not converge to any output. After constructing the network and initializing the neurons to be deactivated for the 1st and 2nd clusters of the test message, we have     1 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 1 0 0 0     0 0 1 0 1 0 1 0 0 0     1 0 0 1 0 0 1 0 0 0     0    W = 0 1 1 0 1 0 1 0 0 and v =  0 . 1 0 0 0 0 1 1 0 0 0     1 1 1 1 1 1 1 0 0 1     0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 It is easy to verify that s0 = (1, 1, 1, 1, 1, 1, 1, 0, 0)T , v 1 = (1, 1, 1, 1, 1, 1, 1, 0, 0)T , s1 = (4, 3, 3, 3, 4, 3, 7, 0, 0)T , v 2 = (1, 0, 0, 0, 1, 0, 1, 0, 0)T , s2 = (2, 2, 2, 2, 2, 2, 3, 0, 0)T , v 3 = (1, 1, 1, 1, 1, 1, 1, 0, 0)T . The underlined values indicate the maximum value within the same cluster. Note that every cluster activates its own neurons with the most signals respectively. Therefore, three neurons are activated in v 2 . In this case, v 3 = v 1 , so that the network does not converge, oscillating between v 2 and v 3 forever. There is another level of complication: the reinforcement factor γ plays a delicate role in the retrieval procedure. If we increase γ = 2, then the network converges. However, we will see in Section VII below that enlarging γ leads to a worse retrieval rate in general. B. The SUM - OF - MAX Rule Converges We now show that SUM - OF - MAX (BAIL - OUT- EARLY) always converges when all the neurons in erased clusters are initialized to be activated. Lemma 1. For SUM - OF - MAX, once deactivated, a neuron stays deactivated forever, i.e., if vit = 0 then vit+1 = 0. Proof: Recall, from Eq. (7), that vit+1 = 1 if and only if = γ + C − 1. Assume in iteration t that neuron(i) is deactivated, i.e., vit = 0. Then vit wii = 0. Since the only possible contribution a neuron PC might obtain from its own cluster is the self loop, sti = c=1 maxj (vjt wji ) < γ + C − 1, thus vit+1 = 0. sti Lemma 2. A clique is stable, i.e., once all neurons of a clique are activated, they stay activated forever. Proof: By definition of a complete sub-graph, all neurons in an activated clique (see Fig. 3) will receive exactly C − 1 signals from other clusters and some positive feedback γ. Therefore by Eq. (7), all neurons in the clique stay activated in the next iteration. Lemma 3. Given a partially erased message, SUM - OF - MAX always converges to a state which contains an ensemble of cliques. Proof: As each previously stored message corresponds to a clique, a partially erased message corresponds to parts of the clique, with the neurons in the non-erased clusters activated. SUM - OF - MAX initializes all the neurons in the missing clusters to be activated. Therefore, the already activated neurons in non-erased clusters will receive contributions from the missing clusters, staying activated in the next iteration. The neurons in the missing clusters which, together with the already activated neurons in non-erased clusters, form a clique will also receive exactly γ + C − 1 signals and will stay activated in the next iteration. By Lemma 2, the ensemble of these cliques will be present in the converged state. Theorem 2. Given a partially erased message, if a neuron is the only one activated in its cluster, it remains activated, i.e., for a given cluster c, if there exists an i ∈ {(c − 1)L + 1, · · · , cL} such that vit = 1 and vjt = 0 for all j ∈ {(c − 1)L + 1, · · · , cL}, j 6= i, then vit+1 = 1. Proof: Suppose, to arrive at a contradiction, that at some point, cluster c has no neuron activated, i.e., ∀i = (c − 1)L + 1, · · · , cL, vit = 0, the other clusters will not receive any 9 signal from cluster c. By Eq. (7), every neuron throughout the network will be deactivated in the next iteration. By Lemma 1, the network converges to this all-deactivated state forever, which violates Lemma 3. Therefore, if a neuron is the only one activated in its cluster, it remains activated. Theorem 3. For any given probe pattern, SUM - OF - MAX always converges. Proof: For a partially erased message, this theorem has already been proved by Lemma 3. We consider an input probe such that some parts of a previously stored message are modified (corrupted). If the probe can still be explained by a clique in the network, the memory converges to this clique by Lemma 2. If the probe cannot be explained by any clique in the network, the activated neurons in the unchanged clusters cannot receive signals from the corrupted clusters. Hence by Eq. (7), the memory converges to the all-deactivated state. Since BAIL - OUT- EARLY is equivalent to SUM - OF - MAX (see Theorem 1), we also have the following. Corollary 1. For any given probe pattern, BAIL - OUT- EARLY always converges. It is worth emphasizing that SUM - OF - MAX converges to a state which contains an ensemble of cliques by Lemma 3. We can randomly choose one of them as the reconstructed message. VI. J OINT R ETRIEVAL RULE A. Proposal We have just seen that SUM - OF - SUM is not guaranteed to converge, whereas SUM - OF - MAX is. In Section VII below we will see that SUM - OF - SUM is generally much faster than SUM OF - MAX , but the accuracy of SUM - OF - MAX is much better when either the number of stored messages or the number of erased symbols increases. It is natural to ask whether we can merge the two rules to obtain a fast and accurate reconstruction scheme. In this section we propose such a hybrid retrieval scheme which combines the best aspects from both procedures. The pseudocode for the joint decoding scheme is given in Algorithm 2. Essentially this decoding algorithm performs one refined iteration of SUM - OF - SUM followed by subsequent, optimized iterations of BAIL - OUT- EARLY until a convergence criterion is satisfied. B. Justification and Convergence As mentioned in Section IV, memory access is extremely expensive on GPUs in comparison to on the host CPU. Therefore, it is of vital importance that we eliminate any unnecessary memory operations. We notice that Lemma 1 and Theorem 2 have crucial implications in designing our new scheme. The former suggests that if vit = 0 then there is no need to loop through two long vectors of length n, i.e., v t and the ith column of W , since we will have vit+1 = 0. Thus, we only need to focus on updating those neuron(i) for which vit = 1. In this sense, the currently active neurons can be Algorithm 2 The joint retrieval scheme. Input: C – number of clusters L – number of neurons in each cluster e – number of erased clusters K – number of test messages W – the weight matrix of dimension n × n V 0 – the value matrix of dimension n × K with each column as a partially erased message for recovery Output: the recovered matrix V t 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: initialize all the neurons inactive in erased clusters S 0 = W V 0 {SUM - OF - SUM} for each thread do {eK threads in parallel, each for an erased cluster} check S 0 and keep neurons with C −e signals activated end for{V 1 obtained} sparsify W to obtain W 0 {use W 0 afterwards} t=0 repeat {BAIL - OUT- EARLY (SUM - OF - MAX)} t = t+1 for each thread do {eLK threads in parallel, each for a neuron in erased clusters of different messages} keep off deactivated neurons, otherwise apply the BAIL - OUT- EARLY scheme end for {V t+1 obtained} until V t+1 == V t {only check erased clusters} considered as a candidate pool that needs to be investigated further in the next iteration. The latter suggests that clusters with only one active neuron (including those which are not erased in the test message) will not change during decoding. Hence, we only update neurons in erased clusters that have not yet reached convergence. In general, this notion of “freezing good clusters” can also be justified as preventing good neurons from being altered undesirably by any retrieval procedure. One final but important consideration is the all-activated initialization scheme. Although it is crucial for the correctness of the SUM - OF - MAX rule, it also introduces too many candidates from the beginning. We will show a motivating example later in Section VII-E. Fortunately, SUM - OF - SUM can help us bypass this particular problem. Theorem 4. The first iteration of SUM - OF - SUM affects neither the correctness of SUM - OF - MAX nor its convergence. Proof: For correctness, let us revisit SUM - OF - SUM. The only problem making SUM - OF - SUM inferior to SUM - OF - MAX is that during the retrieval procedure, as in Fig. 4, it is possible for multiple neurons to be activated simultaneously in one cluster without regulation, which in turn propagates the error or even causes oscillation. However, during the initialization phase, if we deactivate all the neurons in erased clusters, preserving good clusters only, by definition there will be at most one activated neuron per cluster. The aforementioned flaw does not exist anymore. For convergence, recall a clique structure in Fig. 3. For a given message with e clusters erased, there are C − e good 10 Corollary 2. The new joint retrieval scheme always converges. Proof: The joint scheme invokes one iteration of SUM followed by iterations of BAIL - OUT- EARLY. According to Theorem 4, SUM - OF - SUM effectively reduces the size of the candidate pool, with the network’s convergence property untouched. The joint scheme thus always converges by Theorem 3. Combining all these factors, we propose the joint scheme as in Algorithm 2. OF - SUM VII. E XPERIMENTS In this section, we compare SUM - OF - SUM and SUM - OF using the different acceleration approaches discussed previously in Section IV and Section VI. We show that a significant performance gain is achieved in terms of running time after parallelizing the retrieval procedure and applying our new joint retrieval scheme. All the CPU experiments are executed on a 2.6GHz AMD Phenom (tm) 9950 Quad-Core Processor with 16GB of RAM, and all the GPU experiments are executed on an NVIDIA C1060 card, which runs at a frequency of 1.3GHz with 4GB memory and has 30 stream multiprocessors. In order to make as fair a comparison as possible, our CPU code makes use of the Armadillo library [37], linked to BLAS and LAPACK, for optimized linear algebra operations. MAX A. SUM - OF - SUM versus SUM - OF - MAX First, we compare SUM - OF - SUM and SUM - OF - MAX. In this experiment, we have C = 8 clusters with L = 128 neurons each, and the reinforcement factor γ = 2. We randomly generate and store 5000 messages, each of which consists of 8 symbols uniformly sampled from the integers 1 to 128. After the storing stage, we randomly select 3000 out of the 1 sum of sum sum of max 0.9 0.8 0.7 retrieval rate neurons transmitting signals. Therefore, the desired neuron in the erased clusters should receive C − e signals exactly. After one iteration of SUM - OF - SUM, we only keep these neurons with C − e signals in the candidate pool. The sole effect of the first iteration SUM - OF - SUM is to shrink the pool size, with the convergence untouched. Ideally, there should be only one such neuron per erased cluster in the candidate pool, rather than L candidates for SUM - OF - MAX , with two exceptional cases. • There are two memorized messages m1 and m2 which only differ in erased clusters, e.g., we have m1 = (1, 3, 1) and m2 = (1, 3, 2), and the test message is m = (1, 3, ?). In this case, both neuron 1 and 2 in the erased cluster will be present in the pool. • Spurious cliques. While storing messages, distinct cliques may overlap and produce a spurious clique that does not correspond to a stored message, where different edges in this clique were added for different stored messages. In other words, a stored message corresponds to a clique, but not vice versa. We argue that for a relatively large network and a reasonable number of messages to memorize, the candidate pool size is sufficiently small. 0.6 0.5 0.4 0.3 0.2 0.1 0 3 4 5 number of erased clusters 6 Fig. 9. Comparison between the SUM - OF - SUM and SUM - OF - MAX retrieval rules. We have C = 8, L = 128, 5000 stored messages and 3000 test messages. We vary the number of erased clusters, and plot the retrieval rate. 5000 stored messages, erase some parts of them and try to retrieve the erased messages from the GBNN associative memory. We refer to this experiment setting as Scenario 1. Since SUM - OF - SUM does not necessarily converge, we set the maximum number of iterations to 20. We vary the number of erased clusters, and plot the retrieval rate, i.e., the fraction of successfully retrieved messages, in Fig. 9. Observe that when the number of erased clusters is relatively small (3 erased clusters), both rules perform equally well above 97%. As the number of erased clusters increases, although both rules make more errors, the performance of SUM - OF - SUM degrades more drastically than that of SUM OF - MAX . When 5 out of 8 clusters are erased, SUM - OF - SUM can only recover slightly above 50% of the messages, while SUM - OF - MAX still recovers over 90%. If 6 clusters are erased, SUM - OF - MAX is still able to retrieve over 20%, which is significantly higher than SUM - OF - SUM. B. Influence of γ Second, we explore the subtle dependence of the retrieval rate on the value of the reinforcement factor γ used in SUM OF - SUM . We plot the trend for different γ in Fig. 10 using the same experiment Scenario 1 as above. In general, increasing γ hurts the retrieval rate with the only exception of γ = 0, which suggests that γ = 1 can be used as a default value. C. CPU versus GPU Next, we consider the improvements in runtime achieved by running both rules on a GPU versus on a CPU. A larger network is simulated in this case. We have C = 16 clusters with L = 512 neurons each, out of which 7 clusters are erased. We generate and store 50000 random messages, and we use a random subset of 30000 of these to test. We refer to this experiment setting as Scenario 2. The runtime, in seconds, of both parallel decoding (i.e., decoding a batch of messages 11 5000 1 naive 4258.34 4000 running time in seconds retrieval rate 0.8 0.6 0.4 γ=0 γ=1 0.2 0 1 running time in seconds 2083.83 2000 all combined sum of sum 969.42 949.64 911.05 0 2 3 4 5 number of erased clusters 6 joint scheme 20000 15000 13191.70 10000 37.46 14.86 7 CPU (parallel) GPU (parallel) CPU (serial) GPU (serial) 28114.90 25000 Fig. 12. Running time in seconds for different acceleration tricks. We have C = 16, L = 512, 50000 stored messages and 30000 test messages. The first six bars are for SUM - OF - MAX. We plot the performances for different tricks and all combined. We also plot the record of SUM - OF - SUM and our joint scheme at the end for comparison. without any further optimization are respectively (from left-toright) 29×, 3×, 240× and 28× faster. Finally, parallel decoding is faster than serial decoding on GPU, while the situation reverses on CPU. This is reasonable, since parallel decoding can take full advantage of the GPU’s computing power. However, in the CPU case, if we consider a bundle of K messages, even if only one message does not converge, all K messages will be updated. On the other hand, with serial decoding, the retrieval rule will stop as soon as each individual message converges. 9019.70 D. Further Accelerating the SUM - OF - MAX Rule 6119.35 5000 4258.34 969.42 0 sparsification ignore inactive neurons 495.52 Fig. 10. Subtle dependence between the retrieval rate and the reinforcement factor γ. We have C = 8, L = 128, 5000 stored messages and 3000 test messages. We vary the number of erased clusters, and plot the retrieval rate. 30000 parallel decoding 3000 1000 γ=2 γ=3 γ=4 erased clusters only 37.46 sum of max 221.09 sum of sum Fig. 11. Running time in seconds of both rules running on CPU and GPU respectively. We have C = 16, L = 512, 50000 stored messages and 30000 test messages. concurrently) and serial decoding (i.e., decoding message one after another) on both GPU and CPU are shown in Fig. 11. We make three observations: First, for each CPU versus GPU and parallel versus serial decoding configuration, SUM OF - MAX is always significantly slower than SUM - OF - SUM . For now, let us keep in mind that the fastest retrieval configuration of this entire experiment is roughly 40 seconds for SUM - OF SUM parallel decoding on a GPU. We have previously seen that SUM - OF - MAX leads to a much better retrieval accuracy, and so below we focus on achieving the accuracy of the SUM OF - MAX method while improving its runtime. Second, in each group, the bars at the 1st and 3rd locations are results for the CPU implementation, and the 2nd and 4th bars show results for the GPU implementation. Comparing each adjacent pair, we see that the GPU versions consistently run much faster than CPU, as expected. The GPU accelerations In Fig. 12 we show the effect of applying the different techniques discussed in Sections IV and V to accelerate the SUM - OF - MAX rule on a GPU. Although all of the techniques combined reduce the runtime eightfold, from roughly 4000 seconds to 500 seconds, the SUM - OF - MAX rule still cannot compete with SUM - OF - SUM’s 40-second spec, which is highlighted in yellow and bold font in the figure. However, the proposed joint scheme cuts the record by another two thirds, achieving the fastest runtime of only 14.86 seconds for Scenario 2. In Fig. 11, the faster configuration for SUM - OF - MAX on CPU is the serial decoding scheme, to which we compare, our joint scheme achieves a 880× speedup while retaining the decoding accuracy. E. Motivation for Combining Rules Here we provide an example to better illustrate why the joint scheme achieves a significant speedup. We again use Scenario 2 and apply all of the acceleration techniques discussed in Section IV. We initialize the matrix V 0 according to the vanilla SUM - OF - MAX, so that all neurons in clusters corresponding to erased symbols are activated, and only one neuron within each cluster corresponding to a non-erased symbol is active. Fig. 13 depicts a typical run of the experiment. 12 Fig. 13a shows the total runtime spent in each iteration of the SUM - OF - MAX decoding. One observation is that every subsequent iteration requires less time than its previous one due to the application of Lemma 1 and Theorem 2; otherwise, the runtime of each iteration should be roughly the same. Another observation is that the majority of the total runtime is spent in the 1st iteration; this occurs because initially there are too many unnecessary active neurons in erased clusters, and SUM - OF - MAX demands time to process each one of them. Fig. 13b shows the number of test messages (out of 30000) which have converged after each iteration. F. New Joint Scheme Finally, we demonstrate the behavior of the joint decoding scheme across a range of experimental settings. Fig. 14 shows the runtime (in seconds) and retrieval rate compared with SUM - OF - SUM and SUM - OF - MAX for both of Scenarios 1 and 2, while varying the number of erased symbols. The spikes in runtime for SUM - OF - MAX and for the joint scheme in Fig. 14a are due to the fact that decoding becomes more difficult as the number of erased clusters increases, consequently more iterations are required in these cases. In these settings (6 out of 8 clusters erased for Scenario 1, and 14 out of 16 clusters erased for Scenario 2), although the SUM - OF - SUM rule is only a bit faster than SUM - OF - MAX and the joint scheme, the retrieval rate is significantly lower. Another reason that SUM OF - SUM runs faster here is due to the limit on the number of iterations which we impose in our experiments. Note that increasing this limit does not improve the retrieval rate, but it can make the runtime arbitrarily worse because SUM - OF - SUM oscillates. Also observe that in both Fig. 14b and Fig. 14d, the retrieval rates of SUM - OF - MAX and the joint scheme are identical. In Fig. 14d, all three approaches achieve effectively a 100% retrieval rate for up to 13 erased clusters. This is because the number of messages stored (50000) is relatively small for this network. If this number increases, the deviation in retrieval rate between the joint scheme (as well as SUM OF - MAX ) and SUM - OF - SUM will be more pronounced. We conclude from Fig. 14 that the joint retrieval scheme combines the benefits of both existing rules, achieving fast decoding while also maintaining a high retrieval rate. G. Correlated vs. Uncorrelated Messages The experiments above involve storing and retrieving random messages which are generated uniformly and independently. If messages are correlated and the GBNN architecture is unchanged, we expect the performance to degrade in comparison to the results reported above. Modifying GBNNs to accommodate correlated messages is an area of ongoing investigation. As mentioned in Section II, one approach is to use a “grandmother layer”, similar to [34]. Another approach is to append each message with i.i.d. uniform random bits. This requires additional neurons, but reduces the correlation. VIII. S UMMARY In this work, we present optimized implementations of the Gripon-Berrou neural network associative memory on a GPU. We analyze two existing retrieval rules, namely SUM - OF - SUM and SUM - OF - MAX. We show that SUM - OF - SUM may lead to network oscillation. However, we manage to prove the convergence of SUM - OF - MAX. In order to achieve the full speedup, we combine the two rules and propose a hybrid scheme, minimizing the unnecessary computation burdens. The experimental results show an exciting acceleration against a CPU implementation using an optimized linear algebra library. GBNNs embrace a LDPC-like sparse encoding setup, which makes the network extremely resilient to noises and errors. As associative memories serve as building blocks for many machine learning algorithms, we hope the parallel scheme proposed here can be helpful in paving the path to more widespread adoptions of large scale associative memory applications. An obvious future work is to extend GBNNs to deal with correlated messages, which will severely impair the retrieval performance. However, the nice structure of GBNNs seems promising in this direction. In the future, we will try to develop other retrieval schemes, e.g., to handle corrupted patterns as well as incomplete probes. Since SUM - OF - SUM runs orders of magnitude faster, another sensible topic is to emulate SUM - OF MAX using SUM - OF - SUM so that both performance and speed can be retained simultaneously. We may also seek the way to generalize GBNN and extend the sparse neural network’s use in tasks other than associative memory, e.g., classification and regression. R EFERENCES [1] S. Rajasekaran and G. Pai, Neural Networks, Fuzzy Logic and Genetic Algorithms: Synthesis and Applications. PHI Learning Pvt. Ltd., 2004. [2] J. A. Anderson and E. Rosenfeld, Neurocomputing: foundations of research, ser. Bradford Books. MIT Press, 1988, vol. 1. [3] J. A. Anderson, A. Pellionisz, and E. Rosenfeld, Neurocomputing 2: Directions of Research, ser. Bradford Books. MIT Press, 1993, vol. 2. [4] B. Kosko, “Bidirectional associative memories,” IEEE Transactions on Systems, Man and Cybernetics, vol. 18, no. 1, pp. 49–60, 1988. [5] D. J. Willshaw, O. P. Buneman, and H. C. Longuet-Higgins, “Nonholographic associative memory.” Nature, vol. 222, pp. 960–962, 1969. [6] J. Hopfield, “Neural networks and physical systems with emergent collective computational abilities,” Proceedings of the National Academy of Sciences, vol. 79, no. 8, pp. 2554–2558, 1982. [7] ——, “Neurons with graded response have collective computational properties like those of two-state neurons,” Proceedings of the National Academy of Sciences, vol. 81, no. 10, pp. 3088–3092, 1984. [8] S. Kaxiras and G. Keramidas, “Ipstash: a set-associative memory approach for efficient ip-lookup,” in INFOCOM 2005. Proc. 24th Annual Joint Conference of the IEEE Computer and Communications Societies, vol. 2, Miami, FL, USA, 2005, pp. 992–1001. [9] M. E. Valle, “A class of sparsely connected autoassociative morphological memories for large color images,” IEEE Transactions on Neural Networks, vol. 20, no. 6, pp. 1045–1050, 2009. [10] C. S. Lin, D. C. P. Smith, and J. M. Smith, “The design of a rotating associative memory for relational database applications,” ACM Transactions on Database Systems, vol. 1, no. 1, pp. 53–65, March 1976. [11] L. Bu and J. Chandy, “FPGA based network intrusion detection using content addressable memories,” in IEEE Symposium on FieldProgrammable Custom Computing Machines, April 2004, pp. 316–317. [12] K.-J. Lin and C.-W. Wu, “A low-power CAM design for LZ data compression,” IEEE Transactions on Computers, vol. 49, no. 10, pp. 1139–1145, October 2000. [13] H. Zhang, B. Zhang, W. Huang, and Q. Tian, “Gabor wavelet associative memory for face recognition,” IEEE Transactions on Neural Networks, vol. 16, no. 1, pp. 275–278, 2005. [14] A. Jain, J. Mao, and K. Mohiuddin, “Artificial neural networks: A tutorial,” Computer, vol. 29, no. 3, pp. 31–44, March 1996. 13 35000 700 664.48 30000 number of convergent messages running time in seconds 600 500 400 300 200 30000 2 iteration 3 25000 20000 15000 10000 5000 100 0 29976 2.91 2 iteration 1 0.03 3 0 1 0 (a) running time in seconds for each iteration (b) accumulate number of convergent messages after each iteration Fig. 13. A typical run of SUM - OF - MAX with all the neurons in the erased clusters activated initially. We experiment Scenario 2 where we have C = 16 clusters, with L = 512 neurons each, 50000 messages to memorize and 30000 messages to test. (a) shows the running time in seconds for each iteration. (b) shows the accumulate number of the messages that have converged after each iteration. 1.4 0.8 1 retrieval rate running time in seconds 1.2 1 sum of sum sum of max joint scheme 0.8 0.6 0.6 0.4 0.4 0.2 0.2 0 1 2 3 4 5 number of erased clusters 6 0 1 7 (a) running time for Scenario 1 sum of sum sum of max joint scheme 2 3 4 5 number of erased clusters 6 7 (b) retrieval rate for Scenario 1 800 1 sum of sum 700 sum of max joint scheme 0.8 500 retrieval rate running time in seconds 600 400 300 0.6 0.4 200 0.2 100 0 0 5 10 number of erased clusters (c) running time for Scenario 2 15 0 0 sum of sum sum of max joint scheme 5 10 number of erased clusters 15 (d) retrieval rate for Scenario 2 Fig. 14. The behavior of the joint retrieval scheme in general. Both running time in seconds and retrieval rate are plotted respectively as the number of erased clusters increases. We set γ = 2 and the maximum number of iterations allowed is 20. (a) and (b) refer to Scenario 1 where there are 8 clusters with 128 neurons each, 5000 messages to memorize, and 3000 messages to test. (c) and (d) refer to Scenario 2 where there are 16 clusters with 512 neurons each, 50000 messages to memorize, and 30000 messages to test. 14 [15] D. Willshaw, “Models of distributed associative memory.” Ph.D. dissertation, Edinburgh University, 1971. [16] J. Buckingham and D. Willshaw, “On setting unit thresholds in an incompletely connected associative net,” Network: Computation in Neural Systems, vol. 4, no. 4, pp. 441–459, 1993. [17] G. Palm, “On associative memory,” Biological Cybernetics, vol. 36, no. 1, pp. 19–31, 1980. [18] H. Bosch and F. J. Kurfess, “Information storage capacity of incompletely connected associative memories,” Neural Networks, vol. 11, no. 5, pp. 869–876, 1998. [19] D. J. Amit, H. Gutfreund, and H. Sompolinsky, “Statistical mechanics of neural networks near saturation,” Annals of Physics, vol. 173, no. 1, pp. 30–67, 1987. [20] G. Palm, “Neural associative memories and sparse coding,” Neural Networks, vol. 37, pp. 165–171, January 2013. [21] V. Gripon and C. Berrou, “A simple and efficient way to store many messages using neural cliques,” in IEEE Symposium on Computational Intelligence, Cognitive Algorithms, Mind, and Brain (CCMB). Paris, France: IEEE, 2011, pp. 1–5. [22] ——, “Sparse neural networks with large learning diversity,” IEEE Transactions on Neural Networks, vol. 22, no. 7, pp. 1087–1096, 2011. [23] C. Berrou and V. Gripon, “Coded hopfield networks,” in International Symposium on Turbo Codes and Iterative Information Processing (ISTC), September 2010, pp. 1–5. [24] V. Gripon and C. Berrou, “Nearly-optimal associative memories based on distributed constant weight codes,” in Information Theory and Applications Workshop (ITA). San Diego, CA, USA: IEEE, 2012, pp. 269–273. [25] X. Jiang, V. Gripon, and C. Berrou, “Learning long sequences in binary neural networks,” in International Conference on Advanced Cognitive Technologies and Applications, 2012, pp. 165–170. [26] B. K. Aliabadi, C. Berrou, V. Gripon, and X. Jiang, “Learning sparse messages in networks of neural cliques,” ACM Computing Research Repository, 2012, arXiv:1208.4009v1 [cs.NE]. [Online]. Available: http://arxiv.org/abs/1208.4009v1 [27] H. Jarollahi, N. Onizawa, V. Gripon, and W. Gross, “Architecture and implementation of an associative memory using sparse clustered networks,” in IEEE International Symposium on Circuits and Systems (ISCAS). Seoul, Korea: IEEE, 2012, pp. 2901–2904. [28] B. Larras, C. Lahuec, M. Arzel, and F. Seguin, “Analog implementation of encoded neural networks,” in IEEE International Symposium on Circuits and Systems, Beijing, China, 2013, pp. 1–4. [29] J. Austin, J. Kennedy, and K. Lees, “The advanced uncertain reasoning architecture, AURA,” RAM-based Neural Networks, Ser. Progress in Neural Processing, vol. 9, pp. 43–50, 1998. [30] G. Shim, D. Kim, and M. Choi, “Statistical-mechanical formulation of the willshaw model with local inhibition,” Physical Review A, vol. 43, no. 12, p. 7012, 1991. [31] R. G. Baraniuk, “Compressive sensing [lecture notes],” Signal Processing Magazine, IEEE, vol. 24, no. 4, pp. 118–121, 2007. [32] S. Ganguli and H. Sompolinsky, “Compressed sensing, sparsity, and dimensionality in neuronal information processing and data analysis,” Annual review of neuroscience, vol. 35, pp. 485–508, 2012. [33] D. Golomb, N. Rubin, and H. Sompolinsky, “Willshaw model: Associative memory with sparse coding and low firing rates,” Physical Review A, vol. 41, no. 4, p. 1843, 1990. [34] A. Knoblauch, “Neural associative memory for brain modeling and information retrieval,” Information Processing Letters, vol. 95, no. 6, pp. 537–544, 2005. [35] D. B. Kirk and W. H. Wen-mei, Programming massively parallel processors: a hands-on approach. Morgan Kaufmann, 2010. [36] M. Flynn, “Some computer organizations and their effectiveness,” IEEE Transactions on Computers, vol. 100, no. 9, pp. 948–960, 1972. [37] C. Sanderson, “Armadillo: An open source C++ linear algebra library for fast prototyping and computationally intensive experiments,” Technical report, NICTA, Tech. Rep., 2010.
9cs.NE
Exploring the Design Space of Deep Convolutional Neural Networks at Large Scale arXiv:1612.06519v1 [cs.CV] 20 Dec 2016 by Forrest Iandola A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Engineering - Electrical Engineering and Computer Sciences in the GRADUATE DIVISION of the UNIVERSITY OF CALIFORNIA, BERKELEY Committee in charge: Professor Kurt Keutzer, Chair Professor Sara McMains Professor Krste Asanović Fall 2016 Exploring the Design Space of Deep Convolutional Neural Networks at Large Scale Copyright c 2016 by Forrest Iandola Abstract Exploring the Design Space of Deep Convolutional Neural Networks at Large Scale by Forrest Iandola Doctor of Philosophy in Engineering - Electrical Engineering and Computer Sciences University of California, Berkeley Professor Kurt Keutzer, Chair In recent years, the research community has discovered that deep neural networks (DNNs) and convolutional neural networks (CNNs) can yield higher accuracy than all previous solutions to a broad array of machine learning problems. To our knowledge, there is no single CNN/DNN architecture that solves all problems optimally. Instead, the “right” CNN/DNN architecture varies depending on the application at hand. CNN/DNNs comprise an enormous design space. Quantitatively, we find that a small region of the CNN design space contains 30 billion different CNN architectures. In this dissertation, we develop a methodology that enables systematic exploration of the design space of CNNs. Our methodology is comprised of the following four themes. 1. Judiciously choosing benchmarks and metrics. 2. Rapidly training CNN models. 3. Defining and describing the CNN design space. 4. Exploring the design space of CNN architectures. Taken together, these four themes comprise an effective methodology for discovering the “right” CNN architectures to meet the needs of practical applications. 1 To my wife, Dr. Steena Monteiro. i Contents Contents ii List of Figures iv List of Tables v Acknowledgments vi 1 Introduction and Motivation 1 1.1 Motivating the search for the “right” Deep Neural Network (DNN) architecture . . . 1 1.2 Ingredients for success in deep learning . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 The MESCAL Methodology for Design Space Exploration . . . . . . . . . . . . . . . 7 1.4 Organization of this dissertation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5 How this dissertation relates to my prior work . . . . . . . . . . . . . . . . . . . . . . 10 2 Comprehensively defining benchmarks and metrics to evaluate DNNs 12 2.1 Finding the most computationally-intensive DNN benchmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 Transfer learning: amortizing a few large labeled datasets over many applications . . 17 2.3 Beyond accuracy: metrics for evaluating key properties of DNNs . . . . . . . . . . . 18 2.4 Orchestrating engineering teams to target specific DNN benchmarks and metrics . . 26 2.5 Relationship of our approach to the MESCAL methodology . . . . . . . . . . . . . . 29 3 Rapidly training DNNs on compute clusters 30 3.1 The need for efficient and scalable DNN training . . . . . . . . . . . . . . . . . . . . 30 3.2 Hardware for scalable DNN training . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.3 Preliminaries and terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.4 Parallelism strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 ii 3.5 Choosing DNN architectures to accelerate . . . . . . . . . . . . . . . . . . . . . . . . 36 3.6 Implementing efficient data parallel training . . . . . . . . . . . . . . . . . . . . . . . 37 3.7 Evaluation of FireCaffe-accelerated training on ImageNet . . . . . . . . . . . . . . . 41 3.8 Complementary approaches to accelerate DNN training . . . . . . . . . . . . . . . . 46 3.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4 Defining and describing the design space of DNN architectures 48 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.2 Key building blocks of CNN architectures . . . . . . . . . . . . . . . . . . . . . . . . 50 4.3 Understanding the dimensionality of CNN layers . . . . . . . . . . . . . . . . . . . . 57 4.4 A mental model for how CNN dimensions impact the quantity of computation and other metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.5 Local changes to CNN architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 4.6 Global changes to CNN architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.7 Intuition on the size of the design space of CNNs . . . . . . . . . . . . . . . . . . . . 76 4.8 The design space of techniques for training CNNs . . . . . . . . . . . . . . . . . . . . 77 4.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5 Exploring the design space of DNN architectures 81 5.1 Introduction and motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 5.3 SqueezeNet: preserving accuracy with few parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 5.4 Evaluation of SqueezeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.5 CNN Microarchitecture design space exploration . . . . . . . . . . . . . . . . . . . . 89 5.6 CNN Macroarchitecture design space exploration . . . . . . . . . . . . . . . . . . . . 92 5.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 6 Conclusions 95 6.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 6.2 Impact of our FireCaffe work on accelerating CNN/DNN training . . . . . . . . . . . 98 6.3 Impact of our work on exploring the design space of CNN architectures . . . . . . . 101 iii List of Figures 1.1 Machine learning in 2012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Machine learning in 2016 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Considerations when designing DNNs to use in practical applications . . . . . . . . . 3 1.4 Ingredients for success with deep neural networks . . . . . . . . . . . . . . . . . . . . 5 1.5 Impact of training set size on a DNN’s accuracy 6 2.1 The difference in single-GPU training times across different DNN applications. . . . 14 2.2 Multicore CPU server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3 Implementing autonomous driving . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.1 Anatomy of a convolution layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.2 Data parallel DNN training in FireCaffe . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3 Deep neural network architectures with more parameters do not necessarily deliver higher accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4 Illustrating how parameter servers and reduction trees communicate weight gradients 40 3.5 Comparing communication overhead with a parameter server vs. a reduction tree . . 40 3.6 Impact of learning rate on GoogLeNet accuracy . . . . . . . . . . . . . . . . . . . . . 45 4.1 Network-in-Network (NiN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.2 Dimensions of a convolution layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3 Pooling with stride=1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.4 Pooling with stride=2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.1 Microarchitectural view of the Fire module . . . . . . . . . . . . . . . . . . . . . . . 85 5.2 Macroarchitectural view of the SqueezeNet architecture . . . . . . . . . . . . . . . . 86 5.3 Squeeze ratio, model size, and accuracy . . . . . . . . . . . . . . . . . . . . . . . . . 91 5.4 pct3x3 , model size, and accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 iv . . . . . . . . . . . . . . . . . . . . List of Tables 1.1 Organization of this dissertation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Training times and quantities of data in large-scale DNN application domains . . . . 13 2.2 Which aspects of a DNN-based system are evaluated by each metric? . . . . . . . . . 19 3.1 Volumes of data and computation for widely-used CNN/DNN architectures . . . . . 35 3.2 Accelerating the training of midsized deep models on ImageNet-1k. . . . . . . . . . . 44 3.3 Accelerating the training of ultra-deep, computationally intensive models on ImageNet-1k. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.1 Summary of local and global changes to CNN architectures . . . . . . . . . . . . . . 60 4.2 Dimensions of the NiN CNN architecture . . . . . . . . . . . . . . . . . . . . . . . . 62 4.3 NiN architecture with 4x more input channels . . . . . . . . . . . . . . . . . . . . . . 65 4.4 NiN architecture with 4x more filters in conv8 . . . . . . . . . . . . . . . . . . . . . . 67 4.5 NiN architecture with 4x larger filter resolution in one layer . . . . . . . . . . . . . . 69 4.6 NiN architecture with 4x more categories to classify . . . . . . . . . . . . . . . . . . 71 4.7 NiN architecture with pool3 removed . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.8 NiN architecture with 4x larger input data resolution . . . . . . . . . . . . . . . . . . 75 4.9 A CNN architect is responsible for considering and exploring these design choices. . 78 5.1 SqueezeNet architectural dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.2 Comparing SqueezeNet to model compression approaches . . . . . . . . . . . . . . . 89 5.3 SqueezeNet accuracy and model size using different macroarchitecture configurations. 93 v 9 Acknowledgements I would like to thank my parents for encouraging me to pursue what I am most interested in. I would like to thank my wife Steena Monteiro, who is an accomplished computer science researcher, for the last several years worth of brainstorming sessions, collaboration, and encouragement. Thanks to Mike Syphers for introducing me to scientific research more than ten years ago and for inspiring me to pursue research in my career. I would like to thank my advisor, Kurt Keutzer, for being helpful, encouraging, energizing, and thoughtful. While Kurt has exceeded my expectations as a scientific advisor, I also thank Kurt for being my mentor on other topics including management, human behavior, and especially entrepreneurship. I would also like to thank my dissertation committee members Sara McMains and Krste Asanović for their feedback and encouragement. Thanks to Trevor Darrell, Jitendra Malik, and Ross Girshick for encouraging me to participate in their projects even when I was a first-year grad student who brought more questions than solutions to the table. It has been an honor to work with many great collaborators during my time at Berkeley. Thanks to David Sheffield and Michael Anderson for teaching me much of what I know about benchmarking and accelerating software. Thanks to Song Han for a really fun collaboration on designing small neural network models and using model compression techniques. I owe much gratitude to many colleagues and collaborators, including (in no particular order): Steena Monteiro, Matthew Moskewicz, Katya Gonina, Saurabh Gupta, Peter Jin, Anting Shen, Sammy Sidhu, Don MacMillen, Peter Gao, Sergey Karayev, Mehdi Maasoumy, Pierluigi Nuzzo, Mangpo Phothilimthana, Evan Shelhamer, Jon Long, Yangqing Jia, Jeff Donohue, Richard Zhang, Mahsa Kamali, John Hart, Matei Stroila, Tarek Abdelzaher, Bichen Wu, Benjamin Elizalde, Khalid Ashraf, Ning Zhang, Larry Zitnick, Hao Fang, Rupesh Srivastava, Meg Mitchell, John Platt, Li Deng, Piotr Dollár, Jianfeng Gao, Xiaodong He, John Platt, Larry Zitnick, Geoff Zweig and Ryan Farrell. I would like to thank our sponsors. Over the last few years, our research has been partially funded by industrial sponsors and affiliates including BMW, Intel, Google, Huawei, Nokia, NVIDIA, Oracle, Hewlett-Packard, LGE, and Samsung. For the first three years of my PhD, I was funded by the US DOD NDSEG Fellowship, which enabled me to have maximum freedom in my research direction. Our research has also been partially funded by DARPA Award Number HR0011-12-20016.1 Our research used resources of the Oak Ridge Leadership Computing Facility at the Oak Ridge National Laboratory, which is supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC05-00OR22725.2 Finally, thanks to Shirley Salanio for helping me to navigate all the non-obvious logistical nuances of successfully filing a dissertation at Berkeley. Also, in the days leading up to the dissertation filing deadline, I was spending much of my time at the DeepScale office in Mountain View, CA. Thanks to Anting Shen and Daisyca Woe for hand-delivering my dissertation documents to UC Berkeley. 1 2 In other words, thanks to DARPA for being the anchor sponsor of our ASPIRE laboratory at Berkeley. In other words, thanks to Oak Ridge National Lab for lending us the keys to their Titan supercomputer. vi vii Chapter 1 Introduction and Motivation 1.1 Motivating the search for the “right” Deep Neural Network (DNN) architecture Thus far, most computer science research and development has focused on problems for which a mathematical solution or clear step-by-step procedure can be derived. These approaches are feasible in popular computer science topics and applications including databases, numerical linear algebra, encryption, and programming systems. However, there is an extremely broad space of important problems for which no closed-form solution is known. What is the right equation to take pixels of an image and understand its contents? What equation should we use to take audio frequencies and interpret speech? Nature and evolution has developed solutions to some of these problems, but so far there is no foolproof mathematical solution or series of steps that we can write down that will comprehensively solve these problems. For problems where no procedural or mathematical solution is known, we often turn to machine learning (ML), which we can broadly define as enabling the computer to automatically learn without explicitly being programmed. Over its history, the field of machine learning has churned out numerous approaches including decision trees, clustering, hidden Markov models (HMMs), support vector machines (SVMs), and neural networks. Given a new problem for which no mathematical/procedural solution is known, machine learning practitioners have often done some combination of (a) experimenting with several families of machine learning algorithms, and (b) attempting to design new algorithms. In Figure 1.1, we show a number of widely-studied machine learning problems, along with high-accuracy solutions to these problems as of 2012. Since 2012, we have had the opportunity to play a role in the dramatic transformation in the landscape of machine learning algorithms. Over the last few years, the machine learning community has discovered that deep neural networks (DNNs) can give higher accuracy than all previous solutions to a broad array of ML problems. Compared to Figure 1.1, notice that as of the year 2016 (Figure 1.2), the highest-accuracy solutions to these problems are based on DNNs. However, that’s not to say that a single DNN configuration is able to singlehandedly solve all of 1 these problems with high accuracy. Rather, DNNs are a broad family of algorithms that are (a) comprised of multiple layers of automatically-learned data transformations, and (b) the layers are trained in an end-to-end fashion. Thus far, the design of DNN architectures is driven primarily by human intuition and empirical experimentation, and we do not see an overarching theory on the horizon that will supplant this experimental craft. Therefore, the search for the “right” DNN architectures is replacing broader algorithmic exploration in many ML application areas.1 In this dissertation, we propose and codify the best practices for undertaking the search for the right DNN architectures. Sen3ment(Analysis( LDA) Machine(Learning(in(2012( Text) Analysis) Object(Detec3on( Deformable)Parts)Model) Computer) Vision) Seman3c(Segmenta3on( 2nd)Order)Pooling)(O2P)) Word(Predic3on( Linear)InterpolaJon) +)NGGram) Audio) Analysis) Speech(Recogni3on( Hidden)Markov)) Model) Audio(Concept(( Recogni3on( Image(Classifica3on( Fisher)Vectors)+)SVMs) iGVector)+)HMM) Figure 1.1. Contemporary approaches to machine learning problems, as of 2012. (References: Latent Dirichlet Allocation (LDA) [1], Linear Interpolation + N-Gram [2], Hidden Markov Model (HMM) [3], i[1])F.(Iandola,)M.)Moskewicz,)K.)Keutzer.)libHOG:)EnergyGEfficient)Histogram)of)Oriented)Gradient)ComputaJon.)ITSC,)2015.) vector+HMM [4, 5], Deformable Parts Model [6], 2nd Order Pooling (O2P) [7], Fisher Vectors + Support Vector [2])N.)Zhang,)R.)Farrell,)F.(Iandola,)and)T.)Darrell.)Deformable)Part)Descriptors)for)FineGgrained)RecogniJon)and)A\ribute)PredicJon.)ICCV, ) 2013.)) Machines (SVMs) [8].) [3])M.)Kamali,)I.)Omer,)F.)Iandola,)E.)Ofek,)and)J.C.)Hart.)Linear)Clu\er)Removal)from)Urban)Panoramas))InternaJonal)Symposium)on) 1Visual)CompuJng.)ISVC,)2011.) Prof. Alexei Efros of UC Berkeley, whose focus is on computer vision and graphics, says “My students used to ) design new software and algorithms. Now, they design new Deep Neural Networks.” ) 2 Deep$Neural$Networks$(DNNs)$ Object$Detec8on$ 169layer#R9CNN# Sen8ment$Analysis$ 39layer#RNN# Text# Analysis# Computer# Vision# DNN# Seman8c$Segmenta8on$ Word$Predic8on$ word2vec#NN# 199layer#FCN# Audio# Analysis# Speech$Recogni8on$ Audio$Concept$$ Recogni8on$ LSTM#NN# 49layer#DNN# Image$Classifica8on$ 1529layer#CNN# Figure 1.2. As of the year 2016, Deep Neural Networks deliver highest-accuracy solutions [1]#K.#Ashraf,#B.#Elizalde,$F.$Iandola,#M.#Moskewicz,#J.#Bernd,#G.#Friedland,#K.#Keutzer.#Audio9Based#MulTmedia#Event#DetecTon#with#Deep#Neural#Nets# for each of these problems. (References: 3-layer RNN [9], word2vec NN [10], LSTM NN [11], 4-layer DNN [12]), and#Sparse#Sampling.#ACM#ICMR,#2015.# [2]#F.$Iandola,#A.#Shen,#P.#Gao,#K.#Keutzer.#DeepLogo:#Hi[ng#logo#recogniTon#with#the#deep#neural#network#hammer.#arXiv:1510.02131,#2015.# 16-layer R-CNN [13], 19-layer FCN [14], 152-layer CNN [15].) [3]#F.$Iandola,#M.#Moskewicz,#S.#Karayev,#R.#Girshick,#T.#Darrell,#K.#Keutzer.#DenseNet:#ImplemenTng#Efficient#ConvNet#Descriptor#Pyramids.#arXiv: 1404.1869,#2014.# [4]#R.#Girshick,#F.$Iandola,#T.#Darrell,#J.#Malik.#Deformable#Part#Models#are#ConvoluTonal#Neural#Networks.#CVPR,#2015.# [5]#H.#Fang,#S.#Gupta,#F.$Iandola,#et#al.#From#CapTons#to#Visual#Concepts#and#Back.#CVPR,#2015.## # Considera*ons+in+prac*cal+ deep+neural+network+applica*ons+ In the search for new DNN architectures, what do we hope to find? +++++++++++++++Energy+Efficiency+ 1.1.1 T d+ Spee + g n i rain Accuracy+ Figure 1.3. Considerations when designing DNNs to use in practical applications 3 Many machine learning researchers have spent their entire careers optimizing for one metric: accuracy. Accuracy is often defined as the percentage of examples in a held-out test set that a machine learning system can recognize or classify correctly.2 In the last few years, the rise of DNNs has brought enormous improvements in accuracy. For example, on the PASCAL object detection dataset [16], pre-deep-learning methods (typically based on Deformable Parts Models [6]) achieved roughly 34% mean-average precision (mAP) on the PASCAL-2007 validation set. Today, DNNbased object detectors are able to achieve much higher accuracy. For example, the DNN-based Faster R-CNN [13] object detector has achieved 73% mean-average precision on the PASCAL-2007 validation set. This is a relative improvement of more than double the accuracy of the best pre-deeplearning solutions. In short, DNNs have enabled enormous improvements in accuracy in application areas such as computer vision. A by-product of this is that computer vision is now ready for prime time in a number of practical industrial applications. In deploying solutions to real applications, achieving high accuracy is necessary but not usually sufficient to enable the application’s success. A number of other factors — such as the time required to train a model, the speed at which the model can run in inference mode, the energy-efficiency of the system as a whole, and so on — are important for enabling productive workflows and deployable applications. We summarize some of these factors in Figure 1.3, and we give a more detailed account of these factors in Chapter 2. The take-away here is that, when we explore the design space of DNN architectures, we are not only aiming for high accuracy, but we are searching for tradeoffs between accuracy and other practical metrics. 1.2 Ingredients for success in deep learning In both research and industrial settings, many engineers are gearing up to apply deep learning to their respective problem domains. What tools, resources, and objectives should these teams obtain as they dive into this process? We have identified four key ingredients for success with deep learning. We enumerate these ingredients in Figure 1.4, and we discuss them in more detail in the following subsections. 2 A more nuanced accuracy measure is “mean average precision,” which we will discuss in Section 2.3.1. 4 Key$ingredients$for$success$with$ Deep$Learning$ Collect/annotate$ adequate$training$ data$ Train$rapidly$using$ mul9processor$ scaling$ SqueezeNet( and(FireNet:( Development(of(the( "right"(DNNs(for( ADAS(applica=ons(( Find$the$"right"$DNN$ architectures$ Create$efficient$ implementa9on$for$ embedded$hardware$ Boda:(( So?ware(for(portable(and(( rapid(inference(of(DNNs( ( Figure 1.4. Ingredients for success with deep neural networks. We have advanced the stateof-the art in several of these ingredients, with contributions including the FireCaffe [17] rapid DNN training framework, SqueezeNet [18] and other new CNN/DNN architectures, and the Boda [19] framework for portable and efficient DNN inference. 1.2.1 Training Data Training data is the fuel that enables deep neural networks to learn. With enormous amounts of training data, DNNs are able to achieve unprecedented accuracy on a variety of problems. However, now that DNNs are in real products, the product developers receive a steady stream of feedback about what the DNN-based solution is failing to do correctly. For example, picture yourself as a developer of autonomous vehicle technology. End-users report that the vehicle acts “confused” in specific situations, such as night driving, snow, or horizontal stop lights. How do you go about addressing these issues? One of the techniques at your disposal is to collect more training data in dark lighting conditions, inclement weather, and unusual types of stop lights. We anticipate that developers of DNN-based products will constantly be iterating through (1) identifying edge-cases / failure cases, (2) collecting and annotating data to cover these cases, (3) retraining models, and (4) deploying the updated models. 5 0.6 Top-1 accuracy 0.5 0.4 0.3 0.2 0.1 0.0 0 0 200 400 600 800 1000 1umber of examples per class (linear) 1200 Figure 1.5. Impact of training set size on a DNN’s accuracy. This figure was taken directly from the supplementary material of [20]. See Section 1.2.1 of this dissertation for details on this figure. Let us now engage in a more quantitative discussion of how the training set size affects a DNN’s accuracy for a target application. ImageNet-1k [21] is a widely-used dataset that provides a training set of 1.2 million labeled images, where each image has been hand-labeled as belonging to one category (e.g. “cougar,” “safety pin,” or “seat belt”). In total, ImageNet-1k has 1000 categories of images, and the dataset provides roughly 1200 training images per category.3 It is labor-intensive to label 1.2 million images. A logical question is, when training DNN models, how does the quantity of labeled training images affect the model’s accuracy? In the supplementary material of their NIPS 2014 paper [20], Yosinski et al. evaluated precisely this question. In Figure 1.5, we show the key result from the experiment of Yosinski et al. . Each point on Figure 1.5 is a separate training run Figure S1: Top-1 validation accuracy for networks trained on datasets containing reduced numbers of AlexNet [22] DNNdataset architecture, with a specific number examples of the examples. The largest containstrained the entire ILSVRC2012 (Deng etofal.,training 2009) release withper category. For example, the point corresponding to “500” on the x-axis was trained on a subset a maximum of 1300 examples per class, and the smallest dataset contains only 1 example per class of ImageNet-1k consisting of Top: 1000 linear categories 500 images per category. The y-axis is accuracy, (1000 data points in total). axes. with The slope of the rightmost line segment between 1000 defined as isthe percentage of imagesthat in the the amount validation set that the DNN model classified correctly. and 1300 nearly zero, indicating of overfit is slight. In this region the validation Observe training from data leads to higher accuracy. Even on the right-hand of the graph, accuracythat risesmore by 0.010820 0.54094 to 0.55176. Bottom: logarithmic axes. It isside interesting to note thaton even the images networks trained on a shows single example per class or examples per class manage training 1200 per category an improvement of two roughly 1 percentage-point over to attain on 3.8% or images 4.4% accuracy, respectively. Networks onconsensus {5,10,25,50,100} examples perare training 1000 per category. More broadly, thetrained general is that — unless we class exhibit poor convergence and — attain only chance leveland performance. already achieving 100% accuracy increasing the size diversity of the training set typically leads to higher accuracy. In this dissertation, we primarily use publicly-available datasets of training data. That said, most industrial applications of DNNs will require substantial quantities of labeled data that is same 1000 classes as ImageNet, but where each class contained a maximum of n examples, for representative of the task at hand. The biggest challenge in building custom training datasets is the each n 2 {1300, 1000, 750, 500, 250, 100, 50, 25, 10, 5, 2, 1}. The case of n = 1300 is the complete cost and management overhead of getting workers to apply appropriate annotations to the data. In ImageNet dataset. Kurt Keutzer’s research group at Berkeley, we have developed our own tool — BEAVERDAM — for Because occupying a whole GPU for this long was infeasible given our available computing re3 For evaluating accuracy the dataset also provides a held-out validation set of 50 images per category (for a total sources, we also devised a set of hyperparameters to allow faster learning by boosting the learning of 50,000 validation images). rate by 25% to 0.0125, annealing by a factor of 10 after only 64,000 iterations, and stopping after 200,000 iterations. These selections were made after looking at the learning curves for the base case and estimating at which points learning had plateaued and thus annealing could take place. This faster training schedule was only used for the experiments in this section. Each run took just over 4 6 days on a K20 GPU. The results of this experiment are shown in Figure S1 and Table S1. The rightmost few points in the enabling human annotators to efficiently label large quantities of training data. More information about BEAVERDAM is available in [23, 24]. 1.2.2 Rapid training The ability to rapidly train DNN models is important for two reasons. First, rapid training enables developers to more quickly search for the “right” DNN models. Second, rapid training enables the workflow to keep up with ever-expanding training datasets. Enabling rapid training may require some mix of: appropriate computational hardware, efficient implementations, appropriate DNN architectures, and (in many cases) efficient distributed computation over a cluster of servers. We will discuss our approaches for rapid DNN training in Chapter 3. 1.2.3 The right DNN models The right models must give the “right” tradeoffs of efficiency metrics such as energy, compute footprint, memory footprint, all while achieving the accuracy level that is required by the endapplication. We will discuss our approaches exploring DNN models and identifying the “right” DNN models in Chapter 5. 1.2.4 Efficient inference Once we have the right models, we need to deploy them. There are opportunities for efficient implementations on CPUs, GPUs, FPGAs, and ASICs / custom silicon. In all of these cases, we need the right portable and efficient software implementation. In this dissertation, we primarily rely on existing computational kernels such as those in the NVIDIA cuDNN library [25] for efficient DNN inference. The cuDNN kernels were developed by a large team of engineers at NVIDIA, and they are highly efficient on NVIDIA hardware. However, the cuDNN kernels exclusively support NVIDIA processing hardware. Achieving high efficiency for DNN inference on other hardware (e.g. Intel, Texas Instruments, Qualcomm, AMD, and so on) remains a challenge for much of the research and industrial community. In joint work with Matthew Moskewicz, Ali Jannesari, and Kurt Keutzer of UC Berkeley, we developed the Boda software framework. Boda provides DNN computational kernels that are competitive with cuDNN on NVIDIA hardware, and Boda’s kernels are also efficient on other hardware platforms such as Qualcomm GPUs. More information about Boda is available in [19, 26]. 1.3 The MESCAL Methodology for Design Space Exploration So far, we have motivated the search for the “right” DNN architectures, and we have proposed a set of ingredients that are vital for carrying out this search. Now, what is the recipe book to leverage these raw ingredients to cook up new, world-beating deep neural network architectures? In this section, we begin to describe such a recipe book. 7 Deep Neural Networks comprise an enormous design space. An overarching theme and objective of this dissertation is to design new DNN architectures and DNN-based systems that meet particular design goals. While DNNs have only recently become widely studied, there are other areas where broad design spaces have been fruitfully explored. One such area is computational hardware architecture, which comprises an enormous design space that has been continuously explored by numerous semiconductor companies for more than 40 years. In this section, we summarize a number of insights from hardware architectural design practices, and adapt them for DNNs. In the broad design space of computational hardware, at one end of the spectrum lies the fixedfunction circuit, and at the other end of the spectrum lies the general-purpose (GP) processor. Fixed-function circuits are routinely developed with the goal of providing cheap-to-manufacture4 energy-efficient and low-latency solutions for specific problems such as Bluetooth wireless communication [27], network packet routing [28], and bitcoin mining [29]. One challenge is that, when a fixed-function circuit is designed to execute a particular algorithm, any future changes to the algorithm will likely require an entirely new circuit to be produced. On the other hand, general-purpose processors are relatively easy to program, with the ability to execute a broad range of computations. But, a downside to GP processors is that they typically draw more energy (per computation performed) than a well-designed fixed-function circuit, and GP processors can be more expensive to manufacture. So, what options lie between the two extremes of fixedfunction circuits (highly efficient, cheap to manufacture, non-programmable) and general-purpose processors (less efficient, more expensive to manufacture, flexible to program)? Computational hardware solutions in the middleground between fixed-function circuits and GP processors are commonly called Application-Specific Processors (ASIPs). Application-Specific Processors (ASIPs) have been developed for a variety of applications including speech recognition [30], computer vision [31], graphics [32], and software-defined wireless [33]. Even for one given problem (e.g. creating a programmable chip for ethernet network processing), there is a broad design space of ASIPs that can address this problem. This design space include ASIPs that have already been produced/fabricated; designs that have been considered but not fabricated; and designs that have not been considered at all. Each point in the ASIP design space is a processor with unique characteristics such as the number of pipeline stages (depth), the number of processing elements, and the number of vector lanes. Each design point also has specific tradeoffs of energy-efficiency, throughput, latency, manufacturing cost, and other such metrics. The MESCAL Methodology [34] codifies the best practices in navigating this design space to produce high-quality ASIP hardware. The MESCAL methodology recommends beginning by choosing benchmarks and target results on these benchmarks. Then, to achieve the desired results, a cornerstone of MESCAL is Design Space Exploration (DSE), which consists of identifying and evaluating a broad range of points in the design space. In a series of case studies on ASIP hardware for ethernet network processing, the MESCAL book [34] explores dimensions of the design space such as the number of processing elements, the pipeline depth, and the width of vector lanes. Broadly speaking, the characteristics of the ASIP design space have some commonalities with the characteristics of the DNN design space. ASIPs and DNNs both comprise enormous design spaces. In practical deployments, the design spaces of both ASIPs and DNNs present tradeoffs in terms of speed, energy, and other quality metrics (e.g. chip area in the case of ASIPs, and accuracy 4 when produced in large quantities 8 in the case of DNNs). In the next section, we explain our MESCAL-inspired methodology for understanding and exploring the design space of DNN architectures. 1.4 Organization of this dissertation In the MESCAL methodology [34] for exploring the design space of computational hardware, four of the central themes are: • Judiciously using benchmarking • Efficiently evaluate points the hardware design space • Inclusively identify the architectural space • Comprehensively explore the design space After spending a number of years exploring the design space of DNNs, we have found that there are four MESCAL-like themes for DNN design space exploration (DSE). In the following table, we enumerate the DNN DSE themes, and for reference we include the analogous theme from the MESCAL methodology. In this dissertation, we devote one chapter to each of our DNN DSE themes. Table 1.1. Organization of this dissertation. Dissertation Topic in this dissertation chapter Chapter 2 Analogue in MESCAL Methodology Comprehensively defining benchmarks and metrics to Judiciously using benchmarking evaluate DNNs Chapter 3 Chapter 4 Rapidly training DNNs (i.e. efficiently evaluating Efficiently evaluate points the points in the DNN design space) hardware design space Defining and describing the DNN design space Inclusively identify the architectural space Chapter 5 Exploring the design space of DNN architectures Comprehensively explore the design space In Table 1.1 notice that, while the MESCAL methodology has the theme of “Efficiently evaluate points in the hardware design space,” this dissertation has “Rapidly training DNNs.” The reader may ask — wouldn’t the term “evaluating” refer to the inference rather than the training phase of DNNs? Here’s the problem: to test a DNN on a dataset to evaluate its accuracy, it must be trained first! On the ImageNet-1k [21] dataset, it is typical to train a DNN by making 50 or more passes over a corpus of 1 million images. In contrast, to evaluate the DNN, a single pass over 50,000 images is all that is required. Thus, training is the by far the most computationally expensive stage required to evaluate the accuracy of a new DNN architecture. Fortunately, to evaluate other metrics besides accuracy, the computational requirements are much lower. On other 9 metrics such as training speed, inference speed, throughput (FLOPS/sec), and energy efficiency, DNNs can be evaluated using microbenchmarks that take a few seconds at the most. So, for a new DNN architecture, accuracy is the most computationally-intensive metric to evaluate, because we must train a neural net before we can evaluate its accuracy. In other words, when exploring a broad range of DNN architectures, training the model is the most acute computational bottleneck in evaluating each model. 1.5 How this dissertation relates to my prior work To place this dissertation into context, it may be useful to briefly discuss the intellectual history of this work. I began my research career in the mid-2000s working on computational physics topics such as the simulation of particle colliders [35]. I gradually moved into working on computational efficiency aspects of physics simulations, working on physics-oriented distributed computing frameworks [36] as well as single-node acceleration [37]. Aside from computational physics, I also worked directly on core parallel/efficient computing problems, such as the scheduling of tasks in single-GPU [38] and multi-node or distributed [39, 40] environments, as well as the problem of estimating or predicting the latency of sparse-matrix computations [41]. My early work on distributed scheduling was motivated by maximizing computational efficiency, as well as guaranteeing hard real-time constraints in safety-critical applications such as aircraft electronics. I later co-authored a paper directly on the topic of aircraft electronics [42]. At the same time, I conducted research on computer vision applications such as image stitching [43] and facial analysis [44]. My work at Berkeley has focused at the intersection of computer vision, machine learning, and computational efficiency. On the computational efficiency side, my work (with several key co-authors) has spanned analyzing the energy-efficiency of computer vision algorithms [45], efficient feature extraction [46], amortizing the cost of DNN computation in object detection [47], and unifying efficiently-computed DNN features with other object detection approaches [48]. Convolution is one of the most ubiquitous computational patterns in computer vision [49]. In 2013, our “communication-minimizing” GPU convolution kernels [50, 51] delivered a speedup of up to 8x over NVIDIA’s own NVIDIA Performance Primitives (NPP) library [52]. Since that time, NVIDIA has developed more efficient convolution kernels in the cuDNN library [25], and key individuals at NVIDIA tell us that the closed-source cuDNN implementation drew inspiration from our communication-minimizing convolution approach. In 2016, in joint work with Matthew Moskewicz and Kurt Keutzer, we released a report on our Boda framework [19, 53], which provides efficient convolution kernels and other software for efficient neural network computation. On NVIDIA GPUs, we found that Boda’s convolution efficiency is competitive with NVIDIA’s cuDNN software, and Boda also executes efficiently on GPUs from other vendors such as Qualcomm. In addition, several of my contributions have focused developing more accurate approaches to problems such as fine-grained visual classification [54], logo recognition [55], audio-based concept recognition [12], visual object detection [56], and image captioning [57]. In my final two years at Berkeley, I have focused on the problems of (a) accelerating the training of deep neural networks for computer vision [17, 58], and (b) understanding and exploring the design space of deep neural networks [18]. Taken together, these contributions form the basis for a holistic strategy for efficiently exploring the design space of deep neural network (DNN) architectures, 10 which is the focal point for this dissertation. In this dissertation, Chapter 3 is a refinement of our FireCaffe [17] paper on accelerating DNN training, and Chapter 5 is a refinement of our SqueezeNet paper [18], which not only introduced our novel SqueezeNet DNN architecture, but it also explored a variety of DNN architectures of our own design. Chapters 1, 2, 4, and 6 are new discussions that we have not published in our previous work. 11 Chapter 2 Comprehensively defining benchmarks and metrics to evaluate DNNs For years, many computer architects evaluated their technology using a narrow set of benchmarks and metrics such as cycle count. While cycle count is a useful metric, the MESCAL book [34] contends that computer architectures must be evaluated on a representative set of benchmarks and metrics. Ideally, these benchmarks and metrics should be representative of end-applications that the new computer architecture aims to enable. Like the old days of computer architecture when “cycle count” was erroneously considered to be a sufficient metric, machine learning and computer vision research has predominantly focused on a single type of metric: accuracy. In the context of computer vision, “accuracy” typically refers to the ability of a machine learning method to correctly classify, detect, segment, or otherwise understand visual imagery. However, now that computer vision methods are becoming quite accurate, there a number of other metrics that must be considered when developing computer vision technology that will be deployed in real systems. Computer vision methods can be quite computationally intensive, and every application has explicit or implicit limits on factors such as: the speed that must be achieved, the quantity of energy that is available, and the cost and quantity of hardware than can be used. In this chapter, we propose a more holistic set of metrics that enable a benchmarking methodology, which covers accuracy as well as computational efficiency. This chapter is organized as follows. First, in Section 2.1, we search for the most computationally-intensive applications of DNNs. We discover that, when applying neural networks to high-dimensional data such as images and video, the computational requirements can be extremely high. Next, in Section 2.2, we visit DNNs’ requirements for large quantities of expensive labeled training data, and we describe how to alleviate some aspects of this problem with transfer learning. Then, in Section 2.3, we address the question: besides accuracy, what metrics are useful for evaluating DNNs that will be applied to practical applications? In Section 2.4, we describe how to use these benchmarks and metrics to evaluate an engineering team’s progress — as well as individual engineers’ progress — toward the end-goal of achieving a specific tradeoff of accuracy 12 and efficiency. Finally, in Section 2.5, we describe how our metrics and benchmarking approaches compare to the MESCAL methodology [34]. 2.1 Finding the most computationally-intensive DNN benchmarks When choosing representative benchmarks, it is not enough to identify the average case, middleof-the-road benchmarks. Instead, our goal in choosing benchmarks is to identify the worst-case and most challenging cases, and then to focus on optimizing for these cases. Applying this ideology to the present topic, our goal is to take situations where DNN training and/or inference is currently intractably slow, and to use our computational efficiency skills to accelerate these DNN-based applications to run on a much faster time scale. With this in mind, we sought out the most computationally time-consuming applications of DNNs. Specifically, we are looking for applications with the following two properties: • Requirement 1. The total time to train a model is quite high. • Requirement 2. The processing time per data sample during training or inference is quite high. Table 2.1. Training times and quantities of data in large-scale DNN application domains, as reported in the literature. For details on how these were calculated, see Sections 2.1.1— 2.1.4. type of problem area data text word prediction quantity of training supervi- DNN archi- Hardware Training data sion tecture architecture time 100 billion words unsu- 2-layer 1 Titan X 6.2 pervised skip-gram GPU hours (word2vec [10]) [59] audio images video speech recognition image classification activity recognition 2000 hours super- 11-layer 1 NVIDIA 3.5 (Fisher Corpus [60]) vised RNN K1200 GPU days [11] 1 million images super- AlexNet 1 NVIDIA K20 1 week (ImageNet [21]) vised [22] GPU [61] 1 million videos super- AlexNet 10 NVIDIA 1 month (Sports-1M [62]) vised [22] GPUs [62] In Table 2.1, we have identified computationally-intensive DNN applications that make use of large publicly-available datasets in four key domains: text, audio, images, and video. We summarize the key results from Table 2.1 in Figure 2.1. Our main observation in this table is that applications in which each data sample is of higher dimensionality, training takes longer. For example, training 13 Single-GPU Training Time (log scale) 10 3 10 2 10 1 10 0 text audio images Data Type video Figure 2.1. The difference in single-GPU training times across different DNN applications. (See Table 2.1 for more details.) a DNN on text takes 6.2 hours, and training a DNN on video takes 1 month — in other words, the video application took 117x more time to train than the text application. One factor here is that higher-dimensional input data can necessitate higher-dimensional models that have more computational complexity. In the text application [10] in Table 2.1, the authors didn’t report the number of computational operations per data sample, but it appears that the text DNN has far fewer computational operations than the video DNN. This difference in computational complexity among these applications is so dramatic that, even though the text dataset has 10,000x more data samples than the video dataset, training the video DNN is still more than 100x slower than training the text DNN. Finally, notice that the video DNN is trained on 10 GPUs, while the text DNN is trained on 1 GPU. In the best case, training on 10 GPUs would be 10x faster than training on 1 GPU.1 Therefore, in an apples-to-apples comparison on 1 GPU, the video DNN training may be as much as 1000x more time-consuming than the text DNN training, despite the fact that the text training dataset has 10,000x more training samples than the video training dataset. Especially compared to the text application, the image and video applications in Table 2.1 are highly computationally intensive and meet Requirement 1 (total training time is high) and Requirement 2 (time per training sample is high). From the outset, one of our goals was to find the most computationally-intensive DNN applications/benchmarks, and then to go to work accelerating these applications. As you can see from the examples in Table 2.1, computer vision applications on large-scale image and video datasets tend to demand extremely high computational cost. With this in mind, we focus the rest of this dissertation on the application of neural networks to computer vision. Today, almost all neural networks in computer vision are not only deep, but also make extensive use of convolution layers. 1 To be clear, 10x would be a best-case speedup when scaling up from 1 to 10 GPUs. However, factors such as GPU-to-GPU communication overhead can make it difficult to achieve a truly linear speedup when scaling to multiple GPUs. 14 In computer vision, deep convolutional neural networks are often referred to as DCNNs or simply CNNs. From this point forward in the dissertation, we will primarily use the term CNN to describe neural networks applied to computer vision. We now turn our attention back to Table 2.1. As you can probably imagine, summarizing four domains of DNN applications in one table requires many simplifications and omissions. In the following subsections, we provide all the details of how the numbers in Table 2.1 were calculated. If you feel satisfied with your understanding of Table 2.1, we recommend skipping ahead to Section 2.2. 2.1.1 Text (Least computationally intensive) In the past, text analysis algorithms often relied on hand-engineered features such as n-grams. However, since the publication of the word2vec paper [10], Deep Neural Networks have gone into widespread use for creating feature representations of text data. The word2vec approach has been used to improve the accuracy of a number of text-based applications such as document search and internet click prediction. We now provide more background on the word2vec approach. Word2vec requires a large corpus of text data — for example many sentences collected from Wikipedia or other internet text. Unlike the audio, imaging, and video topics discussed in this chapter, training word2vec on text data does not require human-annotated labels. Instead, the word2vec training problem is phrased in a self-supervised way. Then, for each sentence, we remove a word and ask the model to predict what word best fits that sentence. The correct response from the model would be to predict the word that was in the original sentence. Any other response is considered wrong, and the correct response is backpropagated through the model. Ultimately, this produces a model that can predict missing words in sentences. This is self-supervised, because — rather than requiring a human annotator — the labels are derived from the corpus of training data. The research community has discovered that the representation learned in this training procedure is broadly applicable as a high-quality feature representation for a variety of problems. How long does it take to train a word2vec model? The original word2vec paper trained its model on a dataset that contained a total of 100 billion words [10]. The word2vec authors reported training a word2vec model on 100 billion words in one day on a single server, but no information is provided about the type of hardware used in this server. However, Zhao et al. [59] did report the amount of time required to train a word2vec model, as observed in their own experiments. Admittedly, it isn’t entirely clear whether the model by Zhou et al. has the same dimensions and configuration as the model presented in the original word2vec paper. Nevertheless, Zhao et al. [59] reported training a word2vec model on a single NVIDIA Titan X GPU at a rate of 4.5M words per second, which equates to roughly 6.2 hours to complete one epoch of training.2 We used the numbers by Zhao et al. for the word2vec entry in Table 2.1. 2.1.2 Audio (Somewhat computationally intensive) DNNs are now widely used in research and commercial speech recognition systems. In most approaches, training a DNN to perform speech recognition requires a large quantity of appropriate 2 This is assuming one epoch (pass through the training set) is necessary to train a word2vec model. 15 training data. This training data is typically a corpus of spoken-word audio, which has been labeled (by human annotators) with words.3 To our knowledge, the largest publicly available corpus of word-labeled audio data is the Fisher Corpus, which has 2000 hours of data [60]. So, how long does it take to train a high-accuracy DNN on this dataset? In the literature, we have not found any articles that report training times on the Fisher Corpus. However, researchers at Baidu reported the time required to train on an even larger dataset. The Baidu researchers used a 12,000-hour dataset, which includes all 2000 hours of the Fisher Corpus, plus 8600 hours of proprietary data collected and labeled by Baidu, plus a number of smaller datasets such as WSJ [63], Switchboard [64], and LibriSpeech [65]. To train on this 12,000-hour dataset using a single NVIDIA K1200 GPU, the authors reported that it takes approximately 3 weeks to train a high-accuracy DNN model.4 Given that takes 3 weeks to train on the full 12,000-hour Baidu dataset, and knowing that the Fisher Corpus contains 16 as much training data, we estimate that it would take half a week (3.5 days) to train a high accuracy DNN using the Fisher Corpus, which to our knowledge is the largest publicly-available dataset.5 2.1.3 Images (Very computationally intensive) Image classification is a core problem in computer vision. The goal here is to automatically assign one or more labels to an image. If the image is zoomed-in on one primary object such as a dog, a valid classification label could be “dog” or even the specific breed of dog. If the image is zoomed-out on a scene, a reasonable label might be “park” or “office,” depending on the contents of the image. Researchers have developed large datasets of labeled data for training and evaluating image classification methods. One of the largest image classification datasets is ImageNet-1k, which has 1000 categories of images, and an average of 1200 labeled training images per category, for a total of 1.2 million labeled training images [21]. A CNN architecture called AlexNet [22] won the ImageNet image classification competition in 2012. ImageNet is a large dataset, and CNNs are often quite computationally intensive. So, how long does it take to train the AlexNet model on ImageNet-1k? Krizhevsky et al. [22] reported that this training took approximately 1 week. This result was achieved by training on a single NVIDIA K20 GPU using well-tuned computational kernels. The full ImageNet [21] data corpus (of which ImageNet-1k is a modest subset) has at least 7 million images, where each image is labeled as one of 22,000 categories [66]. On a fixed number of epochs6 , training on the full ImageNet corpus should take 6x times longer, for a total of 6 weeks of execution between the time the researcher begins training the model, and the time when the training is complete.7 Now, even larger image classification datasets have been developed. For example, the Places2 scene classification dataset has over 8 million labeled images in the training set [67]. As datasets 3 Alternatively, the corpus can be labeled with individual syllables called phonemes. However, word-labels have been used to train the current state-of-art speech recognition approaches. 4 The Deep Speech 2 authors go on to present multi-GPU distributed training strategies to accelerate training. We will discuss distributed training in depth in Chapter 3. 5 Given a fixed number of epochs (passes through the training set), DNN training time grows linear with the training set size. 6 an “epoch” is one pass through the training set 7 This “6x” number comes from the fact that the full ImageNet dataset has 7M images rather than 1.2M images. 16 continue to grow, the training of DNNs is on track to become more and more computationally expensive. 2.1.4 Video (Extremely computationally intensive) ImageNet-1k has slightly more than 1 million labeled images in its training set. However, the Sports-1M dataset has nearly 1 million labeled videos in its training set [62]. Each video may be comprised of hundreds of frames per minute, and the average video in the dataset is 5.5 minutes long. The labels for Sports-1M are rather coarse. Rather than labeling individual objects or individual frames, the creators of Sports-1M opted to have just one label per video. Specifically, each video is labeled with a particular activity that is being performed in the video. The dataset is called Sports-1M, so the “activities” are types of sports — a total of 487 different types of sports, to be exact. When training models on the Sports-1M dataset, the typical end-goal is to automatically predict one label (e.g. the type of sport being played) for each video in the test set. How long does it take to train a model to recognize types of sports that are being played in videos? Karpathy et al. trained an AlexNet-based CNN model on the Sports-1M dataset [62]. The authors trained the model using custom settings for the downsampling factor in the input images and the number of images or clips to use per training video. Rather than attempting to calculate the training time based on the AlexNet-ImageNet experiments in the previous subsection, we simply report the training times from Karpathy et al. as follows. Karpathy et al. were able to train a high-accuracy DNN model on Sports-1M in 1 month using a cluster of 10 GPUs. 2.2 Transfer learning: amortizing a few large labeled datasets over many applications In the previous section, we found that CNN/DNN training tends to be more time-consuming and computationally expensive in large-scale computer vision recognition problems on images and video, compared to text and audio which typically have less computational overhead. We have dedicated the remainder of this dissertation to accelerating, rethinking, and improving the efficiency and accuracy of CNNs applied to computer vision. A key element in many of today’s computer vision CNN workflows is transfer learning, which we will discuss in the following paragraphs. To achieve the highest possible accuracy, CNN/DNNs typically need a large supply of training data.8 In computer vision, the state-of-art CNNs are often trained with supervised learning methods. Supervised learning methods typically require the training data to be annotated by humans. A practical question is, how do we avoid the need to pay human annotators to annotate enormous datasets for each new application for which we would like to develop high-accuracy CNN models? Image classification is an application where training data is relatively inexpensive to gather. This is because, to train a CNN for image classification, we only need one label (e.g. “dog” or “office building”) for each image. In contrast, the problem of object detection is the problem of automatically localizing and classifying each object in an image. Typically, to train a CNN to 8 We provided some quantitative numbers on how dataset size impacts accuracy in Section 1.2.1. 17 perform object detection, each image must be hand-annotated with a rectangle and a class label for each object in the image. This is substantially more work than simply annotating a class label for each image. Given how much work goes into annotating each image, the popular publicly-available object detection training datasets such as KITTI [68] and PASCAL [16] each have fewer than 10,000 annotated images. This is frustrating, because CNNs typically require a large quantity of training data to achieve the highest possible accuracy. However, recall that it is much less labor-intensive to annotate data for image classification. With this in mind, a popular approach to ingest “enough” data into an object detection CNN is as follows. First, we train the CNN for image classification on an enormous volume of data, such as the 1.2 million images in ImageNet-1k. Partway through the training procedure, we switch from training for image classification (e.g. using ImageNet data) to training for object detection (e.g. using Pascal [16], KITTI [68], COCO [69], or VIRAT [70] data). During this switch from classification to detection, it may be necessary to change the choice of loss function, but the knowledge of natural images that was learned on classification is transferred to training an object detector. Training protocols that involve this switch (e.g. from classification to detection) are called transfer learning. Broadly, any training approach that involves transferring a model learned in one domain (e.g. classification) and adapting that model to a new domain (e.g. detection) can be described as a transfer learning approach. 2.3 Beyond accuracy: metrics for evaluating key properties of DNNs The overwhelming majority of research on machine learning, computer vision, and neural networks has focused on getting the best possible results on one type of metric: accuracy. However, to train models in a tractable and productive timeframe, and to deploy models in real-time without unbounded quantities of hardware, we must apply some discipline in evaluating the computational characteristics of DNN models and DNN execution environments. In this section, we present a menu of metrics that enable disciplined evaluation of the computational properties of DNNs. For completeness, we also present a overview of strategies for evaluating the accuracy of DNNs. We list the metrics in Table 2.2. We orient these metrics especially toward computer vision, but many of these metrics can be applied to other CNN/DNN applications as well. Further, we also show in Table 2.2 how different aspects of the CNN environment (the dataset, image resolution, CNN architecture itself, computational hardware, and solver approach) interact with the metrics. Notice that some metrics are influenced by all aspects of the CNN environment, while other metrics are isolated to only one or two aspects of the CNN environment. Bear in mind that not all of these metrics will necessarily be useful in all applications — rather, our goal here is to present our broad playbook for how to evaluate CNNs and CNN-based systems before deploying them in a real application. For the interested reader, we offer more detail on each of these metrics in the following subsections. If you feel confident in your understanding of the metrics in Table 2.2, we recommend skipping ahead to Section 2.4. 18 Table 2.2. Which aspects of a DNN-based system are evaluated by each metric? (Note that the “Hardware” aspect of the system also includes the computational kernel implementations.) Metric Aspects of system evaluated Dataset Image Resolution CNN/DNN Hardware Solver Architecture Accuracy X Qty of computation X X X X X X X X X X X (ops/image) Frame Rate (FPS) Training Time (hours) X Power (TDP) Energy (Joules/frame) X X Model Size (bytes) Memory Footprint (bytes) 2.3.1 X X X X X X Accuracy Machine learning methods such as DNNs are employed to classify and extract meaning from unstructured data such as text, audio, images, or video. Some methods are better than others at accurately extracting meaning from data. So, how do we go about measuring the accuracy of a machine learning method? A general template of how to measure accuracy involves a test set of data samples, where the experimenter knows the ground truth labels of these samples, but the learning method does not. To evaluate the method’s accuracy, the trained model is applied to the test set, and the method’s accuracy level is computed based on how well the method understood the test set. The exact choice of how to compute accuracy depends on the problem at hand. We now review a few techniques for measuring accuracy in various problem domains. A widely-studied problem in computer vision is image classification — that is, to automatically classify a whole image as “office,” “park,” “restaurant,” etc. DNNs or other classification methods can be trained to learn a mapping from an image to a category label. How do we evaluate the accuracy of such a classifier? If each image in the test set belongs to exactly one category, then the #correct accuracy can be reported simply as a percentage #incorrect . An other widely-studied problem in computer vision is localized detection of objects. The goal here is to automatically draw rectangles around objects in an image, and to automatically assign the correct labels to each rectangle (e.g. car, bus, pedestrian, etc). Localized detection methods can exhibit some extreme behavior — for example, they can cover an entire image in rectangles, or they can choose to draw no rectangles at all. How can such a range of outcomes be summarized in 19 a single metric of accuracy? There are number of approaches, most of which begin by organizing the method’s detections into false positives (FP), true positives (TP), false negatives (FN), and true negatives (TN). With this information, metrics such as average precision (AP) [16] or false positives per image (FPPI) [71] can then be computed. Each of these metrics can summarize an object detector’s accuracy in a single metric. There are a number of additional metrics for calculating accuracy in other problem domains. The accuracy of semantic segmentation — that is, assigning object labels to all pixels in an image — is often evaluated with an Intersection over Union (IOU) metric [72]. The accuracy of speech recognition methods can be evaluated on a per-frame or per-word basis. Likewise, the accuracy of video analysis methods can be evaluated on a timescale ranging from per-frame to per-video [62]. The accuracy of methods for automatically assigning captions or sentences to images is commonly evaluated with metrics such as Bilingual Evaluation Understudy (BLEU) [73] or Metric for Evaluation of Translation with Explicit ORdering (METEOR) [74]. In general terms, BLEU and METEOR are designed to quantify the correctness of the algorithmically generated caption’s word usage, word ordering, and number of words, with respect to a database of ground-truth captions. In optical flow algorithms, the accuracy is often measured with an angular error [75] metric. 2.3.2 Quantity of Computation Today’s DNN architectures present a wide range of computational requirements. For example, the LeNet [76] DNN architecture performs 5.74 million floating-point arithmetic operations (5.74 MFLOPS) to classify a 28x28 image. At the other end of the spectrum, the VGG-19 [77] DNN architecture performs 117,000 MFLOPS to classify a 224x224 image. If applied to a 224x224 image, LeNet performs 2700 MFLOPS to classify the image.9 Applying VGG-19 to a 224x224 input image requires 20,000x more computation than applying LeNet to a 28x28 input image. Even with the same input image size, VGG-19 requires 43x more computation than LeNet. DNNs comprise an enormous design space, and some points in this design space require orders of magnitude more computation than others. So far, we have focused on the quantity of computation required to classify images during the inference phase. Now, we turn our attention to the quantity of computation needed to train a DNN. As a rule of thumb, the computation required per image when training a DNN is 3x more than the computation required for inference [78]. As with inference, one way to think about the quantity of computation is in terms of OPS/frame.10 However, during training, multiple passes through the training set (epochs) are often performed. A good way to think about the quantity of computation is to consider the total number of arithmetic operations required to complete training: (OP S/f rame) ∗ (#f rames in training set) ∗ (#epochs). While the number of epochs could be selected dynamically (e.g. stop training when the model reaches a convergence criterion), we have observed that most CNN researchers define a static number of epochs offline, prior to the training experiment. How does quantity of computation relate to the speed of execution? DNNs/CNNs are com9 On a 28x28 image, the first fully-connected (FC) layer in LeNet has a operates on an input size of 4x4xChannels, and each filter is also 4x4xChannels. To adapt LeNet to a 224x224 image, we make this FC layer into a convolution layer with filters of size 4x4xChannels, and we average pool the output of this layer down to 1x1xChannels. 10 Work by He and Sun [78] and Szegedy et al. [79] are examples of papers that report their CNN models’ accuracy as well as computation required per frame. 20 monly implemented with 32-bit floating-point math (so the OPS are FLOPS), and less commonly with integer math (IOPS). A high-end GPU such as the NVIDIA P100 can perform up to 10.6 TFLOPS/sec [80].11 If running at 10.6 TFLOPS/sec, LeNet (224x224 images) could classify 3900 frames/sec12 , while VGG-19 could classify just 91 frames/sec frames/sec.13 However, there is no guarantee than an off-the-shelf implementation will achieve the peak efficiency of 10.6 TFLOPS/sec. Well-tuned CNN libraries such as Boda [19], cuDNN [25], fbfft [81], and Neon [82] been shown to achieve 30-95% of peak, depending on the choice of hardware and the dimensions of each CNN layer. 2.3.3 Quantity of Communication A computational resource (e.g. one mobile phone or a cluster of servers) has a limited quantity of computation that it can perform each second. However, an often-overlooked factor is that a computational resource also has a limited quantity of communication that it can perform each second. We define communication quite broadly. One variety of communication is the movement of data from one server to an other, for example using a hardware networking platform such as Ethernet or Infiniband. An other variety of communication is within a server, between different layers of the storage and memory hierarchy. Thus, we classify all varieties of data movement as communication. We illustrate an example configuration of hardware pertaining to these levels of data movement in Figure 2.2. In the landmark Roofline Model paper [84], Williams et al. showed that, depending on the method and choice of hardware, the theoretical best-case execution time can be limited by either computation or communication. We interpret this broadly to mean that any of the following can be a limiting factor on the speed at which an algorithm/program can execute: 1. peak throughput computational hardware (influenced by factors such as the number of processors, width of vector lanes, clock speed, and pipeline depth), OR 2. peak bandwidth and latency of the memory hierarchy (typically within a server), OR 3. peak bandwidth and latency of interconnect between servers. Note that we define peak to denote the theoretical best-case that can be achieved by a given hardware unit. With all of this in mind, we find that it is important to analyze not only the quantity of computation, but also the quantity of communication required by a CNN architecture. With specific hardware and implementations, we can also study speed — i.e. “computation per second” and “communication per second,” and we will discuss this in the next section. But, before we get to that, let us briefly consider how the quantity of communication differs during training and inference of CNNs. Training. During the training phase, CNNs incur the communication overheads: 11 A processor’s highest achievable throughput is known as “peak” throughput. 10,600 peak GFLOPS/s / 2.7 GFLOPS per frame 13 where input frames are of size 224x224 for both VGG-19 and LeNet 12 21 cale Intel&Broadwell& Network"interconnect" Main"" Memory" (e.g."ethernet"or"Infiniband)" To"other"servers" PCI:e" interconnect" To"GPUs"and"other"" accelerators" l:lines:thunderx:arms:xeons/" Figure 2.2. Multicore CPU server. In this diagram, each “Xeon” is an Intel Broadwell capJon:"Diagram"of"an"Intel"Broadwell"mulJcore"CPU" CPU core. This diagram includes several levels of communication infrastructure: caches, server."This"diagram"focuses"on"the"communicaJon" memory, and interconnects. Some portions of this diagram are borrowed from [83]. infrastructure"::"caches,"memory,"and"interconnects."" Each"``Xeon""is"a"CPU"core."Some"aspects"of"this"diagram" st"Xeons"," • transferring input data (e.g. images) into registers (often from disk) are"courtesy"of"[REF"The"Next"Pla0orm"arJcle]." • transferring activations and gradients in and out of registers • transferring parameters in and out of registers • transferring model updates across servers (in the case of multi-server training). Inference. During the inference phase, CNNs incur the communication overheads: • transferring input data (e.g. images) into registers (often from disk) • transferring activations in and out of registers • transferring parameters in and out of registers. 22 3" Unlike training, inference does not requite communication across servers because each data sample (e.g. image) can be processed independently, and the model is no longer being updated or modified. 2.3.4 Speed The quantities of computation and communication are properties of a DNN architecture, but these are orthogonal from the underlying hardware and implementation that executes the DNN. Speed is a more holistic metric that is impacted by a number of factors including the DNN architecture, the software implementation, and the choice of computational hardware. The following example illustrates the difference between measuring quantity of computation and measuring speed. During inference, the VGG-19 DNN performs 117 GFLOPS per frame — this is the quantity of computation. The majority (> 95%) of these FLOPS can be attributed to performing convolution calculations. But, at what rate can we expect a processor to perform these FLOPS? Every processor has a theoretical peak, or best-case, throughput in FLOPS/s. For example, an NVIDIA Titan X GPU has a theoretical peak of 6 TFLOPS/s. A study of high-performance computing applications implemented on supercomputers found that the average application runs at approximately 5% of the processor’s peak efficiency [85]. At a rate of 5% of 6 TFLOPS/s (i.e. 0.03 TFLOPS/s), the inference phase of VGG would run at 0.25 frames/sec. However, as shown in our Boda work on accelerating convolutions on GPUs, it is feasible to implement certain problem sizes convolution at 50% of peak, or more, on NVIDIA and Qualcomm GPUs. At 50% of peak (i.e. 3 TFLOPS/s), the inference phase of VGG would run at 2.5 frames/sec, a 10x speedup over 0.25 frames/sec. What we can learn from this simple example is that every CNN architecture requires a particular quantity of computation (e.g. 117 GFLOPS per frame), and the specific software implementation can influence the order-of-magnitude speed at which these FLOPS are executed. So far we have learned that, in addition to the choice of DNN architecture, the software implementation has a major impact on the computational speed. Can the choice of computational hardware also have such an impact? NVIDIA’s Maxwell microarchtecture is the underlying computational hardware in several of NVIDIA’s current products. At the low end, NVIDIA produces the TX1 system, which has a small Maxwell-based GPU with a peak 32-bit computation rate of 0.5 TFLOPS/s [86]. At the high end, NVIDIA produces the Titan X GPU, which has a peak 32-bit computation rate of 6 TFLOPS/s [87]. Even if we use a provably optimal software implementation that achieves the hardware’s peak TFLOPS/s, the TX1 would have a 12x slower frame rate than the Titan X. So, to answer our question: yes, the choice of computational hardware can have an order-of-magnitude impact on the speed at which we execute a CNN. To summarize, the CNN architecture, the software implementation, and the choice of computational hardware all contribute to the speed at which a CNN is executed. In this subsection, we have focused on the speed of the inference phase, but in Chapter 3 we will present a detailed discussion of the factors that determine the speed of CNN training. 2.3.5 Power Experimental autonomous vehicles such as Caltech’s Alice vehicle implement their vision/perception methods using in-vehicle server racks that draw up to 3500W of power [88], and it is rumored that Google’s autonomous SUVs also have onboard computers that draw multiple 23 kilowatts of power. We have had a number of conversations with key people inside of automakers about this issue. To make autonomous driving feasible and economical, automotive OEMs and their suppliers urgently wish to achieve high-quality perception with much lower computational power budgets for both prototype and mass-produced autonomous vehicles. Toyota recently created the Toyota Research Institute (TRI). TRI is a $1 billion research center that focuses on driver assistance and autonomous driving technologies, and computer vision (and more generally visual perception) is a core area of focus. In a recent keynote, Gill Pratt of Toyota Research Institute explained that humans are fairly good at driving cars [89], yet the human body has a resting power draw on the order of 60W, of which 20% is consumed by the human brain [90]. Contrast this with the prototype autonomous cars that we mentioned earlier in this section, which may draw multiple kilowatts of power to execute visual perception methods in real-time. Pratt and the TRI team are working to decrease the power required to perform computer vision while retaining sufficiently high accuracy for safe semi-autonomous and fully-autonomous driving [89]. Using less power directly translates to dissipating less heat. In automotive, drone, and embedded applications, system designers typically prefer to use passive processor cooling, and therefore low-power (low heat dissipation) is a key design goal. Power is also a good proxy for a number of other problem dimensions. Numerous applications require the hardware to be small (e.g. to avoid using up cabin storage in a car, and to avoid having a large payload on a drone). These applications also often require the hardware to be cheap. Low-power computational hardware is often small and cheap — so, by targeting lower power, the hardware is more likely to meet the system-level goals for cost and size. Much of today’s computer vision research still focuses on accuracy as the sole metric. However, it is encouraging that some recent studies have used power as a motivating metric in addition to accuracy. For example, a Cavigelli and Benini recently proposed the Origami design for a CNN accelerator, and the authors evaluated their work in terms of accuracy, power, and operations-perWatt [91]. Likewise, a number of other CNN hardware papers — e.g. Ovtcharov et al. [92] — have reported their power footprints. 2.3.6 Energy In 2015 and 2016, the Design Automation Conference (DAC) hosted the “Low-Power Image Recognition Challenge,” and the organizers of this challenge published some highlights in ICCAD 2016 [93]. The goal was to classify 50,000 ImageNet test images in 10 minutes with a cap on the wattage used, while classifying these images as accurately as possible. Why did the organizers of this competition choose to set limits on both power and time? Without a limit on time, the competitors could simply slow down their computation to the point where it fits with in a particular power budget (wattage). As we will see in the following, the combination of a time limit and a wattage cap has the effect of specifying a limited budget of energy.14 Consider the case where a particular processor can execute a visual recognition method at 4 frames per second (FPS) while drawing 200W of power. To reduce the power envelope, a naive approach would be to simply slow down the computation (by halving the quantity of computational hardware, or by halving the clock frequency), which delivers a best-case improvement of 2x less 14 With this in mind, perhaps the “Low-Power Image Recognition Challenge” ought to have been called the “LowEnergy Image Recognition Challenge.” 24 power draw (as low as 100W). However, this also reduces the frame rate to 2 FPS. Clearly, “power” isn’t a sufficient metric to capture the goals related to computational efficiency, as this metric can easily be gamed by degrading the frame rate. Fortunately, there is a single metric that can capture our efficiency goals: energy (joules). The Joule is defined as (watts * seconds). To achieve 15 FPS on a 30W power budget, we require (30 * 1/15) = 2 joules per frame. 2.3.7 Model size In a CNN, each convolution filter contains multiple parameters. For example, consider a filter with f ilterH = 3, f ilterW = 3, and ch = 100. When represented with 32-bit floating-point numbers, this filter has 3*3*100*(4 bytes/float) = 3.6 KB of parameters. Prior to training a CNN, these parameters are typically initialized to a random distribution. Then, the goal of the training process is to learn the numerical values of the parameters such that the model can fit the training set, while being able to generalize beyond the training set. Modern CNN architectures can comprise tens or hundreds of layers, where each layer can have hundreds of filters. In CNN architectures such as AlexNet [22] and VGG-19 [77], this can add up to hundreds of megabytes of model parameters. However, as we will see in Figure 3.3 of Chapter 3, having more parameters in a CNN does not necessarily lead to higher accuracy. Further, for a specific level of accuracy on a particular dataset, we can often identify several CNN models (some with many parameters, and some with fewer parameters) that are able to achieve this level of accuracy. Given equivalent accuracy, a CNN architecture with fewer parameters has a number of advantages: • More efficient distributed training. Communication among servers is the limiting factor to the scalability of distributed CNN training. For distributed data-parallel training, communication overhead is directly proportional to the number of parameters in the model [17]. In short, smaller models train faster due to requiring less communication. • Less overhead when exporting new models to clients. For autonomous driving, companies such as Tesla periodically copy new models from their servers to customers’ cars. With AlexNet, this would require 240MB of communication from the server to the car. Smaller models require less communication, making frequent updates more feasible. • Feasible FPGA and embedded deployment. FPGAs often have less than 10MB of on-chip memory and no off-chip memory or storage.15 For inference, a sufficiently small model could be stored directly on the FPGA instead of being bottlenecked by the memory bandwidth required to transfer model parameters onto and off of the chip [94]. 2.3.8 Additional metrics to consider Other metrics worth considering include: • Quantity of activations (in addition to the Quantity of parameters, which is also known as the “model size”). 15 For example, the Xilinx Vertex-7 FPGA has a maximum of 8.5 MBytes (i.e. 68 Mbits) of on-chip memory and does not provide off-chip memory. 25 • Total memory footprint. • Chip area (if co-designing an ASIC with a family of CNN architectures). • Total cost of ownership, which may include the cost of hardware, maintenance, energy, and other factors. 2.4 Orchestrating engineering teams to target specific DNN benchmarks and metrics In the previous sections, we have learned that, beyond accuracy, it is often necessary to optimize a CNN-based system for several metrics in order to meet system-level design goals. To build the best possible system, it may be necessary to co-design multiple levels of a CNN-based system, including the CNN architecture, the software implementation, and the computational hardware. To explore, design, and implement such systems, it is often necessary to pull a team of experts who bring deep knowledge in multiple areas (e.g. CNN architecture, efficient software, and efficient hardware). For such a team, it is ideal to have both of the following ways of evaluating progress toward the end-goals: 1. A way to evaluate the holistic progress of the entire organization toward the system-level goals. 2. A way to evaluate the individual progress of the CNN team, the software team, and the hardware team. In Section 2.4.1, we describe an approach for aiming a full-stack team at an overall goal, which may involve achieving a particular level of accuracy on an aggressively low budget of energy or an aggressively high target for speed/throughput. In Section 2.4.2, we describe an approach that enables individual team members or sub-teams to evaluate their contribution to the progress toward these goals. 2.4.1 System-level benchmarking System-level benchmarking promotes creativity in the codesign of algorithms, software, and hardware. We will consider an example of system-level benchmarking in the autonomous driving domain. Autonomous road vehicles present a huge opportunity to save human lives and to reduce unproductive time during commuting. The ability to automatically perform real-time visual perception of the vehicle’s surroundings is a prerequisite to safe autonomous driving for road vehicles. In Figure 2.3, we show how a perception system fits into the overall stack for autonomous driving systems. To drive safely, perception systems must deliver high accuracy. In addition to accuracy, perception systems are subject to a number of practical constraints. For example, real-time computation is crucial in automotive perception applications. It is not very useful to detect that the car has drifted out of the lane, if the car has crashed by the time the computer vision system has identified the lane departure. Likewise, traffic light detection is of limited value if the vehicle has 26 DeepScale Sensors"" How$to$implement$autonomous$driving$ (Cameras,"LIDAR," RADAR,"…)" PercepBon"" Path" Planning" (Computer" Vision)" Control" (adjust"steering" and"speed)" Mapping" • All"levels"of"vehicle"autonomy"(Level"1"–"Level"4)"require"the" Figure 2.3. Overview of how to implement autonomous driving systems, as described to us above"flow"to"work" by our contacts at a major automaker. Today, the perception module is often the limiting factor on the overall system’s level of safety. • Percep&on"is"o@en"the"weakest"link"(based"on"conversaBons" with"Tesla,"BMW,"and"others)" already violated a red light by the time the vision system has detected the light. In addition to the need for real-time computation, a vehicle has a limited supply of energy onboard. On an elec• Improving"the"accuracy"of"percepBon"will"lead"to"improved" tric vehicle, the battery stores a limited amount of energy, and if the autonomous driving system safety"for"all"levels"of"autonomy" is energy-hungry, this cannibalizes energy needed to move the car over long distances. Even on 2" an internal-combustion vehicle, there is a finite supply of fuel in the tank, and installing a highcapacity alternator to generate more power would have the effect of reducing the vehicle’s range and fuel economy. As we discussed in Section 2.3.5, to run high-accuracy perception algorithms in real-time, companies like Google have been rumored to run server racks with as much as 3000W of instantaneous power draw, which equates to 1.8 MJoules/hour. When designing a perception system for practical automotive deployments, it is worthwhile to specify target outcomes on several metrics including accuracy, energy (on a per-frame or per-timestep basis), peak power draw, model size (small CNN models shrink the wireless communication needs for over-the-air updates), and so on. Let us consider the problem of designing a perception system for an autonomous road vehicle.16 In the future, we expect safety standards for autonomous vehicles will be set not only by vehicle manufacturers, but also by automobile safety agencies such as IIHS, NHSTA, and EuroNCAP. Today, the accuracy achieved by the visual perception module is one of the limiting factors in the safety of semi-autonomous and autonomous vehicles. So, what should be the design objectives for a deployable system that meets or exceeds the highest safety rating? First, determine the accuracy metrics and accuracy levels that are required to meet the desired level of safety. As the safety standards are still in flux, it’s not entirely clear what levels of accuracy will be required, but the following steps are applicable to systems at a variety of accuracy operating-points. Next, set a minimum frame rate needed to perform the perception in real-time. Now, so long as we achieve the desired frame rate and accuracy level, using less energy is [almost] always better. So, if our baseline system required 3000W to achieve the desired frame rate of 15 fps (i.e. 200 J/frame) at a specific accuracy level, a worthy goal would be to preserve the accuracy and frame rate in a 30W (2 J/frame) envelope (100x improvement). Now, we have the freedom to modify the algorithm 16 We focus on the problem of converting real-time data feeds from cameras and other sensors into an understanding of the environment. Meanwhile, there is much work to be done on improving sensors, mapping, path planning, and control. 27 (e.g. CNN architecture), software implementation, and choice of hardware, all to target improved energy-efficiency without compromising accuracy or frame rate. In other words: the metric of energy (J/frame) transcends the boundaries of algorithm, software, and hardware, so optimizing for this metric promotes creativity and codesign of multiple layers of the system. 2.4.2 Per-component benchmarking While the overall goal may be to reduce energy per frame (a system-level metric), let us consider the dynamics of a team working toward this goal. In a typical case, the team would include at least one hardware architect, at least one software architect, and at least one CNN architect. For all three team members, the work may focus on identifying usable off-the-shelf solutions (e.g. existing CNN architectures, existing software libraries, and existing hardware components), or developing entirely new solutions (new CNN architectures, new software libraries, and new hardware), or — most likely — pursuing a mixture of off-the-shelf and custom solutions. Each team member will want to evaluate his or her own contributions toward the common cause of improving energyefficiency. We refer to this exercise as per-component benchmarking. The team can do this as follows: • The hardware architect can aim to maximize speed of a representative microbenchmark in terms of OPS/sec. Further, the hardware architect can aim to minimize the power needed to run at peak OPS/sec. This power envelope should include not only the processor itself, but also memory and I/O power requirements. • The CNN architect has several ways to evaluate their work in isolation. Accuracy is a property of the CNN only, and not the software or hardware (assuming no bugs are introduced by new software or hardware). Further, the quantity of computation (number of OPS per image; not per second) allows the CNN architect to chart their progress in reducing computational requirements. Model size is a metric that helps the CNN architect to understand the level of the memory hierarchy in which the model parameters may reside. • The software architect has a more difficult time than the other two architects when attempting to isolate his/her contributions with per-component benchmarks. The software architect can aim to maximize speed (OPS/sec) of relevant CNN problem sizes on representative hardware. If new hardware is being developed, some of this benchmarking may need to occur on simulation-based or FGPA-based prototypes of the proposed hardware. Ideally, the software architect can communicate frequently with the hardware architect and CNN architect, trading notes on hardware limitations and CNN problem dimensions that can be implemented efficiently. As we discussed in Sections 2.3.2 and 2.3.4, a software+hardware system does not always achieve peak OPS/sec on all problem sizes, so the software and hardware architects should be constantly exchanging notes with the CNN architect on problem dimensions. 28 2.5 Relationship of our approach to the MESCAL methodology The MESCAL book [34] points out that many new computer architectures are developed and evaluated using inadequate benchmarks that are not representative of the end applications. Especially at the time when the MESCAL book was written, it was common to see new architectures and chips evaluated based on the number of clock cycles needed to execute a series of instructions. Ideally, the instruction stream would at least be derived from a motivating application (e.g. network packet processing), but sometimes these instructions are chosen more arbitrarily. Not surprisingly, when application-specific processors are developed with such vague benchmarks and objectives, these new processors don’t necessarily deliver improvements on end-application speed and efficiency. As an antidote to this phenomenon, the MESCAL book advocates for system-level benchmarking. This type of benchmarking calls for representative algorithms, implementations, and inputs when evaluating new hardware. Evaluating the top-to-bottom system on metrics such as speed, energy-efficiency, and correctness is the only sure-fire way to understand how the new hardware will perform on the end application. In our discussion of benchmarks and metrics for evaluating deep learning systems, we have advocated for system-level benchmarking. This is well aligned with the MESCAL methodology. For example, the speed (i.e. frame rate during training or inference) of a CNN/DNN system is influenced by all levels of the stack, including the dimensionality of the input data, the neural architecture, the software, and the hardware. Likewise, the energy per frame is influenced by all of these factors. These metrics — and how these can be traded off with accuracy — are system-level benchmarks that promote co-design of all levels of the stack to develop the best possible system. While system-level benchmarking is the most vital type of benchmarking, we find that there are cases where per-component benchmarks are useful, too. For example, the accuracy of the CNN/DNN model is independent of the software and hardware in which it is implemented17 , so the model’s accuracy can be analyzed independently of the rest of the system. Likewise, the number of arithmetic operations in a CNN is a property of the CNN alone. Further, the peak power envelope is purely a property of the hardware. These per-component metrics are useful for individual teams in an organization (e.g. the CNN team, the software team, and the hardware team) to evaluate their individual contributions. However, the “north star” or guiding light should always be the system-level metrics that represent the end-application behavior. 17 If the CNN’s accuracy changes when moving to a different software implementation or hardware platform, this is considered a bug. However, there are opportunities for co-design, such as leveraging hardware that can efficiently do CNN computations at low precision, and then working to mitigate the possible drop in accuracy. 29 Chapter 3 Rapidly training DNNs on compute clusters 3.1 The need for efficient and scalable DNN training Since the publication of AlexNet [22], a variety of new deep neural network (DNN) architectures such as GoogleNet [79], Network-in-Network [95], and VGG [77] have been developed at a rapid pace. This is natural, because with the training and testing dataset fixed (e.g. ImageNet-1k [21]), it is the DNN architecture that is primarily responsible for improvements in accuracy. In other words, the race for improvements in accuracy in image classification and other contemporary problems of computer science has become a race in the development of new DNN architectures. So, what is the bottleneck in the development of new architectures? In the development of new DNN architectures, as in any human research endeavor, creativity is a key element. However, the impact of architectural variations in DNNs — such as number of layers, filter dimensions, and so forth — can be hard to predict, and experimentation is required to assess their impact. A high-accuracy deep neural network (DNN) model such as GoogLeNet [79] can take weeks to train on a modern GPU. This is true even when leveraging deep neural network primitives like cuDNN [25], maxDNN [96], fbfft [81], or Boda [19] — all of which operate near the theoretical peak computation per second achievable on GPUs. Thus, training time is a key challenge at the root of the development of new DNN architectures. This sentiment was voiced by Jeffrey Dean of Google in his recent keynote address [97]. The four key points that Dean makes are: • We [i.e. DNN researchers and users] want results of experiments quickly • There is a “patience threshold:” No one wants to wait more than a few days or a week for a result • This significantly affects scale of problems that can be tackled 30 • We sometimes optimize for experiment turnaround time, rather than absolute minimal system resources for performing the experiment Given the considerable resources available to Google researchers, Dean’s comments indicate that simply throwing more computational resources at the problem is not sufficient to solve the DNN training problem. In the following, we will spend a little more time dimensionalizing the current problems with DNN training and the upside potential if these problems can be solved. 3.1.1 Accelerating DNN Research and Development As a particular example of where long training times are limiting the pace of DNN research and productization, consider the following. ImageNet-1k has 1.2 million training images, distributed across 1000 different category labels. From first-hand conversations with engineers and executives, we know that several internet companies have internal databases containing billions of images with hundreds of thousands of different category labels. Due to long training times, these companies are facing serious delays in bringing DNN-based solutions to market. Accelerated DNN training solutions would address a major pain point for these companies. 3.1.2 Real-Time DNN Training So far, we have argued how accelerating DNN training would benefit applications where DNNs are in use today. Now, we consider ways in which accelerating DNN training would allow DNNbased techniques to be applied in entirely new ways. There are a number of situations where it is crucial to incorporate new data into a DNN model in real time. For example, reinforcement learning (RL) enables robots to learn things themselves with minimal supervision. A recent study by Levine et al. applied state-of-the-art DNN-based RL techniques to enable a robot to teach itself how to build lego structures and screw on bottle caps [98]. This technique is effective, and the robot does indeed learn to screw on bottle caps. However, it takes 3-4 hours for the robot to learn to screw on bottle caps, and the majority of this time is spent on DNN training. Faster DNN training would enable this and other reinforcement learning applications to move toward real-time. Deep Neural Networks are used for an ever-broadening variety of problems, including classifying [79, 55] and detecting [47, 48] objects in images, writing sentences about images [57], identifying actions in videos [12], performing speech recognition [99], and gaining semantic understanding of text [10]. We anticipate that sophisticated reinforcement learning (RL) systems in robotics will eventually leverage all of these modalities, ideally in real-time. 3.1.3 Accelerating DNN Training with FireCaffe In our work, we focus directly on the problem of DNN training. Since single-GPU efficiency has reached the hard limits of the hardware, the next frontier for accelerating DNN training is to scale it across a compute cluster. In this chapter, we present FireCaffe, which scales DNN training across a cluster of 128 GPUs with speedups of more than 40x compared to a single GPU. Our strategy for scaling up DNN training is to focus on reducing communication overhead, and we make a number of design choices toward this goal. For example, we use fast interconnects such as Infiniband or 31 Cray Gemini to accelerate communication among the GPUs. We also show that reduction trees are a faster method for communication than using parameter servers. We map our parallelization strategy to high-accuracy DNN architectures that require less communication. The rest of this chapter is organized as follows. In Section 3.2, we describe our choice of hardware for evaluating scalable DNN training, and Section 3.3 introduces key factors that we will use for analyzing communication among GPU workers. We describe tradeoffs between DNN parallelism strategies in Section 3.4, and Section 3.5 explains why certain high-accuracy DNN architectures are particularly amenable to parallelism. In Section 3.6, we describe our approach to efficiently implementing distributed DNN training. In Section 3.7, we describe good practices that facilitate the comparison of scalable DNN training techniques and we present our speedups for training the NiN and GoogLeNet architectures on ImageNet. Section 3.8 describes approaches that are complimentary to FireCaffe for further accelerating DNN training. We conclude in Section 3.9. 3.2 Hardware for scalable DNN training It is both useful and feasible to experiment with the scalability of DNN computations using theoretical or scale models. However, demonstration and verification of the correctness and realworld scalability of the proposed FireCaffe system requires using concrete hardware platforms. The speed at which data can be sent between nodes is a key consideration in selecting a hardware platform for scalable DNN training. This is because, the faster the interconnect between nodes is, the more scale we can achieve without being dominated by communication overhead. Hardware manufacturers such as Cray and Mellanox address this by developing high-bandwidth, low-latency interconnects that are substantially faster than typical Ethernet connections. For example, the Titan supercomputer at Oak Ridge Leadership Computing Facility (OLCF) has a high bandwidth, low latency Cray Gemini interconnect for communication among servers. The Titan supercomputer has a total of 18,000 servers, with one NVIDIA Kepler-based K20x GPU per server [100, 101]. With this in mind, we choose the OLCF Titan supercomputer for tuning and evaluating FireCaffe. In this research, we use relatively small slices of the overall capacity of Titan for each training run. The additional computational capacity (∼27 PetaFLOPS/s in total) enables us to conduct multiple training runs concurrently, where each training run utilizes 32 to 128 GPUs. When considering 32-node slices of Titan, we found that the interconnect speed (at least for the applications of this work) is similar to that provided by having all nodes in the slice connected to a single Infiniband-class switch. 3.3 Preliminaries and terminology To minimize confusion, we now define some terminology. The key data structures in a convolution layer are data (also called activations) and parameters (also called weights), and we present a simple illustration of this in Figure 3.1.1 More explicitly: in our terminology, the each of the following sets of words are synonyms: (weights = parameters = filters = W ); (nodes = workers 1 For a much more detailed discussion of how convolution layers work, see Section 4.2.1. 32 D:#Input#data#to# this#layer# (x#batch#size)# W:#Params# (x##filters)# Figure 3.1. Anatomy of a convolution layer. This is a high-level overview. We present a more detailed diagram in Figure 4.2. = GPU servers). We also sometimes use the terms “activations” and “data” (D) interchangeably. Fully-connected layers are a special case of convolution layers where f ilterH = dataH and f ilterW = dataW . We define an “epoch” as one pass through the training data. Finally, the word “performance” can be ambiguous, so we write in terms of specific metrics such as “accuracy” and “training time.” Deep neural network training is comprised of iterating between two phases: forward and backward propagation. In the forward phase, a batch of data items (e.g. images) is taken from the training set, and the DNN attempts to classify them. Then comes the backward phase, which consists of computing gradients with respect to the weights (∇W ) and gradients with respect to the data (∇D). The weight gradients are used to update the model’s weights. Then, an other forward phase is performed, and so on. We train models using batched stochastic gradient descent (SGD), which is the standard choice for popular DNN models such as GoogLeNet [79]. We now present a few preliminaries that we will use later in this dissertation for reasoning about data volume to communicate in distributed DNN training. In Equation 3.1, we show how to calculate the total size (in bytes) of the weights in all convolution and fully-connected layers, combined. #layers X |W | = numF iltL−1 ∗ numF iltL ∗ f ilterWL ∗ f ilterHL ∗ 4 (3.1) L=1 where numF iltL is the number of filters in the current layer, numF iltL−1 is the number of input channels, f ilterH is the filter height, and f ilterW is the filter width. Note that each filter produces its own output channel, so the number of filters in layer L − 1 dictates the number of input channels in layer L. In other words, for layer L, the number of input channels is numF iltL−1 , and the number of output channels is numF iltL . Next, Equation 3.2 expresses the size of activations produced by all layers, combined. |D| = #layers X L=1 numF iltL ∗ dataWL ∗ dataHL ∗ batch ∗ 4 (3.2) where dataH is the activation map height, dataW is the activation map width, and batch is the batch size. Note the ∗4 in Equations 3.1 and 3.2 — this is because a single-precision floating-point number is 4 bytes. 33 3.4 Parallelism strategies There are two commonly-used methods for parallelizing neural network training across multiple servers: model parallelism (e.g. [102]) and data parallelism (e.g. [103]). For batched SGD training of DNNs, we define data parallelism as the case where each worker (e.g. GPU) gets a subset of the batch, and then the workers communicate by exchanging weight gradient updates ∇W . We define model parallelism as the case where each worker gets a subset of the model parameters, and the workers communicate by exchanging data gradients ∇D and exchanging activations D. Note that |W | = |∇W | and |D| = |∇D|; in other words, the weights and weight gradients are the same size; and the data and data gradients are the same size. Now, to maximize DNN training scalability, our goal is to select a parallelism strategy that requires the lowest possible quantity of communication between servers. The choice of whether it is ideal to use data parallelism, model parallelism, or both depends strongly on the DNN’s architectural characteristics. Commonly-used DNN architectures for speech recognition (e.g. [104]) consist primarily of fully-connected layers, where the activations and parameters have the same spatial resolution (typically 1x1). For typical batch sizes, these fully-connected models often have a similar quantity of weights W and activations D. For example, we observe in Table 3.1 that this property holds true for the MSFT-Speech DNN architecture [104]. In computer vision, some of the most popular and accurate DNN models (e.g. GoogLeNet [79]) consist primarily of convolution layers, where the spatial resolution of the filters is smaller than the resolution of the activations.2 For these convolutional models, data parallelism is typically preferable because it requires less communication — that is, |∇W | is much smaller than |∇D| at typical batch sizes. Notice that the computer vision DNNs in Table 3.1 all have this property. In FireCaffe, we enable data parallelism across a cluster of GPUs, and we find that it produces ample speedups for training popular deep convolutional neural network architectures. We illustrate our data parallel approach in Figure 3.2. In this configuration, all the GPUs contain the full DNN model parameters. Each worker (GPU) gets a subset of each batch. The GPUs compute their share of the weight gradients. Once the gradients are calculated locally, they are added together using either a parameter server or a reduction tree communication (described in Section 3.6.2). 2 For a more detailed discussion of the dimensionality of parameters and activations, skip ahead to Section 4.3. 34 W GPU 0 W D(0:15) D conv1 i … i=0 update model weights ∑ ∇W i=0 i=0 GPU 31 1023 1023 ∑ ∇W D conv1 ∑ ∇W i i i=992 i=992 W D(992:1023) D(992:1023) D(992:1023) W D D conv2 maxpool softmax i ∑ ∇Wi i=992 avgpool 31 ∑ ∇Wi 1023 W conv3 maxpool 31 ∑ ∇W D(0:15) W D conv2 maxpool 31 sum W using a reduction tree D(0:15) D maxpool conv3 avgpool softmax Figure 3.2. Data parallel DNN training in FireCaffe: Each worker (GPU) gets a subset of each batch. Table 3.1. Volumes of data and computation for widely-used CNN/DNN architectures. The batch size impacts all numbers in this table except for |W |, and we use a batch size of 1024 in this table. Here, TFLOPS is the quantity of computation to perform. We calculated these numbers from the model dimensions that were described by each author. DNN architecture typical use-case data size weight size data/weight Forward+Backward |D| |W | ratio TFLOPS/batch NiN [95] computer vision 5800MB 30MB 195 6.7TF AlexNet [105] computer vision 1680MB 249MB 10.2 7.0TF GoogLeNet [79] computer vision 19,100MB 54MB 358 9.7TF VGG-19 [77] computer vision 42,700MB 575MB 71.7 120TF speech recognition 74MB 151MB 0.49 0.23TF MSFTSpeech [104] 35 3.5 Choosing DNN architectures to accelerate Of the popular deep convolutional neural network architectures for computer vision, some are more amenable to data parallel training than others. One might naı̈vely assume that DNN models with more parameters would produce higher classification accuracy. To evaluate this assumption, consider Figure 3.3, where we plot the total size of all parameters in bytes versus top-5 ImageNet accuracy for several popular DNN architectures. Observe that Network-in-Network (NiN) [95] and AlexNet [22] have similar accuracy, while NiN has 8x fewer parameters than AlexNet. Likewise, GoogLeNet [79] and VGG [77] have similar accuracy, yet GoogLeNet has 10x fewer parameters. In data parallel training, |∇W | is the quantity of data sent by each GPU worker, so DNN architectures with fewer parameters require less communication and are more amenable to training at large scale. You may wonder, what are the architectural choices that led to NiN and GoogLeNet having 8-10x fewer parameters than AlexNet and VGG? The answer is twofold. First, GoogLeNet and NiN are more judicious in their use of filters with spatial resolution: many of the filters in GoogLeNet and NiN have a resolution of 1x1 instead of 3x3 or larger. Second, while VGG and AlexNet each have more than 150MB of fully-connected layer parameters, GoogLeNet has smaller fully-connected layers, and NiN does not have fully-connected layers. In summary, models with fewer parameters are more amenable to scalability in data parallel training, while still delivering high accuracy. Therefore, for the rest of the chapter, we focus our efforts on accelerating the training of models with fewer parameters (e.g. NiN and GoogLeNet) while maintaining high accuracy. 36 GoogLeNet' NiN' VGG_11' VGG_19' AlexNet' Deep'Neural'Networks'can'achieve'high' accuracy'with'rela8vely'few'parameters' more'scalable'training' Figure 3.3. Deep neural network architectures with more parameters do not necessarily deliver higher accuracy. 3.6 Implementing efficient data parallel training Our data-parallel distributed training strategy requires no communication among GPU workers in the forward pass. In the backward pass, a traditional single-GPU implementation (e.g. singleGPU Caffe [106]) sums the weight gradients over all images in the batch and then uses the weight gradient sum to update the model.3 When we distribute the backward pass over a compute cluster, P each GPU worker computes a sum of the weight gradients ( ∇W ) for its subset of the batch. Then, we sum the weight gradients across GPUs. This gradient aggregation scheme produces identical numerical results as you would find on a single GPU. Now, our task is to find an efficient way to sum up ∇W among GPUs in a compute cluster. We consider two strategies for implementing this gradient aggregation: parameter servers, and reduction trees. 3 However, the data gradients (∇D) are not summed up. 37 3.6.1 Parameter server One strategy for communicating gradients is to appoint one node as a parameter server. The remaining worker nodes are each assigned a subset of the batch on which to perform forward and backward-propagation. After each backward pass, all the workers send their gradient updates to the parameter server. Then, the parameter server computes the sum of the gradients. Finally, the parameter server sends the summed gradients to the workers, and the workers apply these gradient updates to their local copies of the model. We illustrate the parameter server communication pattern in Figure 3.4(a). The logical question here is, what is the communication overhead of a parameter server, and how does that overhead scale as we increase the number of GPU workers? Recall from Section 3.4 that each GPU worker provides |W | = |∇W | bytes of weight gradients (Equation 3.1), which need to be summed with gradients from all other GPU workers. Now, the bottleneck is is in sending and receiving all the gradients on one parameter server. If there are p GPU workers, the parameter server is responsible for sending and receiving |∇W | ∗ p bytes of data. If each node (GPU worker or parameter server) can send and receive data at a rate of BW bytes/s, then we can calculate the minimum communication time as follows: param server communication time = |∇W | ∗ p (sec) BW (3.3) In other words, the parameter server’s communication time scales linearly as we increase the number of GPU workers; doubling the number of workers leads to at least 2x more communication time per gradient update. We confirm this experimentally in Figure 3.5. For the parameter server experiments in Figure 3.5, we have implemented a fully synchronous parameter server with the following characteristics. The parameter server is one arbitrarily-selected server in the cluster, while the other servers are workers; the parameter server and worker servers have identical hardware. After each batch, the workers send their weight gradients to the parameter server, the parameter server computes the sum, and then the parameter server sends the sum back to the workers. There are a number of ways to augment the parameter server for greater scalability. For example, when having a single parameter server became a bottleneck, Microsoft Adam [107] and Google DistBelief [108] each defined a pool of nodes that collectively behave as a parameter server. The bigger the parameter server hierarchy gets, the more it looks like a reduction tree. This made us wonder: could we achieve greater scalability if we implement gradient aggregation as a reduction tree? 3.6.2 Reduction tree There are various common patterns of communication in parallel programs; among such common patterns, a frequently occurring one is allreduce. This pattern occurs when each worker produces one or more data values that must be globally reduced (generally with a commutative binary element-wise operator) to produce a single result value, and then this single value must 38 be broadcast to all workers before they can continue. In this work, each worker produces a single vector of length |∇W | (the gradient updates for that worker), which must be reduced using element-wise vector addition (to sum the per-worker gradient updates for each parameter). Since this computation exactly fits the allreduce communication pattern it is convenient to use existing library support for such operations. While there are many possible implementations of allreduce, most share the key property that the time taken to perform the operation scales as the log of the number of workers (at least for large numbers of workers). Intuitively, this is because allreduce algorithms use binomial reduction tree and/or butterfly communication patterns internally [109]. Out of the possible allreduce implementation strategies, we find that the binomial reduction tree is particularly easy to reason about on a theoretical level. So, for the rest of this section, we focus on allreduce communication implemented with a reduction tree. In Figures 3.4(a) and 3.4(b), we present the intuition on how parameter servers and reduction trees differ. We might think of a parameter server as a reduction tree with a height of 1 and a branching factor of p. However, many cluster computers and supercomputers have several dimensions of network fabric among nodes (e.g. an N-D Torus), which enable nodes to talk to each other via many different paths. With this in mind, we can sum gradients using a taller reduction tree, where nodes collaboratively sum the gradients. For example, consider a binary communication tree with a branching factor of 2 and a depth of log2 (p). In this case, the serialized communication is 2log2 (p); the outer 2 represents the fact that each node receives data from 2 children, and the log2 (p) is the height of the tree. Therefore, unlike the parameter server model, the reduction tree’s communication time is: reduction tree communication time = |∇W | ∗ 2log2 (p) (sec) BW (3.4) In practice, the base of log(p) depends on the branching factor in the reduction tree, but the basic idea here is straightforward: While the parameter server communication overhead scales linearly with p, reduction tree communication is much more efficient because it scales logarithmically as O(log(p)). We confirm experimentally that reduction trees scale more efficiently than parameter servers in Figure 3.5. 39 height: log2(p) height: 1 serialized communication: p h serialized communication: 2 (a) parameter server (b) reduction tree Figure 3.4. Illustrating how parameter servers and reduction trees communicate weight gradients. In this figure, we only show the summing-up of weight gradients. We distribute the weight gradient sums by going back down the tree. Measuring communication only (if computation were free) Figure 3.5. Comparing communication overhead with a parameter server vs. a reduction tree. This is for the Network-in-Network DNN architecture, so each GPU worker contributes 30MB of gradient updates. 40 3.7 Evaluation of FireCaffe-accelerated training on ImageNet In this section, we evaluate how FireCaffe can accelerate DNN training on a cluster of GPUs. We train GoogLeNet [79] and Network-in-Network [95] on up to 128 GPU servers in the Titan supercomputer (described in Section 3.2), leveraging FireCaffe’s reduction tree data parallelism (Section 3.6.2). We begin by describing our evaluation methodology, and then we analyze the results. 3.7.1 Evaluation Methodology We now describe a few practices that aid in comparing advancements in accelerating the training of deep neural networks. 1. Evaluate the speed and accuracy of DNN training on a publicly-available dataset. In a recent study, Azizpour et al. applied DNNs to more than 10 different visual recognition challenge datasets, including human attribute prediction, fine-grained flower classification, and indoor scene recognition [110]. The accuracy obtained by Azizpour et al. ranged from 56% on scene recognition to 91% on human attribute prediction. As you can see, the accuracy of DNNs and other machine learning algorithms depends highly on the specifics of the application and dataset to which they are applied. Thus, when researchers report improvements in training speed or accuracy on proprietary datasets, there is no clear way to compare the improvements with the related literature. For example, Baidu [111] and Amazon [112] recently presented results on accelerating DNN training. Amazon and Baidu4 each reported their training time numbers on a proprietary dataset, so it’s not clear how to compare these results with the related literature. In contrast, we conduct our evaluation on a publicly-available dataset, ImageNet-1k [21], which contains more than 1 million training images, and each image is labeled as containing 1 of 1000 object categories. ImageNet-1k is a widely-studied dataset, so we can easily compare our accuracy, training speed, and scalability results with other studies that use this data. 2. Report hyperparameter settings such as weight initialization, momentum, batch size, and learning rate. Glorot et al. [113], Breuel [114], and Xu et al. [115] have each shown that seemingly-subtle hyperparameter settings such as weight initialization can have a big impact on the speed and accuracy produced in DNN training. When training Network-in-Network (NiN) [95], we initialize the weights with a Gaussian distribution centered at 0, and we set the standard deviation (std) to 0.01 for 1x1 convolution layers, and we use std=0.05 for other layers. For NiN, we initialize the bias terms to a constant value of 0, we set the weight decay to 0.0005, and we set momentum to 0.9. These settings are derived from with the Caffe configuration files released by the NiN authors [95]. Frustratingly, in Google’s technical reports on GoogLeNet [79, 116], training details such as batch size, momentum, and learning rate are not disclosed. Fortunately, Wu et al. [117] and Guadarrama [61] each reproduced GoogLeNet and released all the details of their training protocols. As in [61], we train GoogLeNet with momentum=0.9 and weight decay=0.0002, we use xavier [113] 4 Baidu evaluated their training times using proprietary dataset [111]. Baidu also did some ImageNet experiments, but Baidu did not report the training time on ImageNet. 41 weight initialization, and we initialize the bias terms to a constant value of 0.2. We will address learning rate and batch size settings in the following sections. Given a DNN architecture, there are a number of strategies that can further increase accuracy, albeit at a substantial computational cost. One such strategy is to train multiple independent copies of a DNN architecture (e.g. GoogLeNet), each with a different random number generator seed for initializing the parameters. At test time, these DNNs can be used as an ensemble — that is, all DNNs are run on the test data, and for each test data item, the DNN’s classification activations are averaged. For example, using an ensemble of 7 GoogLeNet DNNs, Szegedy et al. achieved a 2 percentage-point accuracy improvement on ImageNet, compared to a single GoogLeNet baseline [79]. An other such technique is to augment the data by adding deformations or color variations during training and/or testing [111]. Our focus in this chapter is to show speedup on training single models and compare with reported baselines. Hence we avoid using exotic data augmentation or ensembles of multiple DNNs. In our experiments, we resize images to 256x256; at training time we use a 224x224 crop with a randomized offset, and at test time we classify the 224x224 crop in the center of the image; these settings are also commonly used in the AlexNet [22] and Network-in-Network [95] DNN architectures. 3. Measure speedups with respect to a single-server baseline. In order to meaningfully measure how much we have accelerated DNN training by adding more GPUs, we must have a representative baseline, e.g. with a single GPU. When reporting results, we begin by considering time required to train a DNN on single GPU, and we report our multi-GPU speedups with respect to this single-GPU baseline. A recent study by Microsoft [107] reported training a custom DNN architecture (e.g. not GoogLeNet or NiN) on a cluster of CPU servers. This may sound impressive, but Microsoft did not report the time that the model would take to train on a single server. It could be that Microsoft achieved a 10x speedup by going from 1 server to 10 servers, or the speedup could be 2x — this isn’t clear from the information provided in Microsoft’s paper. This illustrates the importance of measuring the speed of scalable DNN training systems with respect to a single-server baseline. 4. Measure accuracy with respect to a single-server baseline. In our experience, if hyperparameters such as learning rate and batch size are selected too aggressively, a DNN model may converge quickly, but fall short of the state-of-art accuracy. Therefore, in our experiments, we train multi-GPU models until they reach to the single-GPU accuracy baseline; this validates that we can accelerate DNN training without degrading accuracy. However, in cluster-scale multi-GPU training experiments by Baidu [111] and Flickr [118], the training is stopped prematurely before the DNNs converge. This leaves us wondering whether the Baidu and Flickr multi-GPU training experiments would have reproduced the accuracy produced on a single GPU. To avoid this type of confusion, we evaluate both the speed and accuracy of FireCaffe DNN training with respect to a single-server/single-GPU baseline. 3.7.2 Results: Midsized deep models Using the settings described by Krizhevsky [22], we find that AlexNet achieves 58.9% top-1 ImageNet-1k accuracy after 100 epochs of training. After just 47 epochs of training, we find that NiN also converges to 58.9% top-1 accuracy. Each training iteration of NiN is more time-consuming 42 than AlexNet, and AlexNet and NiN both take approximately 6 days to converge to this level of accuracy. At Google, Krizhevsky developed a scheme for accelerating AlexNet training using multiple GPUs within a single server [105]. Krizhevsky’s strategy uses data parallelism in convolution layers and model parallelism in fully-connected layers. As we show in Table 3.2, Krizhevsky achieves nearlinear acceleration on up to 8 GPUs, but it has not been shown to scale beyond a single server. For reasons that we don’t entirely understand, Krizhevsky’s accuracy drops by 1.8 percentage points when doing multi-GPU training [105]. In FireCaffe, we scale NiN training to 32 GPUs, which is the scale at which we find communication time and computation are approximately equal5 . We begin by using the learning rate and batch size settings that were reported in the Caffe configuration file released by the NiN authors [95]: For a batch size of 256, we use an initial learning rate of 0.01, and we reduce this by a factor of 10x twice during our training. Using this configuration, we reproduce the single-GPU NiN accuracy in 11 hours (13x speedup) when training on 32 GPUs. For a fixed number of epochs, increasing the batch size reduces the number of times we need to communicate weight gradients, thus reducing the overall training time. With this in mind, we now train NiN with a batch size of 1024.6 As in [105] when we increase the batch size, we increase the learning rate by an equal proportion. For example, when we use a batch size of 1024, we initialize the learning rate to 0.04. In this configuration, we train NiN in just 6 hours (23x speedup) on 32 GPUs. By increasing the batch size to 1024, we achieved a substantial speedup, but this came at 3 3 the price of reducing the final accuracy by 10 of a percentage point. We expect that this 10 % of accuracy could be regained at a batch size of 1024 — while retaining a substantial speed advantage — by training for a few more epochs. Finally, on 128 GPUs, we achieve a 39x speedup over single-GPU training. So far, we have compared FireCaffe to the cuda-convnet2 framework from Google [105], which runs on a single-server/multi-GPU platform but not in a multi-server distributed platform. In addition to cuda-convnet2, Google has developed the TensorFlow framework [119], which also supports single-server/multi-GPU training but not distributed multi-server training. Thus far, Google has not released training speed results for multi-GPU TensorFlow. Twitter [120] has also experimented with scaling DNN training to 8 GPUs, but speed and accuracy results have not been released. Tencent [103], Theano [121], and Facebook [122] have published AlexNet singleserver/multi-GPU training times that are slower than Google [105]. Other than FireCaffe, we have not seen literature on training AlexNet/NiN-scale models in a multi-server/multi-GPU setting. On 32 GPUs, FireCaffe is at least 3x faster to train AlexNet/NiN-scale models than all of the aforementioned results. 3.7.3 Results: Ultra-deep models Ultra-deep models such as GoogLeNet can produce higher accuracy, but they present an even bigger challenge in terms of training time. Internally, Google has trained GoogLeNet on a cluster of CPU servers, but they have not reported the time required to complete this training [79, 116]. Fortunately, Guadarrama reproduced GoogLeNet in Caffe, and he released his GoogLeNet Caffe config5 at a batch size of 1024 While keeping a fixed number of epochs. In other words, with a batch size of 1024, we perform 4x fewer training iterations than with a batch size of 256. 6 43 Table 3.2. Accelerating the training of midsized deep models on ImageNet-1k. Hardware Net Epochs Batch Initial Train size Learning time Speedup Accu- Rate Caffe [106] 1 NVIDIA K20 AlexNet 100 256 0.01 [22] Caffe 1 NVIDIA K20 NiN [95] Top-1 racy 6.0 1x 58.9% 1x 58.9% 7.7x 57.1% 13x 58.9% 23x 58.6% 39x 58.6% days 47 256 0.01 5.8 days Google cudaconvnet2 8 NVIDIA K20s AlexNet 100 varies 0.02 (1 node) 16 hours [105] FireCaffe 32 NVIDIA (ours) K20s (Titan NiN 47 256 0.01 11 hours supercomputer) FireCaffe- 32 NVIDIA batch1024 K20s (Titan (ours) 47 1024 0.04 6 hours supercomputer) FireCaffe- 128 NVIDIA batch1024 K20s (Titan (ours) NiN NiN 47 1024 0.04 3.6 hours supercomputer) uration files [61]. Guadarrama trained for 64 epochs using a batch size of 32 and an initial learning rate of 0.01, and we use these settings in our single-GPU GoogLeNet training experiments. Instead of occasionally reducing the learning rate by 10x, Guadarrama used a polynomial learning rate — that is, the learning rate is gradually reduced after every iteration of training. More specifically, at a iter power , given iteration of training, the learning rate is calculated as initialLearningRate(1− max iter ) and we set power to 0.5 in all of our GoogLeNet training runs. Running this in Caffe on a singleGPU, GoogLeNet takes 21 days to train on ImageNet-1k, producing 68.3% top-1 accuracy and 88.7% top-5 accuracy. This is slightly lower than the 89.9% top-5 single-model accuracy reported by Google [79], and it will be interesting to see whether the open-source Caffe community will eventually be able reproduce or surpass Google’s GoogLeNet accuracy. Here, we use the single-GPU Caffe GoogLeNet accuracy (88.7% top-5 accuracy) as a baseline, and we aim to reproduce this rapidly on a cluster of GPUs. Now, we consider how to accelerate GoogLeNet training using FireCaffe. We initially tried to run GoogLeNet with a batch size of 32 on a GPU cluster, but there just wasn’t enough work per batch to keep a GPU cluster saturated. As we learned earlier in the chapter, larger batch sizes lead to less frequent communication and therefore enable more scalability in a distributed setting. When modifying the batch size, Breuel [114] and Krizhevsky [105] found that the choice of learning rate is crucial in order to preserve high accuracy. We trained five separate versions 44 Top-1 ImageNet Accuracy Achieved 100 80 60 40 20 0 0.02 0.04 0.08 0.16 Initial Learning Rate (LR) Figure 3.6. Impact of learning rate (LR) on accuracy achieved in GoogLeNet training. Each of these is a separate training run, trained from scratch. Out of these experiments, LR=0.08 achieved the highest accuracy (68.3% top-1, 88.8% top-5), and LR=0.16 did not learn beyond a random-guess level of accuracy. of GoogLeNet, each with a different initial learning rate (LR): {0.02, 0.04, 0.08, 0.16, and 0.32}, and all with a batch size of 1024. With LR=0.16 and LR=0.32, GoogLeNet didn’t ever learn anything beyond random-chance accuracy on the test set. Using LR=0.02 produced 66.1% top-1 ImageNet-1k accuracy, and LR=0.04 produced 67.2%. Finally, we declare victory with LR=0.08, where we achieved 68.3% accuracy (again, with a batch size of 1024), which matches the accuracy of the baseline that used a batch size of 32. We illustrate the outcome of these learning rate (LR) experiments in Figure 3.6. With a batch size of 1024 and a fixed number of epochs, we find that FireCaffe on 32 GPUs can train GoogLeNet 23x faster than a single GPU. When we move from a batch size of 32 with LR=0.01 to a batch size of 1024 with LR=0.08, we find that GoogLeNet takes a few more epochs to converge (72 epochs instead of 64 epochs), so the absolute training speedup is 20x; we show these results in Table 3.3. In other words, FireCaffe can train GoogLeNet in 23.4 hours on 32 GPUs, compared to 21 days on a single GPU. Finally, on 128 GPUs, we achieve a 47x speedup over single-GPU GoogLeNet training, while matching the single-GPU accuracy. 45 Table 3.3. Accelerating the training of ultra-deep, computationally intensive models on ImageNet-1k. Hardware Net Epochs Batch Initial Train size Learn- time Speedup Top-1 Top-5 Accu- Accu- racy racy 1x 68.3% 88.7% 20x 68.3% 88.7% 47x 68.3% 88.7% ing Rate Caffe 1 NVIDIA GoogLeNet K20 [79] FireCaffe 32 NVIDIA GoogLeNet (ours) K20s (Titan 64 32 0.01 21 days 72 1024 0.08 23.4 hours supercomputer) FireCaffe 128 NVIDIA (ours) K20s (Titan GoogLeNet 72 1024 0.08 10.5 hours supercomputer) 3.8 Complementary approaches to accelerate DNN training We have discussed related work throughout the chapter, but we now provide a brief survey of additional techniques to accelerate deep neural network training. Several of the following techniques could be used in concert with FireCaffe to further accelerate DNN training. 3.8.1 Accelerating convolution on GPUs In the DNN architectures discussed in this chapter, more than 90% of the floating-point operations in forward and backward propagation reside in convolution layers, so accelerating convolution is key to getting the most out of each GPU. Recently, a number of techniques have been developed to accelerate convolution on GPUs. Unlike CPUs, NVIDIA GPUs have an inverted memory hierarchy, where the register file is larger than the L1 cache. Volkov and Demmel [123] pioneered a communication-avoiding strategy to accelerate matrix multiplication on GPUs by staging as much data as possible in registers while maximizing data reuse. Iandola et al. [50] extended the communication-avoiding techniques to accelerate 2D convolution; and cuDNN [25] and maxDNN [96] extended the techniques to accelerate 3D convolution. The Boda framework [19, 26, 53] further extended the techniques to execute efficiently on GPU hardware produced by companies other than NVIDIA. FireCaffe can be coupled with current and future GPU hardware and convolution libraries for further speedups. 46 3.8.2 Decreasing communication among servers Reducing the quantity of data communicated per batch is a useful way to increase the speed and scalability of DNN training. There is an inherent tradeoff here: as gradients are more aggressively quantized, training speed goes up, but the model’s accuracy may go down compared to a nonquantized baseline. While FireCaffe uses 32-bit floating-point values for weight gradients, Jeffrey Dean stated in a recent keynote speech that Google often uses 16-bit floating-point values for communication between servers in DNN training [124]. Along the same lines, Wawrzynek et al. used 16-bit weights and 8-bit activations in distributed neural network training [102]. Going one step further, Seide et al. used 1-bit gradients for backpropagation, albeit with a drop in the accuracy of the trained model [125]. Finally, a related strategy to reduce communication between servers is to discard (and not communicate) gradients whose numerical values fall below a certain threshold. Amazon presented such a thresholding strategy in a recent paper on scaling up DNN training for speech recognition [112]. However, Amazon’s evaluation uses a proprietary dataset, so it is not clear how this type of thresholding impacts the accuracy compared to a well-understood baseline. So far in this section, we have discussed strategies for compressing or quantizing data to communicate in distributed DNN training. There has also been a series of studies on applying dimensionality reduction to DNNs once they have been trained. Jaderberg et al. [126] and Zhang et al. [127] both use PCA to compress the weights of DNN models by up to 5x, albeit with a substantial reduction in the model’s classification accuracy. Han et al. [128] use a combination of pruning, quantization, and Huffman encoding to compress the weights of pretrained models by 35x with no reduction in accuracy. Thus far, these algorithms have only been able to accelerate DNNs at test time. 3.9 Conclusions Long training times impose a severe limitation on progress in deep neural network research and productization. Accelerating DNN training has several benefits. First, faster DNN training enables models to be trained on ever-increasing dataset sizes in a tractable amount of time. Accelerating DNN training also enables product teams to bring DNN-based products to market more rapidly. Finally, there are a number of compelling use-cases for real-time DNN training, such as robot selflearning. These and other compelling applications led us to focus on the problem of accelerating DNN training, and our work has culminated in the FireCaffe distributed DNN training system. Our approach to accelerating DNN training at scale has three key pillars. First, we select network hardware that achieves high bandwidth between GPU servers — Infiniband or Cray interconnects are ideal for this. Second, when selecting a communication algorithm, we find that reduction trees are more efficient and scalable than the traditional parameter server approach. Third, we optionally increase the batch size to reduce the total quantity of communication during DNN training, and we identify hyperparameters that allow us to reproduce the small-batch accuracy while training with large batch sizes. These three pillars helped us to achieve a near-linear speedup for a number of leading deep neural network architectures. In particular, we have achieved 39x speedup on NiN training, and a 47x speedup on GoogLeNet training on a 128 GPU cluster. 47 Chapter 4 Defining and describing the design space of DNN architectures 4.1 Introduction Convolutional neural network (CNN) architectures comprise an enormous design space. By CNN architecture, we mean: • the type(s) of layers to use, • the number of layers, • the ordering/organization of layers, and • the dimensions of each layer. These are design choices that are specified by a human CNN architect. Each CNN architecture delivers a specific set of tradeoffs in terms of accuracy, computational complexity, energy-efficiency, model size, and other metrics. While it is true that there are only a handful of commonly-used CNN computational primitives (e.g. convolution, pooling, dropout, etc), there are many ways of arranging these primitives into a deep neural network architecture. The composition and total number of layers is selected by the CNN architect, and considering that some recent CNN architectures have 1000 layers or more (e.g. Highway Networks [129] and Residual Networks [15]), there is an exponentially large number of permutations in which different types of CNN layers can be composed. Further, within each layer, there are a number of dimensions to be selected by the CNN architect — e.g. in a convolution layer, the number of filters and spatial resolution of filters are user-selectable. Thus, the design space of CNN architectures is enormous. 48 conv1& 96& conv2& 96& conv3& 96& maxpool/2& 96& conv4& 256& conv5& 256& conv6& 256& maxpool/2& 256& conv7& 384& conv8& 384& conv9& 384& maxpool/2& 384& conv10& 1024& conv11& 1024& conv12& 1000& global&avgpool& so/max& "great pyrenees dog" Figure 4.1. The Network-in-Network (NiN) [95] CNN architecture So, why is it so important to understand the design space of CNN architectures? The choice of CNN architecture determines the following aspects of a CNN-based system: • accuracy: controlled by the CNN architecture, training protocol, and training data • quantity of computation per image: controlled entirely by the CNN architecture • model size — i.e. number of parameters in the model: controlled entirely by the CNN architecture • latency and energy used per image: controlled by the CNN architecture, the software implementation, and the choice of hardware 49 Thus, given specific and aggressive goals (e.g. in terms of accuracy, computation, speed, and/or energy), achieving these goals requires a comprehensive understanding of the CNN architectural space. This chapter is organized as follows. In Section 4.2, we describe the key building blocks (i.e. layers) of modern CNNs. In Section 4.3, we explain the geometrical properties of individual CNN layers. Stacking multiple layers to form an end-to-end CNN leads to certain geometrical properties being passed from one layer to the next. In Section 4.4, we provide an intuitive mental model for understanding how changing the dimensions of one CNN layer can impact the overall quantity of computation in a CNN. We explain the ways in which modifying dimensions of one CNN layer impacts the dimensions of downstream layers in Sections 4.5 and 4.6. Clearly, CNNs comprise a large design space, but how large is it? We provide some intuition on this in Section 4.7. While this chapter focuses on CNN architectures, there are a number of additional design choices that influence the time and accuracy level achieved during training, such as: (a) the choice of how to initialize model parameters prior to training the model and (b) the solver approach used to train the model. We summarize some of the present literature on these design choices in Section 4.8. We conclude in Section 4.9. 4.2 4.2.1 4.2.1.1 Key building blocks of CNN architectures Convolution layers The widespread use of convolution in computer vision For more than forty years, convolution has been used widely in image processing and computer vision. For example, the process of obtaining an RGB image from a CCD camera involves convolution using a filter called a Bayer mask [130]. Likewise, one of the most straightforward ways to detect edges — the Sobel Filter — consists entirely of convolving an image with a particular 3x3 filter [131]. Canny edge detection also involves convolving an image with a filter — typically a 5x5 filter where the numerical values in the filter are set based on a Gaussian distribution [132]. With these examples in mind, it should be no surprise that convolution is a key ingredient in applying neural networks to computer vision problems. In convolutional neural networks, we apply many layers of convolution, e.g. classification = conv layer(conv layer(...conv layer(image))).1 While the previous examples (Bayer mask, Sobel filter, Canny edge detection) use filters in which the numerical values were hand-selected by engineers, convolutional neural networks learn the filters’ numerical values from their training data. 4.2.1.2 Introduction to the dimensionality of convolution layers in CNNs Recall that our high-level objectives for this dissertation include decreasing the number of parameters in CNNs and accelerating CNN training by decreasing the computational requirements. If we want to decrease the computational requirements of CNNs, we must first understand how 1 Typically with nonlinearity functions placed between the convolution layers. 50 the current The number of channels in ber of layer is determined by the num layer. filters (numFilt) in the previous filterH dataH TODO:%% • different%color%f ac#va#ons(vs%fi • show%stride%som • …% % % x numFilt filterW x batch size dataW Figure 4.2. Dimensions of a convolution layer. to calculate the amount of computation performed in individual layers of CNNs. In CNNs such as GoogLeNet [79], more than 90% of the arithmetic operations occur in convolution layers, so understanding the dimensionality and computational overhead of convolution layers is particularly important. In CNNs, convolution layers have two main data structures: the parameters2 (W ) and the input data (D). Parameters are contained in convolution filters, and the numerical values of these parameters are learned automatically during training. Input data (D) is the output from the previous layer; or, for the first convolution layer in the network, D consists of data samples (e.g. images) from the training or testing set. We illustrate all of this in Figure 4.2, and we describe it in more detail below. Terminology. We now define the terminology that we will use to describe the individual dimensions of a CNN layer Li . • f ilterH is the height of the filters in this layer. • f ilterW is the width of the filters in this layer. 2 also called “weights” 51 • numF ilt is the number of filters in this layer. Each of these filters is of size f ilterH x f ilterW x ch. • ch the number of channels the input data to this layer. Also, ch is the number of channels in each filter. This is defined by numF ilt in the previous layer. • dataH is the height of the input data to this layer. • dataW is the width of the input data to this layer. • batch size is the number of data samples to which the CNN is applied concurrently. (See Chapter 3, Section 3.3 for details.) Some of these dimensions are inherited from the previous layer (Li−1 ) in the CNN: dataH, dataW , and ch. Other dimensions are selected by the CNN architect: f ilterH, f ilterW , and numF ilt. Parameters (W ). In a convolution layer, W has 4 dimensions: f ilterH, f ilterW , ch, and numF ilt. The filters of W have a spatial resolution of f ilterHxf ilterW , e.g. 1x1 or 3x3. Each filter has multiple channels ch — for example, if there are 3 input channels, then each filter has ch = 3. Finally, there are usually multiple convolution filters (numF ilt), and each filter learns a different pattern to identify in the D. It can be difficult for humans to reason in 4 dimensions, so we recommend taking extra care to avoid forgetting that every convolution layer has multiple filters (numF ilt), and each of those filters has multiple channels (ch). The total quantity of parameters in a layer is f ilterH ∗ f ilterW ∗ ch ∗ numF ilt, and it is common to represent each parameter as a 4-byte floating-point number. Input Data (D) for the first convolution layer. When training a CNN with batched stochastic gradient descent (SGD), D has 4 dimensions: dataH, dataW , ch, and batch. The batch size (batch) is user-selected, and batch is consistent over all convolution layers in the CNN. For the first layer in a CNN3 (L1 ), the input data (D0 ) is a batch of data samples (e.g. images) to train on, and dataH, dataW , and ch are the height, width, and number of channels (e.g. 3 channels for RGB) of the training images. Input Data (D) for later convolution layers. Now, let us consider a CNN layer Li where i > 1, and the input data is the output from the previous layer, Li−1 . Thus, for Li , the height and width of D — dataH, dataW — is determined by the output of the previous layer. For Li , the number of channels in the input data is determined by the number of filters (numF ilt) in Li−1 . Finally, as in L1 , the batch size in Li is user-selected and is constant over all layers in the CNN. 4.2.2 Downsampling and Pooling In convolutional neural networks, it is common to take an RGB image (e.g. 256x256x3) as input and produce a vector (e.g. 1x1xNumberOfCategories) as output. Indeed, by default, CNNs such as GoogLeNet [79], AlexNet [22], and SqueezeNet [18] take an RGB image as input and produce a vector of classifications as output. But, how do we convert data with a spatial resolution such as 256x256 into a data structure without spatial resolution (e.g. 1x1)? The answer is quite simple: we gradually downsample from 256x256 to 1x1. We do not downsample all at once; rather, in a deep network, we typically downsample once every few layers. 3 In our notation, the “first” layer is directly after the input data, and the “last” layer is the one that outputs the final classifications. 52 Pooling) stride:)1" window:)3x3) Input:)200x200) Output:)200x200) +)border)of)zero)padding) Pooling)Window) stride=1) stride=1) 3x3) Figure 4.3. Pooling with stride=1 preserves the input dimensionality (+/- 1 pixel depending on choice of padding). Here, we are visualizing the height and width of the activation plane (dataH and dataW ) and the height and width of the filters (f ilterH and f ilterW ), but we do not show the batch size or number of channels. Before we can describe the typical approach to downsampling in CNN layers, we must first introduce a new term: stride. We discussed several dimensional terms in Section 4.2.1.2, such as the number of filters, the height and width of the filters, and so on. The stride is the interval at which the filters are applied to the input data. If we set the stride to 1, this means we place each convolution filter in every (x,y) location in the input data, producing an “activation map” Di with height and width that are equivalent4 to the input Di−1 . We illustrate the height and width of activations in the stride=1 case in Figure 4.3. However, if we use stride=2, we place each convolution filter at every other (x,y) location: (0,0), (2,0), (4,0), ..., (2,0), (2,2), (2,4), and so on. Thus, a convolution layer with stride=2 produces an activation map of roughly 12 the height and 1 5 2 the width of the input data, so that Di has roughly 4x fewer pixels per channel than Di−1 . We illustrate this downsampling effect with stride=2 in Figure 4.4. Note that a CNN architect could select different strides for the height and width dimensions (e.g. strideH=2, strideW=3). However, in this dissertation we always have (strideH=strideW), so Inspired)by)slide)6)of)this:)h3ps://courses.cs.washington.edu/courses/cse590v/14au/cse590v_dec5_DeepVis.pdf)) we simply use the term stride to denote both the horizontal and vertical stride of a CNN layer. ) Has)a)useful)animaFon)of)stride=1)conv:) Pooling. The idea of using strided operations is not limited to convolution. We usually think h3p://www.wildml.com/2015/11/understandingIconvoluFonalIneuralInetworksI)forInlp/)) of sliding-window operations as being applied to every window (stride=1), but it is valid to compute any sliding-window computation with a stride of any integer greater than or equal to 1. In convolutional neural networks (e.g. GoogLeNet [79], AlexNet [22], SqueezeNet [18], etc.), a common technique is to apply strided pooling. One commonly-used type of pooling is max-pooling, where 4 equivalent size if using partially-padded (“valid”) convolution we use the term “pixels” loosely, describing the input images as well as the intermediate data produced by each CNN layer 5 53 Pooling) stride:)2" window:)3x3) Input:)200x200) +)border)of)zero)padding) Pooling)Window) stride=2) stride=2) 3x3) Output:)100x100) Figure 4.4. Pooling with stride=2 downsamples the height and width by a factor of 2. Here, we are visualizing the height and width of the activation plane (dataH and dataW ) and the height and width of the filters (f ilterH and f ilterW ), but we do not show the batch size or number of channels. While we use pooling in this example, the same intuition applies to convolution and other types of layers. for each neighborhood, we take the maximum-intensity pixel per channel. An other such strategy is average-pooling, which simply consists of taking the average pixel value of each channel in each neighborhood. When architecting pooling layers in CNNs, it is sensible to define neighborhood size (e.g. 2x2 or 3x3) that is no smaller than the stride (e.g. stride=2 or stride=3), otherwise some data will be disregarded during downsampling. Beyond average-pooling and max-pooling, computational photography researchers have devised much more complex mechanisms for downsampling, such as content-aware seam-carving [133]. However, not all downsampling algorithms are easily differentiable. For backpropagation-based training to be applicable, it is necessary that we use downsampling mechanisms for which a derivative can be computed. Nevertheless, applying alternative downsampling methods to CNNs is would be an interesting area of future work. Finally, while we have presented typical strategies that allow CNNs to gradually downsample from an image to a vector, there are cases where the goal is actually to produce an activation map instead of a single vector. One such case is semantic segmentation, which is the problem of assigning a category label (e.g. car, bus, road) to every pixel in the image, and therefore the output of the CNN ought to be a pixel map. Indeed, researchers have addressed this problem with CNNs that do not downsample all the way down to 1x1, sometimes called “fully convolutional networks (FCN)” [14]. Finally, while it is most common to use stride = 1 (no resizing) or stride > 1 Inspired)by)slide)6)of)this:)h3ps://courses.cs.washington.edu/courses/cse590v/14au/cse590v_dec5_Deep ) Has)a)useful)animaFon)of)stride=1)conv:) h3p://www.wildml.com/2015/11/understandingIconvoluFonalIneuralInetworksI)forInlp/)) 54 (downsampling), work such as [14] also uses fractional strides (stride < 1) to upsample/enlarge the dataH and dataW . 4.2.3 Activation function layer If a CNN were literally just a series of convolution layers and nothing else, the model would simply be a linear system. Linear systems are a fairly constrained subset of what can be achieved with deep networks. To express non-linear functions, it is common to introduce a nonlinearity into the output of each convolution layer of a CNN. These nonlinearity functions are sometimes called activation functions. Note that, in diagrams of CNNs, the activation function is often omitted for brevity. Also, in some CNN implementations and frameworks such as Caffe [106], the activation function is implemented as its own layer in the CNN. In historical and recent literature, a number of activation functions have been proposed and applied to CNNs. We do not attempt to provide an exhaustive survey of activation functions, but we provide a few examples below: • Hyperbolic tangent activation [134]: f (x) = tanh(x) • Sigmoid activation [135]: f (x) = 1 1−exp(−x) • Rectified linear unit (ReLU) activation [136]: f (x) = max(0, x) • Variants of ReLU, including: ELU [137], PReLU [138], and Leaky ReLU [139]. For a more exhaustive discussion of activation functions, see the recent survey paper by Gu et al. [140]. The choice of activation function can have two main effects on how a CNN behaves: 1. Quantity of computation required to converge. Given a CNN, changing the per-layer activation functions may change the number of epochs of training required to converge to a particular level of accuracy. 2. Accuracy achieved during training. Given a CNN, changing the per-layer activation functions may change the accuracy that can be achieved during training. In pathological cases, certain choices of activation function may lead to the CNN not learning anything at all and remaining at a very low accuracy level. The ramifications of the activation function are almost entirely constrained to the training phase, and it has little impact on the computational requirements during inference. This is because the quantity of computation required to calculate a typical activation function (e.g. ReLU: f (x) = max(0, x)) is extremely trivial compared to running a typical convolution layer over the same data. Therefore, the quantity of computation in most CNNs is dominated by layers such as convolution, and activation functions typically represent much less than 1% of the total quantity of computation. 55 4.2.4 Loss function layers During training a loss function — sometimes called an objective function — is typically applied at the end of the CNN6 . The ideal choice of loss function (typically implemented as its own layer in the CNN) is highly dependent on the problem at hand. Without going into deep mathematical details, we find that there are two main questions that a CNN architect must ask when beginning the search for the “right” loss function: 1. Classification or regression? Do we want to train the CNN to solve a classification- or regression-style problem? In the classification formulation, it is typical to say “there are 100 labels, and every data sample needs to be assigned to one of these labels.” Image classification (as in the running ImageNet example in Chapter 3) is one example where classification objective functions are sensible. On the other hand, in the regression formulation, it is typical to say “for every every data sample, the sample needs to be analyzed, where the output is a floating-point number between -50 and 50.” Some loss functions, such as logistic regression, can be applied to either classification or regression [141]. Other loss functions — e.g. softmax — are specific to classification. Note that many of the loss functions used in CNNs were not designed specifically for CNN training — rather, they are loss functions that were developed in other areas of mathematical optimization and have been appropriated by CNN researchers. More examples of classification or regression loss functions can be found in [141] and [142]. 2. One loss function or multiple loss functions? While it’s typical to optimize a CNN for one particular loss function, it’s possible to have multiple loss functions. A common example is to optimize a CNN to classify objects (using classification loss) and simultaneously optimize the CNN to localize objects in (using regression loss) [13, 143]. Taken together, these two loss functions train the CNN to perform object detection. For an in-depth discussion of loss functions, we direct the interested reader to [141, 142]. 4.2.5 Regularization function layers In machine learning, the loss function is often formulated such that achieving zero loss (i.e. perfect convergence) on the training set can be done by simply memorizing the training set. This is problematic, because the real world (i.e. the test set and beyond) tends to be more diverse than the training set. The case where a machine-learned model memorizes the training set but delivers poor accuracy on the test set is called overfitting. Regularization refers to a family of techniques that can be used to combat overfitting. Roughly speaking, a method is a regularizer if it makes it more difficult to for a model to memorize the training set. In most cases, regularization is applied during training, but not during inference. These are two of the most widely-used regularization methods in modern CNN/DNN research: • Dropout [144]: if(rand=1), f(x)=0. else, f(x)=x. • Batch Normalization [116]7 : f(x1:batchsize ) = 6 7 x1:batchsize −mean(x1:batchsize ) variance(x1:batchsize ) In our nomenclature, the input data is the “beginning” and the loss function is the “end” of the CNN. Using the straightforward Batch Normalization formulation that was presented in Chapter 8 of [145]. 56 4.3 4.3.1 Understanding the dimensionality of CNN layers How many parameters are in a convolution layer? Consider a convolution layer Li that has 100 filters of spatial resolution f ilterH x f ilterW = 3x3. How many parameters does this layer have? It might be tempting to answer 100*3*3=900, but you would be wrong! In reality, we haven’t given you enough information to answer the question. You need to know the number of channels in the input data to Li . As we discussed in Section 4.2.1.2, for layer Li>1 , the number of input channels (chi ) is determined by the number of filters in the previous layer (numF ilti−1 ). And, the first layer L1 is a special case: the number of input channels chi=1 is determined by the number of channels in the input data to the CNN. To keep our math simple, for the first layer we use numF ilti−1 as a shorthand for “the number of channels in the input data to the CNN.” Now, let us turn our attention back to the present example. If the previous layer Li−1 has 10 filters, then Li has 10 input channels, and Li has chi ∗ numF ilti ∗ f ilterWi ∗ f ilterHi = 10*100*3*3=9000 parameters. If you thought 900, then you were off by a factor of 10! Here, we have considered the number of parameters in just one layer. Calculating the total quantity of parameters in an entire CNN architecture is simply a matter of summing chi ∗numF ilti ∗ f ilterWi ∗ f ilterHi over layers i = 1 : n. We expressed this mathematically in terms of bytes in Chapter 3, Equation 3.1, and we reproduce the equation below. |W | = #layers X L=1 numF iltL−1 ∗ numF iltL ∗ f ilterWL ∗ f ilterHL ∗ 4 (4.1) Note that the the “∗ 4” assumes that we are representing the parameters in the filters as 4-byte floating-point values. The “∗ 4” should be adjusted when representing the parameters with a different number of bytes (e.g. “∗ 2” for 16-bit floating-point values). 4.3.2 How big are the activation maps produced by a convolution layer? Consider a convolution layer Li with 100 filters of size f ilterHi x f ilterWi = 3x3, stridei =2, and no zero-padding (padHi = padWi = 0). Note that the stride of 2 applies in the height and width dimensions. Also, the input data to Li is dataHi−1 x dataWi−1 x chi−1 = 50x50x10. Finally, assume that the batch size is 200. What is the dimensionality of the output data produced by Li ? We know that the number of output channels is 100, because it says above that Li has 100 filters (numF ilti ). We compute the height of the output activations (dataHi ) as dataHi = ceil( dataHi−1 + 2 ∗ padHi − f ilterHi )+1 stridei (4.2) Plugging in the numbers for the present example, this works out to ceil( 50+0−3 ) + 1 = 25. We 2 were given that dataHi = dataWi = 50, so the output width is also 25. Putting it all together, the output activation map from Li is batch x numF ilti x dataHi x dataWi = 200x100x25x25. 57 4.3.3 How many arithmetic operations are performed in a convolution layer? So far, we have discussed how to calculate the dimensionality and quantity of parameters and activations in a convolution layer. Given the dimensionality of the parameters and the dimensionality of the activations that a convolution layer produces as output, this is enough information to calculate the quantity of computation in the layer. As we have discussed in previous sections, a CNN architect is charged with defining certain dimensions for each convolution layer L. These dimensions include the height and width of filters (f ilterHL and f ilterWL ), the number of filters in the previous layer (numF iltL−1 ), the number of filters in the current layer (numF iltL ), the height and width of output activations (dataHL and dataW idthL ). Using these dimensions, we can compute the number of arithmetic operations in convolution layer L as follows: F LOP SL = numF iltL−1 ∗ numF iltL ∗ f ilterWL ∗ f ilterHL ∗ dataWL ∗ dataHL ∗ 2. (4.3) Note that the factor of 2 is to account for the fact that the calculations use multiply-add calculations, which count as two arithmetic operations. Calculating the total quantity of computation in a CNN’s convolution layers is as simple as summing Equation 4.3 over all layers: #layers F LOP Stotal = X numF iltL−1 ∗ numF iltL ∗ f ilterWL ∗ f ilterHL ∗ dataWL ∗ dataHL ∗ 2. (4.4) L=1 So far, we have concentrated on calculating the quantity of computation required for the inference. While inference requires computing the forward pass only, training requires computing both the forward and backward pass. The backward pass requires 2x more computation than the forward pass, because the backward pass requires computing gradients with respect to the weights (∇W ) and gradients with respect to the data (∇D). The computations of ∇W and ∇D each require the same quantity of computation as the entire forward pass. Therefore, per image or data sample, training requires three times the quantity of computation that is required for inference [78]. In other words, to determine the quantity of computation per data sample during training, the procedure is simply to calculate Equation 4.4 and multiply the result by 3. 4.4 A mental model for how CNN dimensions impact the quantity of computation and other metrics Much research has been conducted on some aspects of CNNs such as (1) solvers [146, 147], (2) adding residual connections that skip over layers of CNNs [129, 15, 18], and (3) rethinking how to initialize parameters prior to training CNNs [113, 138]. All of these areas of research have an impact on the time required to train a CNN, and the end accuracy that is achieved. However, do these topics affect the inference speed when it comes to deploy the CNN for a real application? For the most part, no. Solvers and parameter initialization are only relevant during training. 58 The residual connections that have appeared in recent literature [129, 15, 18] have a negligible effect on the inference speed, because they account for a tiny portion of the overall quantity of computation. So, what factors do influence the speed or quantity of computation required during inference time? Simply put, the CNN architecture and the dimensionality of the input data are wholly responsible for determining the quantity of computation required during inference.8 To our knowledge, there are few papers or documents that provide practical intuition on how CNN layer dimensions impact the overall computational footprint. To remedy this, we have codified our own mental model for understanding how changing the dimensions of a CNN impact the CNN’s quantity of computation during inference. Given a CNN, there are a number of ways to modify it in the interest of maximizing accuracy, minimizing the quantity of computation, or optimizing for other metrics. While there are many modifications that we can make to a CNN, the modifications that have the most impact on the quantity of computation tend to deal with the number of channels or filters in layers or the height and width of activations that are passed from one layer to the next. Some of the key ways of modifying a CNN include: • changing the number of channels in the input data, e.g. adding a depth channel or concatenating multiple video frames. (Section 4.5.2); • changing the number of filters in a convolution layer (Section 4.5.3); • changing the spatial resolution (height and/or width) of convolution filters in a layer (Section 4.5.4); • changing the number of categories classified by the CNN (Section 4.5.5); • changing the quantity of downsampling performed in a convolution or pooling layer9 (Section 4.6.1); or • changing the spatial resolution of the input data (Section 4.6.2). Initially, it may seem daunting to understand how each of these types of modifications affect the quantity of computation required to perform inference in a CNN. Fortunately, all of these modifications can be distilled into a straightforward mental model. All of these CNN architectural modifications induce either a local change or a global change to the dimensions of the CNN, and we define these terms as follows. 1. Local change. We define a local change as the case where a modification to CNN layer Li affects only the dimensionality of layer Li and possibly Li+1 . Examples of a local change include changing the number of channels in the input data (Section 4.5.2), changing the number of filters in one convolution layer (Section 4.5.3), and changing the number of categories classified by the CNN (Section 4.5.5). 2. Global change. In contrast to a local change, we define a global change as the case where a modification to CNN layer Li affects the dimensionality of layer Li and the subsequent layers (Li+1 , ..., LN ). Examples of a global change include changing the resolution of the input images (Section 4.6.2) and changing the strides of a convolution or pooling layer (Section 4.6.1). 8 And, as we will see in Chapter 5, model compression can further impact the quantity of computation during inference. 9 e.g. by changing the strides or adding/removing a pooling layer 59 As you can see, all of the CNN modifications that we have considered can be described as either a local change or a global change. In the following two sections (Section 4.5 and Section 4.6), we describe in detail how each type of CNN modification impacts the total quantity of computation in a CNN. But first, we state the key findings up front: • A local change to a layer in a deep CNN typically has little impact on the CNN’s total quantity of computation. • A global change to layer Li affects all layers downstream of Li and can have a multiplicative effect on the CNN’s total quantity of computation. We summarize this in Table 4.1. In Sections 4.5 and 4.6, we will go over how we calculated each line in Table 4.1. Table 4.1. Summary of local and global changes to CNN architectures section type of ∆ Qty of ∆ Qty of ∆ Qty of modification output params computation Initial CNN (NiN [95]) none 1x 1x 1x 4x more input channels Local 1x 1x 1.3x 4x more filters in conv8 Local 1.1x 1.1x 1.1x Section 4.5.4 4x larger filter resolution Local 1x 1.3x 1.3x Table 4.5 in conv7 Section 4.5.5 4x more categories to Local 1x 1.4x 1.1x Table 4.6 classify Section 4.6.1 remove pool3 Global 2.6x 1x 3.8x Table 4.7 downsampling layer Section 4.6.2 4x larger input data Global 4.2x 1x 4.3x Table 4.8 resolution Section 4.5.1 modification Table 4.2 Section 4.5.2 Table 4.3 Section 4.5.3 Table 4.4 4.5 4.5.1 Local changes to CNN architectures Initial CNN architecture: Network-in-Network (NiN) Before we begin to present examples of how changing CNN dimensions impacts the computational footprint, we begin by presenting an initial CNN architecture. We have selected Networkin-Network (NiN) [95] as an initial CNN architecture. In its default configuration, NiN takes an 60 image as input, and it predicts the image’s category (e.g. “soup bowl” or “cowboy hat”) as output. In terms of accuracy, NiN is competitive with the highest-accuracy submissions in the ImageNet 2012 and 2013 image classification challenges. The highest accuracy submission for ImageNet 2014 — GoogLeNet [79] — draws inspiration from the NiN architecture. We present an overview of the NiN architecture in Figure 4.1. We provide more detailed dimensions of the NiN architecture in Table 4.2. Observe that NiN has 12 convolution layers. Each of these convolution layers has a multiple filters, where the filters are in the range from 1x1xChannels to 11x11xChannels. In each layer, all filters are the same size. From beginning to end, NiN gradually downsamples the height and width of the activations from 227x227 down to 1x1. The downsampling is accomplished with max- and average-pooling, as well as (in the first convolutional layer) a convolution stride of 2. In some CNNs such as AlexNet [22], the downsampling to 1x1xChannels is done partway through the CNN, and the last few convolution layers (sometimes called “fullyconnected layers” due to the special case of 1x1 dimensionality) operate without spatial resolution. However, every convolution layer in NiN has a spatial resolution greater than 1x1. After the final convolution layer, NiN does global average pooling, which means it takes the average of each channel’s (x,y) grid to downsample to 1x1xChannels. This design choice has a nice property: regardless of the input image height and width, NiN is able to output an output vector of size 1x1xChannels. For brevity, we have not shown all the details of NiN in Table 4.2. In this table, we have omitted the following details: • ReLU [136] is performed after each convolution layer. • During training, Dropout [144] is performed after the 10th convolution layer. • Batch Normalization [116] is not used at all in NiN. • The initial layer (“data”) provides a batch of 3-channel (RGB) images. • Each pooling layer has a stride of 2. When we say “a stride of 2,” we mean that both the xand y-dimensions have a stride of 2. Within each convolution and pooling layer of NiN, the x- and y-dimensions have the same stride. • As we discussed in Section 4.3, the number of filters (number of output channels) in convolution layer Li defines the number of input channels in convolution layer Li+1 . In Table 4.2, to avoid redundancy we simply list the number of output channels in each layer. • Pooling does not affect the number of channels (and pooling operates independently on each channel), so a pooling layer simply has the same number of output channels as the previous convolution layer. Observe in Table 4.2 that during inference with a batch size of 1024 images NiN produces 5.90GB of output activations (for all layers combined), it has 30.4MB of filters (which is unaffected by the batch size), and it requires 2.27TF of computation. In the following sections, we will show how modifications to NiN impact the quantity of activations, the quantity of filters, and the quantity of computation required during inference. 61 Table 4.2. (Corresponds with Section 4.5.1.) Dimensions of the Network-in-Network (NiN) [95] CNN architecture. We use this as a starting point for a number of CNN modifications in the following subsections. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output Qty of Qty of Qty of channels HxW output params Computation (MB) (MB) (GFLOPS) data - - 3 227x227 633MB 0 0 conv1 11x11 4 96 55x55 1190MB 0.140MB 216GF conv2 1x1 1 96 55x55 1190MB 0.0372MB 57.1GF conv3 1x1 1 96 55x55 1190MB 0.0372MB 57.1GF pool3 3x3 2 96 27x27 287MB 0 0.644GF conv4 5x5 1 256 27x27 764MB 2.46MB 917GF conv5 1x1 1 256 27x27 764MB 263KB 97.8GF conv6 1x1 1 256 27x27 764MB 263KB 97.8GF pool6 3x3 2 256 13x13 177MB 0 0.399GF conv7 3x3 1 384 13x13 266MB 3.54MB 306GF conv8 1x1 1 384 13x13 266MB 0.591MB 51.0GF conv9 1x1 1 384 13x13 266MB 0.591MB 51.0GF pool9 3x3 2 384 6x6 56.6MB 0 0.127GF conv10 3x3 1 1024 6x6 151MB 14.2MB 261GF conv11 1x1 1 1024 6x6 151MB 4.20MB 77.3GF conv12 1x1 1 1000 6x6 151MB 4.10MB 75.5GF pool12 6x6 1 1000 1x1 4.0MB 0 0.073GF 5.90GB 30.4MB 2.27TF total 62 4.5.2 Changing the number of channels in the input data Computer vision algorithms are often applied to color images. Color images are typically represented as a grid of pixels, and each pixel has 3 channels: Red, Green, and Blue, or RGB for short. In CNNs such as AlexNet [22] and NiN [95], each filter of the first convolution layer has a height and width (e.g. 11x11), plus 3 channels to accept RGB images. Channels in RGB-D computer vision. Sensors such as LIDAR can provide depth maps — essentially a grid of pixels, where each pixel represents depth (e.g. meters) from the sensor. When using depth maps, it is common to operate on 4-channel RGB-D images, where the fourth channel is depth. To perform visual recognition on RGB-D images, one approach is to configure a CNN to have 4 channels in the first convolution layer. Some researchers represent RGB-D images with higher numbers of channels. For example, Gupta et al. featurize a depth map into multiple channels of information for each pixel: horizontal disparity, height above ground, and the surface normal [148]. All of these channels are used as input to a CNN. Channels in video recognition. In videos, each frame can typically be represented as an RGB image. Video frames have temporal locality; enabling visual recognition algorithms to leverage this locality can lead to higher recognition accuracy. One such approach is the use of recurrent CNN models (RNNs) [149] and long-short term memory networks (LSTMs) [150], which keep track of the temporal relationship between frames. LSTMs have been applied to video recognition problems such as identifying actions in videos [151], automatically answering questions about images [152], and assigning captions to images [153]. An alternative approach is simply to concatenate multiple video frames together in the channel dimension. For example, in a system to identify human activities/actions that are performed in the TRECVID [154] video dataset, Ji et al. concatenated groups of 7 video frames to use as input to a CNN [155]. In this case, the CNN’s conv1 layer had (3 RGB) * (7 frames) = 21 input channels. In most of the aforementioned applications, an off-the-shelf CNN architecture such as AlexNet [22], VGG [77], or NiN [95] was modified to target a new application with a different number of channels in the input data. An important consideration is, how do these changes impact the quantity of computation performed by a CNN? Let us walk through a straightforward case of changing the number of input channels: we will take NiN (Table 4.2) and increase the number of input channels by a factor of 4x. You can think of this as concatenating 4 RGB video frames together in the channel dimension (to preserve temporal locality across frames), and feeding this to the CNN as a single input data item. 4.5.2.1 Impact on inference When we increase the number of channels in the input data by a factor of 4x (from 3 to 12), how does the quantity of computation during inference change? In Table 4.3, we show the impact of this modification to the NiN architecture on the quantity of computation. Observe that, in the conv1 layer, the quantity of computation increases by a factor of 4x (you can calculate this for yourself using Equation 4.3). In layers after conv1, the quantity of computation is unchanged by this modification. Looking at the CNN from an end-to-end perspective, this modification leads to 1.3x more computation overall. 63 4.5.2.2 Impact on training When we increase the number of channels in the input data by a factor of 4x (from 3 to 12), how does the time required to train a model (for a fixed number of epochs) change? In Table 4.3, we observe that this change requires 1.3x more computation10 , but the quantity of parameters in the CNN remains essentially unchanged. In the data-parallel training approach that we described in Chapter 3, the quantity of communication sent and received by each server is determined by the quantity of parameters in the CNN. Therefore, to answer the question stated above: when we increase the number of channels in the input data to the CNN, training on a fixed number of computation processors is slightly slower. However, the ratio of communication has increased, which means we can scale the modified CNN’s training problem to more processors and nearly regain the time-to-solution that is achievable with the original NiN model. Finally, note that the quantity of output (i.e. total quantity of activations produced by all layers) does not affect the communication requirements in data-parallel distributed CNN training and therefore does not directly impact the scalability or speed of training on multiple processors. 10 Recall from Section 4.3.3 that CNN training requires 3x more computation per image than CNN inference. 64 Table 4.3. (Corresponds with Section 4.5.2.) NiN architecture with 4x more input channels. The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 12 227x227 4x 0 0 conv1 11x11 4 96 55x55 1x 4x 4x conv2 1x1 1 96 55x55 1x 1x 1x conv3 1x1 1 96 55x55 1x 1x 1x pool3 3x3 2 96 27x27 1x 1x 1x conv4 5x5 1 256 27x27 1x 1x 1x conv5 1x1 1 256 27x27 1x 1x 1x conv6 1x1 1 256 27x27 1x 1x 1x pool6 3x3 2 256 13x13 1x 1x 1x conv7 3x3 1 384 13x13 1x 1x 1x conv8 1x1 1 384 13x13 1x 1x 1x conv9 1x1 1 384 13x13 1x 1x 1x pool9 3x3 2 384 6x6 1x 1x 1x conv10 3x3 1 1024 6x6 1x 1x 1x conv11 1x1 1 1024 6x6 1x 1x 1x conv12 1x1 1 1000 6x6 1x 1x 1x pool12 6x6 1 1000 1x1 1x 1x 1x 1x 1x 1.3x (5.90TB) (30.4MB) (2.92TF) total 4.5.3 Changing the number of filters in a convolution layer We now turn our attention to the number of filters in a CNN layer, and the implications of the number of filters on a CNN’s computational properties. In Sections 3.3, 4.2.1.2, and 4.3.1, we have discussed the relationship between channels and filters in CNNs. Now, we work an example where we change the number of filters in a convolution layer within a CNN and observe the impact on the quantity of computation performed by the CNN as a whole. In Network-in-Network (NiN) [95], the conv1 layer has 96 filters. Observe in Table 4.2 that conv1 has 96 output channels. This isn’t a coincidence; the number of filters in a layer dictates the number of output channels produced by the layer. Next, since conv2 has 96 input channels, each filter in conv2 has 96 channels. It also happens that the NiN architects chose to have 96 filters in conv2, and each of these filters has 96 channels. The conv3 layer also has 96 input channels and 96 output channels. In the conv4 layer, there are 96 input channels (from conv3), but the NiN 65 architects decided to have 256 filters in the conv4 layer. The NiN architects also decided to use a spatial resolution of 3x3 for the filters in conv4. Putting it all together, the conv4 layer has 256 filters that are of size 3x3x96. From what we have learned so far, we can observe three properties of the number of filters in a CNN layer: 1. The number of filters in layer Li dictates the number of output channels in Li . 2. The number of input channels in Li+1 is equal to the number of output channels in Li . 3. Each filter has multiple channels. The number of filters in layer Li dictates the number of channels in each filter of layer Li+1 . The choice of the number of filters in CNN layers comprises a huge design space. With this in mind, it is worthwhile to understand how the number of filters in a CNN layer impacts the overall computational overhead of a CNN. To explore this, let us begin with the NiN architecture and increase the number of filters in the conv8 layer, and we will explore how this impacts the computational characteristics of the CNN. 4.5.3.1 Impact on inference When we increase the number of filters in conv8 by a factor of 4x (from 384 to 1536), how does the quantity of computation during inference change? Within conv8, the quantity of computation increases by a factor of 4x; we can calculate this using Equation 4.3. Also, as we discussed earlier in the section, the number of filters in layer Li defines the number of input channels to layer Li+1 . Therefore, each filter in conv9 now has 4x more channels, leading to 4x more computation in conv9. However, in layers other than conv8 and conv9, the quantity of computation is unchanged. As we show in Table 4.4, the overall quantity of computation in the CNN increases by just 1.1x as a result of increasing the number of filters in conv8 by 4x. Since increasing the number of filters in a layer impacts the quantity of computation in just 2 out of the 12 convolution layers, we describe this as a local change to a CNN architecture. 4.5.3.2 Impact on training When we increase the number of filters in conv8 by a factor of 4x (from 384 to 1536), how does the time required to train a model (for a fixed number of epochs) change? This modification led to a negligible 1.1x increase in both computation and model size (i.e. communication). Training the model would be slightly more time-consuming. Since both the communication and computation increased by the same amount, the problem’s distributed scalability remains unchanged. 66 Table 4.4. (Corresponds with Section 4.5.3.) NiN architecture with 4x more filters in conv8. The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 3 227x227 1x 0 0 conv1 11x11 4 96 55x55 1x 1x 1x conv2 1x1 1 96 55x55 1x 1x 1x conv3 1x1 1 96 55x55 1x 1x 1x pool3 3x3 2 96 27x27 1x 1x 1x conv4 5x5 1 256 27x27 1x 1x 1x conv5 1x1 1 256 27x27 1x 1x 1x conv6 1x1 1 256 27x27 1x 1x 1x pool6 3x3 2 256 13x13 1x 1x 1x conv7 3x3 1 384 13x13 1x 1x 1x conv8 1x1 1 1536 13x13 4x 4x 4x conv9 1x1 1 384 13x13 1x 4x 4x pool9 3x3 2 384 6x6 1x 1x 1x conv10 3x3 1 1024 6x6 1x 1x 1x conv11 1x1 1 1024 6x6 1x 1x 1x conv12 1x1 1 1000 6x6 1x 1x 1x pool12 6x6 1 1000 1x1 1x 1x 1x 1.1x 1.1x 1.1x (6.69GB) (33.9MB) (2.57TF) total 4.5.4 Changing the spatial resolution of filters in a convolution layer In CNNs, each filter has a spatial resolution (height x width) that can be any size in the range from 1x1 up to the height and width of the input data to which the filters will be applied.11 CNN architects are free to select filters to be any size in this range. Note that, while we could design a CNN where every filter is a unique size, it’s common for most filters within each layer to have the same spatial resolution. In Chapter 5, we will discuss how the choice of filter resolution affects accuracy. For now, though, we will focus on understanding how modifying the filter resolution of a CNN affects its computational requirements. In the NiN CNN architecture, filters range from 1x1 to 11x11 in their spatial resolution. In Chapter 5, we will learn how the choice of filter resolution can impact accuracy. For now, though, we focus on understanding how changing the resolution of CNN filters affects its computational 11 To be specific, the filters are 1x1xChannels, or larger. For simplicity, we omit the “xChannels” in this section. 67 requirements. Keeping with the running example of “increasing a CNN dimension by 4x,” we next consider how increasing the height and width of the filters of a CNN layer from 3x3 to 6x6 affects the CNNs computational requirements. 4.5.4.1 Impact on inference When we increase the filter resolution in conv7 by a factor of 4x (from 3x3 to 6x6), and increase the amount of zero-padding from a border of 1 pixel to a border of 2 pixels, how does the quantity of computation during inference change? In Table 4.5, we show how this modification to the NiN architecture impacts quantity of computation. Observe in Table 4.5 that, in the conv7 layer, the quantity of computation increases by a factor of 4x. In the the following convolution layer (conv8), notice that the quantity of computation is nearly unchanged. Looking at the CNN from an end-to-end perspective, this modification leads to 1.3x more computation overall. Finally, notice that the quantity of computation in the conv8 and conv9 layers decreased slightly compared to the original NiN architecture (Table 4.2), and the output activations from conv7, conv8, and conv9 shrunk slightly from 13x13 to 12x12. We now take a moment to explain this. The modest change in the quantity of computation and output activation resolution in conv8 and conv9 is due to the choice of zero-padding in our modified conv7 layer. With 3x3 filters and a stride of 1, a border of 1 pixel of zero-padding leads to the input data and output activations being the same height and width. Similarly, with 5x5 filters and a stride of 1, a border of 2 pixels of zeropadding leads to the input data and output activations being the same height and width. However, with 6x6 filters (or any even-numbered filter height and width), getting the output resolution to be equivalent to the input resolution would require a padding technique such as: 3 pixels of padding on the top and left borders, and 2 pixels of padding on the bottom and right borders. Typically, CNN frameworks (e.g. Caffe [106], TensorFlow [119]) do not natively support unequal padding on different sides, so for the example in this section we used a border of 2 pixels of zero-padding on all sides in the modified conv7 layer. This led to slightly smaller output activations from conv7, conv8, and conv9, leading to a slight drop on quantity of computation for conv8 and conv9. 4.5.4.2 Impact on training When we increase the filter resolution in conv7 by a factor of 4x (from 3x3 to 6x6), and increase the amount of zero-padding from a border of 1 pixel to a border of 2 pixels, how does the time required to train a model (for a fixed number of epochs) change? This modification led to a 1.3x increase in both computation and model size (i.e. communication). Training the model would be slightly more time-consuming. Since both the communication and computation increased by the same amount, the problem’s distributed scalability remains unchanged. 68 Table 4.5. (Corresponds with Section 4.5.4.) NiN architecture with 4x larger filter resolution in layer conv7 (3x3 → 6x6). The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 3 227x227 1x 0 0 conv1 11x11 4 96 55x55 1x 1x 1x conv2 1x1 1 96 55x55 1x 1x 1x conv3 1x1 1 96 55x55 1x 1x 1x pool3 3x3 2 96 27x27 1x 1x 1x conv4 5x5 1 256 27x27 1x 1x 1x conv5 1x1 1 256 27x27 1x 1x 1x conv6 1x1 1 256 27x27 1x 1x 1x pool6 3x3 2 256 13x13 1x 1x 1x conv7 6x6 1 384 12x12 0.8x 4x 3.4x conv8 1x1 1 384 12x12 0.8x 1x 0.9x conv9 1x1 1 384 12x12 0.8x 1x 0.9x pool9 3x3 2 384 6x6 1x 1x 1x conv10 3x3 1 1024 6x6 1x 1x 1x conv11 1x1 1 1024 6x6 1x 1x 1x conv12 1x1 1 1000 6x6 1x 1x 1x pool12 6x6 1 1000 1x1 1x 1x 1x 1x 1.3x 1.3x (5.82GB) (41.0MB) (2.99TF) total 4.5.5 Changing the number of categories classified by a CNN Applications of CNNs include single-class (i.e. binary) and multi-class classification. The output layer of a CNN has a number filters that is equal to the number of categories to be classified (i.e. the number of distinct categories in the training set). In the context of this section, we define “classification” inclusively to span (1) full-image classification (e.g. [18]), (2) localized recognition/detection (e.g. [156]), (3) semantic segmentation (e.g. [14]), and other applications. In all of these cases, there is a multi-class classification aspect to the problem: localized detection classifies regions/windows of the images in terms of a list of object categories, and semantic segmentation classifies pixels in terms of a list of visual categories. In all of these applications, the number of filters in the final layer is set equal to the number of classes in the training set. Let us consider the NiN CNN architecture as a starting point. When trained on ImageNet, 69 the authors of NiN allocated 1000 filters in conv12 (the final layer), because ImageNet-1k has 1000 categories of training and test data. Next, we consider the case where we would like to apply NiN to to a visual category recognition task with more categories — say, 4000 categories of images. 4.5.5.1 Impact on inference When we increase the number of categories in the dataset by a factor of 4x (from 1000 to 4000), how does the quantity of computation during inference change? In Table 4.6, we show the impact of this modification to NiN architecture on the quantity of computation. In the final convolution layer (conv12), there is one filter for each category in the dataset. So, the number of filters in conv12 has increased from 1000 to 4000, leading to 4x more computation in conv12. However, the dimensionality and quantity of computation in all other layers remains unchanged. Looking at the CNN from an end-to-end perspective, this modification leads to just 1.1x more computation overall. 4.5.5.2 Impact on training When we increase the number of categories in the dataset by a factor of 4x (from 1000 to 4000), how does the time required to train a model (for a fixed number of epochs) change? In Table 4.6, we observe that this change leads to a 1.4x larger model size (i.e. 1.4x more communication) and computation 1.1x more computation. Therefore, the ratio of communication has decreased, which tells us that this CNN is less scalable than the original NiN model. In other words, not only does this model require more computation than the original NiN model, but the runtime will be dominated by communication at a smaller number of processors than in the case of the original NiN model. For both of these reasons, when using distributed data-parallel training, this model is slower to train than the original NiN model. 70 Table 4.6. (Corresponds with Section 4.5.5.) NiN architecture with 4x more categories to classify. The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 3 227x227 1x 0 0 conv1 11x11 4 96 55x55 1x 1x 1x conv2 1x1 1 96 55x55 1x 1x 1x conv3 1x1 1 96 55x55 1x 1x 1x pool3 3x3 2 96 27x27 1x 1x 1x conv4 5x5 1 256 27x27 1x 1x 1x conv5 1x1 1 256 27x27 1x 1x 1x conv6 1x1 1 256 27x27 1x 1x 1x pool6 3x3 2 256 13x13 1x 1x 1x conv7 3x3 1 384 13x13 1x 1x 1x conv8 1x1 1 384 13x13 1x 1x 1x conv9 1x1 1 384 13x13 1x 1x 1x pool9 3x3 2 384 6x6 1x 1x 1x conv10 3x3 1 1024 6x6 1x 1x 1x conv11 1x1 1 1024 6x6 1x 1x 1x conv12 1x1 1 4000 6x6 4x 4x 4x pool12 6x6 1 4000 1x1 4x 1x 4x 1x 1.4x 1.1x (5.90GB) (42.6MB) (2.49TF) total 4.5.6 Recap of local changes to CNN architectures In the previous sections (4.5.2—4.5.5), we have considered a number local changes to CNN architectures. Under our terminology, a “local” change is one where modifying layer Li only affects the dimensions of layer Li and, in some cases, layer Li+1 . The dimensions of other layers (Li+2 , ..., Ln ) are unaffected by a local change to layer Li . There is a common pattern among all of the local changes that we have considered: the changes all involve modifying the dimensions of one layer’s filters or channels. There is a reason for this: the number of filters in layer Li defines the number of input channels in layer Li+1 , but the number of filters in Li has no bearing on the number of input channels to layers Li+2 , ..., Ln . In contrast to the local changes that we have discussed so far, in the next section we will discuss 71 global changes where modifying the dimensions of Li has an effect on the dimensions of all layers after Li . 4.6 Global changes to CNN architectures In the previous section, we saw that changing various dimensions of filters in layer Li led to a change in computational cost only in layer Li and in some cases layer Li+1 . However, changing the dimensions of the activations produced by layer Li has an impact on the computational cost in all downstream layers. These are what we call global changes to CNN architectures. In the following, we will discuss two examples of global changes to CNNs. 4.6.1 Adding or removing a downsampling layer early in a CNN As we discussed in Section 4.2.2, the settings of strides in convolution or pooling layer Li affect the dimensions of the output activations produced by Li . We now work an example to provide further intuition on this phenomenon. Let us begin with the NiN CNN (Figure 4.1). In the original NiN CNN architecture (Table 4.2), notice that pool3 has its stride set to 2. Consider the case where we modify the CNN architecture by removing the pool3 max-pooling layer. How does the quantity of computation change due to this modification? First, it’s important to note that the computational overhead of a pooling layer is roughly equivalent to a convolution layer that has only one filter — this is quite a low amount of overhead compared to our typical convolution layers with tens or hundreds of filters. So, we will be focusing on how the quantity of computation in the convolutional layers is impacted by the removal of the pool3 layer. 4.6.1.1 Impact on inference When we remove the pool3 layer from NiN, how does the quantity of computation during inference change? In Table 4.7, we show the impact of this modification to NiN architecture on the quantity of computation. When we remove the pool3 layer, the height and width of the input data to conv4 decreases by 2x in height and 2x in width compared to the original network described Table 4.2. This 2x increase in the height and width of activations propagates over subsequent layers, so conv4, conv5, conv6, and beyond each have 4x more computation, for a total of 3.8x less computation compared to the original CNN architecture. 4.6.1.2 Impact on training When we remove the pool3 layer from NiN, how does the time required to train a model (for a fixed number of epochs) change? In Table 4.7, we observe that this change leads to no change in model size (therefore no change in communication) and 3.8x more computation. While the 72 computation has also increased by 3.8x. Therefore, computation has increased by 3.8x, the ratio of communication ∼ we can scale modified CNN’s training problem to 3.8x more processors and nearly regain the time-to-solution that is achievable with the original NiN model. Table 4.7. (Corresponds with Section 4.6.1.) NiN architecture with the pool3 layer removed. The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 3 227x227 1x 0 0 conv1 11x11 4 96 55x55 1x 1x 1x conv2 1x1 1 96 55x55 1x 1x 1x conv3 1x1 1 96 55x55 1x 1x 1x Removed pool3 conv4 5x5 1 256 55x55 4.1x 1x 4.1x conv5 1x1 1 256 55x55 4.1x 1x 4.1x conv6 1x1 1 256 55x55 4.1x 1x 4.1x pool6 3x3 2 256 27x27 4x 1x 4.3x conv7 3x3 1 384 27x27 4.3x 1x 4.3x conv8 1x1 1 384 27x27 4.3x 1x 4.3x conv9 1x1 1 384 27x27 4.3x 1x 4.3x pool9 3x3 2 384 13x13 4.7x 1x 4x conv10 3x3 1 1024 13x13 4.7x 1x 4.7x conv11 1x1 1 1024 13x13 4.7x 1x 4.7x conv12 1x1 1 1000 13x13 4.7x 1x 4.7x pool12 6x6 1 1000 1x1 4x 1x 4x 2.6x 1x 3.8x (15.3GB) (30.4MB) (8.65TF) total 73 4.6.2 Changing the height and width of the input data In every computer vision system, a design choice is what resolution of images should be used as input? This design choice can be implemented in two ways: • The choice of camera resolution, and/or • Optionally, the choice of how to downsample or upsample the images. In CNN-based systems, the conventional wisdom is that higher resolution imagery tends to allow the CNN to deliver higher accuracy [157]. Further, when applying CNNs to extremely complex scenes, high resolution imagery can be especially critical to achieving high accuracy. Now, how does the resolution (height and width) of input images affect the quantity of computation in a CNN. Let us now apply NiN [95] to 4x larger input images. That is, we increase the height and width each by a factor of 2, so the number of input pixels increases by 4x. 4.6.2.1 Impact on inference When double the height and width of the images (from 227x227 to 454x454) that are used as input to NiN, how does the quantity of computation during inference change? In Table 4.8, we show the impact of this modification to NiN architecture on the quantity of computation. In all layers, the height and width of the input data doubles, for a total of approximately 4x more input data to each layer. Or, more precisely, when we follow Equation 4.2 to determine the output activation dimensions for each layer, rounding leads to some of the activations being slightly more than 4x larger than the original version. In each convolution layer, this leads to each convolution filter being applied to roughly 4.2x more (x,y) locations. Overall, this leads to 4.3x more computation when running NiN with 454x454 input images instead of 227x227 input images. Finally, similar to the example in Section 4.5.4, it is due to padding effects that some layers in Table 4.8 have slightly more than 4x more computation than the original NiN architecture in Table 4.2. 4.6.2.2 Impact on training When double the height and width of the images (from 227x227 to 454x454) that are used as input to NiN, how does the time required to train a model (for a fixed number of epochs) change? In Table 4.7, we observe that this change leads to no change in model size (therefore no change in communication) and 4.3x more computation. While the computation has increased by 4.3x, computation the ratio of communication has also increased by 4.3x. Therefore, we can scale the modified CNN’s training problem to ∼4.3x more processors and nearly regain the time-to-solution that is achievable with the original NiN model. 74 Table 4.8. (Corresponds with Section 4.6.2.) NiN architecture with 4x larger input data resolution (227x227 → 454x454). The ∆s represent the change compared to the unmodified version of NiN in Table 4.2. Hand-selected hyperparameters layer filter stride HxW Derived dimensions and quantities (batch=1024) output output ∆ Qty of ∆ Qty of ∆ Qty of channels HxW output params computation data - - 3 454x454 4x 0 0 conv1 11x11 4 96 111x111 4.1x 1x 4.1x conv2 1x1 1 96 111x111 4.1x 1x 4.1x conv3 1x1 1 96 111x111 4.1x 1x 4.1x pool3 3x3 2 96 55x55 4.1x 1x 4.2x conv4 5x5 1 256 55x55 4.1x 1x 4.2x conv5 1x1 1 256 55x55 4.1x 1x 4.2x conv6 1x1 1 256 55x55 4.1x 1x 4.2x pool6 3x3 2 256 27x27 4.3x 1x 4.3x conv7 3x3 1 384 27x27 4.3x 1x 4.3x conv8 1x1 1 384 27x27 4.3x 1x 4.3x conv9 1x1 1 384 27x27 4.3x 1x 4.3x pool9 3x3 2 384 13x13 4.7x 1x 4.7x conv10 3x3 1 1024 13x13 4.7x 1x 4.7x conv11 1x1 1 1024 13x13 4.7x 1x 4.7x conv12 1x1 1 1000 13x13 4.7x 1x 4.7x pool12 13x13 1 1000 1x1 4.7x 1x 4.7x 4.2x 1x 4.3x (24.5GB) (30.4MB) (9.67TF) total 4.6.3 Recap of global changes to CNN architectures In the previous two examples (Sections 4.6.1 and 4.6.2), we modified the height and width of the input data to the first layer Li=1 or modified the height and width of activations produced by layer Li≥1 . We observed that these modifications result not only in changes to the dimensions and quantity of computation in layer Li and layer Li+1 , but also to changes in all downstream layers (Li+1 , ...Ln ). We refer to changes where modifying Li results in changes to the dimensions to all downstream layers as global changes. We can concisely restate our findings as: • Our examples of local changes involved modifying the dimensions of channels or filters in layer Li . Local changes affect the dimensions of layer Li and, in some cases, Li+1 . 75 • Our examples of global changes involve modifying the dimensions of input data or activations in layer Li . Global changes affect the dimensions of layers Li , ..., Ln . 4.7 Intuition on the size of the design space of CNNs In Sections 4.5 and 4.6, we described seven different CNN architectures. How many more CNN architectures are there? We now work out a concrete example on the number of unique CNN architectures that exist in a particular sub-space of the CNN design space. In the ImageNet 2012 and 2013 image-classification competitions, the winning approaches consisted of CNNs that had fewer than 10 layers. In ImageNet 2014 competition, the winners were the VGG-19 [77] 19-layer CNN model and the GoogLeNet [79] CNN model, which has over 20 layers. In their paper on VGG-19, Simonyan and Zisserman not only presented the VGG-19 architecture, but they also explored five variants of the VGG-19 architecture (for a total of six different architectures). For the rest of this section, we use the CNN architectural space defined by Simonyan and Zisserman as the basis for a discussion on how large just a narrow corner of the overall CNN architectural space is. The six CNN architectures presented by Simonyan and Zisserman have up to 19 layers, which we will enumerate as L1 , ..., Ln [77]. In all of these models, layers Ln−2 , Ln−1 , andLn share the same dimensions. The remaining convolution layers L1 , ..., Ln−3 each have one of the following five dimensional configurations: 1. 64 filters of size 3x3xnumF ilti−1 2. 128 filters of size 3x3xnumF ilti−1 3. 256 filters of size 3x3xnumF ilti−1 4. 512 filters of size 3x3xnumF ilti−1 5. 0 filters (i.e. “NULL layer”). We use this in our notation for VGG models that have fewer than 19 layers. So, how many unique CNNs can we create that have up to 16 convolution layers, each with one of the aforementioned dimensions?12 Mathematically, we have 16 layers (some which may be NULL), and each layer can be one of five different dimensions. This works out to 516 = 30 billion unique CNN architectures! In this section we have shown that, even when given a narrow range of options for the type and dimensions for CNN layers, there are billions of unique combinations of these layers. However, the truth is that this section has covered only a narrow corner of the CNN design space. As evidence that the design space is much larger: to our knowledge, there are no known limits or upper-bounds on several dimensions of CNNs, such as (a) the size of the input data, (b) the number of layers, and (c) the number of new types of layers that have yet to be invented. Considering all of these factors, we believe that, for most practical purposes, the design space of CNNs can be considered 12 Or, to be more precise: we are viewing the VGG design space as “up to 16 layers, plus three layers Ln−2 , Ln−1 , Ln that each have a fixed size.” 76 to be an infinitely large design space. In Chapter 5, we will present a strategy for choosing specific regions of the design space that are worthwhile to explore. 4.8 The design space of techniques for training CNNs Given a particular problem (e.g. in the domain of text, audio, or vision) and the ability to obtain appropriate labeled data to train models to solve the problem, a CNN architect must carefully consider and explore a number of design choices (DC’s) including the following: • DC1. The design of the CNN architecture. (Covered in Sections 4.2—4.7.) • DC2. The approach for initializing the CNN architecture’s model parameters prior to training. (Covered in Section 4.8.1.) • DC3. The optimization methodology or solver approach used to train the model. (Covered in Section 4.8.2.) We now present a few observations on the implications of these design choices, as well as how these design choices have been covered in the literature so far. CNN architecture (DC1). The dimensions and design principles of CNN architectures are discussed in relatively little detail in the literature. Out of the thousands of computer vision and CNN papers that have appeared in the last few years, relatively few papers propose a substantially new CNN architecture, and it is even more rare to find papers that propose and evaluate many new CNN architectures. Meanwhile, the choice of CNN architecture directly effects the quantity of computation and the speed that can be achieved during both training and inference. The specific ways in which the CNN architecture impacts the computational footprint is not widely discussed in the literature. Model parameter initialization (DC2) and Solver approach (DC3). Model parameter initialization and solver approaches are widely discussed in the literature. Optimization is a field with a long history and a wide following, and many optimization experts have recently refocused their careers on optimization methods for neural networks. The choice of how to initialize model parameters and the choice of solver approach impacts the number of epochs (i.e. passes through the training set) required to achieve a given level of accuracy.13 Thus, DC2 and DC3 impact the quantity of computation and the time required to train CNN models. However, DC2 and DC3 do not impact the quantity of computation or achievable speed during inference. We summarize the effects of DC1, DC2, and DC3 in Table 4.9. Given that the CNN architecture (DC1) has limited coverage in the literature, and that DC1 has the broadest impact on the CNN’s computational requirements, we have focused our discussions in this chapter on DC1. However, for completeness we now summarize the current literature on model parameter initialization (DC2) and solver approaches (DC3), and we direct the interested reader to resources for further reading. 13 Further, DC2 and DC3 can influence the maximum accuracy that can be achieved when training a specific CNN architecture. 77 Table 4.9. A CNN architect is responsible for considering and exploring these design choices. Design choice Coverage in the literature Impact on quantity of computation DC1: CNN architecture Modest coverage in the Impacts quantity of computation during training literature and inference DC2: Model parameter Heavy coverage in the Impacts quantity of computation during training initialization literature only DC3: Solver approach Heavy coverage in the Impacts quantity of computation during training literature only 4.8.1 Model parameter initialization Prior to applying a solver such as Stochastic Gradient Descent to optimize a CNN’s model parameters, the model parameters must first be initialized. The choice of how to initialize the parameters (i.e. what the initial floating-point parameter values should be) is left up to the CNN architect. That said, the research community has developed a number of widely-used approaches for initializing CNN parameters. Gaussian parameter initialization. A straightforward and widely-used parameterinitialization method is: selecting each parameter’s value from a Gaussian distribution. This approach allows the CNN architect to select a standard deviation for the Gaussian distribution. Optionally, a different standard deviation can be selected for each layer in a CNN. Xavier parameter initialization. The “Xavier” parameter initialization method, developed by Xavier Glorot et al. [113], works as follows. For a given layer, the Xavier method defines the “fan-in” as the number of input channels to the layer. To initialize the parameters in the layer, the Xavier method samples values from a uniform distribution, and the values are normalized based on the fan-in. Xavier normalizes the normal distribution inversely to the fan-in — that is, the more input channels in the layer, the smaller a typical initial parameter value will be. MSRA parameter initialization. Kaiming He et al. of Microsoft Research Asia (MSRA) drew inspiration from Xavier parameter initialization to develop a new parameter initialization method. While the Xavier parameter initialization only looks at the fan-in, the MSRA method [138] takes account of fan-in (number of input channels) as well as fan-out (number of filters in the present layer) to normalize the random distribution from which initial parameter values are sampled. In addition to the choice of normalization, an other difference between MSRA and Xavier is that MSRA uses a Gaussian distribution rather than a normal distribution. Initialization by transfer learning. It is also possible to initialize a CNN’s parameters by using the parameter values from a previous CNN training exercise. This approach, as we described in Section 2.2, is called transfer learning. The parameters for a CNN can be transfered from a supervised (e.g. [22]) or unsupervised (e.g. [158]) learning approach. However, before you can do transfer learning, somebody has to train a CNN from scratch (i.e. from random parameter values)! Reminder: Parameters vs. Hyperparameters. We have discussed approaches for initializing parameters in a CNN. The parameters are the values that are automatically learned through a training proceedure. However hyperparameters (e.g. the number of layers in a CNN) are typically set by a human who is in charge of architecting the CNN. 78 4.8.2 Solver approaches Once we have selected a CNN architecture and initialized its parameters, the next step is to train the CNN’s parameters so it can perform tasks such as identifying objects in images. Developing optimization approaches, or solvers, to train CNN parameters is an extremely active area of research. We now present some of the current approaches to training CNNs. In the present literature, Stochastic Gradient Descent (SGD) is the standard optimization methodology for training CNNs. SGD, as typically applied to CNNs, operates by taking a subset (a.k.a. batch) of the training data, attempting to classify it, and computing gradients that summarize the mistakes that were made when attempting to classify the data. Then backprogation is applied to train each layer to avoid this mistake next time it sees a similar data sample. With the goal of converging to higher accuracy, or converging to a given accuracy level with less computation, a number of SGD variants have been developed. We summarize some of these SGD-based methods as follows. • SGD with momentum aims to accelerate the learning process when faced with noisy gradients [146]. • SGD with Nesterov momentum makes some further tweaks to the gradient update function with the goal of requiring less computation to converge [147]. • Adagrad is an SGD-like optimization method that automatically selects a unique learning rate for each parameter in the neural network [159]. • RMSProp is an evolution of Adagrad that uses a moving average with exponential weighting [160]. For further reading, Chapter 8 of the Deep Learning textbook by Goodfellow et al. [145] explains the mathematical details of several popular forms of SGD. 4.9 Conclusions CNN architects are responsible for several design decisions, including the choice of CNN architecture, the choice of how to initialize the model parameters, and the choice of the solver approach to use for training the model. While parameter initialization and solver approaches have been widely covered in the literature, we have yet to find a useful guide on designing CNN architectures. To remedy this, we have focused this chapter on providing intuition about the dimensions of CNN layers and how these dimensions impact the characteristics of an end-to-end CNN during training and inference. We summarize this intuition in a few key lessons: • The number of channels in layer Li is dictated by the number of filters in the previous layer Li−1 . For the first layer, L1 , the number of channels is dictated by the input data (e.g. 3 channels in RGB images). (Section 4.2) • The quantity of computation, quantity of parameters, and quantity of activations in a layer can be calculated easily with closed-form mathematics. (Section 4.3) 79 • Modifications to the number of channels, number of filters, or spatial resolution of filters yield local changes to a CNN’s dimensions. A local change to layer Li only impacts the dimension of layer Li and in some cases Li+1 . (Section 4.5) • Modifications to the spatial resolution of input data or activations yield global changes to a CNN’s dimensions. A global change to layer Li impacts all following layers (Li+1 , ..., Ln ). (Section 4.6) • CNNs comprise an enormous design space. Considering just a narrow corner of the CNN design space, we discovered that approximately 30 billion CNNs can be constructed. (Section 4.7) • There are a number of standard mechanisms for initializing the model parameters of a CNN and training a CNN. (Section 4.8) 80 Chapter 5 Exploring the design space of DNN architectures 5.1 Introduction and motivation Much of the recent research on deep convolutional neural networks (CNNs) has focused on increasing accuracy on computer vision datasets. For a given accuracy level, there typically exist multiple CNN architectures that achieve that accuracy level. Given equivalent accuracy, a CNN architecture with fewer parameters has several advantages: • More efficient distributed training. Communication among servers is the limiting factor to the scalability of distributed CNN training. For distributed data-parallel training, communication overhead is directly proportional to the number of parameters in the model [17]. In short, small models train faster due to requiring less communication. • Less overhead when exporting new models to clients. For autonomous driving, companies such as Tesla periodically copy new models from their servers to customers’ cars. This practice is often referred to as an over-the-air update. Consumer Reports has found that the safety of Tesla’s Autopilot semi-autonomous driving functionality has incrementally improved with recent over-the-air updates [161]. However, over-the-air updates of today’s typical CNN/DNN models can require large data transfers. With AlexNet, this would require 240MB of communication from the server to the car. Smaller models require less communication, making frequent updates more feasible. • Feasible FPGA and embedded deployment. FPGAs often have less than 10MB1 of onchip memory and no off-chip memory or storage. For inference, a sufficiently small model could be stored directly on the FPGA instead of being bottlenecked by memory bandwidth [94], while video frames stream through the FPGA in real time. Further, when deploying CNNs on 1 For example, the Xilinx Vertex-7 FPGA has a maximum of 8.5 MBytes (i.e. 68 Mbits) of on-chip memory and does not provide off-chip memory. 81 Application-Specific Integrated Circuits (ASICs), a sufficiently small model could be stored directly on-chip, and smaller models may enable the ASIC to fit on a smaller die. As you can see, there are several advantages of smaller CNN architectures. With this in mind, we focus directly on the problem of identifying a CNN architecture with fewer parameters but equivalent accuracy compared to a well-known model. We have identified such an architecture, which we call SqueezeNet. In addition, we present our attempt at a more disciplined approach to searching the design space for novel CNN architectures. The rest of the chapter is organized as follows. In Section 5.2 we review the related work. Then, in Sections 5.3 and 5.4 we describe and evaluate the SqueezeNet architecture. After that, we turn our attention to understanding how CNN architectural design choices impact model size and accuracy. We gain this understanding by exploring the design space of SqueezeNet-like architectures. In Section 5.5, we do design space exploration on the CNN microarchitecture, which we define as the organization and dimensionality of individual layers and modules. In Section 5.6, we do design space exploration on the CNN macroarchitecture, which we define as high-level organization of layers in a CNN. Finally, we conclude in Section 5.7. In short, Sections 5.3 and 5.4 are useful for CNN researchers as well as practitioners who simply want to apply SqueezeNet to a new application. The remaining sections are aimed at advanced researchers who intend to design their own CNN architectures. 5.2 5.2.1 Related work Model Compression The overarching goal of our work is to identify a model that has very few parameters while preserving accuracy. To address this problem, a sensible approach is to take an existing CNN model and compress it in a lossy fashion. In fact, a research community has emerged around the topic of model compression, and several approaches have been reported. A fairly straightforward approach by Denton et al. is to apply singular value decomposition (SVD) to a pretrained CNN model [162]. Han et al. developed Network Pruning, which begins with a pretrained model, then replaces parameters that are below a certain threshold with zeros to form a sparse matrix, and finally performs a few iterations of training on the sparse CNN [163]. Recently, Han et al. extended their work by combining Network Pruning with quantization (to 8 bits or less) and Huffman encoding to create an approach called Deep Compression [164], and further designed a hardware accelerator called EIE [165] that operates directly on the compressed model, achieving substantial speedups and energy savings. 5.2.2 CNN Microarchitecture Convolutions have been used in artificial neural networks for at least 25 years; LeCun et al. helped to popularize CNNs for digit recognition applications in the late 1980s [166]. In neural networks, convolution filters are typically 3D, with height, width, and channels as the key dimensions. When applied to images, CNN filters typically have 3 channels in their first layer (i.e. RGB), 82 and in each subsequent layer Li the filters have the same number of channels as Li−1 has filters. The early work by LeCun et al. [166] uses 5x5xChannels2 filters, and the recent VGG [77] architectures extensively use 3x3 filters. Models such as Network-in-Network [95] and the GoogLeNet family of architectures [79, 116, 167, 168] use 1x1 filters in some layers. With the trend of designing very deep CNNs, it becomes cumbersome to manually select filter dimensions for each layer. To address this, various higher level building blocks, or modules, comprised of multiple convolution layers with a specific fixed organization have been proposed. For example, the GoogLeNet papers propose Inception modules, which are comprised of a number of different dimensionalities of filters, usually including 1x1 and 3x3, plus sometimes 5x5 [79] and sometimes 1x3 and 3x1 [167]. Many such modules are then combined, perhaps with additional ad-hoc layers, to form a complete network. We use the term CNN microarchitecture to refer to the particular organization and dimensions of the individual modules. 5.2.3 CNN Macroarchitecture While the CNN microarchitecture refers to individual layers and modules, we define the CNN macroarchitecture as the system-level organization of multiple modules into an end-to-end CNN architecture. Perhaps the mostly widely studied CNN macroarchitecture topic in the recent literature is the impact of depth (i.e. number of layers) in networks. Simoyan and Zisserman proposed the VGG [77] family of CNNs with 12 to 19 layers and reported that deeper networks produce higher accuracy on the ImageNet-1k dataset [21]. K. He et al. proposed deeper CNNs with up to 30 layers that deliver even higher ImageNet accuracy [138]. The choice of connections across multiple layers or modules is an emerging area of CNN macroarchitectural research. Residual Networks (ResNet) [15] and Highway Networks [129] each propose the use of connections that skip over multiple layers, for example additively connecting the activations from layer 3 to the activations from layer 6. We refer to these connections as bypass connections. The authors of ResNet provide an A/B comparison of a 34-layer CNN with and without bypass connections; adding bypass connections delivers a 2 percentage-point improvement on Top-5 ImageNet accuracy. 5.2.4 Neural Network Design Space Exploration Neural networks (including deep and convolutional NNs) have a large design space, with numerous options for microarchitectures, macroarchitectures, solvers, and other hyperparameters. It seems natural that the community would want to gain intuition about how these factors impact a NN’s accuracy (i.e. the shape of the design space). Much of the work on design space exploration (DSE) of NNs has focused on developing automated approaches for finding NN architectures that deliver higher accuracy. These automated DSE approaches include Bayesian optimization [169], simulated annealing [170], randomized search [171], and genetic algorithms [172]. To their credit, each of these papers provides a case in which the proposed DSE approach produces a NN architecture that achieves higher accuracy compared to a representative baseline. However, these papers 2 From now on, we will simply abbreviate HxWxChannels to HxW. 83 make no attempt to provide intuition about the shape of the NN design space. Later in this chapter, we eschew automated approaches — instead, we refactor CNNs in such a way that we can do principled A/B comparisons to investigate how CNN architectural decisions influence model size and accuracy. In the following sections, we first propose and evaluate the very small SqueezeNet architecture. Next, we show model compression can be applied to make SqueezeNet even smaller. Then, we explore the impact of design choices in microarchitecture and macroarchitecture for SqueezeNetlike CNN architectures. 5.3 SqueezeNet: preserving accuracy with few parameters In this section, we begin by outlining our design strategies for CNN architectures with few parameters. Then, we introduce the Fire module, our new building block out of which to build CNN architectures. Finally, we use our design strategies to construct SqueezeNet, which is comprised mainly of Fire modules. 5.3.1 Architectural Design Strategies Our overarching objective in this chapter is to identify CNN architectures that have few parameters while maintaining competitive accuracy. To achieve this, we employ three main strategies when designing CNN architectures: Strategy 1. Replace 3x3 filters with 1x1 filters. Given a budget of a certain number of convolution filters, we will choose to make the majority of these filters 1x1, since a 1x1 filter has 9X fewer parameters than a 3x3 filter. Strategy 2. Decrease the number of input channels to 3x3 filters. Consider a convolution layer that is comprised entirely of 3x3 filters. As we learned in Section 4.3.1, the total quantity of parameters in this layer is (number of input channels) * (number of filters) * (3*3). So, to maintain a small total number of parameters in a CNN, it is important not only to decrease the number of 3x3 filters (see Strategy 1 above), but also to decrease the number of input channels to the 3x3 filters. We decrease the number of input channels to 3x3 filters using squeeze layers, which we describe in the next section. Strategy 3. Downsample late in the network so that convolution layers have large activation maps. In a convolutional network, each convolution layer produces an output activation map with a spatial resolution that is at least 1x1 and often much larger than 1x1. The height and width of these activation maps are controlled by: (1) the size of the input data (e.g. 256x256 images) and (2) the choice of layers in which to downsample in the CNN architecture. Most commonly, downsampling is engineered into CNN architectures by setting the (stride > 1) in some of the convolution or pooling layers (e.g. [79, 77, 22]). If early3 layers in the network have large 3 In our terminology, an “early” layer is close to the input data. 84 eze8 sq u e 1x18convolu.on8filters8 ReLU8 n expa d8 1x18and83x38convolu.on8filters8 ReLU8 Figure 5.1. Microarchitectural view: Organization of convolution filters in the Fire module. In this example, s1x1 = 3, e1x1 = 4, and e3x3 = 4. We illustrate the convolution filters but not the activations. strides, then most layers will have small activation maps. Conversely, if most layers in the network have a stride of 1, and the strides greater than 1 are concentrated toward the end4 of the network, then many layers in the network will have large activation maps. Our intuition is that large activation maps (due to delayed downsampling) can lead to higher classification accuracy, with all else held equal. Indeed, K. He and H. Sun applied delayed downsampling to four different CNN architectures, and in each case delayed downsampling led to higher classification accuracy [78]. Strategies 1 and 2 are about judiciously decreasing the quantity of parameters in a CNN while attempting to preserve accuracy. Strategy 3 is about maximizing accuracy on a limited budget of parameters. Next, we describe the Fire module, which is our building block for CNN architectures that enables us to successfully employ Strategies 1, 2, and 3. 5.3.2 The Fire Module We define the Fire module as follows. A Fire module is comprised of a squeeze convolution layer (which has only 1x1 filters), feeding into an expand layer that has a mix of 1x1 and 3x3 convolution filters; we illustrate this in Figure 5.1. The liberal use of 1x1 filters in Fire modules is an application of Strategy 1 from Section 5.3.1. We expose three tunable dimensions (hyperparameters) in a Fire module: s1x1 , e1x1 , and e3x3 . In a Fire module, s1x1 is the number of filters in the squeeze layer (all 1x1), e1x1 is the number of 1x1 filters in the expand layer, and e3x3 is the number of 3x3 filters in the expand layer. When we use Fire modules we set s1x1 to be less than (e1x1 + e3x3 ), so the squeeze layer helps to limit the number of input channels to the 3x3 filters, as per Strategy 2 from Section 5.3.1. 4 In our terminology, the “end” of the network is the classifier. 85 conv1 conv1 conv1 96 96 96 maxpool/2 maxpool/2 maxpool/2 fire2 fire2 fire2 96 128 128 fire3 fire3 fire3 128 128 128 fire4 fire4 fire4 256 256 maxpool/2 maxpool/2 fire5 fire5 fire5 256 fire6 256 fire6 384 fire6 384 fire7 fire7 384 fire8 384 fire8 512 fire8 512 maxpool/2 maxpool/2 fire9 fire9 fire9 512 conv10 softmax 512 conv10 1000 global avgpool conv10 1000 "labrador retriever dog" conv1x1 512 maxpool/2 512 conv1x1 384 fire7 384 conv1x1 256 maxpool/2 256 conv1x1 128 1000 global avgpool global avgpool softmax softmax Figure 5.2. Macroarchitectural view of our SqueezeNet architecture. Left: SqueezeNet (Section 5.3.3); Middle: SqueezeNet with simple bypass (Section 5.6); Right: SqueezeNet with complex bypass (Section 5.6). 5.3.3 The SqueezeNet architecture We now describe the SqueezeNet CNN architecture. We illustrate in Figure 5.2 that SqueezeNet begins with a standalone convolution layer (conv1), followed by 8 Fire modules (fire2-9), ending with a final conv layer (conv10). We gradually increase the number of filters per fire module from the beginning to the end of the network. SqueezeNet performs max-pooling with a stride of 2 after layers conv1, fire4, fire8, and conv10; these relatively late placements of pooling are per Strategy 3 from Section 5.3.1. We present the full SqueezeNet architecture in Table 5.1. 5.3.3.1 Other SqueezeNet details For brevity, we have omitted a number of details and design choices about SqueezeNet from Table 5.1 and Figure 5.2. We provide these design choices in the following. The intuition behind these choices may be found in the papers cited below. • So that the output activations from 1x1 and 3x3 filters have the same height and width, we add a 1-pixel border of zero-padding in the input data to 3x3 filters of expand modules. • ReLU [136] is applied to activations from squeeze and expand layers. • Dropout [144] with a ratio of 50% is applied after the fire9 module. 86 • In Table 5.1, note the lack of fully-connected layers in SqueezeNet; this design choice was inspired by the NiN [95] architecture. • When training SqueezeNet, we begin with a learning rate of 0.04, and we linearly decrease the learning rate throughout training, as described in [173]. For details on the training protocol (e.g. batch size, learning rate, parameter initialization), please refer to our Caffe [106] configuration files located here: https://github.com/DeepScale/SqueezeNet. • The Caffe framework does not natively support a convolution layer that contains multiple filter resolutions (e.g. 1x1 and 3x3). To get around this, we implement our expand layer with two separate convolution layers: a layer with 1x1 filters, and a layer with 3x3 filters. Then, we concatenate the outputs of these layers together in the channel dimension. This is numerically equivalent to implementing one layer that contains both 1x1 and 3x3 filters. We released the SqueezeNet configuration files in the format defined by the Caffe CNN framework. However, in addition to Caffe, several other CNN frameworks have emerged, including MXNet [174], Chainer [175], Keras [176], and Torch [177]. Each of these has its own native format for representing a CNN architecture. That said, most of these libraries use the same underlying computational back-ends such as cuDNN [25] and MKL-DNN [178]. The research community has ported the SqueezeNet CNN architecture for compatibility with a number of other CNN software frameworks: • MXNet [174] port of SqueezeNet: [179] • Chainer [175] port of SqueezeNet: [180] • Keras [176] port of SqueezeNet: [181] • Torch [177] port of SqueezeNet’s Fire Modules: [182]. 5.4 Evaluation of SqueezeNet We now turn our attention to evaluating SqueezeNet. In each of the CNN model compression papers reviewed in Section 5.2.1, the goal was to compress an AlexNet [22] model that was trained to classify images using the ImageNet [21] (ILSVRC 2012) dataset. Therefore, we use AlexNet5 and the associated model compression results as a basis for comparison when evaluating SqueezeNet. In Table 5.2, we review SqueezeNet in the context of recent model compression results. The SVD-based approach is able to compress a pretrained AlexNet model by a factor of 5X, while diminishing top-1 accuracy to 56.0% [162]. Network Pruning achieves a 9X reduction in model size while maintaining the baseline of 57.2% top-1 and 80.3% top-5 accuracy on ImageNet [163]. Deep Compression achieves a 35x reduction in model size while still maintaining the baseline accuracy level [164]. Now, with SqueezeNet, we achieve a 50X reduction in model size compared to AlexNet, while meeting or exceeding the top-1 and top-5 accuracy of AlexNet. We summarize all of the aforementioned results in Table 5.2. It appears that we have surpassed the state-of-the-art results from the model compression community: even when using uncompressed 32-bit values to represent the model, SqueezeNet has a 5 Our baseline is bvlc alexnet from the Caffe codebase [106]. 87 Table 5.1. SqueezeNet architectural dimensions. (The formatting of this table was inspired by the Inception2 paper [116].) layer name/type output size input image 224x224x3 conv1 filter size / stride (if not a fire layer) depth s1x1 e1x1 e3x3 s1x1 e1x1 e3x3 # bits (#1x1 (#1x1 (#3x3 sparsity sparsity sparsity squeeze) expand) expand) - - 6bit 14,208 14,208 111x111x96 7x7/2 (x96) 1 maxpool1 55x55x96 3x3/2 0 fire2 55x55x128 2 16 64 64 100% 100% 33% 6bit 11,920 5,746 fire3 55x55x128 2 16 64 64 100% 100% 33% 6bit 12,432 6,258 fire4 55x55x256 2 32 128 128 100% 100% 33% 6bit 45,344 20,646 maxpool4 27x27x256 fire5 27x27x256 2 32 128 128 100% 100% 33% 6bit 49,440 24,742 fire6 27x27x384 2 48 192 192 100% 50% 33% 6bit 104,880 44,700 fire7 27x27x384 2 48 192 192 50% 100% 33% 6bit 111,024 46,236 fire8 27x27x512 2 64 256 256 100% 50% 33% 6bit 188,992 77,581 maxpool8 13x12x512 64 256 256 50% 100% 30% 6bit 197,184 77,581 6bit 513,000 103,400 1,248,424 (total) 421,098 (total) 3x3/2 3x3/2 0 0 fire9 13x13x512 2 conv10 13x13x1000 1x1/1 (x1000) 1 avgpool10 1x1x1000 13x13/1 100% (7x7) #parameter #parameter before after pruning pruning 20% (3x3) 0 1.4× smaller model size than the best efforts from the model compression community while maintaining or exceeding the baseline accuracy. Until now, an open question has been: are small models amenable to compression, or do small models “need” all of the representational power afforded by dense floating-point values? To find out, we applied Deep Compression [164] to SqueezeNet, using 33% sparsity6 and 8-bit quantization. This yields a 0.66 MB model (363× smaller than 32-bit AlexNet) with equivalent accuracy to AlexNet. Further, applying Deep Compression with 33% sparsity and 6-bit quantization on SqueezeNet, we produce a 0.47MB model (510× smaller than 32-bit AlexNet) with equivalent accuracy. Our small model is indeed amenable to compression. In addition, these results demonstrate that Deep Compression [164] not only works well on CNN architectures with many parameters (e.g. AlexNet and VGG), but it is also able to compress the already compact, fully convolutional SqueezeNet architecture. Using 6-bit quantization, Deep Compression compressed SqueezeNet by 10× while preserving the baseline accuracy. In summary: by combining CNN architectural innovation (SqueezeNet) with state-of-the-art compression techniques (Deep Compression), we achieved a 510× reduction in model size with no decrease in accuracy compared to the baseline. Finally, note that Deep Compression [163] uses a codebook as part of its scheme for quantizing CNN parameters to 6- or 8-bits of precision. Therefore, on most commodity processors, it is not 32 trivial to achieve a speedup of 32 8 = 4x with 8-bit quantization or 6 = 5.3x with 6-bit quantization using the scheme developed in Deep Compression. However, Han et al. developed custom hardware 6 Note that, due to the storage overhead of storing sparse matrix indices, 33% sparsity leads to somewhat less than a 3× decrease in model size. 88 Table 5.2. Comparing SqueezeNet to model compression approaches. By model size, we mean the number of bytes required to store all of the parameters in the trained model. CNN Compression Data Original → Reduction in Top-1 Top-5 architecture Approach Type Compressed Model Size ImageNet ImageNet Model Size vs. AlexNet Accuracy Accuracy 32 bit 240MB 1x 57.2% 80.3% AlexNet None (baseline) AlexNet SVD [162] 32 bit 240MB → 48MB 5x 56.0% 79.4% AlexNet Network 32 bit 240MB → 27MB 9x 57.2% 80.3% 5-8 bit 240MB → 6.9MB 35x 57.2% 80.3% None 32 bit 4.8MB 50x 57.5% 80.3% SqueezeNet Deep 8 bit 4.8MB → 0.66MB 363x 57.5% 80.3% (ours) Compression SqueezeNet Deep 6 bit 4.8MB → 0.47MB 510x 57.5% 80.3% (ours) Compression Pruning [163] AlexNet Deep Compression [164] SqueezeNet (ours) — the Efficient Inference Engine (EIE) — that can compute codebook-quantized CNNs more efficiently [165]. In addition, in the months since we released SqueezeNet, P. Gysel developed a strategy called Ristretto for linearly quantizing SqueezeNet to 8 bits [183]. Specifically, Ristretto does computation in 8 bits, and it stores parameters and activations in 8-bit data types. Using the Ristretto strategy for 8-bit computation in SqueezeNet inference, Gysel observed less than a 1 percentage-point drop in accuracy when using 8-bit instead of 32-bit data types.7 5.5 CNN Microarchitecture design space exploration So far in this chapter, we have proposed architectural design strategies for small models, followed these principles to create SqueezeNet, and discovered that SqueezeNet is 50x smaller than AlexNet with equivalent accuracy. However, SqueezeNet and other models reside in a broad and largely unexplored design space of CNN architectures. Now, in Sections 5.5 and 5.6, we explore several aspects of the design space. We divide this architectural exploration into two main topics: microarchitectural exploration (per-module layer dimensions and configurations) and macroarchitectural exploration (high-level end-to-end organization of modules and other layers). In this section, we design and execute experiments with the goal of providing intuition about the shape of the microarchitectural design space with respect to the design strategies that we proposed 7 Compared to Ristretto, Deep Compression enables more aggressive compression with no drop in accuracy. But, we are hopeful that future refinements of the Ristretto approach will incorporate sparsity while matching the dense floating-point model’s accuracy and enabling direct computation in the sparse quantized domain. 89 in Section 5.3.1. Note that our goal here is not to maximize accuracy in every experiment, but rather to understand the impact of CNN architectural choices on model size and accuracy. 5.5.1 CNN Microarchitecture metaparameters In SqueezeNet, each Fire module has three dimensional hyperparameters that we defined in Section 5.3.2: s1x1 , e1x1 , and e3x3 . SqueezeNet has 8 Fire modules with a total of 24 dimensional hyperparameters. To do broad sweeps of the design space of SqueezeNet-like architectures, we define the following set of higher level metaparameters that control the dimensions of all Fire modules in a CNN. We define basee as the number of expand filters in the first Fire module in a CNN. After every f req Fire modules, we increase the number of expand filters byjincrek. In other i words, for Fire module i, the number of expand filters is ei = basee + (incre ∗ f req ). In the expand layer of a Fire module, some filters are 1x1 and some are 3x3; we define ei = ei,1x1 + ei,3x3 with pct3x3 (in the range [0, 1], shared over all Fire modules) as the percentage of expand filters that are 3x3. In other words, ei,3x3 = ei ∗ pct3x3 , and ei,1x1 = ei ∗ (1 − pct3x3 ). Finally, we define the number of filters in the squeeze layer of a Fire module using a metaparameter called the squeeze ratio (SR) (again, in the range [0, 1], shared by all Fire modules): si,1x1 = SR ∗ ei (or equivalently si,1x1 = SR ∗ (ei,1x1 + ei,3x3 )). SqueezeNet (Table 5.1) is an example architecture that we generated with the aforementioned set of metaparameters. Specifically, SqueezeNet has the following metaparameters: basee = 128, incre = 128, pct3x3 = 0.5, f req = 2, and SR = 0.125. 5.5.2 Squeeze Ratio In Section 5.3.1, we proposed decreasing the number of parameters by using squeeze layers to decrease the number of input channels seen by 3x3 filters. We defined the squeeze ratio (SR) as the ratio between the number of filters in squeeze layers and the number of filters in expand layers. We now design an experiment to investigate the effect of the squeeze ratio on model size and accuracy. In these experiments, we use SqueezeNet (Figure 5.2) as a starting point. As in SqueezeNet, these experiments use the following metaparameters: basee = 128, incre = 128, pct3x3 = 0.5, and f req = 2. We train multiple models, where each model has a different squeeze ratio (SR)8 in the range [0.125, 1.0]. In Figure 5.3, we show the results of this experiment, where each point on the graph is an independent model that was trained from scratch. SqueezeNet is the SR=0.125 point in this figure. From this figure, we learn that increasing SR beyond 0.125 can further increase ImageNet top-5 accuracy from 80.3% (i.e. AlexNet-level) with a 4.8MB model to 86.0% with a 19MB model. Accuracy plateaus at 86.0% with SR=0.75 (a 19MB model), and setting SR=1.0 further increases model size without improving accuracy. 5.5.3 Trading off 1x1 and 3x3 filters In Section 5.3.1, we proposed decreasing the number of parameters in a CNN by replacing some 3x3 filters with 1x1 filters. An open question is, how important is spatial resolution in CNNs? The VGG [77] architectures have 3x3 spatial resolution in most layers’ filters; GoogLeNet [79] and 8 Note that, for a given model, all Fire layers share the same squeeze ratio. 90 SqueezeNet# 80.3%# accuracy# 4.8#MB#of# weights# 85.3%# accuracy# 86.0%# accuracy# 13#MB#of# weights# 19#MB#of# weights# Figure 5.3. Exploring the impact of the squeeze ratio (SR) on model size and ImageNet accuracy. Network-in-Network (NiN) [95] have 1x1 filters in some layers. In GoogLeNet and NiN, the authors simply propose a specific quantity of 1x1 and 3x3 filters without further analysis.9 Here, we attempt to shed light on how the proportion of 1x1 and 3x3 filters affects model size and accuracy. We use the following metaparameters in this experiment: basee = incre = 128, f req = 2, SR = 0.500, and we vary pct3x3 from 1% to 99%. In other words, each Fire module’s expand layer has a predefined number of filters partitioned between 1x1 and 3x3, and here we turn the knob on these filters from “mostly 1x1” to “mostly 3x3”. As in the previous experiment, these models have 8 Fire modules, following the same organization of layers as in Figure 5.2. We show the results of this experiment in Figure 5.4. Note that the 13MB models in Figure 5.3 and Figure 5.4 are the same architecture: SR = 0.500 and pct3x3 = 50%. We see in Figure 5.4 that the top-5 accuracy plateaus at 85.6% using 50% 3x3 filters, and further increasing the percentage of 3x3 filters leads to a larger model size but provides no improvement in accuracy on ImageNet. 9 To be clear, each filter is 1x1xChannels or 3x3xChannels, which we abbreviate to 1x1 and 3x3. 91 76.3%# accuracy# 5.7#MB#of# weights# 85.3%# accuracy# 85.3%# accuracy# 13#MB#of# weights# 21#MB#of# weights# Figure 5.4. Exploring the impact of the ratio of 3x3 filters in expand layers (pct3x3 ) on model size and ImageNet accuracy. 5.6 CNN Macroarchitecture design space exploration So far we have explored the design space at the microarchitecture level, i.e. the contents of individual modules of the CNN. Now, we explore design decisions at the macroarchitecture level concerning the high-level connections among Fire modules. Inspired by ResNet [15], we explored three different architectures: • Vanilla SqueezeNet (as per the prior sections). • SqueezeNet with simple bypass connections between some Fire modules. (Inspired by [129, 15].) • SqueezeNet with complex bypass connections between the remaining Fire modules. We illustrate these three variants of SqueezeNet in Figure 5.2. Our simple bypass architecture adds bypass connections around Fire modules 3, 5, 7, and 9, requiring these modules to learn a residual function between input and output. As in ResNet, to implement a bypass connection around Fire3, we set the input to Fire4 equal to (output of Fire2 + output of Fire3), where the + operator is elementwise addition. This changes the regularization applied to the parameters of these Fire modules, and, as per ResNet, can improve the final accuracy and/or ability to train the full model. 92 Table 5.3. SqueezeNet accuracy and model size using different macroarchitecture configurations. Bold face denotes highest accuracy. Architecture Top-1 Top-5 Model Accuracy Accuracy Size Vanilla SqueezeNet 57.5% 80.3% 4.8MB SqueezeNet + 60.4% 82.5% 4.8MB 58.8% 82.0% 7.7MB Simple Bypass SqueezeNet + Complex Bypass One limitation is that, in the straightforward case, the number of input channels and number of output channels has to be the same; as a result, only half of the Fire modules can have simple bypass connections, as shown in the middle diagram of Fig 5.2. When the “same number of channels” requirement can’t be met, we use a complex bypass connection, as illustrated on the right of Figure 5.2. While a simple bypass is “just a wire,” we define a complex bypass as a bypass that includes a 1x1 convolution layer with the number of filters set equal to the number of output channels that are needed. Note that complex bypass connections add extra parameters to the model, while simple bypass connections do not. In addition to changing the regularization, it is intuitive to us that adding bypass connections would help to alleviate the representational bottleneck introduced by squeeze layers. In SqueezeNet, the squeeze ratio (SR) is 0.125, meaning that every squeeze layer has 8x fewer output channels than the accompanying expand layer. Due to this severe dimensionality reduction, a limited amount of information can pass through squeeze layers. However, by adding bypass connections to SqueezeNet, we open up avenues for information to flow around the squeeze layers. We trained SqueezeNet with the three macroarchitectures in Figure 5.2 and compared the accuracy and model size in Table 5.3. We fixed the microarchitecture to match SqueezeNet as described in Table 5.1 throughout the macroarchitecture exploration. Complex and simple bypass connections both yielded an accuracy improvement over the vanilla SqueezeNet architecture. Interestingly, the simple bypass enabled a higher accuracy improvement than complex bypass. Adding the simple bypass connections yielded an increase of 2.9 percentage-points in top-1 accuracy and 2.2 percentage-points in top-5 accuracy without increasing model size. 5.7 Conclusions In this chapter, we have proposed steps toward a more disciplined approach to the design-space exploration of convolutional neural networks. Toward this goal we have presented SqueezeNet, a CNN architecture that has 50× fewer parameters than AlexNet and maintains AlexNet-level accuracy on ImageNet. We also compressed SqueezeNet to less than 0.5MB, or 510× smaller than AlexNet without compression. Since we released this chapter as a technical report in 2016, our colleague Song Han and his collaborators have experimented further with SqueezeNet and model compression. Using a new approach called Dense-Sparse-Dense (DSD) [184], Han et al. use model 93 compression during training as a regularizer to further improve accuracy, producing a compressed set of SqueezeNet parameters that is 1.2 percentage-points more accurate on ImageNet-1k, and also producing an uncompressed set of SqueezeNet parameters that is 4.3 percentage-points more accurate, compared to our results in Table 5.2. In the context of this chapter, we focused on ImageNet as a target dataset. However, it has become common practice to apply ImageNet-trained CNN representations to a variety of applications such as fine-grained object recognition [54, 185], logo identification in images [55], and generating sentences about images [57]. ImageNet-trained CNNs have also been applied to a number of applications pertaining to autonomous driving, including pedestrian and vehicle detection in images [47, 48, 56] and videos [186], as well as segmenting the shape of the road [187]. We think SqueezeNet will be a good candidate CNN architecture for a variety of applications, especially those in which small model size is of importance. In fact, since the original publication of the SqueezeNet techncial report [18], we have done follow-on work — SqueezeDet [188] — which builds upon SqueezeNet to address the problem of localized object detection. As of December 2016, the SqueezeDet models define the state-of-the-art results for accuracy, model size, and frame rate on the KITTI [68] object detection dataset. SqueezeNet is one of several new CNNs that we have discovered while broadly exploring the design space of CNN architectures. We hope that SqueezeNet will inspire the reader to consider and explore the broad range of possibilities in the design space of CNN architectures and to perform that exploration in a more systematic manner. 94 Chapter 6 Conclusions 6.1 Contributions CNN/DNN models have become the best approach for solving a variety of problems in the text, audio, and visual domains with unprecedented accuracy. Among these domains, visual (e.g. images and video) applications are often the most computationally-intensive use-cases of CNN/DNNs. In the interest of choosing the most challenging and computationally-intensive problems, we focused this dissertation primarily on the application of CNNs to visual recognition applications. Even within a specific domain (e.g. images), there does not appear to be a single “best” CNN architecture that is ideal for all computer vision problems under all possible constraints on accuracy, energy-efficiency, and other metrics. Further, CNNs comprise an enormous design space.1 Each architecture in the CNN design space presents its own tradeoffs in terms of computational requirements, communication overhead during distributed training, energy-efficiency, accuracy on the problem at hand, and so on. The CNN design space is not the first large design space that computer scientists have explored. The design space of computer processor hardware architectures is an example of an other large and complex design space. The MESCAL book [34] codified a number best practices or “themes” for exploring the design space of computational hardware architectures. We drew inspiration from the MESCAL book in how we organized this dissertation on exploring the design space of CNN architectures. Quite similar to the MESCAL themes, our four themes are: • Comprehensively defining benchmarks and metrics. (Chapter 2) • Rapidly training CNN/DNNs. (Chapter 3) • Defining and describing the CNN/DNN design space. (Chapter 4) • Exploring the design space of CNN/DNN architectures. (Chapter 5) 1 As we learned in Section 4.7, just a small region of the CNN design space comprises approximately 30 billion different CNN architectures. 95 Taken together, these themes comprise a methodology that will enable the reader to explore the CNN design space in a systematic and directed way. In the following sections, we review our key findings on each of the four themes. 6.1.1 Comprehensively defining benchmarks and metrics CNN/DNNs comprise an enormous design space. Therefore, when exploring the CNN/DNN design space, if you don’t know what you’re looking for, you’re unlikely to find it. With this in mind, it’s useful to define clear goals in terms of benchmarks and metrics. Benchmarks (e.g. datasets) should be representative of the target application. For example, if the goal is to recognize vehicles on the road, then the training and testing data should include annotated road scenes. Important metrics include not only accuracy, but also quantity of computation, quantity of communication, latency, energy-efficiency, and so on. When building a deployable and highly efficient CNN-based system, it is sensible to bring together a CNN architecture team, a software architecture team, and a hardware architecture team. To measure individual teams’ contributions, the CNN team can be evaluated on the quantity of computation and accuracy, and the hardware team can be evaluated on power consumption and best-case peak throughput. While hardware and CNNs can be evaluated individually, it is difficult to evaluate the software team’s contributions in isolation. To evaluate the whole organization’s progress toward an efficient full-stack solution, it is useful to measure metrics such as energyefficiency and speed. 6.1.2 Rapidly training CNN/DNNs Long training times impose a severe limitation on progress in deep neural network research and productization. Accelerating CNN training has several benefits. First, faster CNN training enables models to be trained on ever-increasing dataset sizes in a tractable amount of time. Accelerating CNN training also enables product teams to bring CNN-based products to market more rapidly. These and other compelling applications led us to focus on the problem of accelerating CNN training, and our work has culminated in the FireCaffe distributed CNN training system. With FireCaffe, we achieved a 47x speedup when training the GoogLeNet model. This enabled us to train GoogLeNet in 10.5 hours on 128 GPUs instead of 3 weeks on 1 GPU. After achieving this result, we turned our attention to identifying, training, and evaluating new CNN architectures with specific goals in mind. The use of FireCaffe’s rapid training functionality enabled us to productively explore the design space of CNNs with minimal turnaround time for each experiment. 6.1.3 Defining and describing the CNN/DNN design space The CNN/DNN architecture defines the quantity of computation that is required per data sample during both training and inference. In the context of a CNN-based system, the CNN architecture impacts most of the key metrics, including accuracy, quantity of computation, quantity of communication, latency, energy-efficiency, and model size. Therefore, when preparing to explore the design space of CNN architectures, it is useful to first understand how the design of the CNN 96 architecture impacts some of these metrics. Surprisingly, after conducting a literature survey, we were not able to find a practical guide on how the design of the CNN architecture impacts the behavior (e.g. quantity of computation, quantity of communication) of a CNN-based system. To address this, we developed a guide that explains how we reason about these design choices. When looking at a CNN architecture, it can be a bit intimidating to reason about how each potential change to the CNN would affect metrics such as the quantity of computation. However, we found that most changes to a CNN architecture produces one of the following effects: • A local change to a layer in a deep CNN typically has little impact on the CNN’s total quantity of computation. • A global change to layer Li affects all layers downstream of Li and can have a multiplicative effect on the CNN’s total quantity of computation. To date, we have not seen intuition like this written down anywhere, and this motivated us to explain our intuition and analysis of the topic. Better understanding of CNN architectural dimensions should enable the reader to reason more clearly about the region of the design space that he or she would like to explore. 6.1.4 Exploring the design space of CNN/DNN architectures With of all of the aforementioned information in place, we were able to put our design-space exploration methodology into practice. We set out the following challenge for ourselves: Produce small models (i.e. models with few parameters) that achieve competitive accuracy on a computer vision benchmark. In this challenge problem, the benchmark is the ImageNet-1k image classification dataset [21], and the metrics are accuracy and model size. As a bonus, small models can be trained at larger scale using distributed data-parallel training, and this enabled us to conduct our exploration more quickly. We chose benchmarks (accuracy and model size) that are independent of the choice of hardware and software for executing the CNN. However, as we will see in Section 6.3, other teams have since adapted our small models to achieve system-level goals such as developing FPGA-based CNN systems in which the CNN model fits entirely on-chip. Early on in this process, we first defined a region of the design space to explore. We did our best to define a region of the design space that is likely to contain small models — e.g. CNN designs that use Fire modules, which make abundant use of 1x1 filters, and they alternate between many and few filters per layer. Within this design space, we identified SqueezeNet, a model that has 50x fewer parameters than AlexNet but achieves AlexNet-level accuracy on the ImageNet-1k dataset. Further, by applying model compression to SqueezeNet, we obtained a model that is 510x smaller than AlexNet but produces AlexNet-level accuracy on ImageNet-1k. 97 6.2 Impact of our FireCaffe work on accelerating CNN/DNN training Much of the content in this dissertation (Chapters 1, 2, 4, and 6) is being published for the first time in these pages. Meanwhile, we published versions of Chapters 3 and 5 within the last twelve months [17, 18]. Despite the fact that we only recently released these publications, this work has begun to make an impact on the CNN research literature. As we learned in Chapter 3, it is common for CNNs to take multiple weeks to train on a single GPU. The slow turnaround time of CNN training impedes progress in CNN research and productization. Therefore, over the last couple of years, distributing CNN training over multiple processors has become an increasingly active area of research. Retrospectively, it appears that the release of our FireCaffe paper in late 2015 and its subsequent publication in CVPR 2016 may have been a turning point in how researchers have approached distributed CNN training problems. 6.2.1 Before FireCaffe In early 2015, prior to embarking on the development of the FireCaffe, we surveyed the literature on distributed CNN/DNN training. In the course of this literature survey, we observed the following trends. • Parallelism strategies. In the papers published prior to 2016, researchers experimented with a range of parallelism strategies. Model parallelism was a staple of many of these papers, such as those from Microsoft [107], Google [108], and CMU [189]. Researchers from Stanford and NVIDIA even designed a CNN architecture that was optimized for model parallel training on a cluster of GPUs [190].2 • Communication paradigms. Many of the research papers assumed (either explicitly or implicitly) that that it was manifest destiny that some variant of asynchronous communication would emerge as the best choice. These papers include HOGwild [191] and its follow-on works [192, 193], as well as work from Microsoft [107] and Google [108]. • Evaluation metrics. Researchers used a wide range of metrics to evaluate their work. But, one common metric was number of processors utilized. For example, the DistBelief paper from Google [108] and the Deep Image paper from Baidu [111] each reported the number of processors used, but it was difficult to interpret these results because each of these papers used a proprietary dataset and reported time-to-convergence only on that dataset. As we will see in the next subsection, recent works have done this type of evaluation on publicly-available datasets, which makes it easier to make comparisons between the different approaches. • Hardware communication networks. The early papers tended to place little emphasis on the choice of networking hardware used to communicate between servers. In some papers, using slow (e.g. 1 Gbps Ethernet) connections between servers led to severe limitations on the speed and scalability of the system as a whole [194]. In other papers, the authors 2 To be clear, this CNN architecture used the natural data parallelism within each GPU, but it used model parallelism as the primary mechanism for scaling over multiple GPUs. 98 simply focused on scaling the training CNN/DNN models over multiple GPUs within a single server [103, 105, 120, 121, 122, 195]. 6.2.2 Since FireCaffe Compared to the approaches mentioned in the previous subsection, our work in the FireCaffe paper [17] (reproduced in Chapter 3 of this dissertation) advocated for the following: (a) data parallelism, (b) synchronous communication, (c) evaluation of time-to-convergence to a predetermined accuracy level on a publicly-available dataset, and (d) using the fastest communication hardware available. We were early pioneers of these approaches; in research papers on distributed CNN/DNN training that have been released in the last few months, we’ve noticed the following trends emerge: • Parallelism strategy: focus on data parallelism. In our FireCaffe paper [17], we extolled the benefits of focusing on data parallel communication in distributed CNN training. In the papers published in 2016, researchers have gravitated toward data-parallel training of CNNs. Perhaps most interestingly, the Google Brain team — which was an advocate for model parallelism in its earlier paper [108] — recently used data parallelism (without model parallelism) in the distributed CNN training results that they released at ICLR 2016 [196]. • Communication paradigm: synchronous. In our FireCaffe paper [17], we demonstrated that the limiting factor in asynchronous communication is typically the need for a central parameter server. To mitigate this, we advocated for synchronous communication, which enables the use of collective communication approaches such as reduction trees. While the parameter server slows down linearly in the number of workers (e.g. GPU workers), collective communication slows down logarithmically in the number of workers, enabling it to run efficiently at larger scale. This approach has begun to take hold in the recent research literature. Intel recently published their latest results on distributed CNN training to 256 servers, and the communication is fully synchronous [178]. Incidentally, a key individual at Intel told us that the FireCaffe paper was used “as a bible” by the Intel teams who were in charge of producing these results [197]. Further, a version of the Theano CNN/DNN framework that supports synchronous data-parallel communication was released in mid-2016 [198]. Finally, the recent paper from Google used fully-synchronous communication for distributed CNN training, and it even provided an approach to more elegantly address fault tolerance in the synchronous communication paradigm [196]. • Evaluation metric: time to convergence. In our FireCaffe paper [17], we advocated for the following strategy for evaluating a distributed CNN training approach. Given a specific dataset and a specific target accuracy level, the goal is to train a CNN to the desired accuracy level as rapidly as possible. Everything else is up to the system architect: the choice of CNN architecture, the choice of computational hardware, the choice of communication hardware, and so on. This benchmarking methodology appears to be catching on. Recent papers from Intel [178] and Google [196] use this methodology in their benchmarking. • Hardware communication network: 56 Gbit/s or better. In our FireCaffe paper [17], we encouraged system architects to use the fastest communication hardware that is available to them. Universities and large corporations sometimes have datacenters containing a number of different compute clusters. For employees who are deciding which of their existing compute 99 clusters to use for distributed CNN/DNN training, our approach would encourage them to use the compute cluster that has the fastest network connections (e.g. 40 Gbit/s ethernet or 56 Gbit/s Infiniband) bridging the servers in the cluster. If designing or ordering new compute clusters, our approach would encourage the system infrastructure team to spend a substantial portion of the budget to purchase fast communication hardware. Our way of thinking appears to be catching on. In their recent distributed CNN training results, Intel used 56 Gbit/s FDR Infiniband network hardware when scaling to 256 CPU servers [178].3 6.2.3 Future work: Further improvements to distributed CNN/DNN training As we discussed in Chapter 3, in order to distribute the training of a CNN/DNN model over multiple servers, it is necessary to communicate among the servers during the training process. In the applications described in the general literature on distributed computing, the need for communication among servers is quite common. In the distributed computing literature, the software optimization of overlapping communication and computation has been studied for more than twenty-five years [201, 202]. In our FireCaffe results, we did not overlap communication and computation. That is, if training a particular CNN on a particular hardware platform requires a total of 5 hours of communication and 5 hours of computation, our FireCaffe results would say “the CNN took 10 hours to train.” However, the Purine [203] multi-GPU CNN training framework proposed a form of communicationcomputation overlapping. The basic idea is as follows. In the backward pass, whenever a layer Li finishes computing its data gradients (∇Di ), Purine would stage these gradients for communication. However, these gradients will not be needed until it is time to compute the forward pass of Li , and this allows for ∇Di to be communicated while computation is performed on other layers. Let us consider the best-case speedup when applying this approach. In the best case, we would have a CNN where all layers had exactly the same amount of communication (e.g. 1MB of data) and exactly the same amount of computation (e.g. 10 GFLOPs per batch). In the best case scenario, the time to communicate (in the form of an allreduce sum) 1MB of data over all servers is identical to the time required to perform 10 GFLOPs of computation on one server. In this ideal case, the overlapping approach described in Purine [203] would lead to precisely a 2x speedup over nonoverlapping training. However, in all of the CNNs described in this dissertation (e.g. Tables 4.2— 4.8, Table 5.1), there are substantially more parameters (in bytes) in the final layers than in the early layers, and layers vary in their computational requirements (in FLOPs). Given that these practical cases deviate from the “best case scenario” that we described, overlapping communication and computation would lead to less than a 2x speedup over serialized communication and computation. That said, there is an opportunity to address this by designing CNN architectures that expose more overlapping opportunities by making the layers more homogenous in their communication and computation requirements. 3 Note that, while many researchers have struggled to implement CNNs efficiently on CPUs (e.g. [199], [200]), we have found that it’s possible to achieve on the order of 1 TFLOP/s per CPU when executing CNNs using well-tuned implementations. 100 6.3 Impact of our work on exploring the design space of CNN architectures The last four years have marked a resurgence in the use of neural networks for computer vision, led chiefly by the unprecedented accuracy that modern deep neural networks provide. In this frenzy, hardware architects have developed a variety of accelerators and computational platforms targeted specifically at CNN/DNNs. We have observed a recurring theme in this work: A team of hardware architects begin by taking off-the-shelf CNN architecture such as AlexNet [22], and then they engineer an accelerator designed with this off-the-shelf model in mind. In fact, all of the following work on FPGA- and ASIC-based CNN accelerators reports its speed and efficiency results solely on the AlexNet CNN architecture: Eyeriss [204], ShiDianNao [205], Motamedi et al. [206], Ovtcharov et al. [92], and Zhang et al. [207]. There is certainly merit in comparing the efficiency of different computational hardware approaches on the same CNN architecture. However, in their 2012 paper Krizhevsky et al. were quite clear that the AlexNet model was designed to leverage problem sizes that are ideal for an NVIDIA GTX580 GPU [22]. When using other computational hardware — and especially when designing new hardware — it is critical to design CNNs that will execute efficiently on this hardware. In other words, to achieve the best possible results on various metrics (e.g. accuracy, throughput, energy-efficiency), it is ideal to co-design the CNN architecture, the software implementation, and the computational hardware. Encouragingly, researchers have begun to make progress on holistically designing CNN architectures, software, and hardware. One problem that we mentioned in Chapter 5 is that the parameters of large CNNs such as AlexNet [22] typically do not fit on-chip in today’s processors or FPGAs, requiring time- and energy-intensive communication with off-chip DRAM. Building on their previous work in Deep Compression [164], Han et al. recently developed Efficient Inference Engine (EIE) [165]. EIE is an accelerator that is able to retain compressed versions of AlexNet [22] or VGG-19 [77] in on-chip SRAMs, dramatically reducing the need for off-chip memory traffic. While most CNN accelerators process dense representations of the parameters and data, EIE operates directly on the sparse representation of the CNN that is produced by Deep Compression. The EIE authors point out that the use of models such as SqueezeNet (with or without compression) further reduces the memory requirements. Our work has begun to directly impact how researchers co-design CNNs and hardware. D. Gschwend recently released a report and implementation of ZynqNet, which comprises custom CNNs and a custom hardware implementation for executing CNN inference on Xilinx Zynq FPGAs [208]. In his report, Gschwend says, “[We used] SqueezeNet as the basis for our own CNN topology, due to its good fit for an FPGA-based implementation. The tiny parameter set could even be fit into the on-chip SRAM of a medium-sized FPGA, and optimizations are relatively easy to try thanks to the fast training cycles and the clear network structure.” Rather than simply porting SqueezeNet to his FPGA accelerator, Gschwend used SqueezeNet as a starting point for developing his own “ZynqNet” family of CNN architectures. With the goal of efficiently targeting FPGAs, Gschwend outlined four particular CNN design objectives to be used in the ZynqNet CNN architectures:4 4 While Gschwend argues that these design objectives are particularly critical for enabling straightforward and efficient FPGA implementations, the objectives may also enable more efficient execution on other hardware such as CPUs and GPUs. 101 1. Constrain the model size so that the CNN’s parameters will fit into an FPGA’s on-chip memory. 2. Use power-of-two sizes wherever possible in CNN dimensions. Gschwend mentions that, “On the FPGA, multiplications and divisions by a power of 2 can be calculated with inexpensive shift operations, which enables optimizations in the addressing of image caches in the accelerator.” 3. For downsampling the activations produced by CNN layers, replace max-pooling with strided convolution wherever possible (inspired by [209]). Not only does this eliminate the need to consume chip-area with max-pooling hardware, but Gschwend found situations where this improves accuracy on ImageNet-1k image classification. 4. Equalize the quantity of activations, or “layer capacity,” produced by each module in the CNN. This helps to further conserve memory space on the FPGA. In addition, Gschwend found cases where this change also leads to higher accuracy. All of this culminates in a CNN architecture that Gschwend was able to implement on an FPGA. Beyond the opportunities for improving speed and efficiency, it appears that co-designing the CNN architecture with FPGA hardware implementation actually saved Gschwend a substantial amount of engineering effort. In an appendix of Gschwend’s report, it mentions that all the work mentioned above was developed by Gschwend on his own during a 6-month Master’s thesis project. Contrast that with Eyeriss [204] and ShiDianNao [205], where each group of authors spent multiple years with a team of five to ten engineers to develop and optimize hardware architectures for AlexNet. Gschwend’s work demonstrates that designing the “right” CNN architecture can lead to a substantial savings in hardware-engineering effort. Works such as EIE [165] and ZynqNet [208] are encouraging, and we anticipate that orders-of-magnitude improvements remain on the table in several key metrics (e.g. energy-efficiency, throughput) for those who choose to co-design the CNN architecture, software, and hardware. 102 Bibliography [1] Jordan Boyd-Graber and Philip Resnik, “Holistic sentiment analysis across languages: Multilingual supervised latent dirichlet allocation,” in Empirical Methods in Natural Language Processing (EMNLP), 2010. [2] W. Naptali, M. Tsuchiya, and S. Nakagawa, “Topic dependent class based language model evaluation on automatic speech recognition,” in IEEE Spoken Language Technology Workshop (SLT), 2010. [3] Jike Chong, Ekaterina Gonina, and Kurt Keutzer, “Efficient automatic speech recognition on the gpu,” in GPU Computing Gems Emerald Edition, 2011. [4] Xiaodan Zhuang, Stavros Tsakalidis, Shuang Wu, Pradeep Natarajan, Rohit Prasad, and Prem Natarajan, “Compact audio representation for event detection in consumer media,” in INTERSPEECH, 2012. [5] B. Elizalde, H. Lei, and G. Friedland, “An i-vector representation of acoustic environments for audio-based video event detection on user generated content,” in IEEE International Symposium on Multimedia (ISM), 2013. [6] Pedro F. Felzenszwalb, Ross B. Girshick, David McAllester, and Deva Ramanan, “Object detection with discriminatively trained part-based models,” PAMI, 2010. [7] João Carreira, Rui Caseiro, Jorge Batista, and Cristian Sminchisescu, “Semantic segmentation with second-order pooling,” in European Conference on Computer Vision (ECCV), 2012. [8] F. Perronnin and J. Sanchez, “Compressed fisher vectors for LSVRC,” in PASCAL VOC / ImageNet Workshop at ICCV, 2011. [9] Ozan İrsoy and Claire Cardie, “Deep recursive neural networks for compositionality in language,” in NIPS, 2014. [10] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean, “Distributed representations of words and phrases and their compositionality,” in NIPS, 2013. [11] Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan C. Catanzaro, Jingdong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, Erich Elsen, Jesse Engel, Linxi Fan, Christopher Fougner, Tony Han, Awni Y. Hannun, Billy Jun, Patrick LeGresley, Libby Lin, Sharan Narang, Andrew Y. Ng, Sherjil Ozair, Ryan Prenger, Jonathan 103 Raiman, Sanjeev Satheesh, David Seetapun, Shubho Sengupta, Yi Wang, Zhiqian Wang, Chong Wang, Bo Xiao, Dani Yogatama, Jun Zhan, and Zhenyao Zhu, “Deep speech 2: End-to-end speech recognition in english and mandarin,” arXiv:1512.02595, 2015. [12] Khalid Ashraf, Benjamin Elizalde, Forrest Iandola, Matthew Moskewicz, Julia Bernd, Gerald Friedland, and Kurt Keutzer, “Audio-based multimedia event detection with dnns and sparse sampling,” in ICMR, 2015. [13] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun, “Faster r-cnn: Towards real-time object detection with region proposal networks,” in NIPS, 2015. [14] Jonathan Long, Evan Shelhamer, and Trevor Darrell, “Fully convolutional networks for semantic segmentation,” in CVPR, 2015. [15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun, “Deep residual learning for image recognition,” arXiv:1512.03385, 2015. [16] Mark Everingham, Luc Van Gool, Christopher K. I. Williams, John Winn, and Andrew Zisserman, “The pascal visual object classes (VOC) challenge,” International Journal of Computer Vision (IJCV), 2010. [17] Forrest N. Iandola, Khalid Ashraf, Matthew W. Moskewicz, and Kurt Keutzer, “FireCaffe: near-linear acceleration of deep neural network training on compute clusters,” in CVPR, 2016. [18] Forrest N. Iandola, Song Han, Matthew W. Moskewicz, Khalid Ashraf, William J. Dally, and Kurt Keutzer, “SqueezeNet: Alexnet-level accuracy with 50x fewer parameters and <0.5mb model size,” arXiv:1602.07360, 2016. [19] Matthew W. Moskewicz, Forrest N. Iandola, and Kurt Keutzer, “Boda-RTC: Productive generation of portable, efficient code for convolutional neural networks on mobile computing platforms,” arXiv:1606.00094, 2016. [20] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson, “How transferable are features in deep neural networks?,” in NIPS, 2014. [21] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “ImageNet: A large-scale hierarchical image database,” in CVPR, 2009. [22] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton, “ImageNet Classification with Deep Convolutional Neural Networks,” in NIPS, 2012. [23] Anting Shen, “BeaverDam: Video annotation tool for computer vision training labels,” M.S. thesis, University of California, Berkeley, 2016. [24] Anting Shen, “BeaverDam,” https://github.com/antingshen/beaverdam, 2016. [25] Sharan Chetlur, Cliff Woolley, Philippe Vandermersch, Jonathan Cohen, John Tran, Bryan Catanzaro, and Evan Shelhamer, “cuDNN: efficient primitives for deep learning,” arXiv:1410.0759, 2014. [26] Matthew W. Moskewicz, Ali Jannesari, and Kurt Keutzer, “A metaprogramming and autotuning framework for deploying deep learning applications,” arXiv:1611.06945, 2016. 104 [27] P. van Zeijl, J. W. T. Eikenbroek, P. P. Vervoort, S. Setty, J. Tangenherg, G. Shipton, E. Kooistra, I. C. Keekstra, D. Belot, K. Visser, E. Bosma, and S. C. Blaakmeer, “A bluetooth radio in 0.18- mu;m cmos,” IEEE Journal of solid-state circuits, 2002. [28] Rob Munoz, “Asics vs. net processors: Understanding the true costs,” http://www.eetimes. com/document.asp?doc_id=1277605, 2002. [29] “List of bitcoin mining asics,” 2016, https://en.bitcoin.it/wiki/List_of_Bitcoin_ mining_ASICs. [30] L. Codrescu, W. Anderson, S. Venkumanhanti, M. Zeng, E. Plondke, C. Koob, A. Ingle, C. Tabony, and R. Maule, “Hexagon dsp: An architecture optimized for mobile multimedia and communications,” IEEE Micro, 2014. [31] T. Chen, Z. Du, N. Sun, J. Wang, C. Wu, Y. Chen, and O. Temam, “High-throughput accelerator for ubiquitous machine-learning,” in International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2014. [32] “Nvidia geforce gtx 980. featuring maxwell, the most advanced gpu ever made,” NVIDIA Whitepaper, 2014. [33] M. Hempstead, D. Brooks, and G. Y. Wei, “An accelerator-based wireless sensor network processor in 130 nm cmos,” IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 2011. [34] Matthias Gries and Kurt Keutzer, Building ASIPs: The MESCAL Methodology, Springer, 2005. [35] Forrest Iandola and Michael Syphers, “Electron beam focusing for the international linear collider,” in American Association for the Advancement of Science Annual Meeting (AAAS), 2008. [36] Forrest N. Iandola, Matthew O’Brien, and Richard Procassini, “PyMercury: interactive python for the mercury monte carlo particle transport code,” in International Conference on Mathematics and Computational Methods Applied to Nuclear Science and Engineering (M&C), 2011. [37] Forrest N. Iandola, Jan Schuemann, Jungwook Shin, Bruce Faddegon, Harald Paganetti, and Joseph Perl, “Representing range compensators in the TOPAS monte carlo system,” in European Workshop on Monte Carlo Treatment Planning (MCTP), 2012. [38] Vivek Kini, Forrest Iandola, and Timothy Murray, “Techniques for assigning priorities to streams of work,” US Patent Number 20140344822, 2014. [39] Forrest Iandola, Fatemeh Saremi, Tarek Abdelzaher, Praveen Jayachandran, and Aylin Yener, “Real-time capacity of networked data fusion,” in International Conference on Information Fusion, 2011. [40] Fatemeh Saremi, Praveen Jayachandran, Forrest Iandola, Yusuf Sarwar, and Tarek Abdelzaher, “On schedulability and time composability of multisensor data aggregation networks,” in International Conference on Information Fusion, 2012. 105 [41] Steena Monteiro, Forrest Iandola, and Daniel Wong, “STOMP: Statistical techniques for optimizing and modeling performance of blocked sparse matrix vector multiplication,” in International Symposium on Computer Architecture and High Performance Computing (SBACPAD), 2016. [42] Mehdi Maasoumy, Pierluigi Nuzzo, Forrest Iandola, Maryam Kamgarpour, Alberto Sangiovanni-Vincentelli, and Claire Tomlin, “Optimal load management system for aircraft electric power distribution,” in IEEE Conference on Decision and Control (CDC), 2013. [43] Mahsa Kamali, Ido Omer, Forrest Iandola, Eyal Ofek, and John C. Hart, “Linear clutter removal from urban panoramas,” in ISVC, 2011. [44] Mahsa Kamali, Forrest N. Iandola, Hui Fang, and John C. Hart, “Methmorph: Simulating facial deformation due to methamphetamine usage,” in ISVC, 2011. [45] Michael Anderson, Forrest Iandola, and Kurt Keutzer, “Quantifying the energy efficiency of object recognition and optical flow,” UC Berkeley Technical Report, 2014. [46] Forrest N. Iandola, Matthew W. Moskewicz, and Kurt Keutzer, “libHOG: Energy-efficient histogram of oriented gradient computation,” in ITSC, 2015. [47] Forrest N. Iandola, Matthew W. Moskewicz, Sergey Karayev, Ross B. Girshick, Trevor Darrell, and Kurt Keutzer, “Densenet: Implementing efficient convnet descriptor pyramids,” arXiv:1404.1869, 2014. [48] Ross B. Girshick, Forrest N. Iandola, Trevor Darrell, and Jitendra Malik, “Deformable part models are convolutional neural networks,” in CVPR, 2015. [49] Bor-Yiing Su, Parallel Application Library for Object Recognition, Chapter 3, Ph.D. thesis, University of California, Berkeley, 2012. [50] Forrest N. Iandola, David Sheffield, Michael Anderson, Phitchaya Mangpo Phothilimthana, and Kurt Keutzer, “Communication-minimizing 2d convolution in gpu registers,” in ICIP, 2013. [51] Forrest N. Iandola, David Sheffield, Michael Anderson, Phitchaya Mangpo Phothilimthana, and Kurt Keutzer, “Minimizing memory communication for 2d image convolution in gpu registers,” in GPU Technology Conference (GTC), 2013. [52] “NVIDIA Performance Primitives (NPP),” developer.nvidia.com/npp. [53] Matthew W. Moskewicz, “Boda: A c++ framework for efficient experiments in computer vision,” https://github.com/moskewcz/boda, 2016. [54] Ning Zhang, Ryan Farrell, Forrest Iandola, and Trevor Darrell, “Deformable part descriptors for fine-grained recognition and attribute prediction,” in ICCV, 2013. [55] Forrest N. Iandola, Anting Shen, Peter Gao, and Kurt Keutzer, “DeepLogo: Hitting logo recognition with the deep neural network hammer,” arXiv:1510.02131, 2015. [56] Khalid Ashraf, Bichen Wu, Forrest N. Iandola, Matthew W. Moskewicz, and Kurt Keutzer, “Shallow networks for high-accuracy road object-detection,” arXiv:1606.01561, 2016. 106 [57] Hao Fang, Saurabh Gupta, Forrest Iandola, Rupesh Srivastava, Li Deng, Piotr Dollar, Jianfeng Gao, Xiaodong He, Margaret Mitchell, John C. Platt, C. Lawrence Zitnick, and Geoffrey Zweig, “From captions to visual concepts and back,” in CVPR, 2015. [58] Peter Jin, Forrest Iandola, and Kurt Keutzer, “How to scale distributed deep learning?,” in NIPS MLSys Workshop, 2016. [59] John Canny, Huasha Zhao, Ye Chen, Bobby Jaros, and Jiangchang Mao, “Machine learning at the limit,” in IEEE International Conference on Big Data, 2015. [60] Christopher Cieri, David Miller, and Kevin Walker, “The fisher corpus: a resource for the next generations of speech-to-text,” in International Conference on Language Resources and Evaluation (LREC), 2004. [61] Sergio Guadarrama, “BVLC googlenet,” https://github.com/BVLC/caffe/tree/master/ models/bvlc_googlenet, 2015. [62] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei, “Large-scale video classification with convolutional neural networks,” in CVPR, 2014. [63] Douglas B. Paul and Janet M. Baker, “The design for the wall street journal-based csr corpus,” in Association for Computational Linguistics Workshop on Speech and Natural Language, 1992. [64] John J. Godfrey, Edward C. Hollima, and Jane McDaniel, “Switchboard: Telephone speech corpus for research and development,” in ICASSP, 1992. [65] V. Panayotov, G. Chen, D. Povey, and S. Khudanpur, “LibriSpeech: an ASR corpus based on public domain audio books,” in International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2015. [66] Hao Zhang, Zhiting Hu, Jinliang Wei, Pengtao Xie, Gunhee Kim, Qirong Ho, and Eric P. Xing, “Poseidon: A system architecture for efficient gpu-based deep learning on multiple machines,” arXiv:1512.06216, 2015. [67] B. Zhou, A. Khosla, A. Lapedriza, A. Torralba, and A. Oliva, “Places2: A large-scale database for scene understanding,” http://places2.csail.mit.edu, 2015. [68] Andreas Geiger, Philip Lenz, and Raquel Urtasun, “Are we ready for autonomous driving? the kitti vision benchmark suite,” in CVPR, 2012. [69] Tsung-Yi Lin, Michael Maire, Serge Belongie, Lubomir Bourdev, Ross Girshick, James Hays, Pietro Perona, Deva Ramanan, C. Lawrence Zitnick, and Piotr Dollar, “Microsoft COCO: common objects in context,” in ECCV, 2014. [70] Sangmin Oh, Anthony Hoogs, Amitha Perera, Naresh Cuntoor, Chia-Chih Chen, Jong Taek Lee, Saurajit Mukherjee, J. K. Aggarwal, Hyungtae Lee, Larry Davis, Eran Swears, Xioyang Wang, Qiang Ji, Kishore Reddy, Mubarak Shah, Carl Vondrick, Hamed Pirsiavash, Deva Ramanan, Jenny Yuen, Antonio Torralba, Bi Song, Anesco Fong, Amit Roy-Chowdhury, and Mita Desai, “A large-scale benchmark dataset for event recognition in surveillance video,” in CVPR, 2011. 107 [71] Piotr Dollar, Christian Wojek, Bernt Schiele, and Pietro Perona, “Pedestrian detection: A benchmark,” in CVPR, 2009. [72] Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille, “The role of context for object detection and semantic segmentation in the wild,” in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [73] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu, “Bleu: a method for automatic evaluation of machine translation,” in Association for Computational Linguistics Meeting (ACL), 2002. [74] S. Banerjee and A. Lavie, “An automatic metric for mt evaluation with improved correlation with human judgments,” in ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization, 2005. [75] Simon Baker, Daniel Scharstein, J.P. Lewis, Stefan Roth, Michael J. Black, and Richard Szeliski, “A database and evaluation methodology for optical flow,” in ICCV, 2007. [76] Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, 1998. [77] Karen Simonyan and Andrew Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv:1409.1556, 2014. [78] Kaiming He and Jian Sun, “Convolutional neural networks at constrained time cost,” in CVPR, 2015. [79] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich, “Going deeper with convolutions,” arXiv:1409.4842, 2014. [80] “Nvidia tesla p100. the most advanced datacenter accelerator ever built,” NVIDIA Whitepaper, 2016. [81] Nicolas Vasilache, Jeff Johnson, Michaël Mathieu, Soumith Chintala, Serkan Piantino, and Yann LeCun, “Fast convolutional nets with fbfft: A gpu performance evaluation,” arXiv:1412.7580, 2014. [82] Nervana Systems, “Neon,” https://github.com/NervanaSystems/neon, 2016. [83] Timothy Prickett Morgan, “Intel lines up ThunderX ARM against Xeons,” http://www. nextplatform.com/2016/05/31/intel-lines-thunderx-arms-xeons, 2016. [84] Samuel Williams, Andrew Waterman, and David Patterson, “Roofline: an insightful visual performance model for multicore architectures,” Communications of the ACM, 2009. [85] Kirk W. Cameron, Rong Ge, and Xizhou Feng, “High-performance, power-aware distributed computing for scientific applications,” IEEE Computer, 2005. [86] “Nvidia tegra x1. nvidias mobile superchip,” NVIDIA Whitepaper, 2015. [87] Hwancheol Jeong, Sangbaek Lee, Weonjong Lee, Jeonghwan Pak, Jangho Kim, and Juhyun Chung, “Performance of gtx titan x gpus and code optimization,” arXiv:1511.00088, 2015. 108 [88] Lars B. Cremean, Tully B. Foote, Jeremy H. Gillula, George H. Hines, Dmitriy Kogan, Kristopher L. Kriechbaum, Jeffrey C. Lamb, Jeremy Leibs, Laura Lindzey, Christopher E. Rasmussen, Alexander D. Stewart, Joel W. Burdick, and Richard M. Murray, “Alice: An information-rich autonomous vehicle for high-speed desert navigation,” Journal of Field Robotics, 2006. [89] Gill Pratt, “Keynote presentation on autonomous driving at Toyota Research Institute,” in GPU Technology Conference (GTC), 2016. [90] Ferris Jabr, “Does thinking really hard burn more calories?,” scientificamerican.com/article/thinking-hard-calories, 2012. https://www. [91] Lukas Cavigelli and Luca Benini, “Origami: A 803 gop/s/w convolutional network accelerator,” arXiv:1512.04295, 2015. [92] Kalin Ovtcharov, Olatunji Ruwase, Joo-Young Kim, Jeremy Fowers, Karin Strauss, and Eric S. Chung, “Accelerating deep convolutional neural networks using specialized hardware,” Microsoft Research Whitepaper, 2015. [93] Yung-Hsiang Lu, Alan M. Kadin, Alexander C. Berg, Thomas M. Conte, Erik P. DeBenedictis, Rachit Garg, Ganesh Gingade, Bichlien Hoang, Yongzhen Huang, Boxun Li, Jingyu Liu, Wei Liu, Huizi Mao, Junran Peng, Tianqi Tang, Elie K. Track, Jingqiu Wang, Tao Wang, Yu Wang, and Jun Yao, “Rebooting computing and low-power image recognition challenge,” in International Conference on Computer-Aided Design (ICCAD), 2015. [94] Jiantao Qiu, Jie Wang, Song Yao, Kaiyuan Guo, Boxun Li, Erjin Zhou, Jincheng Yu, Tianqi Tang, Ningyi Xu, Sen Song, Yu Wang, and Huazhong Yang, “Going deeper with embedded fpga platform for convolutional neural network,” in ACM International Symposium on FPGA, 2016. [95] Min Lin, Qiang Chen, and Shuicheng Yan, “Network in network,” arXiv:1312.4400, 2013. [96] Andrew Lavin, “maxDNN: an efficient convolution kernel for deep learning with maxwell gpus,” arXiv:1501.06633, 2015. [97] Jeff Dean, “Keynote: Large scale deep learning,” in ACM Conference on Information and Knowledge Management (CIKM), 2014. [98] Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel, “End-to-end training of deep visuomotor policies,” arXiv:1504.00702, 2015. [99] Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, and Andrew Y. Ng, “Deep speech: Scaling up end-to-end speech recognition,” arXiv:1412.5567, 2014. [100] V Anantharaj, F Foertter, W Joubert, and J Wells, “Approaching exascale: application requirements for olcf leadership computing,” https://www.olcf.ornl.gov/wp-content/ uploads/2013/01/OLCF_Requirements_TM_2013_Final1.pdf, 2013, p43–45. [101] Oak Ridge Leadership Computing Facility (OLCF), “Introducing titan: Advancing the era of accelerated computing,” http://www.olcf.ornl.gov/titan, 2015. 109 [102] John Wawrzynek, Krste Asanović, Brian Kingsbury, David Johnson, James Beck, and Nelson Morgan, “Spert-ii: A vector microprocessor system,” Computer, 1996. [103] Y. Zou, Xing Jin, Yi Li, Zhimao Guo, Eryu Wang, and Bin Xiao, “Mariana: Tencent deep learning platform and its applications,” in VLDB, 2014. [104] Frank Seide, Gang Li, and Dong Yu, “Conversational speech transcription using contextdependent deep neural networks,” in INTERSPEECH, 2011. [105] Alex Krizhevsky, “One weird trick for parallelizing convolutional neural networks,” arXiv:1404.5997, 2014. [106] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell, “Caffe: Convolutional architecture for fast feature embedding,” arXiv:1408.5093, 2014. [107] Trishul Chilimbi, Yutaka Suzue, Johnson Apacible, and Karthik Kalyanaraman, “Project Adam: building an efficient and scalable deep learning training system,” in OSDI, 2014. [108] Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, M. Ranzato, Andrew Senior, Paul Tucker, Ke Yang, Quoc V. Le, and Andrew Y. Ng, “Large scale distributed deep networks,” in NIPS, 2012. [109] Rajeev Thakur, Rolf Rabenseifner, and William Gropp, “Optimization of collective communication operations in mpich,” International Journal of High Performance Computing Applications, 2005. [110] Hossein Azizpour, Ali Sharif Razavian, Josephine Sullivan, Atsuto Maki, and Stefan Carlsson, “From generic to specific deep representations for visual recognition,” in CVPR Deep Vision Workshop, 2015. [111] Ren Wu, Shengen Yan, Yi Shan, Qingqing Dang, and Gang Sun, “Deep image: Scaling up image recognition,” arXiv:1501.02876, 2015. [112] Nikko Strom, “Scalable distributed DNN training using commodity gpu cloud computing,” in INTERSPEECH, 2015. [113] Xavier Glorot and Yoshua Bengio, “Understanding the difficulty of training deep feedforward neural networks,” JMLR, 2010. [114] Thomas M. Breuel, “The effects of hyperparameters on SGD training of neural networks,” arXiv:1508.02788, 2015. [115] Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li, “Empirical evaluation of rectified activations in convolutional network,” arXiv:1505.00853, 2015. [116] Sergey Ioffe and Christian Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” JMLR, 2015. [117] Z Wu, Y Zhang, F Yu, and J Xiao, “A gpu implementation of googlenet,” http://vision. princeton.edu/pvt/GoogLeNet, 2014. [118] Cyprien Noel, Jun Shi, and Andy Feng, “Large scale distributed deep learning on hadoop clusters,” 2015, http://yahoohadoop.tumblr.com/post/129872361846. 110 [119] Martı́n Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng, “TensorFlow: Large-scale machine learning on heterogeneous systems,” Google Technical Report, 2015. [120] Clement Farabet, “Real-time, content-driven representations at twitter,” in GPU Technology Conference, 2015. [121] Weiguang Ding, Ruoyan Wang, Fei Mao, and Graham W. Taylor, “Theano-based large-scale visual recognition with multiple gpus,” arXiv:1412.2302, 2014. [122] Omry Yadan, Keith Adams, Yaniv Taigman, and MarcAurelio Ranzato, “Multi-gpu training of convnets,” arXiv:1312.5853, 2013. [123] Vasily Volkov and James W. Demmel, “Benchmarking GPUs to tune dense linear algebra,” in Supercomputing, 2008. [124] Jeff Dean, “Keynote: Large scale deep learning,” in GPU Technology Conference, 2015. [125] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu, “1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns,” in INTERSPEECH, 2014. [126] Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman, “Speeding up convolutional neural networks with low rank expansions,” arXiv:1405.3866, 2014. [127] Xiangyu Zhang, Jianhua Zou, Xiang Ming, Kaiming He, and Jian Sun, “Efficient and accurate approximations of nonlinear convolutional networks,” arXiv:1411.4229, 2014. [128] Song Han, Huizi Mao, and William J. Dally, “A deep neural network compression pipeline: Pruning, quantization, huffman encoding,” arXiv:1510.00149, 2015. [129] R. K. Srivastava, K. Greff, and J. Schmidhuber, “Highway networks,” in ICML Deep Learning Workshop, 2015. [130] Bryce E. Bayer, “Color imaging array,” US Patent Number 3971065, 1976. [131] I. Sobel and G. Feldman, “A 3x3 isotropic gradient operator for image processing,” Stanford Artificial Intelligence Project (SAIL), 1968. [132] John Canny, “A computational approach to edge detection,” IEEE Transactions on pattern analysis and machine intelligence (PAMI), 1986. [133] Shai Avidan and Ariel Shamir, “Seam carving for content-aware image resizing,” ACM Transactions on graphics (TOG), 2007. [134] John G. Gale and Theodore P. Williams, “Light adaptation and temperature effects in rat piii retinal response: analysis with a two-state model,” Proceedings of the National Academy of Sciences, 1980. 111 [135] Stevan Harnad, S. J. Hanson, and J. Lubin, “Categorical perception and the evolution of supervised learning in neural nets,” Cognition and Brain Theory, 1982. [136] Vinod Nair and Geoffrey E. Hinton, “Rectified linear units improve restricted boltzmann machines,” in ICML, 2010. [137] D.-A. Clevert, T. Unterthiner, and S. Hochreiter, “Fast and accurate deep network learning by exponential linear units (ELUs),” arXiv:1511.07289, 2015. [138] K. He, X. Zhang, S. Ren, and J. Sun, “Delving deep into rectifiers: Surpassing human-level performance on imagenet classification,” in ICCV, 2015. [139] A. L. Maas, A. Y. Hannun, and A. Y. Ng, “Rectifier nonlinearities improve neural network acoustic models,” in ICML, 2013. [140] Jiuxiang Gu, Zhenhua Wang, Jason Kuen, Lianyang Ma, Amir Shahroudy, Bing Shuai, Ting Liu, Xingxing Wang, and Gang Wang, “Recent advances in convolutional neural networks,” arXiv:1512.07108, 2015. [141] Chris Aldrich and Lidia Auret, Unsupervised Process Monitoring and Fault Diagnosis with Machine Learning Methods, Chapter 4, Springer, 2013. [142] David Rosenberg, “Loss functions for regression and classification,” davidrosenberg.github.io/ml2015/docs/3a.loss-functions.pdf, 2015. https:// [143] Joseph Redmon, Santosh Kumar Divvala, Ross B. Girshick, and Ali Farhadi, “You only look once: Unified, real-time object detection,” arXiv:1506.02640, 2015. [144] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting,” JMLR, 2014. [145] Ian Goodfellow, Yoshua Bengio, and Aaron Courville, “Deep learning,” Book in preparation for MIT Press, 2016. [146] I. Sutskever, J. Martens, G. Dahl, and G.E. Hinton, “On the importance of initialization and momentum in deep learning,” in ICML, 2013. [147] Yuri Nesterov, “A method of solving a convex programming problem with convergence rate o(1/k2),” Soviet Mathematics Doklady, 1983. [148] Saurabh Gupta, Ross Girshick, Pablo Arbelaez, and Jitendra Malik, “Learning rich features from rgb-d images for object detection and segmentation,” in ECCV, 2014. [149] Barak A Pearlmutter, “Learning state space trajectories in recurrent neural networks,” Neural Computation, 1989. [150] Sepp Hochreiter and Jurgen Schmidhuber, “Learning state space trajectories in recurrent neural networks,” Neural Computation, 1997. [151] Joe Yue-Hei Ng, Matthew Hausknecht, Sudheendra Vijayanarasimhan, Oriol Vinyals, Rajat Monga, and George Toderici, “Beyond short snippets: Deep networks for video classification,” in CVPR, 2015. 112 [152] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein, “Neural module networks,” in CVPR, 2016. [153] J. Donahue, L.A. Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell, “Long-term recurrent convolutional networks for visual recognition and description,” in CVPR, 2015. [154] Paul Over, George M. Awad, Jon Fiscus, Martial Michel, Alan F. Smeaton, and Wessel Kraaij, “TRECVID 2009 - goals, tasks, data, evaluation mechanisms and metrics,” in TRECVID Workshop, 2009. [155] Shuiwang Ji, Wei Xu, Ming Yang, and Kai Yu, “3d convolutional neural networks for human action recognition,” in ICML, 2010. [156] Ross B. Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation,” in CVPR, 2014. [157] Marion Chevalier, Nicolas Thome, Matthieu Cord, Jerome Fournier, Gilles Henaff, and Elodie Dusch, “Lr-cnn for fine-grained classification with varying resolution,” in ICML, 2015. [158] Philipp Krähenbühl, Carl Doersch, Jeff Donahue, and Trevor Darrell, “Data-dependent initializations of convolutional neural networks,” in ICLR, 2016. [159] John Duchi, Elad Hazan, and Yoram Singer, “Adaptive subgradient methods for online learning and stochastic optimization,” Journal of Machine Learning Research (JMLR), 2011. [160] Tijmen Tieleman and Geoffrey Hinton, “Rmsprop: Divide the gradient by a running average of its recent magnitude,” coursera: Neural networks for machine learning, 2012. [161] Consumer Reports, “Tesla’s new autopilot: Better but still needs improvement,” http://www.consumerreports.org/tesla/ tesla-new-autopilot-better-but-needs-improvement, 2016. [162] E.L Denton, W. Zaremba, J. Bruna, Y. LeCun, and R. Fergus, “Exploiting linear structure within convolutional networks for efficient evaluation,” in NIPS, 2014. [163] S. Han, J. Pool, J. Tran, and W. Dally, “Learning both weights and connections for efficient neural networks,” in NIPS, 2015. [164] S. Han, H. Mao, and W. Dally, “Deep compression: Compressing DNNs with pruning, trained quantization and huffman coding,” arxiv:1510.00149v3, 2015. [165] Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J Dally, “Eie: Efficient inference engine on compressed deep neural network,” International Symposium on Computer Architecture (ISCA), 2016. [166] Y. LeCun, B.Boser, J.S. Denker, D. Henderson, R.E. Howard, W. Hubbard, and L.D. Jackel, “Backpropagation applied to handwritten zip code recognition,” Neural Computation, 1989. [167] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna, “Rethinking the inception architecture for computer vision,” arXiv:1512.00567, 2015. [168] Christian Szegedy, Sergey Ioffe, and Vincent Vanhoucke, “Inception-v4, inception-resnet and the impact of residual connections on learning,” arXiv:1602.07261, 2016. 113 [169] J. Snoek, H. Larochelle, and R.P. Adams, “Practical bayesian optimization of machine learning algorithms,” in NIPS, 2012. [170] T.B. Ludermir, A. Yamazaki, and C. Zanchettin, “An optimization methodology for neural network weights and architectures,” IEEE Trans. Neural Networks, 2006. [171] J. Bergstra and Y. Bengio, “An optimization methodology for neural network weights and architectures,” JMLR, 2012. [172] K.O. Stanley and R. Miikkulainen, “Evolving neural networks through augmenting topologies,” Neurocomputing, 2002. [173] Dmytro Mishkin, Nikolay Sergievskiy, and Jiri Matas, “Systematic evaluation of cnn advances on the imagenet,” arXiv:1606.02228, 2016. [174] Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang, “Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems,” arXiv:1512.01274, 2015. [175] S. Tokui, K. Oono, S. Hido, and J. Clayton, “Chainer: a next-generation open source framework for deep learning,” in NIPS Workshop on Machine Learning Systems (LearningSys), 2015. [176] “Keras: Deep learning library for theano and tensorflow,” https://keras.io, 2016. [177] Ronan Collobert, Koray Kavukcuoglu, and Clement Farabet, “Torch7: A matlab-like environment for machine learning,” in NIPS BigLearn Workshop, 2011. [178] Dipankar Das, Sasikanth Avancha, Dheevatsa Mudigere, Karthikeyan Vaidyanathan, Srinivas Sridharan, Dhiraj D. Kalamkar, Bharat Kaul, and Pradeep Dubey, “Distributed deep learning using synchronous stochastic gradient descent,” arXiv:1602.06709, 2016. [179] Guo Haria, “convert squeezenet to mxnet,” https://github.com/haria/SqueezeNet/ commit/0cf57539375fd5429275af36fc94c774503427c3, 2016. [180] Eddie Bell, “A implementation of squeezenet in chainer,” https://github.com/ejlb/ squeezenet-chainer, 2016. [181] “Squeezenet keras implementation,” https://github.com/DT42/squeezenet_demo, 2016. [182] Sagar M Waghmare, “FireModule.lua,” https://github.com/Element-Research/dpnn/ blob/master/FireModule.lua, 2016. [183] Philipp Gysel, “Ristretto: Hardware-oriented approximation of convolutional neural networks,” arXiv:1605.06402, 2016. [184] Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Shijian Tang, Erich Elsen, Bryan Catanzaro, John Tran, and William J. Dally, “DSD: Regularizing deep neural networks with dense-sparsedense training flow,” arXiv:1607.04381, 2016. [185] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell, “Decaf: A deep convolutional activation feature for generic visual recognition,” arXiv:1310.1531, 2013. 114 [186] Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew G Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun, “3d object proposals for accurate object class detection,” in NIPS, 2015. [187] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla, “SegNet: A deep convolutional encoder-decoder architecture for image segmentation,” arxiv:1511.00561, 2015. [188] Bichen Wu, Forrest Iandola, Peter H. Jin, and Kurt Keutzer, “SqueezeDet: Unified, small, low power fully convolutional neural networks for real-time object detection for autonomous driving,” arXiv:1612.01051, 2016. [189] Mu Li, Dave Andersen, Alex Smola, Junwoo Park, Amr Ahmed, Vanja Josifovski, James Long, Eugene Shekita, and Bor-Yiing Su, “Scaling distributed machine learning with the parameter server,” in Operating Systems Design and Implementation (OSDI), 2015. [190] Adam Coates, Brody Huval, Tao Wang, David J. Wu, Andrew Y. Ng, and Bryan Catanzaro, “Deep learning with cots hpc systems,” in ICML, 2013. [191] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu, “Hogwild: A lock-free approach to parallelizing stochastic gradient descent,” in NIPS, 2011. [192] Cyprien Noel and Simon Osindero, “Dogwild! – distributed hogwild for cpu & gpu,” in NIPS Workshop on Distributed Machine Learning and Matrix Computations, 2014. [193] Christopher De Sa, Ce Zhang, Kunle Olukotun, and Christopher Rè, “Taming the wild: A unified analysis of hogwild!-style algorithms,” in NIPS, 2015. [194] Philipp Moritz, Robert Nishihara, Ion Stoica, and Michael I. Jordan, “Sparknet: Training deep networks in spark,” arXiv:1511.06051, 2015. [195] Sixin Zhang, Anna Choromanska, and Yann LeCun, “Deep learning with elastic averaging sgd,” in NIPS, 2015. [196] Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Jozefowicz, “Revisiting distributed synchronous sgd,” in International Conference on Learning Representations (ICLR), 2016. [197] Joseph Spisak, “Personal communication, 2016-05-24,” 2016. [198] He Ma, Fei Mao, and Graham W. Taylor, “Theano-mpi: a theano-based distributed training framework,” arXiv:1605.08325, 2016. [199] Minjie Wang, Tianjun Xiao, Jianpeng Li, Jiaxing Zhang, Chuntao Hong, and Zheng Zhang, “Minerva: A scalable and highly efficient training platform for deep learning,” in NIPS Workshop on Distributed Machine Learning and Matrix Computations, 2014. [200] Zhongyang Zheng, Wenrui Jiang, Gang Wu, and Edward Y. Chang, “Speedo: Parallelizing stochastic gradient descent for deep convolutional neural network,” in NIPS Workshop on Machine Learning Systems (LearningSys), 2015. [201] Cevdet Aykanat, Fusun Ozguner, Fikret Ercal, and Ponnuswamy Sadayappan, “Iterative algorithms for solution of large sparse systems of linear equations on hypercubes,” IEEE Transactions on Computers, 1988. [202] John L. Gustafson, Gary R. Montry, and Robert E. Benner, “Development of parallel methods for a 1024-processor hypercube,” SIAM Journal on Scientific and Statistical Computing, 1988. 115 [203] Min Lin, Shuo Li, Xuan Luo, and Shuicheng Yan, “Purine: A bi-graph based deep learning framework,” in International Conference on Learning Representations (ICLR), 2015. [204] Y.-H. Chen, T. Krishna, J. Emer, and Vivian Sze, “Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks,” in IEEE International Conference on Solid-State Circuits (ISSCC), 2016. [205] Zidong Du, Robert Fasthuber, Tianshi Chen, Paolo Ienne, Ling Li, Tao Luo, Xiaobing Feng, Yunji Chen, and Olivier Temam, “Shidiannao: Shifting vision processing closer to the sensor,” in ACM/IEEE International Symposium on Computer Architecture (ISCA), 2015. [206] Mohammad Motamedi, Philipp Gysel, Venkatesh Akella, and Soheil Ghiasi, “Design space exploration of fpga-based deep convolutional neural networks,” in Design Automation Conference (DAC), 2016. [207] Chen Zhang, Peng Li, Guangyu Sun, Bingjun Xiao Yijin Guan, and Jason Cong, “Optimizing fpga-based accelerator design for deep convolutional neural networks,” in International Symposium on Field-Programmable Gate Arrays (FPGA), 2015. [208] David Gschwend, “Zynqnet: An fpga-accelerated embedded convolutional neural network,” M.S. thesis, Swiss Federal Institute of Technology Zurich (ETH-Zurich), 2016. [209] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller, “Striving for simplicity: The all convolutional net,” in International Conference on Learning Representations (ICLR), 2015. 116
9cs.NE
1 Interlinked Cycles for Index Coding: Generalizing Cycles and Cliques arXiv:1603.00092v2 [cs.IT] 25 Feb 2018 Chandra Thapa, Lawrence Ong, and Sarah J. Johnson Abstract We consider a graphical approach to index coding. While cycles have been shown to provide coding gain, cycles and cliques (a specific type of overlapping cycles) have been exploited in existing literature. In this paper, we define a more general form of overlapping cycles, called the interlinked-cycle (IC) structure, that generalizes cycles and cliques. We propose a scheme, called the interlinked-cyclecover (ICC) scheme, that leverages IC structures in digraphs to construct scalar linear index codes. We characterize a class of infinitely many digraphs where our proposed scheme is optimal over all linear and non-linear index codes. Consequently, for this class of digraphs, we indirectly prove that scalar linear index codes are optimal. Furthermore, we show that the ICC scheme can outperform all existing graph-based schemes (including partial-clique-cover and fractional-local-chromatic number schemes), and a random-coding scheme (namely, composite coding) for certain graphs. Index Terms Index coding, interlinked-cycle cover, graph theory, broadcast with side information. I. I NTRODUCTION In index coding (introduced by Birk and Kol [1] in 1998), a sender broadcasts messages through a noiseless shared channel to multiple receivers, each knowing some messages a priori, which are known as side information. Side information occurs frequently in many communication networks, e.g., in a web browsers’ cache. Knowing the side information of the receivers, the sender can send coded symbols, known as an index code, in such a way that all of the receivers can decode their requested messages using their side information and the received coded symbols. The aim is to find the shortest (optimal) index code. How to optimally design an index code for The authors are with the School of Electrical Engineering and Computing, The University of Newcastle, Callaghan, NSW 2308, Australia (e-mail: [email protected]; [email protected]; [email protected]). February 25, 2018 DRAFT 2 an arbitrary index-coding instance, a specific index-coding problem characterized by the message sets each receiver wants and knows, is an open problem to date. In the literature, various approaches have been adopted to solve the index-coding problem. We broadly classify these approaches into four categories: (i) numerical, (ii) Shannon’s random coding, (iii) interference alignment, and (iv) graph-based. Numerical approaches include rank minimization over finite fields [2], [3] (which is NP-hard to compute in general [4], [5]), and mathematical optimization programming (semi-definite programming [6], linear programming [7], and integer-linear programming [8]). These approaches do not provide much intuition on the interaction between the side-information configuration and the index codes. Shannon’s random coding approaches [9], [10] require infinitely long message packets. Interference-alignment approaches treat index coding as an interference-alignment problem [11], [12], and construct index codes via two alignment techniques, namely one-to-one alignment and subspace alignment. These alignment techniques have no well-defined algorithms to construct index codes for arbitrary index-coding instances. Graph-based approaches [8], [13]–[22] provide intuition on the sideinformation configurations and index codes. These approaches represent index-coding instances by graphs, and construct index codes as functions of the graphs. These graph-based schemes provide linear (scalar and vector) index codes. Although linear index codes are not always optimal [3], [23], they have simpler encoding and decoding processes. We classify graph-based approaches into two sub-categories: (i) Maximum distance separable (MDS) code based interference alignment approaches, and (ii) graph structure based approaches. The MDS code based interference alignment approaches construct index codes by treating messages not known to a receiver as interference, and aligning all interference with the help of MDS codes. These approaches include the partial-clique-cover scheme [13] and its fractional version [8], [14], the local-chromatic-number scheme and its fractional version [15], and the partitioned-local-chromatic-number scheme and its fractional version [16]. Graph structure based approaches exploit special graph structures, based on messages known to the receivers that can provide some savings1 in index-coding instances. It has been shown that no structure in an acyclic graph can provide any savings [2]. Furthermore, if an arc does not belong to any cycle, then removing it does not change the optimal index code 1 The number of transmissions saved by transmitting coded symbols (coded messages) rather than transmitting uncoded messages is called savings of the index code. For savings, greater is better. February 25, 2018 DRAFT 3 [19]–[21]. These observations point to the importance of cycles in index coding. In the literature, only cycles and cliques, a specific combination of overlapping cycles, have been exploited so far in the graph structure based approaches. More precisely, cycles in digraphs are exploited by the cycle-cover scheme [17], [18] and its fractional version [17], and cliques in digraphs are exploited by the clique-cover scheme [13] and its fractional version [7]. Overlapping cycles can provide more savings than considering cycles individually. We take a clique as an example. In a clique, every vertex forms a cycle with any other vertex, and we see overlapping of cycles at every vertex. If we consider only cycles in the clique, we get an index code strictly longer than that by considering the clique. However, not all forms of overlapping cycles are useful, in the sense that they provide more savings than considering cycles and cliques. In this work, we consider a graph structure based approach, and propose structures of overlapping cycles that can be exploited in graphs to provide potentially more savings than the cycle-cover scheme, the clique-cover scheme, and other existing schemes. The proposed structures are called interlinked-cycle (IC) structures, and they generalize cycles and cliques. Furthermore, we define a scheme, called the interlinked-cycle cover (ICC) scheme, that constructs index codes based on IC structures. In addition, we extend the ICC scheme to allow time-sharing among overlapping IC structures, we call the scheme the fractional-ICC scheme. Also, we extend the IC structures and present a scheme that exploits the extended-IC structures, we call the scheme the extended-ICC scheme. Referring to the work by Ong [24], for all index-coding instances up to five receivers (9846 problems) where each receiver requests exactly one message, and each message is requested by exactly one receiver, we find that the ICC scheme (including fractional and extended versions) provides the minimum index codelength for all message alphabet sizes except problems modeled by eight non-isomorphic digraphs (see Remark 9 for the details). A. Our contributions 1) We propose a new index-coding scheme (called the ICC scheme) that generalizes the clique-cover scheme and the cycle-cover scheme. The new scheme constructs scalar linear index codes. 2) We characterize a class of digraphs (with infinitely many members) for which the ICC scheme is optimal (over all linear and non-linear index codes). This means scalar linear index codes are optimal for this class of digraphs. 3) For a class of digraphs, we prove that the ICC scheme performs at least as well as the February 25, 2018 DRAFT 4 partial-clique-cover scheme. We conjecture that the result is valid in general. Furthermore, we present a class of digraphs where the additive gap between these two schemes grows linearly with the number of vertices in the digraph. 4) For a class of digraphs, we prove that the ICC scheme performs at least as well as the fractional-local-chromatic-number scheme. Moreover, we present a class of digraphs where the additive gap between these two schemes grows linearly with the number of vertices in the digraph. 5) We show that the ICC scheme can outperform all of the existing graph-based schemes and the composite-coding scheme in some examples. 6) We extend the ICC scheme to the fractional-ICC scheme. This modified scheme time-shares multiple IC structures, and constructs vector linear index codes that can be, for certain digraphs, shorter than the scalar linear index codes obtained from the ICC scheme. II. D EFINITIONS AND BACKGROUND A. Problem formulation Consider a transmitter that wants to transmit N messages X = {x1 , x2 , . . . , xN } to N receivers {1, 2, . . . , N } in a unicast message setting, meaning that each message is requested by only one receiver, and each receiver requests only one message. Without loss of generality, let each receiver i request message xi , and possess side information Si ⊆ X \ {xi }. This problem can be described by a digraph D = (V (D), A(D)), where V (D) = {1, 2, . . . , N }, the set of vertices in D, represents the N receivers. An arc (i → j) ∈ A(D) exists from vertex i to vertex j if and only if receiver i has packet xj (requested by receiver j) in its side information. The set of the side information of a vertex i is Si , {xj : j ∈ ND+ (i)}, where ND+ (i) is the out-neighborhood of i in D. Let X and all Si be ordered sets, where the ordering can be arbitrary but fixed. Definition 1 (Index code): Suppose xi ∈ {0, 1}t for all i and some integer t ≥ 1, i.e., each message consists of t bits. Given an index-coding problem modeled by D, an index code (F ,{Gi }) is defined as follows: 1) An encoding function for the source, F : {0, 1}N ×t → {0, 1}p , which maps X to a p-bit index code for some positive integer p. 2) A decoding function Gi for every receiver i, Gi : {0, 1}p × {0, 1}|Si |×t → {0, 1}t , that maps the received index code F (X) and its side information Si to the requested message xi . February 25, 2018 DRAFT 5 Definition 2 (Broadcast rate or index codelength): The broadcast rate of an index code (F , {Gi }) is the number of transmitted bits per received message bits at every user, or equivalently the number of transmitted coded symbols (each of t bits). This is denoted by `(D) , pt , and is also referred to as the index codelength. Definition 3 (Optimal broadcast rate): The optimal broadcast rate for a given index coding problem D with t-bit messages is βt (D) , min `(D), and the optimal broadcast rate over all t F is defined as β(D) , inf βt (D). t Remark 1: For broadcast rates, the minimum is optimal. Definition 4 (Maximum acyclic induced sub-digraph): For a digraph D, an induced acyclic sub-digraph formed by removing the minimum number of vertices in D, is called a maximum acyclic induced sub-digraph (MAIS). The order of the MAIS is denoted as MAIS(D). It has been shown that for any digraph D and any message length of t-bits, MAIS(D) lower bounds the optimal broadcast rate [2], MAIS(D) ≤ β(D) ≤ βt (D). (1) B. Some existing schemes In this sub-section, we describe the clique-cover, the cycle-cover and the partial-clique-cover schemes in detail. These schemes provide some basic intuitions about our proposed ICC scheme. Throughout this paper, “disjoint" refers to “vertex-disjoint" unless stated otherwise. Definition 5 (Clique): A clique is a sub-digraph where each vertex has an out-going arc to every other vertex in that sub-digraph. Definition 6 (Clique-covering number, `CL (D)): The clique-covering number is the minimum number of cliques partitioning a digraph D (over all partitions) such that if each clique is denoted as S ρi for i ∈ {1, . . . , `CL (D)}, then ∀i V (ρi ) = V (D), V (ρi ) ∩ V (ρj ) = ∅, ∀i, j ∈ {1, . . . , `CL (D)} and i 6= j (here a vertex is a clique of size one). The clique-covering number is equal to the chromatic number of the underlying undirected graph of the complement digraph, i.e., `CL (D) = χ(UD̄ ), where UD̄ is the underlying undirected graph of D̄, D̄ is the complement digraph of D, and χ(D) denotes the chromatic number of D. Definition 7 (Clique-cover scheme): The clique-cover scheme finds a set of disjoint cliques that provides the clique-covering number, and constructs an index code in which the coded symbol for each of the disjoint cliques is the bit-wise XOR of messages requested by all of the vertices in that clique. February 25, 2018 DRAFT 6 Remark 2: Any clique with n vertices permits a savings of n − 1. The clique-cover scheme achieves the following rate: Proposition 1 (Birk and Kol [13]): The optimal broadcast rate of an index coding instance is upper bounded by the clique cover number, i.e., β(D) ≤ βt (D) ≤ `CL (D), ∀t. Definition 8 (Path and cycle): A path consists a sequence of distinct (except possibly the first and last) vertices, say 1, 2, . . . , M , and an arc (i → i + 1) for each consecutive pair of vertices (i, i + 1) for all i ∈ {1, 2, . . . , M − 1}. We represent this path from the vertex 1 to the vertex M as h1, 2, . . . , M i. Here 1 is the first vertex and M is the last vertex. A path having (i) at least two distinct vertices, and (ii) the same first and last vertex is a cycle. Moreover, in any cycle, the in-degree and the out-degree of any vertex are both exactly one. Definition 9 (Cycle-covering number, `CY (D)): The difference between the total number of vertices in D and the maximum number of disjoint cycles in D is the cycle-covering number. Definition 10 (Cycle-cover scheme): The cycle-cover scheme finds a set of disjoint cycles in D that provides the cycle-covering number, and constructs an index code that has (i) coded symbols for each disjoint cycle (for a cycle h1, 2, . . . , M, 1i, a set of coded symbols are {x1 ⊕ x2 , x2 ⊕ x3 , . . . , xM −1 ⊕ xM }), and (ii) uncoded messages which are requested by those vertices not included in any of the disjoint cycles in D. Remark 3: Any cycle permits a savings of one. The cycle-cover scheme achieves the following rate: Proposition 2 ( [13], [17], [18]): The optimal broadcast rate of an index-coding problem is upper bounded by the cycle-covering number, i.e., β(D) ≤ βt (D) ≤ `CY (D), ∀t. Definition 11 (Partial clique): A sub-digraph Di = (V (Di ), A(Di )) is a κ(Di )-partial clique, where κ(Di ) = |V (Di )| − δ + (Di ) − 1 and δ + (Di ) is the minimum out-degree of Di . Definition 12 (Partial-clique number, `PC (D)): If D1 , D2 , . . . , Dm , for some positive integer S m, partition a digraph D such that V (Di ) = V (D) and V (Di ) ∩ V (Dj ) = ∅, ∀i, j ∈ {1, 2, . . . , m} and i 6= j, then ∀i∈{1,2,...,m} m X `PC [D1 , D2 , . . . , Dm ] = (κ(Di ) + 1), i=1 and the partial-clique number of the digraph is `PC (D) = D1 ,Dmin `PC [D1 , D2 . . . , Dm ], 2 ,...,Dm (2) where the minimum is taken over all partitions. February 25, 2018 DRAFT 7 Definition 13 (Partial-clique-cover scheme): The partial-clique-cover scheme finds a set of disjoint partial cliques in D that provides the partial-clique number, and constructs an index code that has (i) κ(Di ) + 1 coded symbols for each disjoint κ(Di )-partial clique with |V (Di )| > 1 (a partial clique uses MDS codes to generate coded symbols), and (ii) an uncoded message for each disjoint κ(Di )-partial clique with |V (Di )| = 1. The partial-clique-cover scheme achieves the following rate: Proposition 3 (Birk and Kol [13]): The optimal broadcast rate of an index coding instance is upper bounded by the partial-clique number, i.e., β(D) ≤ `PC (D). (3) Remark 4: The partial-clique-cover scheme performs at least as well as the cycle-cover and the clique-cover schemes, i.e., `PC (D) ≤ min {`CL (D), `CY (D)}. (4) This is because the partial-clique-cover scheme includes the cycle-cover scheme or the cliquecover scheme as a special case. By definition, a clique is a 0-partial clique, and a cycle with n vertices is a (n − 2)-partial clique. Despite the fact that the partial-clique-cover scheme uses MDS codes, which require sufficiently large message length t in general, to construct index codes, one can find MDS codes for any cycle and any clique for any t. Remark 5: The clique-cover, the cycle-cover and the partial-clique-cover schemes provide scalar linear index codes. We can also construct vector linear index codes by time-sharing all possible cliques, cycles, partial cliques in their respective schemes, and these are called the fractional versions of those schemes. The fractional version can strictly decrease the broadcast rates (over the non-fractional version) for some digraphs, e.g., a 5-cycle [7]. III. M OTIVATING OVERLAPPING CYCLES We present an example that illustrates the importance of overlapping cycles in index coding. Consider the digraph D1 in Fig. 1a. In D1 , the cycles h1, 2, 1i and h1, 4, 3, 5, 1i overlap at vertex 1, and some cycles similarly overlap at vertices 2 and 3. Note that MAIS(D1 ) = 3 ≤ β(D1 ). Index codelengths for D1 by existing graph-based schemes (some schemes require a sufficiently large t) are depicted in Table I. Among all existing schemes listed in Table I, only the composite-coding scheme (which requires infinitely long message length) can achieve β(D1 ). However, there exists a scalar linear February 25, 2018 DRAFT 8 1 4 1 2 5 2 4 3 3 (a) (b) Fig. 1. Two digraphs with overlapping cycles, (a) D1 , and (b) D2 . TABLE I I NDEX CODELENGTHS FOR THE DIGRAPH D1 IN F IG . 1 A FROM EXISTING SCHEMES Schemes Index codelength Clique cover [13] 4 Fractional-clique cover [7] 4 Cycle cover [17], [18] 4 Fractional-cycle cover [17] 3.5 Partial-clique cover [13] 4 Fractional-partial-clique cover [14] 3.5 Local-chromatic number [15] 4 Local time sharing [14], bLTS 3.5 Asymmetric coding [14], b(RLTS ) 3.5 Composite coding [9] 3 index code of length three, i.e., {x1 ⊕ x2 ⊕ x3 , x4 ⊕ x3 , x5 ⊕ x1 }, which is not found by these existing index-coding schemes. Later in this paper, we will show how to obtain this code by considering overlapping cycles. In some digraphs with overlapping cycles, the optimal broadcast rate can be obtained by the cycle-cover scheme (which only codes on disjoint cycles). The digraph D2 in Fig. 1b gives one of these cases, where the optimal broadcast rate β(D2 ) = 2 is achieved by the cycle-cover scheme, `CY (D2 ) = 2. For these digraphs, there is no benefit considering overlapping cycles. This paper explores structures with overlapping cycles having index codes with length strictly shorter than that obtained from the cycle-cover scheme (possibly other existing schemes as well). We will identify a class of such structures, and call them IC structures. We will also show that exploiting IC structures can strictly outperform the composite-coding scheme for some digraphs. February 25, 2018 DRAFT 9 IV. U NDERSTANDING IC STRUCTURES AND CONSTRUCTION OF INDEX CODES In this section, we provide an informal description of an IC structure and code construction. This provides an insight into IC structures. The main idea behind our definition of an IC structure is the existence of a set of vertices with the following property: For any pair of vertices in the set, there exists a cycle containing these two vertices, and no other vertices in the set. We call such a vertex set an inner vertex set, and its vertices are called inner vertices (see Section V-A for the formal definition). The remaining vertices that are not inner vertices are called non-inner vertices. Now we illustrate IC structures with an example. For the digraph in Fig. 1a, {1, 2, 3} is an inner vertex set. This is because the cycle h1, 2, 1i includes the vertex pair (1, 2), the cycle h2, 3, 2i includes the vertex pair (2, 3), and the cycle h1, 4, 3, 5, 1i includes the vertex pair (1, 3). Consequently, the vertices 1, 2 and 3 are interlinked by cycles that are not disjoint (e.g., the vertex 1 is in cycles h1, 2, 1i and h1, 4, 3, 5, 1i), and such cycles are called interlinked cycles. In Section V-A, we will formally define an IC structure to be a sub-digraph consisting of paths among the inner vertices rather than cycles between different inner vertex pairs. However, the two definitions are linked by the observation that two disjoint (except for the end vertices) paths hA, . . . , Bi and hB, . . . , Ai form a cycle. The construction of an index code for the IC structure is as follows: (i) One codeword symbol is formed by the XOR of messages requested by all of the inner vertices (e.g., for the digraph in Fig. 1a, the vertices 1, 2 and 3 are inner vertices, so one of the coded symbols is x1 ⊕ x2 ⊕ x3 ), and (ii) for each of the remaining vertices (non-inner vertices), a codeword symbol is formed by the XOR of the message requested by the vertex and the messages requested by all of its out-neighborhood vertices (e.g., for the digraph in Fig. 1a, vertices 4 and 5 are non-inner vertices, so the corresponding coded symbols are x4 ⊕ x3 and x5 ⊕ x1 ). Thus the index code for the digraph in Fig. 1a (which is also an IC structure) is {x1 ⊕ x2 ⊕ x3 , x4 ⊕ x3 , x5 ⊕ x1 }. Now the decoding process is as follows: Vertex 2 decodes its requested message x2 from the coded symbol x1 ⊕ x2 ⊕ x3 because it has x1 and x3 in its side information. Vertices 4 and 5 decode their requested messages x4 and x5 from the coded symbols x4 ⊕ x3 and x5 ⊕ x1 respectively because vertex 4 has x3 in its side information, and vertex 5 has x1 in its side information. Vertex 1 decodes its requested message x1 from (x1 ⊕ x2 ⊕ x3 ) ⊕ (x4 ⊕ x3 ) = x1 ⊕ x2 ⊕ x4 because it has x2 and x4 in its side information. Vertex 3 decode its requested message x3 from February 25, 2018 DRAFT 10 (x1 ⊕ x2 ⊕ x3 ) ⊕ (x5 ⊕ x1 ) = x2 ⊕ x5 ⊕ x3 because it has x2 and x5 in its side information. V. A N IC STRUCTURE AND CONSTRUCTION OF THE I NDEX C ODE In this section, we provide the formal definition of an IC structure and code construction. A. Definition of an IC structure In a digraph D, consider a structure having the following property: • It has an inner vertex set denoted as VI . Without loss of generality, we consider VI = {1, 2, . . . , K}. The vertices in VI are called inner vertices. For any ordered pair of inner vertices (i, j) ∈ VI and i 6= j, there is a path from i to j, and the path does not include any other vertex in VI except the first and the last vertices. Due to the existence of paths between any vertex pair in VI , for each inner vertex i ∈ VI , we can always find a directed rooted tree in D, denoted by Ti , where inner vertex i is the root vertex, and all other inner vertices VI \ {i} are the leaves (see Fig. 2a). The trees may be non-unique. If the S union of K selected trees, each one rooted at a unique inner vertex (i.e., ∀i∈VI Ti (see Fig. 2b)), satisfies two conditions (to be defined shortly), we call it an interlinked-cycle structure (denoted as a K-IC sub-digraph: DK = (V (DK ), A(DK )), where V (DK ) ⊆ V (D), A(DK ) ⊆ A(D), and VI = {1, 2, . . . , K}). Now we define a type of cycle and a type of path. Definition 14 (I-path, I-cycle): A path in which only the first and the last vertices are from VI , and they are distinct, is an I-path. If the first and the last vertices are the same, then it is an I-cycle. In other words, an I-cycle is a directed cycle containing exactly one inner vertex. The conditions for an IC structure are as follows: 1) Condition 1: There is no I-cycle in DK . 2) Condition 2: For all ordered pairs of inner vertices (i, j), i 6= j, there is only one I-path from i to j in DK (this condition implies that in DK , for any two inner vertices, there is exactly one cycle containing them and no other inner vertices). These two conditions are necessary for our code construction described in the following section (for more discussions, see Examples 2 and 3). B. Construction of an index code for a K-IC structure We propose the following coded symbols for a K-IC structure DK with |V (DK )| = N 0 : February 25, 2018 DRAFT 11 i Root Vertex Inner Vertices Intermediate vertices of the tree T1 Ti i ∈ {1, 2, ..., K} K 2 Intermediate vertices of the tree TK 1 VI Leaf Vertices VI \ {i} Intermediate vertices of the tree T2 Intermediate vertices belong to V (D) \ VI 1 K (a) (b) Fig. 2. (a) Outline of a tree Ti which has the root vertex i ∈ VI , all vertices in VI \ {i} as the leaf vertices, and some or all vertices in V (D) \ VI (i.e., the non-inner vertex set) as intermediate vertices (between the root and the leaves), and b) outline of an IC structure, where different trees Ti (shown in different colors) can share intermediate vertices. 1) A coded symbol obtained by the bitwise XOR (denoted by ⊕) of messages (each of t bits) requested by all vertices of the inner vertex set VI , i.e., wI , K M (5) xi . i=1 2) For each non-inner vertex j ∈ {K + 1, K + 2, . . . , N 0 }, a coded symbol obtained by the bitwise XOR of the message requested by j with the messages requested by its out-neighborhood vertices in DK , i.e., w j , xj ⊕ M (6) xq . + q∈ND (j) K Denote this code constructed for the K-IC structure by W , {wI , wj : K + 1 ≤ j ≤ N 0 }. The total number of coded symbols in W is `(DK ) = N 0 − K + 1. Remark 6: For a given DK , encoding W requires at most t × K − 1 + P i∈V (DK )\VI bit-wise XOR operations where t is the number of bits in each message symbol. (7) ! |ND+K (i)| Proposition 4: The code W constructed for a K-IC structure is an index code. Proof: Refer to Appendix A. The following example illustrates the definition of an IC structure. February 25, 2018 DRAFT 12 T1 T2 1 T3 2 D 3 1 4 T1 1 4 5 6 4 6 4 5 2 5 2 3 1 3 1 2 3 6 T2 2 T3 3 D 1 5 4 2 4 2 3 1 1 3 (a) 2 5 3 (b) D T1 T2 1 T3 2 T4 3 1 4 2 5 6 2 6 5 3 3 4 1 3 4 1 2 4 1 2 3 5 4 (c) Fig. 3. (a) A digraph D that is also an IC structure along with its trees T1 , T2 and T3 , (b) a digraph D along with its trees T1 , T2 and T3 , has an I-cycle at vertex 2, and (c) a digraph D along with its trees T1 , T2 , T3 and T4 , has two I-paths at vertex 3 from vertex 1. Example 1: Consider the digraph D in Fig. 3a where we have identified the inner-vertex set VI = {1, 2, 3}. For vertices 1, 2 and 3, we can always find the directed rooted trees T1 , T2 and T3 . The union of these three trees form a digraph, denoted DK , with the following: (i) There is no I-cycle in DK , and (ii) the vertex 1 has only one I-path to each of the vertices 2 and 3 (i.e., h1, 5, 2i and h1, 6, 3i), and so do vertices 2 and 3. Thus DK is a 3-IC structure with K = 3. The following examples demonstrate why we impose two conditions, viz., Condition 1 and Condition 2, for the definition of an IC structure. Example 2 (Why no I-cycle in DK ?): Consider the digraph D in Fig. 3b where we have identified VI = {1, 2, 3}. The digraph has an I-cycle at vertex 2, i.e., h2, 4, 2i. Suppose that we consider D to be an IC structure. We construct a code for D from our proposed code construction; wI = x1 ⊕ x2 ⊕ x3 , w4 = x4 ⊕ x2 ⊕ x3 and w5 = x5 ⊕ x2 ⊕ x1 . We can verify that vertex 2 with side information {x1 , x4 } cannot decode its requested message from the code. This shows that our proposed scheme does not provide an index code for this case. In fact, MAIS(D) = 4, thus no index code of length three exists for D. Moreover, the cycle-cover scheme is optimal here. Example 3 (Why only one I-path for any ordered pair of the vertices (i, j) ∈ VI , i 6= j, is required in DK ?): Consider the digraph D in Fig. 3c where we have identified VI = {1, 2, 3, 4}. The digraph has two I-paths from vertex 1 to vertex 3, viz., h1, 5, 3i and h1, 6, 3i. Suppose that we February 25, 2018 DRAFT 13 consider D as an IC structure. We construct a code for D from our proposed code construction; wI = x1 ⊕ x2 ⊕ x3 ⊕ x4 , w5 = x5 ⊕ x3 ⊕ x4 and w6 = x6 ⊕ x2 ⊕ x3 . We can verify that vertex 1 with side information {x5 , x6 } cannot decode its requested message from the code. This shows that our proposed scheme does not provide an index code for this case. VI. M AIN R ESULTS In this section, firstly, we define the interlinked-cycle cover (ICC) scheme. Secondly, we prove that the proposed ICC scheme includes the cycle-cover scheme and the clique-cover scheme as special cases. Finally, for a class of digraphs (which includes infinitely many digraphs), we prove that our proposed scheme is optimal, i.e., it achieves the optimal broadcast rates of those digraphs. Definition 15 (ICC scheme): For any digraph D, the ICC scheme finds a set of disjoint IC structures covering D. It then codes each of these IC structures DK using the code construction described in Section V-B. Note that when |V (DK )| = 1, we simply send the requested message uncoded. Now we present a main result of this paper. It is best expressed in terms of savings, defined as follows: Definition 16 (Savings): The number of transmissions saved by transmitting coded symbols (coded messages) rather than transmitting uncoded messages (i.e., N −`(D)), is called the savings of the index code. It is denoted as S(D). Theorem 1: For any digraph D, an index code of length `ICC (D) = N − ψ P (Ki − 1) can be i=1 achieved by the ICC scheme, where (Ki − 1) is the savings in each disjoint Ki -IC structure, and ψ is the number of disjoint IC structures in D. Proof: Consider a K-IC structure DK with N 0 number of vertices. It follows from (7) that the total savings achieved by the ICC scheme in a DK is N 0 − `ICC (DK ) = N 0 − (N 0 − K + 1) = K − 1. (8) For any digraph D containing ψ disjoint IC structures, a savings of Ki − 1 is obtained in each DKi (from (8)), where i ∈ {1, . . . , ψ}. Now the summation of savings in all disjoint IC structures P P provides the total savings, i.e., ψi=1 (Ki − 1). Hence, `ICC (D) = N − ψi=1 (Ki − 1). Remark 7 (Complexity issue): IC structures found by the ICC scheme are not unique. So, finding the best `ICC (D) involves optimizing over all choices of disjoint IC structures in D, and February 25, 2018 DRAFT 14 this may require high time complexity. Refer to Appendix B for an algorithm that exhaustively searches IC structures in D and computes `ICC (D). The complexity can be reduced to some extent in the following way: We partition the digraph into sub-digraphs taking critical arcs2 [19]–[21] into account, and then search for IC structures in each of the sub-digraphs. A. The ICC scheme includes the cycle-cover and the clique-cover schemes as special cases Theorem 2: The ICC scheme includes the cycle-cover and the clique-cover schemes as special cases. Proof: The proof is divided into two parts. In the first part, we prove that the clique-cover scheme is a special case of the ICC scheme, and in the second part, we prove that the cycle-cover scheme is a special case of the ICC scheme. (Part 1) Consider a clique with N 0 ≥ 1 vertices, and without loss of generality, assume that the vertices are 1, 2, . . . , N 0 . We choose VI = {1, 2, . . . , N 0 } to be an inner vertex set. As there is exactly one I-path between every ordered pair of vertices, and no I-cycles (indeed no non-inner vertices at all). The clique is a N 0 -IC structure. Now for the clique, (i) the clique-cover scheme constructs an index code {x1 ⊕ · · · ⊕ xN 0 } of length one, and (ii) the ICC scheme constructs an index code {wI = x1 ⊕ · · · ⊕ xN 0 } of length one. The index codes from both of the schemes are the same. In fact, for any digraph, if we consider the ICC scheme exploiting only N 0 -IC structures with |VI | = N 0 , i.e., disjoint cliques in digraphs, then this is simply the clique-cover scheme. (Part 2) Consider a cycle with N 0 ≥ 2 number of vertices, and without loss of generality, assume that the vertices are 1, 2, . . . , N 0 . Consider VI = {i, j} for any i, j ∈ {1, 2, . . . , N 0 } and i 6= j. Vertex i has only one I-path to j and vice versa, and there is no I-cycle. Thus a cycle is a 2-IC structure. Now we choose i = N 0 −1 and j = N 0 , so VI = {N 0 −1, N 0 }. For the cycle, (i) the cycle-cover scheme constructs an index code {x1 ⊕x2 , x2 ⊕ x3 , . . . , xN 0 −1 ⊕xN 0 } of length N 0 −1, and (ii) the ICC scheme constructs an index code {wI , wj : 1 ≤ j ≤ N 0 − 2} of length N 0 − 1, where wI = xN 0 −1 ⊕ xN 0 and {wj : 1 ≤ j ≤ N 0 − 2} = {x1 ⊕ x2 , x2 ⊕ x3 , . . . , xN 0 −2 ⊕ xN 0 −1 }. The index codes from both of the schemes are the same. In fact, for any digraph, if we consider the ICC scheme exploiting only 2-IC structures, i.e., disjoint cycles in digraphs, then this is simply the cycle-cover scheme. 2 An arc in a digraph is said to be critical if the removal of that arc from the digraph strictly increases the optimal broadcast rate. February 25, 2018 DRAFT 15 Corollary 1: The optimal broadcast rate of an index-coding instance, with t-bit messages for any t ≥ 1, is upper bounded by the index codelength obtained from the ICC scheme, and this upper bound is at least as tight as the cycle-covering number and the clique-covering number, i.e., β(D) ≤ βt (D) ≤ `ICC (D) ≤ min{`CL (D), `CY (D)}, ∀t. (9) Proof: From Theorem 2, the cycle-cover and the clique-cover schemes are special cases of the ICC scheme, thus `ICC (D) ≤ min{`CL (D), `CY (D)}. From Theorem 1, we have βt (D) ≤ `ICC (D), and from the definition of β(D), we have β(D) ≤ βt (D). Therefore, β(D) ≤ βt (D) ≤ `ICC (D) ≤ min{`CL (D), `CY (D)}. These three schemes are valid for one-bit messages. By concatenating the index codes, we get (9) for any number of bits. Remark 8: `CL (D) and `CY (D) are lower bounded by both `ICC (D) (from Corollary 1) and `PC (D) (from (3)). A difference between these two bounds is that the `ICC (D) bound is valid for all t, whereas the `PC (D) bound is valid only for sufficiently large t. B. The ICC scheme is optimal for a class of digraphs Theorem 3: For messages of any t ≥ 1 bits, if a K-IC structure DK has • (Case 1) no cycle containing only non-inner vertices (for example, refer to the digraph D1 in Fig. 1a), or • (Case 2) exactly M ≥ 1 cycles containing only non-inner vertices and these cycles are all disjoint, and we can partition the inner-vertex set VI into M + 1 subsets such that each of them forms a disjoint IC structure (possibly by including some non-inner vertices) of case 1, and all of the IC structures are also disjoint from the M cycles among non-inner vertices (for example, refer to the digraph in Fig. 4), then the scalar linear index code given by the ICC scheme is optimal for DK , i.e., `ICC (DK ) = β(DK ) = βt (DK ). Proof: Refer to Appendix C. Proposition 5: For messages of any t ≥ 1 bits and all K-IC structures with K ∈ {1, 2, 3}, the scalar linear index code given by the ICC scheme is optimal, i.e., `ICC (DK ) = β(DK ) = βt (DK ). Proof: Refer to Appendix D. For all K-IC structures that we have constructed (including K-IC structures not satisfying Theorem 3), the scalar linear index code given by the ICC scheme is optimal. We conjecture that this holds in general. February 25, 2018 DRAFT 16 5 1 10 2 4 3 8 6 7 9 Fig. 4. A 5-IC structure DK=5 with VI = {1, 2, 3, 6, 7}. For this structure, an index code provided by the ICC scheme is {x1 ⊕ x2 ⊕ x3 ⊕ x6 ⊕ x7 , x4 ⊕ x3 , x5 ⊕ x1 , x8 ⊕ x6 ⊕ x9 , x9 ⊕x7 ⊕x8 , x10 ⊕ x3 ⊕ x5 }, which is of length `ICC (DK=5 ) = 6. Furthermore, one can verify that MAIS(Dk=5 ) = 6. In this structure, one can find a cycle h8, 9, 8i that contains only non-inner vertices (viz., vertices 8 and 9). There is only one cycle of this kind in the structure. So, we get M = 1. Now we can partition the inner vertex set VI into M + 1, i.e., 2 subsets, viz., {1, 2, 3} and {6, 7} such that each of the subsets (possibly by including some non-inner vertices) forms a disjoint IC structure (which are also disjoint from the cycle h8, 9, 8i). The first IC structure DK=3 is formed by vertices in {1, 2, 3, 4, 5} with inner-vertex set {1, 2, 3}, and the second IC structure DK=2 is formed by vertices in {6, 7} with inner-vertex set {6, 7} (one can find these partitions by removing red arcs from DK=5 ). Furthermore, DK=3 and DK=2 are two IC structures with no cycle containing only non-inner vertices (i.e., these are IC structures of case 1 of the Theorem 3). Note that any single vertex is also an IC structure with K = 1. Now by encoding over the partitions in DK=5 (structures remaining after removing all red arcs), the ICC scheme constructs an index code {x1 ⊕ x2 ⊕ x3 , x5 ⊕ x1 , x4 ⊕ x3 , x6 ⊕ x7 , x8 ⊕ x9 , x10 } of the length six that is equal to `ICC (DK=5 ). Conjecture 1: For messages of any t ≥ 1 bits and any K-IC structure DK , the scalar linear index code given by the ICC scheme is optimal, i.e., `ICC (DK ) = β(DK ) = βt (DK ). VII. C OMPARISON WITH EXISTING SCHEMES In this section, for a class of digraphs (to be defined shortly), we compare the ICC scheme to the partial-clique-cover scheme, and prove that `ICC (D) ≤ `PC (D). We conjecture that `ICC (D) ≤ `PC (D) is valid in general. Furthermore, we present a family of digraphs where the additive gap (on the index codelength) between these two schemes grows linearly with the total number of the vertices in the digraph. Secondly, we show all of the above for the fractional-local-chromatic-number scheme instead of the partial-clique-cover scheme. Finally, with the help of some examples, we show that the ICC scheme can outperform all of the existing graph-based schemes and the composite-coding scheme. A. The ICC scheme vs. the partial-clique-cover scheme Considering a digraph D0 as a κ(D0 )-partial clique, we re-express D0 in terms of savings in the following proposition. February 25, 2018 DRAFT 17 Proposition 6: For a κ(D0 )-partial clique, the partial-clique-cover scheme provides savings equal to the minimum out-degree of D0 , i.e., S(D0 ) = δ + (D0 ). Proof: Let the total number of vertices in D0 be N 0 . From the definition of partial cliques, i.e., Definition 11, we have δ + (D0 ) = N 0 −(κ(D0 ) + 1) = N 0 − `PC (D0 ) = S(D0 ). (10) Some partial cliques can be further partitioned into smaller partial cliques such that the sum of the partial-clique numbers of its partitioned partial cliques equals that of the original partial clique. This can cause ambiguity while considering partial cliques during our proofs, so we define the notion of minimal partial clique as follows: Definition 17 (Minimal partial clique): A partial clique D0 is a minimal partial clique if the savings obtained from D0 (i.e., δ + (D0 ) from (10)) is always greater than the sum of the savings in each further partitioned sub-digraphs of D0 (over all partitions in D0 ), i.e., max + 0 + 0 + 0 0 {δ (D ) + δ (D ), . . . + δ (D δ + (D0 ) > D10 ,D20 ,...,DM 1 2 M )}, 0 where M is some integer greater than one, and the maximum is over all partitions D10 , D20 , . . . , DM of the minimal partial clique D0 . Theorem 4: For a class of digraphs, where each digraph D gets partitioned into minimal partial 0 cliques D10 , D20 , · · · , DM , for some positive integer m such that (i) for all i ∈ {1, 2, · · · , M }, δ + (Di0 ) ∈ {0, 1, 2, |V (Di0 )| − 1} (we have four members in this set), (ii) V (Di0 ) ∩ V (Dj0 ) = ∅ for all i 6= j, S 0 (iii) V (D) = M i=1 V (Di ), and P 0 (iv) `PC (D) = M i=1 `PC (Di ), then the ICC scheme performs at least as well as the partial-clique-cover scheme, i.e., `ICC (D) ≤ `PC (D). Proof: Refer to Appendix E for the proof. Corollary 2: For any D in which out-degree d+ D (i) ≤ 2 for all i ∈ V (D), we have `ICC (D) ≤ `PC (D). February 25, 2018 DRAFT 18 K +1 N K +2 Here, i i, j j 1, 2 3, 4 K − 1, K i, j ∈ {1, 2, ..., K} and i 6= j Fig. 5. A digraph belonging to the Class A. Proof: For the given D, the minimal partial cliques that partition it to obtain the partial-clique number all have the minimum out-degree belonging to {0, 1, 2} because d+ D (i) ≤ 2. It follows from Theorem 4 that `ICC (D) ≤ `PC (D). For all digraphs that we have analyzed (including digraphs not considered in Theorem 4), we have observed `ICC (D) ≤ `PC (D). For example, the digraph in Fig. 15b has `ICC (D) = `PC (D), and the digraphs in Fig. 1a and Fig. 15a have `ICC (D) strictly less than `PC (D). We conjecture that this holds in general. Conjecture 2: For any digraph D, the ICC scheme performs at least as well as the partialclique-cover scheme, i.e., `ICC (D) ≤ `PC (D). 1) Additive Gap between the ICC scheme and the partial-clique-cover scheme: For an even integer K ≥ 2, consider a digraph D with N = 3K 2 vertices. Now we define a class of digraphs, we call Class A, as follows: For each i ∈ {1, 2, . . . , K2 }, (i) vertex K + i has out-degree d+ D (K + i) = 2, and its out-going arcs go to vertices 2i − 1 and 2i, and + (ii) vertices 2i − 1 and 2i have d+ D (2i − 1) = dD (2i) = K 2 in such a way that there are arcs in both directions between 2i − 1 and 2i, and each of the remaining K 2 − 1 out-going arcs of 2i − 1 and 2i goes to each vertex in {K + 1, K + 2, . . . , 3K/2} \ {K + i} (this vertex set has K 2 − 1 number of vertices in total). Without loss of generality, a Class A digraph D is shown in Fig. 5. Proposition 7: For any digraph D of Class A, we have `PC (D) − `ICC (D) = N 3 − 1. Proof: In a digraph D of the Class A (shown in Fig. 5), minimal partial cliques with vertex sets {1, 2}, {3, 4}, . . . , {K − 1, K}, {K + 1}, {K + 2}, . . . , {N } provides `PC (D) = K (from Proposition 8 in Appendix F). The digraph D is also an IC structure with the inner-vertex set VI = {1, 2, . . . , K} providing `ICC (D) = February 25, 2018 K 2 + 1 (from Proposition 8 in Appendix F). Thus DRAFT 19 `PC (D) − `ICC (D) = K 2 −1= N 3 − 1. B. The ICC scheme vs. the fractional-local-chromatic-number scheme Theorem 5: Consider a K-IC structure DK with |V (DK )| = N 0 . If 1) the minimum out-degree of DK , δ + (DK ) ≤ K − 1, and 2) DK has no bi-directional arcs, then the ICC scheme performs at least as well as the fractional-local-chromatic-number scheme, i.e., `ICC (DK ) ≤ `FLCN (DK ). Before presenting the proof, we start with the definition of the local chromatic number, and a necessary lemma. Definition 18 (Local chromatic number [15]): The local chromatic number χ` (D) of a digraph D is χ` (D) := min c max |{c(u) i∈V (D) : u ∈ ND+ (i)}| + 1, where the minimum is taken over all proper colorings c of D, and c(u) is the color of vertex u according to the coloring c. We first prove the following lemma before proving the theorem. Lemma 1: For a digraph D with no bi-directional arcs, the local chromatic number of its complement, i.e., D̄, is equal to the difference between the total number of vertices (which is N ) and the minimum out-degree of the digraph D, i.e., χ` (D̄) = N − δ + (D). Proof: Here the underlying undirected graph of D̄ is a complete graph, so any proper coloring in D̄ yields every vertex with a unique color. Thus the most colorful out-neighborhood belongs to the vertex with the maximum out-degree. For a vertex v in D (v is also in D̄), we have χ` (D̄) = max d+ (v) + 1. D̄ v (11) We know that the out-degree of a vertex v in D and D̄ is related by the following equation: d+ (v) = N − 1 − d+ D (v). D̄ (12) From (12), if the vertex v has the minimum out-degree in D, then it has the maximum out-degree in D̄ and vice versa, so + max d+ (v) = N − 1 − min d+ D (v) = N − 1 − δ (D). D̄ v February 25, 2018 v (13) DRAFT 20 From (11) and (13), we get (14) χ` (D̄) = N − δ + (D). Proof of Theorem 5: For a digraph D, the length of the index code from the local chromatic number is `LCN (D) = χ` (D̄) [15]. Now for DK that has no bi-directional arc (given), from Lemma 1 we get, `LCN (DK ) = χ` (D̄K ) = N 0 − δ + (DK ). (15) Here the underlying undirected graph of D̄K , i.e., UD̄K is a complete graph, so the fractional local chromatic number (χf (D̄K )) and the local chromatic number (χ` (D̄K )) is the same, i.e., χf (D̄K ) = χ` (D̄K ). Hence, `LCN (DK ) = `FLCN (DK ) = N 0 − δ + (DK ). (16) Now considering (7) and (16), we get `ICC (DK ) ≤ `FLCN (DK ) since K − 1 ≥ δ + (DK ). As an example, we construct a class of digraphs satisfying Theorem 5. Example 4: Consider a class of digraphs where each digraph D has an even number of vertices N , and let K = N . 2 Furthermore, vertices in D can be grouped into two sets (without loss of generality, let them be {1, 2, . . . , K} and {K + 1, K + 2, . . . , N }) such that for each i = {1, 2, . . . , K}, vertex K + i has an arc to vertex i, and vertex i has arcs to all {K + 1, K + 2, . . . , N } \ {K + i}. For the digraph D, δ + (D) = 1, and it has no bidirectional arcs. So, `FLCN (D) = N − δ + (D) = N − 1. One can prove that D is also a K-IC structure with VI = {1, 2, . . . , K}. Now we get `ICC (D) = N − K + 1 = N 2 + 1. The additive gap, `FLCN (D) − `ICC (D) = N −4 , 2 and the gap grows linearly with N . Fig. 3a depicts an example digraph belonging to this class with K = 3. C. The ICC scheme can outperform existing schemes including the composite-coding scheme As an example, we present one IC structure satisfying case 1 of Theorem 3. The structure is depicted in Fig. 6. The structure is a 4-IC, and it is denoted D4 . An index code from the ICC scheme is {x1 ⊕ x2 ⊕ x3 ⊕ x4 , x5 ⊕ x2 ⊕ x3 , x6 ⊕ x3 ⊕ x4 }, which is of length `ICC (D4 ) = 3. From Theorem 3, `ICC (D4 ) = β(D4 ) = βt (D4 ) = 3. For D4 , the index codelength by existing schemes are shown in Table II (these index codelengths are verified by exhaustive search). The index codelengths provided by the aforementioned existing schemes are strictly greater than `ICC (D4 ). February 25, 2018 DRAFT 21 6 1 2 3 4 5 Fig. 6. A 4-IC structure with VI = {1, 2, 3, 4}. TABLE II I NDEX CODELENGTHS FOR THE DIGRAPH D3 IN F IG . 6 FROM EXISTING SCHEMES Schemes Index codelength Clique cover [13] 5 Fractional-clique cover [7] 5 Cycle cover [17], [18] 4 Fractional-cycle cover [17] 4 Partial-clique cover [13] 4 Fractional-partial-clique cover [14] 4 Local chromatic number [15] 4 Fractional Local chromatic number [15] 3.5 Fractional-partitioned local chromatic number [16] 3.5 Composite coding [9] 3.5 VIII. E XTENSIONS In this section, firstly, we extend the ICC scheme using time-sharing to code over overlapping IC structures in a digraph, and to obtain vector linear index codes. Secondly, we extend the definition of the IC structure in such a way that we can extend the ICC scheme to code on extended IC structures. A. Fractional ICC scheme Let Ds = (V (Ds ), {(i, j) ∈ A(D) : i, j ∈ V (Ds )}) denote a sub-digraph induced by a subset s of the vertices in D = (V (D), A(D)). We define a function   |V (Ds )| − Ks + 1, if Ds is a Ks -IC structure, φ(Ds ) =  |V (Ds )|, otherwise. February 25, 2018 DRAFT 22 The index codelength3 from the fractional ICC scheme is represented as `FICC (D), and given by the following linear program: X minimize fs · φ(Ds ) s∈S subject to X s∈S:j∈V (Ds ) fs ≥ 1, for each j ∈ V (D), (17) fs ∈ [0, 1], s ∈ S. Here S is the power set of V (D). In the fractional ICC scheme, each sub-digraph induced by the subset s in S is assigned a weight [0, 1] such that the total weight of each message over all of the subsets it belongs to is at least one. In this scheme, `FICC (D) is the minimum sum of weights. The ICC scheme is a special case of the fractional ICC scheme where fs ∈ {0, 1}, so β(D) ≤ `FICC (D) ≤ `ICC (D). B. Extension of the IC structure We start with an example that provides an insight to the extension of the IC structure. Consider a digraph D that has three cliques ρ1 , ρ2 and ρ3 each of size two. Let V (ρ1 ) = {1, 2}, V (ρ2 ) = {3, 4} and V (ρ3 ) = {5, 6} be vertex sets of those three cliques respectively. Furthermore, for the clique pair (ρ1 , ρ2 ), all vertices in V (ρ1 ) have out-going arcs to all vertices in V (ρ2 ), and the result follows similarly for clique pairs (ρ2 , ρ3 ) and (ρ3 , ρ1 ). This digraph is depicted in Fig. 7a. One can verify that D is a 4-IC structure with an inner vertex set VI = {1, 2, 3, 4}. We cannot get a 5-IC structure in D. Suppose that we pick VI = {1, 2, 3, 4, 5}, there is no path from vertices 1 and 2 to vertex 5 without passing through the inner vertex 3 or 4. By symmetry, choosing any 5 vertices as an inner vertex set will have the same issue. Now the ICC scheme gives an index code {x1 ⊕ x2 ⊕ x3 ⊕ x4 , x5 ⊕ x1 ⊕ x2 , x6 } of length `ICC (D) = 3. However, from the coding point of view of an IC structure, vertices 5 and 6 need not be separated during encoding because they have the same arc sets ND+ (5)\{6} = ND+ (6)\{5} and ND− (5) \ {6} = ND− (6) \ {5}, and have arcs to each other. This means we can get another index code by removing x6 , and replacing x5 with x5 ⊕ x6 , i.e., {x1 ⊕ x2 ⊕ x3 ⊕ x4 , x5 ⊕ x6 ⊕ x1 ⊕ x2 } of length two. Here due to the special connectivity of clique {5, 6}, we have treated it as a single vertex, and used x5 ⊕ x6 in the code construction. In light of this, we will now extend the 3 See the work by Blasiak et al. [7] for the derivation of (timeshared) index codes using the fractional version of a scheme. February 25, 2018 DRAFT 23 5 6 vs 4 3 2 1 4 (a) 3 2 1 (b) Fig. 7. (a) The digraph with three cliques each of order two, and all vertices of a clique have out-going arcs to all vertices of another clique such that the three cliques are connected in a cyclic pattern as shown (from the ICC scheme, the digraph has an index code {x1 ⊕ x2 ⊕ x3 ⊕ x4 , x5 ⊕ x1 ⊕ x2 , x6 } of length `ICC (D) = 3), and (b) the same digraph, but with a super-vertex notation (the super-vertex, denoted by vs , is formed by vertices 5 and 6, and the digraph has an index code {x1 ⊕ x2 ⊕ x3 ⊕ x4 , x5 ⊕ x6 ⊕ x1 ⊕ x2 } of length two). definition of an IC structure to capture cliques with such special configurations. To achieve this we define a term called a super-vertex. Definition 19 (Super-vertex): In a digraph D, let Vs be a vertex set where (i) all vertices in Vs have arcs to each other, i.e., they form a clique, and (ii) every vertex i ∈ Vs has the same ND+ (i) \ Vs and the same ND− (i) \ Vs . Such a group of vertices (all i ∈ Vs ) is called a super-vertex and denoted as vs . Now we define extended IC structures and an index-coding scheme for them. Definition 20 (Extended IC structure): The extended IC (EIC) structure is defined as an IC structure that allows super-vertices in its non-inner vertex set. Definition 21 (Extended ICC scheme): For any digraph D, the extended ICC (EICC) scheme finds a set of disjoint EIC structures covering D. It then codes each of these EIC structures using the code construction described in the following: • Each super-vertex (non-inner vertices) is treated as a single vertex during the construction and the encoding process of the EIC structure. • We consider the message requested by the super-vertex to be the XOR of all messages requested by the vertices forming the super-vertex. • Each of these EIC structures are treated as an IC structure, and an index code is constructed using the ICC scheme. Along with super-vertices, and taking their definition into account, one can prove the validity of the code constructed by the EICC scheme similar to the proof of Proposition 4. Denote the length of the index code produced by the EICC scheme by `EICC (D). February 25, 2018 DRAFT 24 1 1 5 2 4 3 (a) 1 5 2 4 1 5 3 2 4 (b) D5 3 (c) D6 1 5 2 4 3 (d) D7 5 2 4 3 (e) D8 Fig. 8. (a) We form four digraphs D1 , D2 , D3 , and D4 by removing any number (zero to two inclusive) of dashed arcs from the digraph (this gives four non-isomorphic digraphs), (b) D5 , (c) D6 , (d) D7 , and (e) D8 . All of the digraphs (D1 to D8 ) have an index code {x1 ⊕ x2 ⊕ x3 , x1 ⊕ x4 ⊕ x5 } of length two. Furthermore, two is the optimal codelength for the digraphs. The ICC scheme (including fractional and extended versions) achieves the minimum of the index codelength of (i) 5 2 7 3 for D6 , and (ii) for the remaining digraphs D1 , D2 , D3 , D4 , D5 , D7 , and D8 . Theorem 6: For a digraph D, the index codelength obtained from the EICC scheme is a better upper bound to the optimal broadcast rate than the codelength obtained from the ICC scheme, i.e., β(D) ≤ βt (D) ≤ `EICC (D) ≤ `ICC (D). Proof: It follows from the definition of EIC structures that include IC structures as special cases. Remark 9: Referring to the work by Ong [24], which proved that linear index codes are optimal for all unicast index-coding instances up to and including five receivers, we find that the ICC scheme (including fractional and extended versions) provides the minimum index codelength for all message alphabet sizes for all unicast index-coding instances up to five receivers (9846 non-isomorphic problems) except 8 problems (modeled by 8 non-isomorphic digraphs). The eight non-isomorphic digraphs are illustrated in Fig. 8. IX. C ONCLUSION Graph-based approaches have been shown to be useful for index coding, in which cycles play an important role. Prior to this work, cycles and cliques (including the timeshared version) were exploited to construct index codes. In this work, we attempted to extend the role of cycles in index coding. We took a step further and showed the benefits of coding on interlinked-cycle structures (one form of overlapping cycles). Our proposed scheme generalizes coding on cycles and cliques. By identifying a useful interlinked-cycle structure, we were able to characterize a class of infinitely many graphs where scalar linear index codes are optimal. For some classes of digraphs, we proved that the ICC scheme performs at least as well as some existing schemes such as the partial-clique-cover scheme and the fractional-local-chromatic-number scheme. Furthermore, February 25, 2018 DRAFT 25 for a class of digraphs, we proved that the partial-clique-cover scheme and the ICC scheme have linearly-growing additive gap in index codelength with the number of vertices in the digraphs. We proved a similar result for the fractional-local-chromatic-number scheme and the ICC scheme for another class of digraphs. We extended the ICC scheme, to allow time-sharing over all possible IC structures in digraphs. We also extended the IC structure to allow super vertices as its non-inner vertices. However, it remains an open problem to identify cycles overlapping in other useful ways. A PPENDIX A P ROOF OF P ROPOSITION 4 A K-IC structure DK has some properties captured in the following lemmas, which will be used to prove Proposition 4. Here we consider Ti and Tj as any two distinct directed rooted trees present in DK with the root vertices i and j respectively. Lemma 2: For any vertex v ∈ V (Ti ) ∩ V (Tj ), and v ∈ / VI , the set of leaf vertices that fan out from the common vertex v in each tree is a subset of VI \ {i, j}. Proof: In a tree Ti (see Fig. 9), for any vertex v ∈ V (Ti ) and v ∈ / VI , let LTi (v) be a set of leaf vertices that fan out from vertex v. If vertex j ∈ LTi (v), then there exists a path from v to j in Ti . However, in Tj , there is a path from j to v. Thus in the sub-digraph4 DK , we obtain a path from v to j (via Ti ) and vice versa (via Tj ). As a result, a cycle including non-inner vertices and only one inner vertex (i.e., j) exists. This cycle is an I-cycle, and condition 1 (i.e., no I-cycle) for DK is violated. Hence, j ∈ / LTi (v). In other words, LTi (v) ⊆ VI \ {i, j}. Similarly, LTj (v) ⊆ VI \ {i, j}. Lemma 3: For any vertex v ∈ V (Ti ) ∩ V (Tj ), and v ∈ / VI , the out-neighborhood of vertex v is same in both trees, i.e., NT+i (v) = NT+j (v). Proof: Here the proof is done by contradiction. Let us suppose that NT+i (v) 6= NT+j (v). For this proof we refer to Fig. 9. This proof has two parts. In the first part, we prove that LTi (v) = LTj (v), and then prove that NT+i (v) = NT+j (v) in the second part. (Part 1) Suppose that LTi (v) 6= LTj (v). From Lemma 2, LTi (v) is a subset of VI \ {i, j}. Now pick a vertex c that belongs to VI \ {i, j} such that c ∈ LTi (v) but c ∈ / LTj (v) (such c exists since we suppose that LTi (v) 6= LTj (v), and we swap the indices i and j if LTi (v) ⊂ LTj (v)). In 4 As DK = February 25, 2018 S ∀i∈VI Ti , a path present in any Ti also present in DK . DRAFT 26 i Ti j Tj v v Arc NT+i (v) c Arc P ath NT+j (v) b LTi (v) ⊆ VI \ {i, j} d VI \ {i} c P ath e LTj (v) ⊆ VI \ {i, j} d VI \ {i, j} VI \ {j} Fig. 9. Outline of the directed rooted trees Ti and Tj with root vertices i and j respectively, and a non-inner vertex v in common. Here we have used solid arrow to indicate an arc, and dashed arrow to indicate a path. tree Ti , there exists a directed path from vertex i, which includes v to the leaf vertex c. Let this path be Pi→c (Ti ). Similarly, in tree Tj , there exists a directed path from vertex j, which doesn’t include v (since c ∈ / LTj (v)), and ends at the leaf vertex c. Let this path be Pj→c (Tj ). In the digraph DK , we can also obtain a directed path from j which passes through v (via Tj ), and ends at the leaf vertex c (via Ti ). Let this path be Pj→c (DK ). The paths Pj→c (Tj ) and Pj→c (DK ) are different, which indicates the existence of multiple I-paths from j to c in DK , this violates the condition 2 for DK . Consequently, LTi (v) = LTj (v). (Part 2) Now we pick a vertex b such that, without loss of generality, b ∈ NT+i (v) but b ∈ / NT+j (v) (such b exists since we assumed that NT+i (v) 6= NT+j (v), and we swap the indices i and j if NT+i (v) ⊂ NT+j (v)). Furthermore, we have two cases for b, which are (case 1) b ∈ LTi (v), and (case 2) b ∈ / LTi (v). Case 1 is addressed in the first part of this proof. On the other hand, for case 2, we pick a leaf vertex d ∈ LTi (b) such that there exists a path (see Fig. 9) that starts from v followed by b, and ends at d, i.e., hv, b, . . . , di exists in Ti . A path hj, . . . , vi exists in Tj . Thus a path hj, . . . , v, b, . . . , di exists in DK . From the first part of the proof, we have LTi (v) = LTj (v), so d ∈ LTj (v). Now in Tj , there exists a path from j to d, which includes v followed by a vertex e such that e ∈ NT+j (v) and e 6= b (as b ∈ / NT+j (v)), and the path ends at d, i.e., hj, . . . , v, e, . . . , di which is different from hj, . . . , v, b, . . . , di. Note that in trees Ti and Tj , only the root and the leaf vertices are from VI , so multiple I-paths are observed at d from j. This violates condition 2 for DK . Consequently, NT+i (v) = NT+j (v). Lemma 4: If a vertex v ∈ V (Ti ) such that v ∈ / VI , then its out-neighborhood is the same in Ti and in DK , i.e., NT+i (v) = ND+K (v). February 25, 2018 DRAFT 27 Proof: For any v ∈ V (Ti ) from Lemma 3, NT+i (v) = NT+j (v) for all {j : v ∈ Tj }. Since S DK = ∀i∈VI Ti , vertex v must have the same out-neighborhood in DK as well. Proof of Proposition 4: From (6), all j ∈ {K + 1, K + 2, . . . , N 0 } which are non-inner vertices, can decode their requested messages. This is because the coded symbol wj is the bitwise XOR of the messages requested by j and its all out-neighborhood vertices, and any j has messages requested by all of its out-neighborhood vertices in its side information. For an inner vertex i, rather than analyzing the sub-digraph DK , we will analyze its tree Ti , and show that it can decode its message from the relevant symbols in W . We are able to consider only the tree Ti due to the Lemma 4. Now let us take any tree Ti . Assume that it has a height H where 1 ≤ H ≤ (N 0 − K + 1). The vertices in Ti are at various depths, i.e., {0, 1, 2, . . . , H} from the root vertex i. The root vertex i has depth zero, and any vertex at depth equal to the height of the tree is a leaf vertex. Firstly, in Ti , we compute the bitwise XOR among coded symbols of all non-leaf vertices L at depth greater than zero, i.e., Zi , j∈V (Ti )\VI wj . However, in Ti , the message requested by a non-leaf vertex, say p, at a depth strictly greater than one, appears exactly twice in {wj : j ∈ V (Ti ) \ VI }; i) once in wk , where k is parent of p in tree Ti , and ii) once in wp . Refer to (20) for mathematical details. Thus they cancel out each other while computing Zi in the tree Ti . Hence, in the tree Ti , the resultant expression is the bitwise XOR of i) messages requested by all non-leaf vertices at depth one, and ii) messages requested by all leaf vertices at depth strictly greater than one. Refer to (21) for mathematical details. Secondly, in Ti , we compute wI ⊕ Zi (refer to (22) for mathematical details) which yields the bitwise XOR of i) the messages requested by all non-leaf vertices at depth one, which are out-neighbors of i, ii) the messages requested by all leaf vertices at depth one, which are also out-neighbors of i, and iii) the message requested by i, i.e., xi . This is because the message requested by each leaf vertex at depth strictly greater than one in the tree Ti is present in both the resultant terms of Zi and in wI , thereby canceling out itself in February 25, 2018 DRAFT 28 wI ⊕ Zi . Hence, wI ⊕ Zi yields the bitwise XOR of xi and {xj : j ∈ ND+K (i)}. As i knows all {xj : j ∈ ND+K (i)} as side-information, any inner vertex i can decode its required message from wI ⊕ Zi . The mathematical computations of Zi and wI ⊕ Zi in the tree Ti are as follows: 1) Computing Zi : M Zi = wj j∈V (Ti )\VI M = j∈V (Ti )\VI j∈V (Ti )\VI j∈V (Ti )\VI M + q∈ND (j) K XV (Ti ) , L j∈V (Ti )\VI XV0 (Ti ) , M j∈V (Ti )\VI  xj ⊕    L q∈NT+ (j)\VI i M q∈NT+ (j)∩VI i   xq   q∈NT+ (j) i   xj ⊕ M q∈NT+ (j)\VI i = XV (Ti ) ⊕ XV0 (Ti ) . Where,  M   xq   xj ⊕  M =   xj ⊕  M =  xq ⊕ M q∈NT+ (j)∩VI i   xq  (18)  xq, and  xq = M xq . (19) q:q∈VI \{i} & q ∈N / T+ (i) i Here (19) is obtained because each q ∈ VI \ {i} has only one parent in Ti , and we exclude all q ∈ VI \ {i} whose parent is i, and XV0 (Ti ) is bitwise XOR of messages requested by all of the leaf vertices not in the out-neighborhood of i. If we expand XV (Ti ) as per the group of vertices February 25, 2018 DRAFT 29 according to their depth, we get XV (Ti ) =  M j1 ∈NT+ (i)\VI i M  xj1 ⊕  j2 ∈NT+ (j1 )\VI i M i M q∈NT+ (j1 )\VI  xj2 ⊕ jH−2 ∈ NT+ (jH−3 )\VI   i M  xq⊕ q∈NT+ (j2 )\VI i   xq  ⊕ . . . ⊕  M  xjH−2 ⊕ q∈NT+ (jH−2 )\VI i  xq ⊕          M    xq . . . xjH−1 ⊕    jH−1 ∈  q∈NT+ (jH−1 )\VI   i + NT (jH−2 )\VI {z } | i M =∅ = M xj . (20) j∈NT+ (i)\VI i Note that the intermediate terms in XV (Ti ) cancel out (we have used the same color to indicate the terms that cancel each other). Now substituting XV (Ti ) of (20) and XV0 (Ti ) of (19) in (18), we get Zi = M k∈NT+ (i)\VI i February 25, 2018    xk ⊕   M q:q∈VI \{i} & q ∈N / T+ (i) i    xq  .  (21) DRAFT 30 2) Computing wI ⊕ Zi : wI ⊕ Zi = wI ⊕ XV (Ti ) ⊕ XV0 (Ti ) M M M = xi ⊕ xj ⊕ xk ⊕ xq k∈NT+ (i)\VI j∈VI \{i}    = xi ⊕   i M j:j∈VI \{i} & j∈NT+ (i) xj ⊕ i M i   = xi ⊕   M j:j∈VI \{i} & j∈NT+ (i) M   xk ⊕   xj ⊕  j:j∈VI \{i} & j ∈N / T+ (i)  k∈NT+ (i)\VI  q:q∈VI \{i} & q ∈N / T+ (i) i i   xj  ⊕  M q:q∈VI \{i} & q ∈N / T+ (i) M k∈NT+ (i)\VI i i i     xq     xk  .  (22) A PPENDIX B A N ALGORITHM FOR THE ICC SCHEME For the ICC scheme, we present an algorithm that exhaustively searches all IC structures in a digraph D and computes its index codelength. The overview of the algorithm is as follows: In the first round, we remove all the vertices having in-degree or out-degree equal to zero and the arcs associated with them from D, and consider the resulting sub-digraph, denoted D0 , for further processing. In the second round, we start with a single vertex i ∈ V (D0 ) (which is considered as a 1-IC structure) and check whether or not, in D0 , we can find larger IC structures with the inner-vertex set VI = {i, j} for each j ∈ V (D0 ), j 6= i. This checking and finding task is done by invoking a proposed function, which we call CheckInnerVertices(VI0 , DK , v 0 , D0 , P), where DK is an IC structure, VI0 is the inner-vertex set of DK , v 0 is the vertex that need to be checked, and P is the set of all possible simple paths in D0 between all pairs of the unique vertices in V (D0 ) (for this round, VI0 = VI , DK = ({i}, ∅), v 0 = j, and D0 and P remain the same for all round). The pseudocode of the function is presented as Algorithm 2. In D0 , there can exist multiple paths between any two vertices, so we can obtain multiple IC structures with the same VI , and the February 25, 2018 DRAFT 31 Algorithm 1: Enumerate all possible IC structures for a digraph D and compute `ICC (D). Input: Digraph D = (V (D), A(D)). //V (D) = {1, 2, . . . , N }. Output: `ICC (D) and the corresponding IC structures covering D. − V0 = {v : v ∈ V (D) and d+ D (v) = 0, or dD (v) = 0}; V (D0 ) = V (D) \ V0 ; Let a sub-digraph of D induced by the vertex set V (D0 ) be D0 , where D0 = (V (D0 ), A(D0 )) and without loss of generality V (D0 ) = {1, 2, · · · , N 0 }; N 0 ≥ 1; //Initialization I = {(∅, ∅)}; //A family of sets collecting all IC structures along with their inner-vertex sets. For any i, j ∈ V (D0 ) such that i 6= j, let Pi→j (D0 ) , {Pi→j (D0 )} be the set of all possible simple paths from i to j; //All possible simple paths between any two vertices in a digraph can be found by implementing Warshall’s algorithm or the modified depth-first search algorithm. P , {Pi→j (D0 )}∀i,j∈V (D0 ):i6=j ; foreach vertex i ∈ {1, 2, . . . , N 0 } do V1,i = {i}; D1,i = {D1,i,1 } = {({i}, ∅)}; //Da,b is a family of sets collecting all IC structures with the same inner vertex set Va,b , where a indicates the total number of inner vertices and b is used for indexing, and Da,b,j is an IC structure which is the j th element of Da,b . I ← I ∪ {(D1,i,1 , V1,i )}; s = 1; Ps = N 0 ; V = ∅; //V is a family of sets collecting all sets of vertices that have already been checked whether or not they are inner-vertex sets of IC structures. //Iteration while Ps 6= 0 do p = 0; foreach Vs,i , i ∈ {1, 2, . . . , Ps } do foreach non-empty Ds,i,j ∈ Ds,i , j ∈ {1, 2, . . . , |Ds,i |} do V 0 = V (D0 ) \ V (Ds,i,j ); if V 0 6= ∅ then foreach k ∈ V 0 do if (Vs,i ∪ {k}) ∈ / V then (check, D) = CheckInnerVertices(Vs,i , Ds,i,j , k, D0 , P); if check = Yes then p ← p + 1; Vs+1,p = Vs,i ∪ {k}; Ds+1,p = D , {Ds+1,p,1 , Ds+1,p,2 , . . . , Ds+1,p,M }, where M = |D|; I ← I ∪ {(Ds+1,p,m , Vs+1,p )}∀m∈{1,2,...,M } ; V ← V ∪ {(Vs,i ∪ {k})}; s ← s + 1; Ps ← p; Let cover(I) , {I0 ⊆ I : structures covering `ICC (D0 ) = `ICC (D) = D0 ; min S Da,b,c ∈ I0 P I0 ∈ cover(I) ∀D 0 a,b,c ∈ I |V0 | + `ICC (D0 ); February 25, 2018 V (Da,b,c ) = V (D0 )}, where a, b, c are positive integers providing the label of the chosen IC (|V (Da,b,c )| − |Va,b | + 1), where `ICC (D0 ) is minimized over all I0 ; DRAFT 32 Algorithm 2: Checks and grows a given IC structure. Function CheckInnerVertices(VI0 , DK , v 0 , D0 , P) Without loss of generality, let VI0 = {1, 2, . . . , M }, where M = |VI0 |; For any i, j ∈ V (D0 ), consider P0i→j (D0 ) , Pi→j (D0 ) \ {Pi→j (D0 ) : V (Pi→j (D0 )) ∩ (VI0 \ {i, j}) 6= ∅}; s = 1; D0 = ∅; //D0 is a family of sets collecting all of the IC structures grown from the given IC structure DK . if ∀i ∈ VI0 , P0i→v0 (D0 ) 6= ∅ and P0v0 →i (D0 ) 6= ∅ then foreach unique [P1→v0 (D0 ), . . . , PM →v0 (D0 ), Pv0 →1 (D0 ), . . . , Pv0 →M (D0 )] ∈ P01→v0 (D0 ) × · · · × P0M →v0 (D0 ) × P0v0 →1 (D0 ) × · · · × P0v0 →M (D0 ) do Ds0 = DK ∪ (P1→v0 (D0 ) ∪ . . . ∪ PM →v0 (D0 ) ∪ Pv0 →1 (D0 ) ∪ . . . ∪ Pv0 →M (D0 )); V 0 = VI0 ∪ {v 0 }; //In Ds0 , we check I-cycles and I-paths. if ∀i ∈ V 0 , every Pi→i (Ds0 ) has V (Pi→i (Ds0 )) ∩ (V 0 \ {i}) 6= ∅ then if ∀i, j ∈ V 0 , i 6= j, there is one and only one path Pi→j (Ds0 ) such that V (Pi→j (Ds0 )) ∩ V 0 = {i, j} then D0 ← D0 ∪ {Ds0 }; s ← s + 1; if D0 = 6 ∅ then return (Yes, D0 ); else return (No, D0 ); function CheckInnerVertices(VI0 , DK , v 0 , D0 , P) finds and returns all possible IC structures with the same VI . We carry out the second round operations for all vertices in V (D0 ). In the third round, for each of the IC structures obtained in the second round, we check whether or not we can find a larger IC structure that includes one extra inner-vertex from the vertices not included in the IC structure. This is again done by invoking the function CheckInnerVertices(VI0 , DK , v 0 , D0 , P). We repeat this process of checking and finding IC structures till we can not find any larger IC structures. This will happen when the IC structure in the earlier round is the largest IC structure possible with the respective vertices. For details, refer to the pseudocode in Algorithm 1. After finding all possible IC structure in D0 , we compute `ICC (D0 ) by minimizing the codelengths provided by IC structures covering D0 over all possible IC structures in D0 . The sum of `ICC (D0 ) and the number of vertices removed from D in the first round provides `ICC (D). The algorithm presented here is a brute-force search, and it might be intractable for large February 25, 2018 DRAFT 33 digraphs (having large number of vertices) because of large numbers of checks that need to be performed during the algorithm’s runtime. We do not consider designing heuristic (but faster) algorithms, as it is not the focus of this work. A PPENDIX C P ROOF OF T HEOREM 3 We first prove one lemma that will help to prove the optimality of the ICC scheme. Lemma 5: In an IC structure, any cycle must contain either (i) no inner vertex, or (ii) at least two inner vertices. Proof: It follows directly from the property of an IC structure that a cycle cannot be formed by including only one inner vertex because this type of cycle is an I-cycle. Proof of Theorem 3: We will show that the MAIS lower bound (1) is tight for all t. We consider that DK has N 0 ≥ 1 vertices. For any DK , if K = 1, then there exists an inner vertex, and there is no arc and vertex except the inner vertex. This is because in DK=1 , if there exists any other vertex beside the inner vertex, then it must be a non-inner vertex because K = 1. The additional vertex can be a non-inner vertex if and only if it is included by an I-path in DK=1 . If there exists an I-path, then there must be at least two inner vertices in DK=1 (which contradicts the given condition K = 1). Thus DK=1 contains only one vertex, and MAIS(DK=1 ) = 1. For K ≥ 2, we have the following: (Case 1) From Lemma 5, any cycle must include at least two inner vertices, or no inner vertex, thus if we remove K − 1 inner vertices, then the digraph DK becomes acyclic. Thus MAIS(DK ) ≥ N 0 − K + 1. (23) `ICC (DK ) = N 0 − K + 1. (24) From Theorem 1, we get It follows from (1), (23) and (24) that MAIS(DK ) = N 0 − K + 1 = `ICC (DK ). Thus `ICC (DK ) = β(DK ) = βt (DK ) = N 0 − K + 1. (Case 2) A DK can be viewed in two ways. The first way is considering the whole DK as a K-IC structure. The second way is considering induced sub-digraphs of DK which consist of a) M disjoint cycles together consisting of a total of NA (0 ≤ NA < N 0 − K) non-inner vertices (if NA = 0 or 1, then M = 0, which is case 1), February 25, 2018 DRAFT 34 b) M + 1 disjoint IC structures each with Ni vertices and Ki inner vertices in such a way P +1 that M i=1 Ki = K, we consider that each IC structure is also disjoint from all M cycles among non-inner vertices, and c) total remaining of NB = N 0 − NA − PM +1 i=1 Ni non-inner vertices (which are not included in M cycles, or the M + 1 IC structures). Now we will show that both ways of looking at DK are equivalent in the sense of the index codelength generated from our proposed scheme, and both equal to MAIS(DK ). We prefer the second way of viewing DK for our proof since it is easier to find the MAIS lower bound. For the partitioned DK (looking at in the second way), the total number of coded symbols is the summation of the coded symbols for (i) each of the M disjoint cycles (each cycle has saving equal to one), (ii) each of the M + 1 disjoint IC structures (each of the IC structures has savings equal to K − 1), and (iii) NB uncoded symbols for the remaining non-inner vertices, i.e., 0 `ICC (DK ) = (NA − M ) + = N 0 − K + 1. M +1 X i=1 (Ni − Ki + 1) + NB (25) 0 From (24) and (25), `ICC (DK ) = `ICC (DK ), thus from both perspectives the code length is the same. Now for DK (looking at in our second way), if we remove one vertex from each of the M cycles among non-inner vertices (M removal in total), and remove Ki − 1 vertices from each of P +1 the M + 1 IC structures ( M i=1 (Ki − 1) = K − M − 1), i.e., total removal of K − 1, then the digraph becomes acyclic. Thus MAIS(DK ) ≥ (N 0 − K + 1). (26) It follows from (1), (25), and (26) that MAIS(DK ) = N 0 − K + 1 = `ICC (DK ). Thus `ICC (DK ) = β(DK ) = βt (DK ) = N 0 − K + 1. A PPENDIX D P ROOF OF P ROPOSITION 5 Proof: Let D3 be a 3-IC structure having an inner-vertex set VI = {a, b, c}. Now we prove that any non-inner vertices of D3 belonging to an I-path could not contribute to form a cycle including only non-inner vertices of D3 . To show this, we start by picking two inner vertices a February 25, 2018 DRAFT 35 and b, and the I-path Pa→b (D3 ). We assume that the I-path includes n ≥ 0 non-inner vertices, i.e., Pa→b (D3 ) = ha, v1 , v2 , . . . , vn , bi. Further, let {v1 , v2 , . . . , vn } be denoted by Vn . If n = 0, then Vn = ∅ for Pa→b (D3 ). Now for n ≥ 1, we have the following in D3 : • Pb→a (D3 ), Pc→a (D3 ) and Pb→c (D3 ) cannot contain any vertex in Vn of Pa→b (D3 ) because of the following: 1) If Pb→a (D3 ) or Pc→a (D3 ) contains any vertex v ∈ Vn , then Pa→v (D3 ) (part of Pa→b (D3 )) and Pv→a (D3 ) (part of Pb→a (D3 ) or Pc→a (D3 )) form an I-cycle at a. The existence of the I-cycle in D3 contradicts the definition of an IC structure. 2) If Pb→c (D3 ) contains any vertex v ∈ Vn , then Pb→v (D3 ) (part of Pb→c (D3 )) and Pv→b (D3 ) (part of Pa→b (D3 )) form an I-cycle at b. The existence of the I-cycle in D3 contradicts the definition of an IC structure. • One can verify that only the remaining I-paths Pa→c (D3 ) and Pc→b (D3 ) can contain vertices in Vn without forming an I-cycle in D3 . Now for Pa→b (D3 ) and Pa→c (D3 ), these two I-paths must form a directed rooted tree Ta with the root vertex a (by the definition of an IC structure). Thus any set of vertices and arcs from these two I-paths alone could not form a cycle including only non-inner vertices. Furthermore, if Pa→b (D3 ) and Pa→c (D3 ) contain some common non-inner vertices, then let a vertex vi ∈ Vn , which is in Ta , be the vertex from where Ta branches to b and c (refer to Fig. 10a). For Pa→b (D3 ) and Pc→b (D3 ), any set of vertices and arcs from these two I-paths alone could not form a cycle including only non-inner vertices because of the following: • If they contain some common non-inner vertices, then let vj ∈ Vn be the first vertex where Pa→b (D3 ) and Pc→b (D3 ) meet each other (refer to Fig. 10b). Considering any set of vertices and arcs belonging only to these two I-paths, a cycle including only non-inner vertices can form only if a part of Pc→b (D3 ) contributes to form a path from vj to vi ∈ Vn for some i ∈ {1, 2, . . . , j − 1}. This path is not possible because multiple I-paths would be created from a or c to b in D3 (contradiction of the definition of an IC structure). In fact, both the I-paths have the same destination, i.e., b, so there must be only one path from vj to b common in both of them (to avoid any multiple I-paths). For Pa→c (D3 ) and Pc→b (D3 ), if these I-paths contain a non-inner vertex v in common, then Pc→v (D3 ) (part of Pc→b (D3 )) and Pv→c (D3 ) (part of Pa→c (D3 )) forms an I-cycle at c (contradiction to the definition of an IC structure). Thus Pa→c (D3 ) and Pc→b (D3 ) cannot contain February 25, 2018 DRAFT 36 Ta a c a vj vi vi vj c b c a (a) b b (b) (c) Fig. 10. (a) Pa→b (D3 ) and Pa→c (D3 ) forming a tree Ta , and the tree branches at vertex vi to go to b and c in D3 , (b) Pa→b (D3 ) and Pc→b (D3 ) having some vertices in Vn in common, and these two paths first meet at vertex vj , and (c) Pa→b (D3 ), Pa→c (D3 ) and Pc→b (D3 ) together in D3 . The dashed lines indicate paths. any vertex in common except c. Consequently, considering Pa→b (D3 ), Pa→c (D3 ) and Pc→b (D3 ) (along with assumptions that there are some common non-inner vertices in (i) Pa→b (D3 ) and Pa→c (D3 ), and (ii) Pa→b (D3 ) and Pc→b (D3 )), we end up with the structure as shown in Fig. 10c, where j > i and i, j ∈ {1, 2, . . . , n}. This structure contradicts one of the necessary conditions5 for any vertex in Vn to contribute to form a cycle including only non-inner vertices in D3 . Thus there is no vertex in Vn to contribute to form a cycle including only non-inner vertices in D3 . Due to symmetry, the result (any non-inner vertices of D3 belonging to Pa→c (D3 ) could not contribute to form a cycle including only non-inner vertices of D3 ) implies similarly for non-inner vertices belonging to any of the I-paths in D3 . Therefore, there is no cycle among the non-inner vertices in D3 . By Theorem 3, for D3 , we get `ICC (D3 ) = β(D3 ) = βt (D3 ). The proof is straightforward for 2-IC structure (which is a cycle) and 1-IC structure (which is a single vertex). A PPENDIX E P ROOF OF T HEOREM 4 In this section, firstly, for every minimal partial clique D0 with δ + (D0 ) ∈ {0, 1, 2, |V (D0 )| − 1}, we prove that there exists an IC structure within it such that both of the schemes (partial-cliquecover and ICC) provide the same savings. Secondly, we conjecture that the result is valid in general (this is the main reason that results the Conjecture 2). The summary is depicted in Table III. Finally, we prove the theorem. 5 There should be an incoming path to a vertex in Vn (let this vertex be va ) and an out-going path from a vertex in Vn (let this vertex be vb ), for some a ≤ b, where a, b ∈ {1, 2, . . . , n}. One can easily verify this necessary condition. February 25, 2018 DRAFT 37 We prove some lemmas (Lemmas 6, 7 and 8) that capture the properties of the minimal partial clique D0 . Lemma 6: A minimal partial clique D0 with |V (D0 )| ≥ 2 vertices and the minimum out-degree δ + (D0 ) = 1 is a cycle, and both the partial-clique-cover scheme and the ICC scheme achieve savings of one. Proof: The properties of D0 with |V (D0 )| ≥ 2 and δ + (D0 ) = 1 are as follows: In D0 , (i) as δ + (D0 ) = 1, the partial-clique-cover scheme provides the savings of one by Proposition 6, (ii) further partitioning could not provide any savings because it is a minimal-partial-clique, and (iii) there exists at least a cycle because an acyclic digraph should have a sink vertex (a vertex with out-degree zero), and that does not exist since δ + (D0 ) = 1. Thus D0 , which is a minimal partial clique, having all of the above properties is a cycle. From Theorem 2, a cycle is a 2-IC structure, and the ICC scheme provides savings of one by (7). Note that such D0 with |V (D0 )| = 2 is also a clique of order two. Now we define some terms. Definition 22 (Figure-of-eight): Two directed cycles C1 and C2 intersecting only at one vertex, say u, such that V (C1 ) ∩ V (C2 ) = {u}, is a figure-of-eight structure at u. Lemma 7: A minimal partial clique D0 with |V (D0 )| ≥ 1 vertices and the minimum out-degree δ + (D0 ) = |V (D0 )| − 1, is a clique of order |V (D0 )|, and D0 has the savings of |V (D0 )| − 1 from both the partial-clique-cover scheme and the ICC scheme. Proof: In D0 , if δ + (D0 ) = |V (D0 )| − 1, then each vertex has an out-going arc to every other vertex, which is a clique by definition. Thus the partial-clique-cover scheme provides savings of |V (D0 )| − 1 by Proposition 6. From Theorem 2, a clique is a |V (D0 )|-IC structure, and the ICC scheme provides savings of |V (D0 )| − 1 by (7). Lemma 8: In any minimal partial clique D0 with |V (D0 )| ≥ 3 vertices and δ + (D0 ) = 2, there exists a 3-IC structure, and D0 has the savings of two from both the partial-clique-cover scheme and the ICC scheme. We first define some terms and prove some lemmas (Lemmas 9, 10, 11 and 12) that will help to prove the Lemma 8. Definition 23: A path in the forward direction indicates a path from a vertex i to any vertex j such that j > i, and a path in the reverse direction indicates a path from a vertex j to any vertex i such that i < j. For simplicity, we refer a forward path to a path in the forward direction, and a reverse path to a path in the reverse direction. February 25, 2018 DRAFT 38 TABLE III PARTIAL CLIQUES AND IC STRUCTURES FROM THE SAVINGS PERSPECTIVE |V (D0 )| δ + (D0 ) 1 0 1 2 3 4 5 6 7 8 Savings = 0. Savings = 1; D0 is a cycle, which is a special case of an IC. Proved Savings = 2; a 3-IC exists in D0 . 2 3 Savings = δ + (D0 ); a K-IC with K = δ + (D0 ) exists in D0 4 Conjectured D0 doesn’t exist All of the shaded regions represent D0 with δ + (D0 ) = |V (D0 )|−1 = savings; D0 is a clique, which is a special case of an IC. Proved Definition 24 (Farthest path): Consider a sequence of vertices labeled in an increasing order such that there are multiple paths from a vertex i in the sequence to other vertices in the sequence. Among those paths from i, the path to the vertex with the largest label is called the farthest path from vertex i. For example, let 1, 2, . . . , 9 be a sequence of vertices in an increasing order, and 1 has paths to vertices 3, 5 and 9. The path from from 1 to 9 is the farthest path from 1. For the remainder of this section, we consider the following: • A minimal partial clique D0 with |V (D0 )| ≥ 3 number of vertices and δ + (D0 ) = 2 has at least one cycle by Lemma 9. Without loss of generality, denote the cycle by C, and its vertices by V (C) = {1, 2, . . . , p}. For simplicity, vertices of C are labeled in an increasing order as shown in Fig. 12a. • For a, b ∈ V (C), Pa→b (C) denotes a path from a to b including only vertices and arcs of C, 0 and Pa→b (D0 ) denotes a path from a to b consisting of arcs and vertices outside C except vertices a and b. • For the vertices in V (C) (see Fig. 12a), vertex 1 (the first vertex of C) has only forward paths to other vertices of C (Definition 23), and vertex p (the last vertex of C) has only reverse paths to other vertices of C (Definition 23). Let i ∈ V (C) \ {1, p} be the first vertex in the vertex sequence that has a reverse path to any vertex in V (C), i.e., there exist a 0 Pi→j (D0 ) such that j ∈ {1, 2 . . . , i − 1} and all vertices in {1, 2 . . . , i − 1} have no reverse path. February 25, 2018 DRAFT 39 Lemma 9: In a minimal partial clique D0 with the minimum out-degree δ + (D0 ) = 2, and |V (D0 )| ≥ 3 vertices; 1) there exists at least one cycle, C, and 2) for a vertex v ∈ V (C), one of its out-going arcs (beside the arc in C) contribute to form a path that always returns to some vertex in C. Proof: In D0 with |V (D0 )| ≥ 3 vertices and δ + (D0 ) = 2, there exists at least one cycle, denoted C. This is because if any D0 is acyclic, then it must contain at least one sink vertex, and there cannot be sink vertices in D0 since δ + (D0 ) = 2. Assume that vertices u, v ∈ V (C) such that there is an arc from u to v in C. Now in D0 , u has out-degree d+ D0 (u) ≥ 2, and the next out-going arc of u (other than the arc in C) (i) goes to any vertex in V (C) \ {v}, or (ii) contributes a path, say Q, which includes at least one vertex outside C. Consider the terminal vertex of the path Q to be z such that z ∈ V (D0 ) \ V (C). Vertex z cannot be a sink vertex because d+ D0 (z) ≥ 2, and it must contribute to form a path. Since there are no disjoint cycles (all cycles are connected, otherwise any two disjoint cycles in D0 provides savings of two and such D0 is not a minimal partial clique with δ + (D0 ) = 2), z must have a return path to a vertex in V (C). Analyzing D0 by considering the out-going paths from vertices of C, we get the following lemmas. 0 Lemma 10: Any path Pk→m (D0 ) for k ∈ {j + 1, j + 2, . . . , i − 1}, m ∈ V (C) \ {i} and a path 0 Pi→j (D0 ) are disjoint. Proof: We had considered that vertex i of C is the first vertex having a reverse path. Now if 0 0 any path Pk→m (D0 ) meets path Pi→j (D0 ) at some vertices, then there exists a reverse path from vertex k to j. This is not possible because such k would have been the first vertex in the vertex sequence that has a reverse path (contradiction). 0 Lemma 11: Any farthest path from j, Pj→k (D0 ), for k ∈ {j + 1, j + 2, . . . , p} and a path 0 Pm→q (D0 ) for m ∈ {j + 1, j + 2, . . . , k − 1}, q ∈ {k + 1, k + 2, . . . , p} are disjoint. 0 0 Proof: If the farthest path from j, Pj→k (D0 ), meets any path Pm→q (D0 ) at some vertices, 0 0 then there exists Pj→q (D0 ). This is not possible; otherwise, path Pj→q (D0 ) would have been the farthest path (contradiction). 0 0 Lemma 12: If any path Pj→k (D0 ) and a path Pm→j (D0 ) for any m 6= k meet at some common vertices except j, then there exists a figure-of-eight at j. February 25, 2018 DRAFT 40 v v v x v x w u w (a) u w (b) u (c) w u (d) Fig. 11. The possible cases of out-going arcs for vertex u ∈ V (C). The paths are indicated by dashed lines, and the arcs are indicated by solid lines. Proof: If j = k or m = j, then we get a figure-of-eight structure at j. Two closed paths at j 0 will be (i) Pj→j (D0 ), and (ii) C. If j 6= k 6= m, then let x be the common vertex which is nearest 0 0 to j in these two paths Pj→k (D0 ) and Pm→j (D0 ). Now we get a figure-of-eight structure at j. 0 0 Two closed paths at j will be (i) Pj→x (D0 ) (part of Pj→k (D0 )), Px→j (D0 ) (part of Pm→j (D0 )), and (ii) C. These closed paths are disjoint except j. Now we prove Lemma 8. Proof of Lemma 8: The proof is done by the detailed structural analysis of the minimal partial clique D0 . We divide the proof into two parts: In Part-I, we prove that D0 has a figure-ofeight structure (see Definition 22) at a vertex, and in Part-II, we prove there exist a 3-IC structure within D0 having a figure-of-eight structure. (Part-I) Consider the cycle C in D0 has p ≥ 2 vertices. Now based on C, there are two cases in D0 , and those are (i) C with p = 2, i.e., C is a clique of size two, and (ii) C with p ≥ 3. We assume u and v are the two distinct vertices belonging to V (C) in such a way that there exist a directed arc from u to v. In D0 , d+ D0 (u) ≥ 2 and the next out-going arc of u goes out of C, and contributes to form a path, say Q that returns to some vertex in V (C) by Lemma 9. (Case (i)) The cycle C is a clique of size two. Therefore, the path Q returns to C either at u or v. Now we get a figure-of-eight structure at u if the path returns to u, otherwise it returns to v. For the latter case, we get a new cycle that includes the path Q (which includes u, some vertices other than v), vertex v and the arc from v to u (i.e., arc of the cycle C). The new cycle has more than two vertices, thus this ends up with case (ii). (Case (ii)) On the basis where path Q returns, we have the following sub-cases: Q returns to (ii-A) u (see in Fig. 11a) providing a figure-of-eight structure, (ii-B) v (see in Fig. 11b and 11c), and (ii-C) some vertex w ∈ V (C) \ {u, v} (see in Fig. 11d). February 25, 2018 DRAFT 41 1 1 p 2 j 1 i (a) j i−1 (b) Path-A i p m (c) Path-B 1 j p k Path-B k k−1 p i j 1 Path-A k k−1 (d) i m p i p (e) Path-A Path-B Path-B 1 j Path-A k−1 k i−1 i q p 1 j (f) k−1 k m−1 m (g) 0 Fig. 12. (a) Cycle C and its vertices, (b) figure-of-eight at vertex j with Pj→k (D0 ) for k ∈ {i + 1, i + 2, . . . , p}, (c) figure0 of-eight at vertex j with Pj→i (D0 ), (d) illustration of path-A and path-B, (e) figure-of-eight at vertex j with path-A, path-B 0 0 and Pk−1→m (D0 ) for m ∈ {i + 1, i + 2, . . . , p}, (f) figure-of-eight at vertex j with path-A, path-B and Pk−1→i (D0 ), and (g) illustration of updating path-A and path-B. The paths are indicated by dashed lines, and the arcs are indicated by solid lines. For sub-case (ii-B), we have a vertex x ∈ V (Q) \ V (C) such that there is a direct arc from x to v. Since there are no disjoint cycles, the next out-going arc of x (besides the arc from x to v) contributes to form a path to a vertex in V (C). If x has path to u, then we get a figure-of-eight at u (shown in Fig. 11b), otherwise we have the following: a) x has a path to some w ∈ V (C) \ {u, v}, so this ends up with sub-case (ii-C) (shown in Fig. 11d), or b) x has a path to v, but for this case, we have another path (shown in Fig. 11c) from u to v (beside the direct arc from u to v, and path including the direct arc from x to v), and in this path, we can repeat sub-case (ii-B) by considering the predecessor of v in place of x. Since the number of vertices in D0 is finite, sub-case (ii-B) either ends up with a figure-of-eight structure or sub-case (ii-C). For sub-case (ii-C), note that we have a path Q, which is disjoint from C except the first and the last vertices, which starts from any vertex u ∈ V (C) and returns to some vertex w ∈ V (C) \ {u, v}. February 25, 2018 DRAFT 42 We start analyzing the sub-case (ii-C) in D0 considering vertices in V (C). For the vertices in V (C) (see Fig. 12a), in a sequential order starting from vertex 1, we track their out-going paths (which may include vertices not in V (C)) to other vertices in V (C). For this sub-case, we know 0 that there exist a Pi→j (D0 ) such that j ∈ {1, 2 . . . , i − 1} and all vertices in {1, 2 . . . , i − 1} have only forward paths. Now we consider out-going paths from j (the paths are always forward paths), and get the following subsub-cases: 0 1) If the farthest path from j is Pj→k (D0 ) for some k ∈ {i + 1, i + 2, . . . , p}, then there 0 exists a figure-of-eight at j. Two closed paths at j will be (i) Pj→i (C), Pi→j (D0 ), and (ii) 0 0 0 Pj→k (D0 ), Pk→j (C) (refer Fig. 12b). If Pj→k (D0 ) and Pi→j (D0 ) are disjoint except j, then 0 by recalling the definition of Pa→b (C) and Pa→b (D0 ) for any a, b ∈ V (C), one can show 0 0 that the two closed paths are disjoint except j. Otherwise, Pj→k (D0 ) and Pi→j (D0 ) are not disjoint except j, and by Lemma 12, one can find a figure-of-eight at j. 0 (D0 ) for k = i, then there exists a figure-of-eight at j. 2) If the farthest path from j is Pj→k 0 0 0 (D0 ), Pi→j (D0 ), and (ii) Pj→i−1 (C), Pi−1→m (D0 ) for Two closed paths at j will be (i) Pj→i m ∈ {i + 1, i + 2, . . . , p} (one of the forward paths of i − 1), Pm→j (C) (refer Fig. 12c). 0 Using Lemmas 10 and 11, and recalling the definition of Pa→b (C) and Pa→b (D0 ) for any a, b ∈ V (C), one can show that these two closed paths are disjoint except j. 0 (D0 ) for some k ∈ {j + 2, j + 3, . . . , i − 1}. 3) Otherwise, the farthest path from j is Pj→k Starting from j, we have at least two forward paths to some vertices in V (C) such that these paths are disjoint except j. We assume these paths are path-A (the path from j to 0 k − 1) and path-B (the path from j to k). Paths Pj→k−1 (C) and Pj→k (D0 ) will be path-A and path-B respectively (refer Fig. 12d). Now considering the out-going paths from k − 1 into account (the paths are always forward paths), we get the following subsubsub-cases: 0 (D0 ) for some m ∈ {i + 1, i + 2, . . . , p}, (a) If the farthest path from k − 1 is Pk−1→m then there exists a figure-of-eight at j. Two closed paths at j will be (i) path-A, 0 0 Pk−1→m (D0 ), Pm→j (C), and (ii) path-B, Pk→i (C), Pi→j (D0 ) (refer Fig. 12e). Using 0 Lemmas 10 and 11, and recalling the definition of Pa→b (C) and Pa→b (D0 ) for any a, b ∈ V (C), one can show that these two closed paths are disjoint except j. 0 (b) If the farthest path from k − 1 is Pk−1→m (D0 ) for m = i, then there exists a figure-of0 0 eight at j. Two closed paths at j are (i) path-A, Pk−1→i (D0 ), Pi→j (D0 ), and (ii) path-B, 0 Pk→i−1 (C), Pi−1→q (D0 ) for q ∈ {i + 1, i + 2, . . . , p} (one of the forward paths of February 25, 2018 DRAFT 43 v u w u v w (a) (b) Fig. 13. (a) Structure of D0 with the minimum out-degree two, and (b) rearranging D0 to get an IC structure. The paths are indicated by dashed lines, and the arcs are indicated by solid lines. 0 0 (D0 ) and Pi→j (D0 ) are disjoint except j, then i − 1), Pq→j (C) (refer Fig. 12f). If Pj→k 0 by using Lemmas 10 and 11, and recalling the definition of Pa→b (C) and Pa→b (D0 ) for any a, b ∈ V (C), one can show that the two closed paths are disjoint except j. 0 0 Otherwise, Pj→k (D0 ) and Pi→j (D0 ) are not disjoint except j, and by Lemma 12, one can find a figure-of-eight at j. 0 (c) Otherwise, the farthest path from k − 1 is Pk−1→m (D0 ) for some m ∈ {k + 1, k + 2, . . . , i − 1}. The union of path-B and Pk→m−1 (C) give new path-A and we update 0 k − 1 = m − 1. Similarly, the union of path-A and Pk−1→m (D0 ) give new path-B and we update k = m (Refer Fig. 12g). Considering new path-A, new path-B, and updating k = m, we repeat the subsubsub-cases of subsub-case 3. During this iteration, if we get subsubsub-case (a) or (b), then there is a figure-of-eight. Otherwise, we have subsubsub-case (c), where k strictly increase to a value up to i − 1. However, when k reaches i − 1, we must have either subsubsub-case (a) or (b). Thus for all cases, D0 with |V (D0 )| ≥ 3 and δ + (D0 ) = 2 has a figure-of-eight structure at a vertex. (Part-II) Without loss of generality, we consider a figure-of-eight structure at vertex u (two intersecting cycles at u are indicated by red and blue colors in Fig. 13a). Now for the figure-of-eight structure at u in D0 (see Fig. 13a), consider a vertex v in a cycle C1 (indicated in blue color), and a vertex w in another cycle C2 (indicated in red color) in such a way that both v and w have direct arcs going to u. One of the out-going arcs of v must contribute to form a path, say Q, returning to a vertex in V (C2 ) \ {u}. This is because all other cases are not possible; • Q cannot return to any vertex in V (C1 ) \ {u, v}, otherwise a disjoint cycle to C2 will be created. February 25, 2018 DRAFT 44 2 6 1 3 4 2 5 6 1 3 4 (a) 5 (b) 2 2 6 1 3 4 5 (c) 6 1 3 4 5 (d) Fig. 14. Vertices in red, blue and green colors are three internal vertices for the 3-IC in each of the cases. • Q can return to u, but for this case, we have another path from v to u (beside path including direct arc from v to u), and in this path, we can repeat the case by considering the predecessor of u in place of v. Thus this case ends up with the same consideration as of the cycle C1 with the vertex v having direct arc to the vertex u. • Q must return to some vertex in V (C1 ) and V (C2 ) due to Lemma 9. Now in a similarly way, one of the out-going arcs of w must also contribute a path to a vertex in V (C1 ) other than u. Rearrange D0 to get the structure in Fig. 13b. Now consider VI = {u, v, w}. We can see that any vertex in VI has only one I-path each to other two vertices in VI with no I-cycles. Thus a 3-IC exists in D0 (for example, see Fig. 14). Consecutively, the ICC scheme provides savings of two by (7). Again, for D0 , the partial-clique-cover scheme provides savings of two by Proposition 6. For all minimal partial cliques that we have analyzed, there exists an (δ + (D0 ) + 1)-IC structure within each minimal partial clique having the minimum out-degree δ + (D0 ). We conjecture that this holds in general (the following conjecture is not a part of the proof of the Theorem 4, but this provides an intuition about the Conjecture 2). Conjecture 3: For any minimal partial clique D0 , both the partial-clique-cover scheme and the ICC scheme provides the same savings. Now we prove Theorem 4. Proof of Theorem 4: Given a digraph D, if minimal partial cliques, partitioning the digraph to provide partial-clique number, have δ + (D0 ) ∈ {0, 1, 2, |V (D)| − 1}, then using the ICC scheme on each of the minimal partial cliques, we achieve `PC (D) by using Lemmas 6, 7 and 8, and February 25, 2018 DRAFT 45 1 1 2 5 4 2 5 3 4 (a) 3 (b) Fig. 15. (a) The digraph, denoted D1 , has `PC (D1 ) = 3 (considering possible sub-digraphs with vertex sets; {2, 3, 4} forming a clique, {1} and {5} forming two cliques each with single vertex), but `ICC (D1 ) = 2 (considering sub-digraphs with vertex sets; {1, 2, 3, 4, 5} forming an IC structure with 1, 2, 3 and 4 as inner vertices), and (b) the digraph, denoted D2 , has `PC (D2 ) = 3 (considering possible sub-digraphs with vertex sets; {1, 2} forming a clique, and {3, 4, 5} forming a cycle), and `ICC (D2 ) = 3 (considering sub-digraphs with vertex sets; {1, 2} forming an IC structure, and {3, 4, 5} forming another IC structure). considering zero savings for δ + (D0 ) = 0 from any schemes. The ICC scheme may produce a shorter index code by considering a different partitioning of the digraph (for example, see Fig. 15a and 15b). Example 5: This example illustrates that for the class of digraphs stated in Theorem 4, the ICC scheme performs as least as well as the partial-clique-cover scheme. Consider two digraphs that are depicted in Fig. 15. The digraph in Fig. 15a has more savings from the ICC scheme than that obtained from the partial-clique-cover scheme, and the digraph in Fig. 15b has equal savings from both schemes. A PPENDIX F Note that K is an even integer greater than 2, N = 3K , 2 and i, j ∈ {1, 2, . . . , K2 } such that j 6= i. Proposition 8: For any digraph D of the Class A, the index codelength obtained from the partial-clique-cover scheme and the ICC scheme are K and and `ICC (D) = K 2 K 2 + 1 respectively, i.e., `PC (D) = K + 1. Firstly, we prove some lemmas. Lemma 13: Any minimal partial clique D0 in a digraph of the Class A provides savings less than or equal to two, i.e., S(D0 ) ≤ 2. Proof: If any minimal partial clique D0 in D of the Class A includes a vertex K + i for any i ∈ {1, 2, . . . , K2 }, then δ + (D0 ) ≤ 2. This is because the out-degree of any vertex K + i in D is two, i.e., d+ D (K + i) = 2 by construction. Now any minimal partial clique without any vertex in {K + 1, K + 2, . . . , 3K } has δ + (D0 ) ≤ 1. This is because for any vertex in {1, 2, . . . , K}, only 2 February 25, 2018 DRAFT 46 }. So, any minimal partial one out-neighbor is in this set, and the rest are in {K + 1, K + 2, . . . , 3K 2 clique in the digraph can have δ + (D0 ) ≤ 2. Now by proposition 6, we know that S(D0 ) = δ + (D0 ). Lemma 14: A digraph D of the Class A has no minimal partial clique with δ + (D0 ) = 2. Proof: In D, we try to construct a minimal partial clique D0 that has δ + (D0 ) = 2 (we do not need to consider D0 having δ + (D0 ) > 2 because of Lemma 13) by starting from D0 with only one vertex and then adding vertices into its vertex set in such a way that we can obtain δ + (D0 ) = 2. We start from any vertex K + i for an i ∈ {1, 2, . . . , K2 } (we will show a similar result if we start from some vertex i). Let V (D0 ) = {K + i} be the vertex set of D0 . Now we include both of the two out-neighbor vertices of K + i, i.e., vertices in ND+ (K + i) in V (D0 ). If we include + 0 only one out-neighbor vertex of K + i in V (D0 ), then d+ D0 (K + i) = 1 resulting δ (D ) = 1. The new vertex-induced sub-digraph D0 has V (D0 ) = {K + i, 2i − 1, 2i}, and δ + (D0 ) = 1 + because d+ D0 (2i − 1) = dD0 (2i) = 1. To get a minimum out-degree of two, we must include another vertex in V (D0 ) from {K + 1, K + 2, . . . , 3K } \ {i}. By symmetry, it does not make any 2 difference which vertex to add. We arbitrarily choose K + j, for some j ∈ {1, 2, . . . , K2 } \ {i}. Now the new vertex-induced sub-digraph D0 has V (D0 ) = {K + i, 2i − 1, 2i, K + j} for a j. + Here δ + (D0 ) = 0 because d+ D0 (K + j) = 0. We further include all vertices in ND (K + j) in V (D0 ) because d+ D (K + j) = 2, and if we include only one of its out-neighbor vertices, then δ + (D0 ) = 1. The new D0 has V (D0 ) = {K + i, 2i − 1, 2i, K + j, 2j − 1, 2j} and δ + (D0 ) = 2. Further, including any vertex set in V (D0 ) could not increase δ + (D0 ) because any D0 must have δ + (D0 ) = S(D0 ) ≤ 2 (Lemma 13). If we start building D0 with some m ∈ {1, 2, . . . , K}, we will end up with a sub-digraph (i) that includes {m, K + i, 2i − 1, 2i, K + j, 2j − 1, 2j} for some i, j ∈ {1, 2, . . . , K2 } where i 6= j 6= m, or (ii) that includes {2i − 1, 2i, K + j, 2j − 1, 2j, K + i} for some i, j ∈ {1, 2, . . . , K2 } where i 6= j and m = 2i or 2i − 1. Altogether, any minimal partial clique with δ + (D0 ) = 2 must contain {K + i, 2i − 1, 2i, K + j, 2j − 1, 2j} for some i, j ∈ {1, 2, . . . , K2 } where i 6= j. However, D0 is not the minimal because by simply considering two partial cliques among the vertices in D0 , i.e., partial cliques with vertex sets {2i − 1, 2i} and {2j − 1, 2j}, we get savings of two (one in each). Proof of Proposition 8: For a minimal partial clique D0 in D of the Class A, Lemma 13 provides δ + (D0 ) ≤ 2, and Lemma 14 proves that there exists no minimal partial clique with δ + (D0 ) = 2. Thus the minimal partial cliques in a digraph D of the Class A are only cycles. For February 25, 2018 DRAFT 47 this case, the cycle-cover scheme and the partial-clique-cover scheme for D are the same. Since any cycle must include two vertices from {1, 2, . . . , K}, `PC (D) ≥ 3K 2 − K 2 = K. The minimal partial cliques with vertex sets {1, 2}, {3, 4}, . . . , {K −1, K}, {K +1}, {K +2}, . . . , {N } provide `PC (D) = K 2 + K 2 = K. Consider a vertex set VI = {1, 2, . . . , K} with K number of vertices. In the digraph D, any vertex v ∈ VI has only one path each to all other vertices in VI \ {v} such that only the first and the last vertices of each of these paths belong to VI (i.e., I-path). Moreover, there is no I-cycle at any vertex in VI . Thus this forms an IC structure with inner-vertex set VI . Now from (7), `ICC (D) = N − K + 1. Thus `ICC (D) = 3 × ( K2 ) − K + 1 = K 2 + 1. R EFERENCES [1] Y. Birk and T. Kol, “Coding on demand by an informed source (iscod) for efficient broadcast of different supplemental data to caching clients,” IEEE Trans. Inf. Theory, vol. 52, no. 6, pp. 2825–2830, Jun. 2006. [2] Z. Bar-Yossef, Y. Birk, T. S. Jayram, and T. Kol, “Index coding with side information,” IEEE Trans. Inf. Theory, vol. 57, no. 3, pp. 1479–1494, Mar. 2011. [3] E. Lubetzky and U. Stav, “Nonlinear index coding outperforming the linear optimum,” IEEE Trans. Inf. Theory, vol. 55, no. 8, pp. 3544–3551, Aug. 2009. [4] R. Peeters, “Orthogonal representaions over finite fields and the chromatic number of graphs,” Combinatorica, vol. 16, no. 3, pp. 417–431, Sept. 1996. [5] S. H. Dau, V. Skachek, and Y. M. Chee, “Optimal index codes with near-extreme rates,” IEEE Trans. Inf. Theory, vol. 60, no. 3, pp. 1515–1527, Mar. 2014. [6] E. Chlamtac and I. Haviv, “Linear index coding via semidefinite programming,” in Proc. 23rd Annu. ACM-SIAM Symp. on Discrete Algorithms (SODA), Jan. 2012, pp. 406–419. [7] A. Blasiak, R. D. Kleinberg, and E. Lubetzky, “Broadcasting with side information: Bounding and approximating the broadcast rate,” IEEE Trans. Inf. Theory, vol. 59, no. 9, pp. 5811–5823, Sept. 2013. [8] H. Yu and M. Neely, “Duality codes and the integrality gap bound for index coding,” IEEE Trans. Inf. Theory, vol. 60, no. 11, pp. 7256–7268, Sept. 2014. [9] F. Arbabjolfaei, B. Bandemer, Y.-H. Kim, E. Sasoglu, and L. Wang, “On the capacity region for index coding,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jul. 2013, pp. 962–966. [10] S. Unal and A. B. Wagner, “General index coding with side information: Three decoder case,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jul. 2013, pp. 1137–1141. [11] H. Maleki, V. R. Cadambe, and S. A. Jafar, “Index coding – An interference alignment perspective,” IEEE Trans. Inf. Theory, vol. 60, no. 9, pp. 5402–5432, Jul. 2014. [12] S. A. Jafar, “Topological interference management through index coding,” IEEE Trans. Inf. Theory, vol. 60, no. 1, pp. 529–568, Oct. 2013. [13] Y. Birk and T. Kol, “Informed-source coding-on-demand (ISCOD) over broadcast channels,” in Proc. IEEE INFOCOM, vol. 3, Mar. 1998, pp. 1257–1264. [14] F. Arbabjolfaei and Y.-H. Kim, “Local time sharing for index coding,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jun. 2014, pp. 286–290. February 25, 2018 DRAFT 48 [15] K. Shanmugam, A. G. Dimakis, and M. Langberg, “Local graph coloring and index coding,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jul. 2013, pp. 1152–1156. [16] ——, “Graph theory versus minimum rank for index coding,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jul. 2014, pp. 291–295. [17] M. A. R. Chaudhry, Z. Asad, A. Sprintson, and M. Langberg, “On the complementary index coding problem,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jul. 2011, pp. 224–248. [18] M. J. Neely, A. S. Tehrani, and Z. Zhang, “Dynamic index coding for wireless broadcast networks,” IEEE Trans. Inf. Theory, vol. 59, no. 11, pp. 7525–7540, Nov. 2013. [19] F. Arbabjolfaei and Y.-H. Kim, “Structural properties of index coding capacity using fractional graph theory,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jun. 2015, pp. 1034–1038. [20] ——, “On critical index coding problems,” in Proc. IEEE Inf. Theory Workshop (ITW), Oct. 2015, pp. 9–13. [21] M. Tahmasbi, A. Shahrasbi, and A. Gohari, “Critical graphs in index coding,” IEEE Journal on Selected Areas in Communications, vol. 33, no. 2, pp. 225–235, Feb. 2015. [22] L. Ong, “Linear codes are optimal for index-coding instances with five or fewer receivers,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), Jun. 2014, pp. 491–495. [23] S. E. Rouayheb, A. Sprintson, and C. Georghiades, “On the index coding problem and its relation to network coding and matroid theory,” IEEE Trans. Inf. Theory, vol. 56, no. 7, pp. 3187–3195, Jul. 2010. [24] L. Ong, “Optimal finite-length and asymptotic index codes for five or fewer receivers,” Jun. 2016. [Online]. Available: https://arxiv.org/pdf/1606.05982v1.pdf February 25, 2018 DRAFT 1 Corrections to “Interlinked Cycles for Index Coding: Generalizing Cycles and Cliques” Chandra Thapa, Lawrence Ong, and Sarah J. Johnson We provide a correction to [1] in response to an error reported by M. B. Vaddi and B. S. Rajan [2]. To this effect, we add one extra condition for the definition of an IC structure on page 36961 . This correction is required because referring to the proof of the Lemma 3 on page 37022 , the following statements may not be correct in general: Statement 1: In the digraph DK , we can also obtain a directed path from j which passes • through v (via Tj ), and ends at the leaf vertex c (via Ti ). Statement 2: Thus a path hj, . . . , v, b, . . . , di exists in DK . • In particular, Statement 1 is valid if and only if Pj→v (Tj ) ∩ Pv→c (Ti ) = {v}, i.e., the paths Pj→v (Tj ) and Pv→c (Ti ) have no vertex in common except v, where Pj→v (Tj ) is the path from j to v in Tj , and Pv→c (Ti ) is the path from v to c in Ti . We observe a similar problem in Statement 2. To address this issue, we introduce an additional constraint3 to the definition of an IC structure on page 36961 (stated as Condition 3 in the following). The conditions for an IC structure are modified as follows: • Condition 1: There is no I-cycle in DK . • Condition 2: For all ordered pairs of inner vertices (i, j), i 6= j, there is only one I-path from i to j in DK (this condition implies that in DK , for any two inner vertices, there is exactly one cycle containing them and no other inner vertices). [New:] Condition 3: No cycle containing only non-inner vertices. • 1 page 10 of the arXiv version 2 page 25 of the arXiv version 3 This constraint was introduced in “Graphical Approaches to Single-Sender and Two-Sender Index Coding”, PhD thesis, submitted on 24 Jan. 2018 by C. Thapa for examination. February 25, 2018 DRAFT 2 With the introduction of Condition 3, Statements 1 and 2 are now correct, otherwise a cycle containing only non-inner vertices can be formed, which contradicts the new definition of an IC structure. For example, for Statement 1, if there exists at least another non-inner vertex, say a, such that a 6= v and a ∈ Pj→v (Tj ) ∩ Pv→c (Ti ), then there exist Pa→v (Tj ) and Pv→a (Ti ), which gives a cycle including only non-inner vertices ha, . . . , v, . . . , ai. The aforementioned correction was also proposed independent and in parallel by K. V. Bharad- waj and B. S. Rajan [3]. The new definition of an IC structure always satisfies Case 1 in Theorem 3 on page 36984 ; Case 2 (and the corresponding proof on page 37055 ) is no longer required. So, Theorem 3 can be strengthened as follows: [New:] Theorem 3: For messages of any t ≥ 1 bits, for any K-IC structure DK , the scalar linear index code given by the ICC scheme is optimal for DK , i.e., `ICC (DK ) = β(DK ) = βt (DK ). Now, Proposition 5 on page 36986 is a special case of the modified Theorem 3 and should be deleted. Also, Conjecture 1 on page 36987 is the same as the modified Theorem 3, so it is no longer required and should be deleted. In Algorithm 2 on page 37058 , the phrase “such that V (Pi→j (Ds0 )) ∩ V 0 = {i, j} then” is replaced by [New:] “such that V (Pi→j (Ds0 )) ∩ V 0 = {i, j} and no cycle only among V (Pi→j (Ds0 )) \ {i, j} then” to take Condition 3 into account. Besides the foregoing changes and updates, the remainder reported results and proofs are intact. ACKNOWLEDGMENT The authors would like to thank Dr. Min Li for useful discussions. 4 page 15 of the arXiv version 5 page 33 of the arXiv version 6 page 15 of the arXiv version 7 page 16 of the arXiv version 8 page 32 of the arXiv version February 25, 2018 DRAFT 3 R EFERENCES [1] C. Thapa, L. Ong, and S. J. Johnson, “Interlinked cycles for index coding: Generalizing cycles and cliques,” IEEE Trans. Inf. Theory, vol. 63, no. 6, pp. 3692–3711, Jun. 2017. [2] M. B. Vaddi and B. S. Rajan, “Optimal index codes for a new class of interlinked cycle structure,” IEEE Comms. Lett. (Early Access Articles), 29 Jan. 2018. [Online]. Available: https://doi.org/10.1109/LCOMM.2018.2799202 [3] K. V. Bharadwaj and B. S. Rajan, “On index codes for interlinked cycle structured side-information graphs,” 12 Feb. 2018. [Online]. Available: https://arxiv.org/abs/1802.04183v1 February 25, 2018 DRAFT
7cs.IT
Model selection principles in misspecified models † Jinchi Lv University of Southern California, Los Angeles, USA arXiv:1005.5483v2 [math.ST] 11 May 2016 and Jun S. Liu Harvard University, Cambridge, USA Summary. Model selection is of fundamental importance to high-dimensional modeling featured in many contemporary applications. Classical principles of model selection include the Bayesian principle and the Kullback-Leibler divergence principle, which lead to the Bayesian information criterion and Akaike information criterion, respectively, when models are correctly specified. Yet model misspecification is unavoidable in practice. We derive novel asymptotic expansions of the two well-known principles in misspecified generalized linear models, which give the generalized BIC (GBIC) and generalized AIC (GAIC). A specific form of prior probabilities motivated by the Kullback-Leibler divergence principle leads to the generalized BIC with prior probability (GBICp ), which can be naturally decomposed as the sum of the negative maximum quasi-log-likelihood, a penalty on model dimensionality, and a penalty on model misspecification directly. Numerical studies demonstrate the advantage of the new methods for model selection in both correctly specified and misspecified models. Keywords: Model selection; Model misspecification; Bayesian principle; Kullback-Leibler divergence principle; AIC; BIC; GAIC; GBIC; GBICp 1. Introduction We consider in this article the type of data (yi , xi1 , · · · , xip )ni=1 , where the yi ’s are independent observations of the response variable Y conditional on its covariates, or explanatory variables, (xi1 , · · · , xip )T . When the dimensionality or the number of covariates p is large compared with the sample size n, it is desirable to produce sparse models that involve only a small subset of predictors. With such models one can improve the prediction accuracy and enhance the model interpretability. See, for example, Fan and Lv (2010) for an overview of recent progresses in high-dimensional variable selection problems. A natural and fundamental problem that arises from such a task is how to compare models with different sets of predictors. Two classical principles of model selection are the Kullback-Leibler (KL) divergence principle and the Bayesian principle, which lead to the Akaike information criterion (AIC) by Akaike (1973, 1974) and Bayesian information criterion (BIC) by Schwartz (1978), respectively, when the models are correctly specified. The AIC and BIC have been proved to be powerful tools for model selection in various settings; see, for example, Burnham and Anderson (1998) for an account of these developments. Stone (1977) showed heuristically the asymptotic equivalence of AIC and the leave-one-out cross-validation. Bozdogan (1987) studied asymptotic properties of the AIC and BIC, showing that in parametric settings, AIC asymptotically has a positive probability of overestimating the true dimension, while BIC is asymptotically consistent in estimating the true model. The model selection consistency of BIC has also been shown in Casella et al. (2009). Hall (1990) compared AIC with KL cross-validation in the setting of histogram density estimation. Yang and Barron (1998) studied the asymptotic property of model selection criteria related to the AIC and minimum description length principles in density estimation. Other work on model selection includes the risk inflation criterion (Foster and George, 1994), the generalized information criterion (Konishi and Kitagawa, 1996), Bayesian measure using deviance information criterion (Spiegelhalter et al., 2002; Gelman et al., 2004), model evaluation using the absolute prediction error (Tian et al., 2007), tuning parameter selection in penalization method (Wang, Li and Tsai, 2007; Fan and Tang, 2012), the parametricness index (Liu and †Lv’s research was supported by NSF CAREER Award DMS-0955316 and Grant DMS-0806030 and 2008 Zumberge Individual Award from USC’s James H. Zumberge Faculty Research and Innovation Fund. Liu’s research was supported by NSF Grant DMS-0706989 and NIH Grant R01-HG02518-02. We sincerely thank the Joint Editor, an Associate Editor, and a referee for their constructive comments that significantly improved the paper. The first draft of the paper was written in 2008. 2 J. Lv and J. S. Liu Yang, 2011), and many extensions of the AIC and BIC (see, for example, Bozdogan, 1987 and 2000; Bogdan, Ghosh and Doerge, 2004; Chen and Chen, 2008; Żak-Szatkowska and Bogdan, 2011). In parametric modeling, one chooses a priori a family of distributions and then finds a model in this family that best fits the data, often based on the maximum likelihood principle. Despite this common practice, it has been a common wisdom in statistics that “all models are wrong, but some are more useful than others.” Thus, in a broad sense all models are misspecified. Neither AIC nor BIC, however, explicitly accounts for such model misspecification. When the model family is misspecified, evaluating whether a model selection procedure is good or bad becomes more subtle because we can no longer simply say that a selected model is “correct” or “incorrect.” We can mathematically define that a procedure is consistent if it can asymptotically select the model in the family that is theoretically closest to the true model, according to a certain discrepancy measure such as the KL divergence. In the same token, we can define a procedure to be better than others if on average it can select a model closer to the true model than others, according to a certain discrepancy measure. In practice, this type of discrepancy computation can, however, be nontrivial. We content ourselves with the scenario of generalized linear models (GLMs) (McCullagh and Nelder, 1989) with p predictors. In this case, a procedure is better than another if on average it can select more relevant predictors than the other. Prediction is also another important measure for model evaluation. In this paper, we derive asymptotic expansions of the Bayesian and KL divergence principles in misspecified GLMs. The general idea appears also applicable to other model settings. The technical results lead us to propose the generalized BIC (GBIC) and generalized AIC (GAIC). A specific choice of prior probabilities for the models motivated by the KL divergence principle leads us to propose the generalized BIC with prior probability (GBICp ), which can be written as the sum of the negative maximum quasi-log-likelihood, a penalty on model dimensionality, and a penalty on model misspecification directly. Our results can also be viewed as an extension of the classical approaches to non-independent and identically distributed (non-i.i.d.) settings. The rest of the paper is organized as follows. In Section 2, we discuss the quasi-maximum likelihood estimation (QMLE) in misspecified GLMs and two classical model selection principles. We investigate asymptotic expansions of these principles in misspecified models and present resulting model selection criteria in Section 3. In Section 4, we provide all technical conditions and investigate asymptotic properties of the quasi-maximum likelihood estimator (QMLE). We present several numerical examples to illustrate the finitesample performance of these model selection criteria in both correctly specified and misspecified models in Section 5. In Section 6, we provide some discussions of our results and their implications as well as some possible extensions. All technical details are relegated to the Appendix. 2. Model misspecification and model selection principles 2.1. Quasi-maximum likelihood estimation To facilitate the presentation, we introduce some notation and state some basic facts of the QMLE in misspecified GLMs with deterministic design matrices. Conditional on the covariates, we assume that the n-dimensional random response vector Y = (Y1 , · · · , Yn )T has a true unknown distribution Gn with density function n Y gn,i (yi ), (1) gn (y) = i=1 where y = (y1 , · · · , yn )T . Each observation yi of the response variable may depend on all or some of the p predictors xij . Model (1) entails that all components of Y are independent but not necessarily identically distributed. Consider an arbitrary subset M ⊂ {1, · · · , p} with d = |M| ≤ n ∧ p. Define xi = (xij : j ∈ M)T and X = (x1 , · · · , xn )T , an n × d deterministic design matrix. Since the true model Gn is unknown, we choose a family of generalized linear models Fn (·, β) as our working models, with density function fn (z, β)dµ0 (z) = n Y i=1 f0 (zi , θi )dµ0 (zi ) ≡ n Y i=1 exp [θi zi − b(θi )] dµ(zi ), (2) Model Selection Principles in Misspecified Models 3 where z = (z1 , · · · , zn )T , θ = (θ1 , · · · , θn )T = Xβ with β ∈ Rd , b(θ) is a smooth convex function, µ0 is the Lebesgue measure on Euclidean spaces, and µ is some fixed measure on R. Clearly {f0 (z, θ) : θ ∈ R} is a family of distributions in the regular exponential family and may not contain gn,i ’s. Denote by b(θ) = (b(θ1 ), · · · , b(θn ))T and µ(θ) = (b′ (θ1 ), · · · , b′ (θn ))T , and define a matrix-valued function Σ(θ) = diag{b′′ (θ1 ), · · · , b′′ (θn )}. It is a well-known fact that for any n-dimensional random vector Z with distribution Fn (·, β) given by (2), we have EZ = µ(Xβ) and cov(Z) = Σ(Xβ). (3) Theorem 5 in Section 4.2 shows that under some regularity conditions, there exists a unique distribution Fn (·, βn,0 ) in the family of misspecified GLMs in (2) that has the smallest KL divergence from the true model Gn , where the KL divergence (Kullback and Leibler, 1951) of the posited GLM Fn (·, β) in (2) from the true model Gn is given by I(gn ; fn (·, β)) = Z [log gn (z)]gn (z)dz − Z [log fn (z, β)]gn (z)dz = n X I(gn,i ; f0 (·, θi )), (4) i=1 R R where I(gn,i ; f0 (·, θi )) = [log gn,i (z)]gn,i (z)dz − [log f0 (z, θi )]gn,i (z)dz. Thus, the parameter β is identifiable in such misspecified models. This uniqueness entails that Fn (·, β n,0 ) = Gn when the model is correctly specified, that is, Gn ∈ {Fn (·, β) : β ∈ Rd }. The QMLE of the d-dimensional parameter vector β n,0 is defined as b = arg max ℓn (y, β), (5) β n β∈Rd where ℓn (y, β) = log fn (y, β) = yT Xβ − 1T b(Xβ) + n X log i=1 dµ (yi ) dµ0 b is the solution to the score equation is the quasi-log-likelihood function. Clearly β n Ψn (β) ≡ ∂ℓn (y, β) = XT [y − µ(Xβ)] = 0, ∂β (6) (7) which becomes the normal equation XT y = XT Xβ in the linear regression model. b is a consistent Under some regularity conditions, Theorem 6 in Section 4.2 shows that the QMLE β n estimator of β n,0 , and Theorem 7 further establishes its asymptotic normality. The asymptotic covariance b is A−1 Bn A−1 , where matrix of β n n n     Bn ≡ cov Ψn (β n,0 ) = cov XT Y = XT cov(Y)X, (8) in view of (31), with cov(Y) = diag{var(Y1 ), · · · , var(Yn )} by the independence assumption, and An = An (β n,0 ) with An (β) ≡ ∂ 2 I(gn ; fn (·, β)) ∂ 2 ℓn (y, β) =− = XT Σ(Xβ)X 2 ∂β ∂β2 (9) under the smoothness condition. Throughout the paper, the expectation and covariance are taken with respect to the true distribution Gn unless specified otherwise. In view of (3), An (β) defined in (9) is exactly the covariance matrix of XT Y when Y has distribution Fn (·, β), and thus An is the covariance matrix of XT Y under the best misspecified GLM Fn (·, β n,0 ), whereas Bn defined in (8) is the covariance matrix of XT Y under the true model Gn . It is well known in classical maximum likelihood theory that the identity An = Bn holds when the model is correctly specified, with An and Bn being the Hessian and outer product forms of the Fisher information matrix, respectively. These two matrices play a pivotal role in quasi-maximum likelihood estimation of misspecified models. 4 J. Lv and J. S. Liu 2.2. Bayesian and Kullback-Leibler divergence principles Suppose we have a set of competing models: {Mm : m = 1, · · · , M }. A typical Bayesian model selection procedure is to first give nonzero prior probability αMm on each model Mm , and then prescribe a prior distribution µMm for the parameter vector in the corresponding model. Assume that the density function of µMm is bounded in RMm = Rdm and locally bounded away from zero throughout the domain. The Bayesian principle of model selection is to choose the most probable model a posteriori. That is, to choose model Mm0 such that m0 = arg maxm∈{1,··· ,M} S(y, Mm ; Fn ), where Z (10) S(y, Mm ; Fn ) = log αMm exp [ℓn (y, β)] dµMm (β) with the log-likelihood ℓn (y, β) as in (6) and the integral over Rdm . Fix an arbitrary model M = Mm and b =β b let β n n,m be the QMLE. Using the Taylor expansion, Schwartz (1978) showed that S(y, M; Fn ) can be b ) − log n |M| + log αM with β b the maximum likelihood estimator (MLE) asymptotically expanded as ℓn (y, β n n 2 of β, for the case of i.i.d. observations with correctly specified regular exponential family of models. This expression allowed Schwartz to introduce the seminal BIC for model selection: b ) + (log n) |M|, BIC(y, M) = −2ℓn (y, β n (11) where a factor of 2 is included to make it consistent with the usual definition of AIC give in (15). Schwartz’s original arguments were generalized later by Cavanaugh and Neath (1999). For each m ∈ {1, · · · , M }, the marginal distribution νm of the response vector Y conditional on model Mm has the density function Z dνm (12) (z) = exp [ℓn (z, β)] dµMm (β), z ∈ Rn . dµ0 The KL divergence of νm from the true model Gn is given by   Z dνm I gn ; = E log gn (Y) − E log exp [ℓn (Y, β)] dµMm (β), dµ0 (13) which leads to the following proposition. Proposition 1. a) For each m ∈ {1, · · · , M }, we have   dνm + log αMm + E log gn (Y), ES(Y, Mm ; Fn ) = −I gn ; dµ0 (14) where the expectation is taken with respect to the true distribution Gn . b) Assume αM1 = · · · = αMM . Then we have   dνm arg max ES(Y, Mm ; Fn ) = arg min I gn ; . m∈{1,··· ,M} m∈{1,··· ,M} dµ0 Proposition 1 holds true regardless of whether or not the true model is in the set of candidate models. We see that for each m ∈ {1,  · · · , M}, −S(y, Mm ; Fn ) + log αMm gives, up to a common additive constant, an m unbiased estimate of I gn ; dν dµ0 . This shows that the Bayesian principle of model selection can be restated as choosing the model that minimizes the KL divergence of the marginal distribution of the response vector Y from its true distribution, provided that we assign equal prior probabilities on the M competing models. Given a set of candidate models {Mm : m = 1, · · · , M } of form (2), we can also compare them using the KL divergence principle of model selection introduced by Akaike (1973, 1974), who studied the case of b i.i.d. observations with correctly specified models. With the sequence of QMLE’s {β n,m : m = 1, · · · , M } based on these models, Akaike’s principle of model selection is to choose the model Mm0 that minimizes b b the KL divergence I(gn ; fn (·, β n,m )) of the fitted model Fn (·, β n,m ) from the true model Gn , that is, m0 = Model Selection Principles in Misspecified Models 5 b arg minm∈{1,··· ,M} I(gn ; fn (·, β n,m )). This principle is equivalent to choosing the model Mm0 that maximizes the expected log-likelihood with the expectation taken with respect to an independent copy of Y. For notational simplicity, we drop the subscript m hereafter when there is no confusion. Using the asymptotic theory of MLE, Akaike (1973) showed for the case of i.i.d. observations that the expected log-likelihood can b ) − |M|, which leads to the seminal AIC for comparing models: be asymptotically expanded as ℓn (y, β n b ) + 2|M|. AIC(y, M) = −2ℓn (y, β n (15) 3. Asymptotic expansions of model selection principles in misspecified models We here derive a novel asymptotic expansion of the Bayesian principle in misspecified GLMs. Our derivation indicates that, in contrast to traditional AIC and BIC, directly incorporating the effect of model misspecification in a model selection criterion can be beneficial. The KL divergence principle has been considered by many researchers in the setting of model misspecification (see Section 3.3); the derivations were, however, mostly for the case of i.i.d. observations and often by heuristic arguments. We also give a rigorous asymptotic expansion of this principle in misspecified GLMs with deterministic design matrices. 3.1. Generalized BIC in misspecified models Let us consider the log-marginal likelihood S(y, M; Fn ), as defined in (10), in misspecified models. In GLM (2), the parameter vector θ ∈ Rn for the response vector Y is given by θ = Xβ. Under this working model and some regularity conditions, as in Schwartz (1978), we can apply the classical Laplace approximation (that is, Taylor-expanding the exponent to the second order and using the Gaussian integration to obtain necessary terms) to show that with probability tending to one, Z h i b ) + log exp −(β − β b )T An (β b )(β − β b )/2 dβ + C ′ S(y, M; Fn ) = ℓn (y, β n n n n n b )| + Cn , b ) − log n |M| − 1 log |n−1 An (β = ℓn (y, β n n 2 2 (16) b is the maximizer of ℓn (y, β), An (β) = −∂ 2 ℓn (y, β)/∂β2 = XT Σ(Xβ)X, and C ′ and Cn are both where β n n bounded quantities. When the model is misspecified, it is, however, no longer clear whether the Cn term b )| in (16) depends on the scale of the is still bounded. Moreover, the second-order term − 21 log |n−1 An (β n design matrix X and thus is not very meaningful. We will derive an asymptotic expansion of the Bayes factor in misspecified models using the asymptotic theory of the QMLE presented in Section 4.2. M Let µM be the prior distribution on β ∈ Rd for model M and π(β) = dµ dµ0 (β) its prior density relative to the Lebesgue measure µ0 on Rd . In high-dimensional Bayesian modeling, we need to put some basic constraint on the prior distribution in order to prevent it from assigning a diminishingly low probability in a vicinity of the theoretically best model under the KL divergence. Let δn be a sequence of diverging positive b in Theorem 6, we have the concentration probability numbers. By the proof of consistency of the QMLE β n bound b ∈ Nn (δn )} ≥ 1 − 4d , P {β n c2 δn2 where Nn (δn ) = {β ∈ Rd : kB1/2 n (β − β n,0 )k ≤ δn } is an asymptotically shrinking neighborhood of the parameter vector β n,0 of the best GLM Fn (·, β n,0 ) and c is some positive constant specified in Condition 2 in Section 4.1. We denote by b )k ≤ δn } en (δn ) = {β ∈ Rd : kB1/2 (β − β N n n b and N enc (δn ) the complement of N en (δn ). Clearly N en (δn ) ⊂ Nn (2δn ) a neighborhood of the QMLE β n b ∈ Nn (δn )}. The key idea of deriving the asymptotic expansion of the conditional on the above event {β n log-marginal likelihood S(y, M; Fn ) is to expand the quasi-log-likelihood function ℓn (y, β) at the QMLE b and show that the integral with the prior distribution on the neighborhood N en (δn ) dominates that on β n 6 J. Lv and J. S. Liu e c (δn ). Note that the neighborhood Nn (2δn ) of β n,0 shrinks asymptotically with the sample size n, meaning N n that the constraint on the prior becomes weaker asymptotically. For any β ∈ Rd , we define a quantity b ), ℓ∗n (y, β) = ℓn (y, β) − ℓn (y, β n (17) which is the deviation of the quasi-log-likelihood from its maximum. It follows from (10) and (17) that b ) + log Eµ [Un (β)n ] + log αM , S(y, M; Fn ) = ℓn (y, β (18) n M  −1 ∗  where Un (β) = exp n ℓn (y, β) . We present the asymptotic expansion of the above term log EµM [Un (β)n ] in the following theorem. Theorem 1. Under Conditions 1, 2, and 5 in Section 4.1, we have with probability tending to one, b ) − log n |M| + 1 log |Hn | + log αM + log(2π) |M| + log cn + o(1), S(y, M; Fn ) = ℓn (y, β n 2 2 2 (19) where Hn = A−1 n Bn and cn ∈ [c1 , c2 ]. Following the asymptotic expansion in the above theorem, we introduce the generalized BIC (GBIC) as follows. Definition 1. We define GBIC of the competing model M by b ) + (log n) |M| − log |H b n |, GBIC(y, M; Fn ) = −2ℓn (y, β n (20) b n is an estimate of the covariance contrast matrix Hn given in Section 3.4. where H Compared with BIC, GBIC takes into account model misspecification explicitly. The second term in b n | in GBIC GBIC is the same as that in BIC and penalizes the model complexity. The third term − log |H is, however, not always nonnegative and thus is not necessarily a penalty term on model misspecification. b n ≈ Id since Hn = Id due to An = Bn and thus When the model is correctly specified, we would expect H b log |Hn | ≈ log |Id | = 0. In this sense, GBIC introduced above generalizes BIC. We will see in Section 5 that the second-order term in GBIC can lead to improved performance in small samples even in correctly specified models. 3.2. GBICp in misspecified models Assigning a reasonable prior probability to each candidate model is an art. One usually chooses to give a higher prior probability to a model with lower complexity. In this section, we consider enlightening this prior choice with the KL divergence principle. For each candidate model Mm with 1 ≤ m ≤ M , denote by h i b Dm = E I(gn ; fn (·, β (21) n,m )) − I(gn ; fn (·, β n,m,0 )) b the expected excess KL divergence of the best fitted model Fn (·, β n,m ) from the true model Gn relative to that of the theoretically best model Fn (·, β n,m,0 ) from the true model. It follows from the definition of β n,m,0 in Theorem 5 that b I(gn ; fn (·, β n,m )) − I(gn ; fn (·, β n,m,0 )) ≥ 0, which entails that Dm is nonnegative. It is of interest to consider the following prior assignment: αMm ∝ e−Dm , which prefers models with less variability. In the case when the model family is correctly specified, this prior probability is asymptotically proportional to e−d/2 , where d is the number of covariates in the model. By the proof of Theorem 3, we have log αM = − 21 tr(Hn ) + o(1) up to a common additive constant, which along with Theorem 1 leads to the following asymptotic expansion of the Bayes factor. Model Selection Principles in Misspecified Models 7 Theorem 2. Under Conditions 1–6 in Section 4.1, if the prior probabilities αMm = Ce−Dm with C some normalization constant, we have with probability tending to one, b )− S(y, M; Fn ) = ℓn (y, β n 1 1 log(2π) log n |M| − tr(Hn ) + log |Hn | + |M| + log(cn C) + o(1), 2 2 2 2 (22) where Hn = A−1 n Bn and cn ∈ [c1 , c2 ]. Following the asymptotic expansion in the above theorem, we introduce the generalized BIC with prior probability (GBICp ) as follows. Definition 2. We define GBICp of the competing model M by b ) + (log n) |M| + tr(H b n ) − log |H b n |, GBICp (y, M; Fn ) = −2ℓn (y, β n (23) b n is an estimate of the covariance contrast matrix Hn given in Section 3.4. where H Let us consider the case of correctly specified models. As discussed in Section 3.4, we can construct a b n of the covariance contrast matrix Hn = Id , which entails that the second-order term consistent estimate H b b tr(Hn ) − log |Hn | is asymptotically close to |M|. This term is asymptotically dominated by the penalty term (log n)|M| on model complexity. In view of (23), this observation suggests that under the uniform asymptotic dominance of the second-order term, the model selection criterion GBICp is asymptotically equivalent to BIC in correctly specified models, leading to model selection consistency; similar result also holds for GBIC. The GBICp also enjoys a representation shown in the following proposition. b n for some d × d symmetric positive definite b n in (23) is chosen to be A b −1 B Proposition 2. When H n b n and B b n , we have matrices A h i b ) + (1 + log n)|M| + 2I N (0, B b n ); N (0, A b n) , GBICp (y, M; Fn ) = −2ℓn (y, β n (24) b n ); N (0, A b n )] = 1 [tr(H b n ) − log |H b n | − d] is the KL divergence of the d-variate Gaussian where I[N (0, B 2 b b n ). distribution N (0, An ) from the d-variate Gaussian distribution N (0, B The above representation shows that GBICp in misspecified models admits a natural decomposition of the form goodness of fit + model complexity + model misspecification, (25) where the first term is the negative maximum quasi-log-likelihood and the two penalty terms on model complexity and model misspecification are both nonnegative. However, neither the plain GBIC nor GAIC, which will be introduced in Section 3.3, has such a decomposition. The model misspecification term in GBICp has a natural interpretation. Under the true model Gn , we have E(XT Y) = XT EY and cov(XT Y) = XT cov(Y)X = Bn . Under some regularity conditions, an application of the central limit theorem shows that the asymptotic distribution of XT (Y − µ) with µ = EGn Y is close to N (0, Bn ). On the other b asymptotically converges to hand, if we misspecify the true model as the GLM Fn (·, β), the QMLE β n β n,0 such that Fn = Fn (·, β n,0 ) is the best model in the posited GLM family to approximate the true model Gn under the KL divergence. It follows from (31) and (3) that EFn (XT Y) = XT EFn Y = XT µ and covFn (XT Y) = XT Σ(Xβ n,0 )X = An . Under some regularity conditions, the asymptotic distribution of XT (Y − µ) is now close to N (0, An ). Thus the KL divergence of N (0, An ) from N (0, Bn ) provides a natural bn ≈ B b n since measure of model misspecification. When the model is correctly specified, we would expect A b b An = Bn , and thus I[N (0, Bn ); N (0, An )] ≈ 0. We will show in Section 5 that the second-order term in GBICp can also lead to improved performance in small samples even in correctly specified models. 8 J. Lv and J. S. Liu 3.3. Generalized AIC in misspecified models We now consider the KL divergence principle in misspecified models. AIC has been studied by many researchers, mainly for the case of i.i.d observations. Takeuchi (1976) generalized the derivation of AIC and obtained a term tr(A−1 B) in place of the dimension of the model, where B and A are two matrices that involve the first and second derivatives of the log-likelihood function, respectively. This term was also obtained by Stone (1977) in deriving the asymptotic expansion for the cross-validation. In fact, tr(A−1 B) is the well-known Lagrange-multiplier test statistic. See also Hosking (1980), Shibata (1989), Konishi and Kitagawa (1996), Burnham and Anderson (1998), and Bozdogan (2000). b In view of (4), the KL divergence of the fitted model Fn (·, β n,m ) from the true model Gn can be written as b b e I(gn ; fn (·, β (26) n,m )) = E log gn (Y) − ηn (β n,m ), e β) and Y e is an independent copy of Y. Thus the best model chosen by Akaike’s where ηn (β) = Eℓn (Y, b principle of model selection is m0 = arg maxm∈{1,··· ,M} ηn (β n,m ). For notational simplicity, we drop the subscript m. We also drop the last constant term in the quasi-log-likelihood ℓn (y, β) defined in (6), which does not depend on β, and redefine it as ℓn (y, β) = yT Xβ − 1T b(Xβ). In view of (26), for the purpose b ). In practice, of model comparison, we need to estimate the quantity of the expected log-likelihood ηn (β n b ) tends to we have only a single sample y available. Clearly the maximum quasi-log-likelihood ℓn (y, β n b overestimate ηn (βn ) since we would use the same data twice, that is, in both estimation and model evaluation. b ) in the following theorem. We present the asymptotic expansion of Eηn (β n Theorem 3. Under Conditions 1–4 and 6 in Section 4.1, we have b ) = Eℓn (y, β b ) − tr (Hn ) + o(1), Eηn (β n n (27) where Hn = A−1 n Bn and both expectations are taken with respect to the true distribution Gn .  As mentioned before, a correction term of form tr An−1 Bn is well known in the literature, but has been derived usually for the case of i.i.d. observations and often by heuristic arguments. Following the asymptotic expansion in the above theorem, we have the generalized AIC (GAIC) as follows. Definition 3. The GAIC of the competing model M is   b ) + 2tr H bn , GAIC(y, M; Fn ) = −2ℓn (y, β n (28) b n is an estimate of the covariance contrast matrix Hn given in Section 3.4. where H The GAIC shares some common features with the GBIC. It incorporates the effects of model complexity b n for some d × d b n in (28) is chosen to be A b −1 B and model misspecification in a single term. When H n 1/2 −1 1/2 b n and B b n , we have tr(H b n ) = tr(B b A b B b ) ≥ 0, showing that symmetric positive definite matrices A n n n the term added to the negative maximum quasi-log-likelihood in GAIC is indeed a penalty term. When the model is correctly specified, it holds that tr(Hn ) = tr(Id ) = d = |M| since Hn = Id due to An = Bn , which b n ) ≈ tr (Id ) = |M|, which reflects is the number of predictors in the GLM (2). Thus we would expect tr(H the penalty on model complexity as in AIC. As mentioned before, many extensions of AIC under different settings share the same form as in (28). We will also see in Section 5 that the second-order term in GAIC can lead to improved performance in small samples even in correctly specified models. We point out that equation (4.5) in Stone’s derivation (Stone, 1977) suggests that under the same working models, the GAIC and cross-validation are asymptotically equivalent under some weak conditions, where the cross-validation uses the log-density assessment. 3.4. Estimation of covariance contrast matrix Hn b n of the covariance contrast The model selection criteria GAIC, GBIC, and GBICp require an estimate H matrix Hn , a contrast between the covariance structures in the misspecified model and in the true model. Model Selection Principles in Misspecified Models 9 Specifically, we need to estimate the trace tr (Hn ) for GAIC, the log-determinant log |Hn | for GBIC, and both quantities for GBICp . Estimating these quantities in misspecified models is nontrivial. In this paper, we consider two specific estimators for them and illustrate the performance of the resulting model selection criteria with extensive numerical studies. More accurate estimation of tr (Hn ) and log |Hn |, especially in high dimensions, demands rigorous theoretical studies, which we will not address in the paper. Through our numerical studies, we found that estimating the trace of the covariance contrast matrix Hn and estimating its log-determinant exhibit different behavior. To show the utility of the new model selection criteria, we b n : a simple estimator for log |Hn | and estimate the two quantities separately with two different estimators H a bootstrap estimator for tr (Hn ). b n of the plug-in form A b −1 B b n with A b n and B b n some To estimate log |Hn |, we consider the estimate H n b d × d symmetric positive definite matrices. Since the QMLE β n provides a consistent estimator of β n,0 in the best misspecified GLM Fn (·, β n,0 ), a natural estimate of matrix An is given by b ) = XT Σ(Xβ b )X. b n = An (β A n n (29) When the model is correctly specified or more generally EY = µ(Xβ n,0 ), the following simple estimator b n = XT diag B nh i h io b ) ◦ y − µ(Xβ b ) X, y − µ(Xβ n n (30) with “◦” representing the Hadamard (componentwise) product, provides an asymptotically unbiased estimator of Bn . In view of (8), we adopt the form of the diagonal matrix in (30) for estimating log |Hn |. This form seems effective in ensuring the positive definiteness and well-conditionedness of the matrix, which b n as the are crucial for effectively estimating the log-determinant. We refer to the resulting estimator H b n and B b n in (29)–(30) are provided in Appendix B, when simple estimator. The formulas for matrices A the working model Fn is chosen to be one of the three commonly used GLMs: the linear regression model, logistic regression model, and Poisson regression model. The following theorem justifies the consistency of bn = A b −1 b the above simple estimator H n Bn when the model is correctly specified. Theorem 4. Assume that the model is correctly specified, Conditions 1, 2, and 7 in Section 4.1 hold, bn = bn = A b −1 B and the smallest and largest eigenvalues of n−1 Bn are bounded away from 0 and ∞. Then H n b b Id + oP (1), where An and Bn are given in (29) and (30), respectively. In Theorem 4, the assumption that the smallest and largest eigenvalues of n−1 Bn are bounded away from 0 and ∞ can be relaxed to converge to 0 or diverge to ∞, which will affect the consistency rate. Although b n in (30) may not be most suitable for the trace estimation. it is positive definite, the simple estimator B The general bias in such an estimator can affect more the performance of GAIC than that of GBIC and GBICp , due to the presence of the penalty term (log n) d on model complexity in the latter two information criteria. For example, tr {(1 + c)Hn } − tr (Hn ) = ctr (Hn ) is of the same order as tr (Hn ) for some nonzero constant c close to zero, while log |(1 + c)Hn | − log |Hn | = [log(1 + c)]d can be asymptotically dominated by the term (log n) d. To mitigate the bias in estimating Bn , it is sensible to construct the residual vector with a large model. This approach generally gives rise to a less biased estimator for Bn . Motivated by these b n with A b n given above and B bn bn = A b −1 B considerations, to estimate tr (Hn ) we introduce the estimate H n constructed using the following bootstrap procedure (Efron, 1979). To reduce the model bias, we first use a large model, with regularization when needed, and the idea of cross-validation to construct a proxy d of the deviation vector Y − EY. Then, we draw some bootstrap samples, each of size n, from the n observed vectors of the covariates and constructed deviations. For each bootstrap sample (X∗ , d∗ ), we calculate the b n as the covariance matrix of the covariance vector (X∗ )T d∗ . Finally, we obtain the bootstrap estimate B b n as the covariance vectors constructed from the bootstrap samples. We refer to the resulting estimator H bootstrap estimator. The estimates for tr (Hn ) and log |Hn | introduced above may not be the most effective ones. In practice, one can construct other estimates of both quantities by, for example, treating the squared residual [y − b )] ◦ [y − µ(Xβ b )] as a function of the corresponding fitted value µ(Xβ b ) and some covariates, and µ(Xβ n n n doing some local smoothing. Another possible way of estimating Hn is using the bootstrap as suggested by 10 J. Lv and J. S. Liu b is asymptotically Theorem 7. We show in Theorem 7 that under certain regularity conditions, the QMLE β n −1 −1 T −1 −1 normal with mean β n,0 and covariance matrix Cn (Cn ) = An Bn An , where Cn = Bn−1/2 An . In view of −1 b d b b Hn = (A−1 n Bn An )An , this asymptotic normality motivates us to construct the estimate Hn as Cov(β n )An b ) of the covariance matrix of the QMLE β b . Regularization methods d β using the bootstrap estimate Cov( n n for large covariance matrix estimation can also be exploited to improve the estimation of both tr (Hn ) and log |Hn |. 4. Technical conditions and results 4.1. Technical conditions Denote by λmin (·) and λmax (·) the smallest and largest eigenvalues of a given matrix, respectively, and k · k the Euclidean norm of a vector as well as the matrix operator norm. We need the following mild regularity conditions. Condition 1. b(θ) is twice differentiable with b′′ (θ) always positive and X has full column rank d. Condition 2. λmin (Bn ) → ∞ as n → ∞ and there exists some c > 0 such that for any δ > 0, minβ ∈Nn (δ) λmin [Vn (β)] ≥ c for all sufficiently large n, where Vn (β) = Bn−1/2 An (β)Bn−1/2 and Nn (δ) = {β ∈ Rd : kB1/2 n (β − β n,0 )k ≤ δ}. e n (β , · · · , β )−Vn k = o(1), where Vn = Vn (β ) = Condition 3. For any δ > 0, maxβ ,··· ,β ∈Nn (δ) kV 1 d n,0 1 d −1/2 −1/2 e −1/2 −1/2 e e with the j-th row of An (β 1 , · · · , β d ) the and Vn (β 1 , · · · , βd ) = Bn An (β 1 , · · · , β d )Bn Bn An Bn corresponding row of An (β j ) for each j = 1, · · · , d. Condition 4. maxni=1 E|Yi − EYi |3 = O(1) and Condition 5. The prior density π(β) satisfies Pn T −1 3/2 i=1 (xi Bn xi ) = o(1). inf π (β) ≥ c1 and sup π (β) ≤ c2 β∈Nn (2δn ) β ∈Rd for some positive constants c1 , c2 and a sequence of positive numbers δn satisfying δn−1 = o(log−1/2 n) and maxβ∈Nn (2δn ) max{|λmin (Vn (β) − Vn )|, |λmax (Vn (β) − Vn )|} = o(1), and λmax (Vn ) is of a polynomial order of n. b − β )k3+α = Condition 6. supδ maxj,k,l |∂ 3 ηn (β n,0 + n1/2 Cn−1 δ)/∂δj ∂δk ∂δl | = o(n3/2 ) and EkCn (β n n,0 O(1) for some α > 0, where Cn = Bn−1/2 An and δ = (δ1 , · · · , δd )T . Condition 7. There exists some L > 0 such that for any δ > 0, the functions n−1 An (β), n−1 XT diag{|µ(Xβ)− µ(Xβ n,0 )|}X, and n−1 XT diag{[µ(Xβ) − µ(Xβn,0 )] ◦ [µ(Xβ) − µ(Xβ n,0 )]}X are Lipschitz with a Lipschitz Pn constant L in the neighborhood Nn (δ). In addition, n−1/2 i=1 {xi xTi (Yi −EYi )2 } has bounded second central moment and P (maxni=1 |Yi − EYi | > Kn ) → 0 as n → ∞ for some Kn = o(n1/2 ). Condition 1 contains some basic smoothness and regularity conditions to ensure the uniqueness of the b by a standard strict concavity argument and the uniqueness of the best misspecified GLM QMLE β n Fn (·, βn,0 ) under the KL divergence in Theorem 5. b in Theorem 6. The first part of Condition Condition 2 is for establishing the consistency of the QMLE β n T 2 requires that the smallest eigenvalue of X cov(Y)X diverges as n increases. When var(Yi )’s are bounded away from 0 and ∞, this assumption amounts to the usual assumption on the design matrix X in linear regression for consistency, that is, λmin (XT X) → ∞ as n → ∞. Intuitively, the second part of Condition 2 means that the covariance structures given by the misspecified GLMs in a shrinking neighborhood of the best working model Fn (·, β n,0 ) cannot be too far away from the covariance structure under the true model Gn . This requirement is analogous to that in importance sampling, that is, the support of the sampling distribution has to cover that of the target distribution. When the model is correctly specified, we have Model Selection Principles in Misspecified Models 11 Vn = Vn (β n,0 ) = Id since An = Bn by the equivalence of the Hessian and outer product forms for the Fisher information matrix. b in Theorem 7, Conditions 3 and 4 facilitate the derivation of the asymptotic normality of the QMLE β n e n (β 1 , · · · , βd ) in a shrinking neighborwhere the former is on the continuity of the matrix-valued function V hood of β n,0 and the latter is a typical moment condition for proving asymptotic normality using Lyapunov’s theorem. The first part of Condition 5 is a mild condition on the prior distribution on β requiring that its prior density is bounded and locally bounded away from zero in a shrinking neighborhood of β n,0 , and facilitates the derivation of the asymptotic expansion of the Bayes factor in misspecified models in Theorems 1 and 2. See Section 3.1 for more discussions on this condition. The second part of Condition 5 ensures that the en (δn ) is negligible in integral EµM [Un (β)n 1Ne c (δn ) ] with the prior distribution outside the neighborhood N n approximating the log-marginal likelihood S(y, M; Fn ). Condition 6 contains some regularity conditions for rigorously deriving the asymptotic expansion of the KL divergence principle in misspecified models in Theorem 3. It is also needed for deriving the asymptotic expansion of the log-prior probability in Theorem 2. bn = A b −1 B b n, Condition 7 collects additional regularity conditions to ensure that the simple estimator H n b b with An and Bn given in (29) and (30), respectively, is a consistent estimator of Hn = Id when the model is correctly specified. The Lipschitz conditions on the three matrix-valued functions in the asymptotically shrinking neighborhood Nn (δ) are mild and reasonable. The moment and tail conditions on the response variable Yi are standard. 4.2. Asymptotic properties of QMLE For completeness, we briefly present here some asymptotic properties of the QMLE in misspecified GLMs with deterministic design matrices, which serve as the foundation for deriving asymptotic expansions of model selection principles. The consistency and asymptotic normality of MLE in correctly specified GLMs were studied in Fahrmeir and Kaufmann (1985). A general theory of maximum likelihood estimation of misspecified models was presented in White (1982), who studied the case of i.i.d. observations from a general distribution and used the KL divergence as a measure of model misspecification. We generalize those results to misspecified GLMs with deterministic design matrices, where the observations may no longer be i.i.d. Theorem 5. (Parameter identifiability). Under Condition 1, the KL divergence I(gn ; fn (·, β)) has a unique global minimum at βn,0 ∈ Rd , which solves the equation XT [EY − µ(Xβ)] = 0. (31) b satisfies β b − β = oP (1). Theorem 6. (Consistency). Under Conditions 1 and 2, the QMLE β n n n,0 D b satisfies Cn (β b −β ) −→ Theorem 7. (Asymptotic normality). Under Conditions 1–4, the QMLE β n n n,0 N (0, Id ), where Cn = Bn−1/2 An . When the model is correctly specified, we have Cn = Bn−1/2 An = A1/2 n since An = Bn . Thus in this case, b in Theorems 6 and 7 become the conventional the consistency and asymptotic normality of the QMLE β n asymptotic theory of the MLE. To simplify the technical presentation, the above asymptotic normality is for fixed dimensionality d. With more delicate analysis, one can show the asymptotic normality for diverging dimensionality d, which is not the focus of the current paper. See, for example, the technical analysis in Fan and Lv (2011) for penalized-maximum likelihood estimation, where the dimensionality is allowed to grow nonpolynomially with the sample size. 5. Numerical examples In this section, we illustrate the performance of model selection criteria GAIC, GBIC, and GBICp in relatively small samples, with the bootstrap estimator for tr (Hn ) and the simple estimator for log |Hn | introduced in 12 J. Lv and J. S. Liu Table 1. Frequency of estimated model size for model in Section 5.1.1 over 100 simulations for different n and σ; 3∗ corresponds to the true model {1, 2, 3} σ Criterion Model size (n = 20) Model size (n = 40) Model size (n = 80) 2 3∗ 4 5 6 2 3∗ 4 5 6 2 3∗ 4 5 6 0.25 AIC 0 55 32 12 1 0 55 36 7 2 0 71 19 9 1 BIC 0 68 24 7 1 0 81 15 4 0 0 94 5 1 0 GAIC 0 79 19 1 1 0 65 27 7 1 0 74 19 6 1 GBIC 0 78 18 4 0 0 83 15 2 0 0 95 5 0 0 GBICp 0 94 5 1 0 0 90 9 1 0 0 97 3 0 0 0.5 AIC 0 51 34 10 5 0 54 33 11 2 0 59 36 3 2 BIC 0 65 28 6 1 0 80 16 4 0 0 85 15 0 0 GAIC 2 72 21 5 0 0 69 21 10 0 0 63 34 1 2 GBIC 0 73 22 5 0 0 87 11 2 0 0 86 14 0 0 GBICp 1 94 5 0 0 0 93 7 0 0 0 98 2 0 0 Section 3.4. These studies represent some first attempts for obtaining insights into the effect of incorporating model misspecification for model selection; the estimation of tr (Hn ) and log |Hn | still requires rigorous theoretical investigations. Model selection with limited sample size is frequently encountered in practice and the dimension of candidate models can be large due to the large number of covariates. One example in Section 5.1.1 is for the case of correctly specified models, and five other examples are for the case of misspecified models. In particular, in Sections 5.1.2-5.1.3 and 5.2.3, we consider high-dimensional linear and logistic regression with interaction, respectively, with Section 5.1.3 focusing on the case of moderate effects. Measures of prediction and variable selection are used to evaluate the selected model. We include the classical AIC and BIC as benchmark model selection criteria. With reduced dimensionality given by the set of covariates in the selected model, one can perform more delicate analysis in practice. 5.1. Linear models We consider here three linear models, starting with a correctly specified model of moderate size and proceeding to high-dimensional sparse linear models with interaction terms. We observed that GBIC and GBICp outperformed other information criteria in all settings, often by a large margin when the sample size is small. 5.1.1. Best subset linear regression We simulated 100 data sets from the linear regression model y = Xβ + ε, (32) where y is an n-dimensional response vector, X is an n × p design matrix, β is a p-dimensional regression coefficient vector, and the error vector ε ∼ N (0, σ 2 In ) is independent of X. For each simulated data set, the rows of X were sampled as i.i.d. copies from N (0, Σ0 ) with Σ0 = (0.5|i−j| )i,j=1,··· ,p . To apply the best subset regression, we chose p = 6 and set β as β 0 = (1, −1.25, 0.75, 0, 0, 0)T . We considered n = 20, 40, 80, and σ = 0.25 and 0.5, respectively. For each data set, we first applied the best subset regression to build all possible submodels of {1, · · · , 6}, each of which numbers represents the corresponding covariate, and then selected the final model using the AIC, BIC, GAIC, GBIC, and GBICp . Table 1 summarizes the comparison results of the frequency of estimated model size with 3∗ representing the true underlying sparse model supp(β 0 ) = {1, 2, 3} for compactness. The performance of all information criteria generally improves as the sample size increases. AIC tended to select a larger model than the true one even for large sample sizes, while BIC performed well when the sample size is large but also tended to select a larger model than the true one when the sample size is small. GAIC and GBIC improved over AIC and BIC, respectively, across all sample sizes tested and especially when the sample size is moderate, indicating the effectiveness of the second-order terms even in correctly specified models. When the sample size became larger, GBIC tended to perform better than GAIC. GBICp outperformed all other model selection criteria. Model Selection Principles in Misspecified Models 13 Table 2. Percentiles of prediction error, false positives (FP), and false negatives (FN) as well as selection probability (SP) and inclusion probability (IP) of the SICA estimate for model in Section 5.1.2 over 100 simulations for different p p Criterion Prediction error FP (FN) SP IP 25th 50th 75th 25th 50th 75th 50 AIC 1.3095 1.4433 1.6337 4 (0) 6 (0) 8 (0) 0 1 BIC 1.1822 1.2661 1.3924 0 (0) 1 (0) 4 (0) 0.35 0.99 GAIC 1.1843 1.2697 1.3820 0 (0) 2 (0) 4 (0) 0.27 0.99 GBIC 1.1598 1.2357 1.3401 0 (0) 1 (0) 2 (0) 0.48 0.99 GBICp 1.1350 1.1873 1.2749 0 (0) 0 (0) 0 (0) 0.79 0.99 Oracle 1.1253 1.1600 1.2201 0 (0) 0 (0) 0 (0) 1 1 100 AIC 1.4579 1.6807 1.9342 7 (0) 10 (0) 13 (0) 0 1 BIC 1.3123 1.5229 1.7922 2.5 (0) 7 (0) 10.5 (0) 0.11 1 GAIC 1.2038 1.2733 1.4182 0 (0) 1 (0) 2.5 (0) 0.37 1 GBIC 1.2193 1.3731 1.6458 1 (0) 3 (0) 7 (0) 0.23 1 GBICp 1.1253 1.2076 1.2745 0 (0) 0 (0) 1 (0) 0.69 1 Oracle 1.1105 1.1639 1.2318 0 (0) 0 (0) 0 (0) 1 1 200 AIC 1.6678 1.8637 2.1852 10 (0) 14 (0) 16 (0) 0 1 BIC 1.6598 1.8637 2.1852 9.5 (0) 13.5 (0) 16 (0) 0 1 GAIC 1.1860 1.3045 1.4507 0 (0) 1 (0) 3 (0) 0.27 0.99 GBIC 1.5115 1.7947 2.1321 7 (0) 11 (0) 15 (0) 0.03 1 GBICp 1.1561 1.2317 1.3614 0 (0) 1 (0) 2 (0) 0.43 0.99 Oracle 1.1201 1.1661 1.2167 0 (0) 0 (0) 0 (0) 1 1 5.1.2. High-dimensional sparse linear regression with interaction To evaluate how each information criterion fares in high-dimensional incorrectly specified settings, we simulated 100 data sets from the following linear model: y = Xβ + xp+1 + ε, (33) where X = (x1 , · · · , xp ) is an n × p design matrix, xp+1 = x1 ◦ x2 is an interaction term which is the product of the first two covariates, and the rest is the same as in (32). To make variable selection easily interpretable in misspecified models, we consider the case that all covariates are independent of each other and thus set Σ0 = Ip . We chose β as β0 = (1, −1.25, 0.75, −0.95, 1.5, 0, · · · , 0)T , n = 80, and σ = 0.25, and considered p = 50, 100, and 200, respectively. Although the data were generated from model (33), we fit the linear regression model (32) without interaction. This is an example of misspecified models. In view of (33), the true model involves only the first five covariates in a nonlinear form. Since the other covariates are independent of those five covariates, the oracle working model is supp(β 0 ) = {1, · · · , 5}, which indicates the linear regression model (32) with the first five covariates. Clearly it is unrealistic to implement the best subset regression due to its computational complexity. Therefore, we used the SICA regularization method in Lv and Fan (2009) and implemented it with the ICA algorithm in Fan and Lv (2011). For each data set, we first applied the SICA to build a sequence of sparse models and then selected the final model using the same five model selection criteria. To compare the selected models by the information criteria, we consider the oracle estimate based on the oracle working model {1, · · · , 5} as the benchmark and use both measures of prediction and variable selection. b 2 with β b an estimate and (xT , Y ) The first performance measure is the prediction error defined as E(Y −xT β) an independent observation. The second and third measures are the numbers of false positives and false negatives, respectively. Here, a false positive means a selected covariate outside the oracle working model and a false negative means a missed covariate in the oracle model. The fourth measure is the probability of recovering exactly the oracle working model, and the fifth measure is the inclusion probability of including all covariates in the oracle working model. The former characterizes the model selection consistency property, while the latter characterizes the sure screening property (Fan and Lv, 2008). In the calculation of the expectation in the prediction error, an independent test sample of size 10,000 was generated for approximating the expectation. Table 2 summarizes the comparison results of the 25th, 50th, and 75th percentiles of the first three performance measures as well as the selection probability and inclusion probability of the estimated model. 14 J. Lv and J. S. Liu Table 3. Percentiles of prediction error, false positives (FP), and false negatives (FN) as well as selection probability (SP) and inclusion probability (IP) of the SICA estimate for model in Section 5.1.3 over 100 simulations for different p p Criterion Prediction error FP (FN) SP IP 25th 50th 75th 25th 50th 75th 50 AIC 1.3743 1.5164 1.7514 3 (0) 5 (0) 7 (0) 0.01 0.94 BIC 1.2867 1.4375 1.6424 0 (0) 2 (0) 4 (0) 0.22 0.79 GAIC 1.2427 1.3988 1.6279 0 (0) 0 (0) 1 (1) 0.36 0.61 GBIC 1.2586 1.3859 1.5947 0 (0) 1 (0) 3 (0) 0.32 0.78 GBICp 1.2359 1.3793 1.6951 0 (0) 0 (0) 1 (1) 0.38 0.54 Oracle 1.1723 1.2481 1.3116 0 (0) 0 (0) 0 (0) 1 1 100 AIC 1.5881 1.7814 2.0827 6 (0) 9 (0) 11 (0) 0 0.85 BIC 1.5572 1.7290 2.0359 5 (0) 8 (0) 11 (0) 0.04 0.80 GAIC 1.2877 1.4812 1.8517 0 (0) 0 (1) 1 (2) 0.29 0.42 GBIC 1.3751 1.6393 1.8202 1 (0) 4 (0) 8 (1) 0.15 0.74 GBICp 1.2877 1.4626 1.9309 0 (0) 0 (1) 1 (2) 0.29 0.42 Oracle 1.1837 1.2405 1.3155 0 (0) 0 (0) 0 (0) 1 1 200 AIC 1.7916 2.0573 2.4881 9.5 (0) 12 (0) 15 (0) 0 0.78 BIC 1.7735 2.0465 2.4881 9 (0) 12 (0) 15 (0) 0 0.78 GAIC 1.3964 1.8119 2.2214 0 (0.5) 0 (2) 1 (3) 0.21 0.25 GBIC 1.7128 2.0465 2.4881 9 (0) 12 (0) 15 (0) 0.01 0.77 GBICp 1.3683 1.6990 2.1528 0 (0) 0 (1) 1 (3) 0.22 0.27 Oracle 1.1855 1.2367 1.3168 0 (0) 0 (0) 0 (0) 1 1 The conclusions are similar to those in Section 5.1.1. As the dimensionality p increases, all information criteria tend to select a larger model and the prediction performance deteriorates. GAIC performed better than AIC, and GBIC and GBICp performed better than BIC in terms of prediction and variable selection. In particular, the model selected by GBICp mimics closely the oracle estimate. We observe that although all methods can have good sure screening property, the probability of model selection consistency generally decreases with dimensionality. It is interesting that GAIC tended to perform better than GBIC when the dimensionality became larger, which can be understood as an effect of decreasing effective sample size due to the noise accumulation associated with high dimensionality. 5.1.3. High-dimensional linear regression with interaction and moderate effects We now consider the case of high-dimensional linear regression with interaction and moderate effects. We simulated 100 data sets from model (33) with the same setting as in Section 5.1.2, except that we set β as β 0 = (1, −1.25, 0.75, −0.95, 1.5, 0.5, −0.5, 0.5, −0.5, 0.5, · · · , 0)T . Compared with the model in Section 5.1.2, the five additional main linear effects are moderately strong. For each data set, we fit the misspecified linear regression model (32) without interaction. As argued in Section 5.1.2, the oracle working model is supp(β 0 ) = {1, · · · , 10}. We applied the same method to build a sequence of sparse candidate models and used the same performance measures to compare the five model selection criteria as in Section 5.1.2. Table 3 summarizes the comparison results of the 25th, 50th, and 75th percentiles of the first three performance measures as well as the selection probability and inclusion probability of the estimated model. The conclusions are similar to those in Section 5.1.2. We observe that due to the appearance of many moderate effects, all information criteria have less probability of sure screening especially when the dimensionality is large, meaning that some covariates in the oracle working model can be missed. 5.2. Nonlinear models In this section, we examine behaviors of the five information criteria in nonlinear models. They include a polynomial model, a single-index model, and a high-dimensional logistic regression model with interaction. We again observed that the new information criteria GBIC and GBICp outperformed the classical AIC and BIC in all settings. Model Selection Principles in Misspecified Models 15 Table 4. Frequency of estimated order for model in Section 5.2.1 over 100 simulations for different n and σ σ Criterion Model size (n = 20) Model size (n = 40) Model size (n = 80) 2 3 4 5 6 2 3 4 5 6 2 3 4 5 6 0.25 AIC 0 48 17 19 16 0 47 23 14 16 0 54 17 12 17 BIC 0 62 13 14 11 0 63 21 9 7 0 81 10 4 5 GAIC 5 78 5 2 4 3 88 3 4 2 0 97 2 1 0 GBIC 0 97 3 0 0 0 92 5 1 2 0 91 5 2 2 GBICp 3 94 0 0 0 1 98 1 0 0 0 99 1 0 0 0.5 AIC 0 38 16 23 23 0 40 16 20 24 0 47 13 21 19 BIC 0 55 15 18 12 0 64 14 12 10 0 81 9 5 5 GAIC 12 72 1 1 1 5 89 4 0 0 1 98 1 0 0 GBIC 0 97 2 1 0 0 88 5 4 3 0 93 4 2 1 GBICp 8 82 0 0 0 3 95 1 0 0 0 100 0 0 0 5.2.1. Polynomial regression with heteroscedasticity Since each of the criteria GAIC, GBIC, and GBICp includes a second-order term that is related to the variance of the response, we consider the cubic polynomial regression model with heteroscedastic variance y = 1 + 5x − 2x2 + 1.55x3 + |x|1/2 ε, (34) where y is the response, x ∼ N (0, 1) is the covariate, and the error ε ∼ N (0, σ 2 ) is independent of x. We simulated 100 data sets from this model, each of which contains n i.i.d. observations, with n = 20, 40, 80, and σ = 0.25 and 0.5, respectively. Although the data were generated from model (34), we fit the polynomial regression model with constant variance which is incorrectly specified. For each data set, we first fit the polynomial regression model with constant variance of order 1 up to 6 and then selected the final model using the same five model selection criteria. Table 4 summarizes the comparison results of the frequency of estimated order of polynomial regression model. The conclusions are similar to those in Section 5.1.1. The improved performance of GAIC, GBIC, and GBICp over AIC and BIC indicates the usefulness of the second-order terms in capturing the difference between the estimated error variance and the apparent residual variance. 5.2.2. Nonlinear regression As another example of misspecified models, we consider a single-index model in which the response depends on a linear combination of covariates through a nonlinear link function. We simulated 100 data sets from the nonlinear regression model y = f(Xβ) + ε, (35) where y is an n-dimensional response vector, f(z) = (f (z1 ), · · · , f (zn ))T with f (z) = z 3 /(0.5 + z 2 ) and z = (z1 , · · · , zn )T , X is an n × p design matrix, β is a p-dimensional regression coefficient vector, and the error vector ε ∼ N (0, σ 2 In ) is independent of X. The rest of the setting is the same as that in Section 5.1.1 except that as in Section 5.1.2, we consider the case that all covariates are independent of each other and thus set Σ0 = Ip . Although the data were generated from model (35), we fit the linear regression model (32). Therefore, the family of working models excludes the true model due to the nonlinearity. As argued in Section 5.1.2, the oracle working model is supp(β 0 ) = {1, 2, 3} which indicates the linear regression model (32) with the first three covariates. For each data set, we first applied the best subset linear regression to build all possible submodels of {1, · · · , 6} and then selected the final model using the same five model selection criteria. Table 5 summarizes the comparison results of the frequency of estimated model size with 3∗ representing the oracle working model {1, 2, 3} for compactness. The conclusions are similar to those in Section 5.1.2. 16 J. Lv and J. S. Liu Table 5. Frequency of estimated model size for model in Section 5.2.2 over 100 simulations for different n and a; 3∗ corresponds to the oracle working model {1, 2, 3} σ Criterion Model size (n = 20) Model size (n = 40) Model size (n = 80) 2 3∗ 4 5 6 2 3∗ 4 5 6 2 3∗ 4 5 6 0.25 AIC 0 51 41 8 0 0 60 32 7 1 0 64 32 3 1 BIC 0 71 27 2 0 0 82 16 2 0 0 90 10 0 0 GAIC 0 81 16 3 0 0 74 22 3 1 0 75 22 2 1 GBIC 0 79 20 1 0 0 83 15 2 0 0 91 9 0 0 GBICp 0 94 6 0 0 0 91 9 0 0 0 96 4 0 0 0.5 AIC 0 52 36 11 1 0 54 33 12 1 0 51 40 9 0 BIC 0 66 28 5 1 0 77 21 2 0 0 93 6 1 0 GAIC 3 73 22 1 0 0 67 27 6 0 0 63 30 7 0 GBIC 0 77 20 3 0 0 83 17 0 0 0 94 6 0 0 GBICp 1 90 9 0 0 0 90 10 0 0 0 99 1 0 0 Table 6. Percentiles of prediction error, false positives (FP), and false negatives (FN) as well as selection probability (SP) and inclusion probability (IP) of the SICA estimate for model in Section 5.2.3 over 100 simulations Criterion Prediction error FP (FN) SP IP 25th 50th 75th 25th 50th 75th AIC 0.1411 0.1512 0.1623 15 (0) 17 (0) 19 (0) 0 0.98 BIC 0.1330 0.1468 0.1591 12.5 (0) 15 (0) 18 (0) 0 0.98 GAIC 0.1148 0.1206 0.1284 9 (0) 11 (0) 14 (0) 0 0.99 GBIC 0.1017 0.1063 0.1155 1 (0) 2 (0) 5.5 (0) 0.23 0.96 GBICp 0.1010 0.1048 0.1094 0 (0) 1 (0) 2 (0) 0.39 0.94 Oracle 0.0923 0.0944 0.0968 0 (0) 0 (0) 0 (0) 1 1 5.2.3. High-dimensional logistic regression with interaction We now consider the high-dimensional logistic regression with interaction. We simulated 100 data sets from the logistic regression model (2) with interaction and an n-dimensional parameter vector θ = Xβ + 2xp+1 , (36) where X = (x1 , · · · , xp ) is an n × p design matrix, xp+1 = x1 ◦ x2 is an interaction term, and the rest is the same as in (33). For each data set, the n-dimensional response vector y was sampled from the Bernoulli distribution with success probability vector (eθ1 /(1 + eθ1 ), · · · , eθn /(1 + eθn ))T , where θ = (θ1 , · · · , θn )T is given in (36). As in Section 5.1.2, we consider the case that all covariates are independent of each other and thus set Σ0 = Ip . We chose β as β 0 = (2.5, −1.9, 2.8, −2.2, 3, 0, · · · , 0)T and considered (n, p) = (200, 1000). Although the data were generated from model (2) with parameter vector (36), we fit the logistic regression model without interaction. This provides another example of misspecified models. As argued in Section 5.1.2, the oracle working model is supp(β 0 ) = {1, · · · , 5} which indicates the logistic regression model (2) with the first five covariates. As in Section 5.1.2, for each data set, we first applied the SICA (Lv and Fan, 2009) implemented with the ICA algorithm (Fan and Lv, 2011) to build a sequence of sparse models and then selected the final model using the same five model selection criteria. We use the same five performance measures as in Section 5.1.2. The prediction error is defined as E[Y − Tb b an estimate and (xT , Y ) an independent observation. Table 6 summarizes b β))]2 with β exp(xT β)/(1+exp(x the comparison results of the 25th, 50th, and 75th percentiles of the first three performance measures as well as the selection probability and inclusion probability of the estimated model. The conclusions are similar to those in Section 5.1.2. GAIC, GBIC, and GBICp improved over AIC and BIC in terms of prediction and variable selection. 6. Discussions We have considered the problem of model selection in misspecified models under two well-known model selection principles: the Bayesian principle and the Kullback-Leibler divergence principle. The novel asymptotic expansions of the two principles in misspecified generalized linear models lead to the GBIC and GAIC. In Model Selection Principles in Misspecified Models 17 particular, a specific form of prior probabilities motivated by the Kullback-Leibler divergence principle leads to the GBICp which has a natural decomposition into the negative maximum quasi-log-likelihood and two penalties on model dimensionality and model misspecification, respectively. Numerical studies have demonstrated the advantage of the new methods for model selection in both correctly specified and misspecified models. When the model is misspecified, the posterior distribution of the parameter may not reflect the true b can have a different asymptotic covariance uncertainty of the estimation. In particular, the QMLE β n matrix than the posterior covariance matrix of β. When this difference grows larger as the sample size n increases, its impact on model selection can be rather significant. To mitigate this issue, we have considered an asymptotic framework that allows the prior distribution to vary with sample size, and introduced a local constraint on the prior density preventing it from giving diminishingly low probability to a shrinking region containing the theoretically best model. Our technical analysis reveals that the covariance contrast matrix, Hn = A−1 n Bn , between the covariance structures in the misspecified model and in the true model plays a pivotal role in our model selection framework. Specifically, effective estimates of its trace and log-determinant are needed for implementing the model selection criteria. Through numerical studies, we found that estimation of these two quantities exhibits different behavior. We have considered the simple estimator for log |Hn | and the bootstrap estimator for tr (Hn ); these estimators may not be the best possible ones and the estimation of both quantities tr (Hn ) and log |Hn | needs rigorous theoretical studies, especially in high dimensions. Some other possible ways of estimating Hn have been discussed in Section 3.4. The problem of model selection in misspecified models is challenging and our studies can be regarded as the first step toward understanding the effect of explicitly incorporating model misspecification for model selection. So far we have explored the expression of GBICp taking an additive form of the three terms: goodness of fit, model complexity, and model misspecification. Possible extensions of the GBICp include introducing other weights and considering non-additive forms. We considered the classical asymptotic setting of fixed dimensionality in our asymptotic expansions for technical simplicity. It would be interesting to extend all the results to high dimensions as well as more general model settings, with the dimensionality diverging with the sample size. It also remains open to characterize the optimality of these model selection criteria in misspecified models. These problems are beyond the scope of the current paper and will be interesting topics for future research. A. Proofs The proofs of Theorem 5 and Propositions 1 and 2 are omitted here and are given in the technical report Lv and Liu (2010). A.1. Proof of Theorem 1 e n = {β b ∈ Nn (δn )}, where Nn (δn ) = {β ∈ Rd : kB1/2 (β − β )k ≤ δn }. By We condition on the event Q n n,0 n b in Theorem 6, we have the proof of consistency of the QMLE β n en ) ≥ 1 − P (Q 4d →1 c2 δn2 since δn → ∞ by Condition 5. It is easy to see that ℓ∗n (y, β) defined in (17) is a smooth concave function on b , Rd with its maximum 0 attained at β = β n ∂ 2 ℓ∗n (y, β)/∂β2 = −An (β),   and Un (β) = exp n−1 ℓ∗n (y, β) takes values between 0 and 1. Thus by Taylor’s theorem, expanding ℓ∗n (y, ·) b gives for any β in the neighborhood N en (δn ) = {β ∈ Rd : kB1/2 (β − β b )k ≤ δn }, around β n n n ℓ∗n (y, β) =   1 b )T ∂ 2 ℓ∗ (y, β )/∂β2 (β − β b ) = − n δ T Vn (β )δ, (β − β n n ∗ n ∗ 2 2 (37) 18 J. Lv and J. S. Liu b , δ = n−1/2 B1/2 (β−β b ), and Vn (β) = B−1/2 An (β)B−1/2 . where β∗ lies on the line segment joining β and β n n n n n b and thus β ∈ N en (δn ) defined above is a convex set containing β en (δn ) ⊂ Clearly, the neighborhood N n ∗ Nn (2δn ). Let ρn (δn ) = max max {|λmin (Vn (β) − Vn ) |, |λmax (Vn (β) − Vn ) |} β ∈Nn (2δn ) with Vn = Vn (βn,0 ). By Conditions 5 and 2, ρn (δn ) ≤ λmin (Vn )/2 for sufficiently large n. Thus it follows from (37) that q1 (β)1Nen (δn ) (β) ≤ −n−1 ℓ∗n (y, β)1Nen (δn ) (β) ≤ q2 (β)1Nen (δn ) (β), (38) where q1 (β) = 12 δ T [Vn − ρn (δn )Id ] δ and q2 (β) = 21 δ T [Vn + ρn (δn )Id ] δ. This entails   i h   EµM e−nq2 1Nen (δn ) ≤ EµM Un (β)n 1Nen (δn ) ≤ EµM e−nq1 1Nen (δn ) . (39) We will see later that inequality (39) is the key step in deriving the asymptotic expansion of log EµM [Un (β)n ] in (18). We list some auxiliary results in the following two lemmas, whose proofs are similar to those given in the technical report Lv and Liu (2010). Lemma 1. Under Condition 5 in Section 4.1, we have Z Z   −nqj −nqj 1Nen(δn ) ≤ c2 e−nqj 1Nen(δn ) dµ0 , c1 e 1Nen (δn ) dµ0 ≤ EµM e j = 1, 2. Lemma 2. It holds that i h  EµM Un (β)n 1Ne c (δn ) ≤ exp −κn δn2 , n  d/2 Z 2π −nq1 dµ0 = e |Vn − ρn (δn )Id |−1/2 , n  d/2 Z 2π |Vn + ρn (δn )Id |−1/2 , e−nq2 dµ0 = n  d/2   Z  d d 1 2π −nqj 2 2 −1 , j = 1, 2, 1Ne c (δn ) dµ0 ≤ e exp − κn δn + + log κn δn d n nκn 2 2 2 (40) (41) (42) (43) (44) where κn = λmin (Vn )/2 and it is assumed that κn δn2 > d in (44). Now we are ready to obtain the asymptotic expansion of log EµM [Un (β)n ] in (18). By Conditions 5 and −1 −2 2, λ−1 n), which along with (41) shows that the term EµM [Un (β)n 1Ne c (δn ) ] converges to min (Vn )δn = o(log n zero atR a rate faster than any polynomial rate in n. Similarly, in view of (44), we can show that the two terms e−nqj 1Ne c (δn ) dµ0 with q = 1, 2 converge to zero at a rate faster than any polynomial rate in n. It n follows from ρn (δn ) = o(λmin (Vn )) that −1/2 |Vn ± ρn (δn )Id |−1/2 = |Vn |−1/2 |Id ± ρn (δn )V−1 n |    = |Vn |−1/2 1 + O ρn (δn )tr(V−1 n )    = |Vn |−1/2 [1 + o(1)]. = |Vn |−1/2 1 + O ρn (δn )dλ−1 min (Vn ) Since λmax (Vn ) is assumed to be of a polynomial order of n in Condition 5, combining these results with (39) and Lemmas 1 and 2 yields ) (  d/2 2π −1/2 n |Vn | [1 + o(1)] + log cn log EµM [Un (δ) ] = log n =− 1 log(2π) log n d + log |A−1 d + log cn + o(1), n Bn | + 2 2 2 en . where cn ∈ [c1 , c2 ]. This together with (18) proves the conclusion on the event Q Model Selection Principles in Misspecified Models 19 A.2. Proof of Theorem 2 By (21) and the first part of the proof of Theorem 3, we have 1 log αM = − tr(Hn ) + log C + o(1), 2 which along with Theorem 1 leads to the desired asymptotic expansion of the Bayes factor. A.3. Proof of Theorem 3 It suffices to prove  b ) = ηn (β ) − 1 tr A−1 Bn + o(1) Eηn (β n n n,0 2 and h i  b ) − 1 tr A−1 Bn + o(1). ηn (β n,0 ) = E ℓn (y, β n n 2 We will prove (45) and (46) in separate steps. Define b + n1/2 C−1 β) ℓen (y, β) = ℓn (y, β n n and (45) (46) ηen (β) = ηn (β n,0 + n1/2 C−1 n β), where Cn = Bn−1/2 An and β = (β1 , · · · , βd )T . 1) We first prove (45). The key idea is to do a second-order Taylor expansion of ηen (β) around 0 and retain the Lagrange remainder term. By Theorem 5, ηn attains its maximum at βn,0 . Thus we derive h i  b − β ) = ηen (0) − n vT C−1 An C−1 v b ) = ηen n−1/2 Cn (β ηn (β n n,0 n n n 2  1 X 3 − ∂ ηen (β ∗ )/∂βj ∂βk ∂βl vj vk vl 6 j,k,l    1 X 3 n −1 1/2 v− ∂ ηen (β ∗ )/∂βj ∂βk ∂βl vj vk vl , = ηn (β n,0 ) − vT B1/2 n An Bn 2 6 j,k,l b − β ) and β lies on the line segment joining v and 0. By where v = (v1 , · · · , vd )T = n−1/2 Cn (β n n,0 ∗ Condition 6, |∂ 3 ηen (β ∗ )/∂βj ∂βk ∂βl | = o(n3/2 ). D b − β ) −→ b − β )k3+α = O(1) for some α > 0 by Since Cn (β N (0, Id ) by Theorem 7 and EkCn (β n n,0 n n,0 Condition 6, Theorem 6.2 in DasGupta (2008) applies to show that for any j, k, l, E(nvj vk ) → δjk and E(n3/2 |vj vk vl |) = O(1), where δjk denotes the Kronecker delta. By Condition 2, we have λmin (Vn ) ≥ c for some positive constant c, which entails that    −1 1/2 1/2 −1 1/2 ≤ dλmax (B1/2 tr A−1 n An Bn ) n Bn = tr Bn An Bn = dλ−1 min (Vn ) = O(1). Combining these results yields   1  1/2 −1 1/2  1X b Eηn (β n ) = ηn (β n,0 ) − tr Bn An Bn + o(1) + o(n3/2 )O(n−3/2 ) 2 6 j,k,l  1 = ηn (β n,0 ) − tr A−1 n Bn + o(1). 2 2) We then prove (46). The key idea is to represent ℓn (y, βn,0 ) using a second-order Taylor expansion b and retaining the Lagrange remainder term. It is easy to see that the difference of ℓn (y, ·) around β n 20 J. Lv and J. S. Liu between ηn (β) and ℓn (y, β) is linear in β, which implies that each pair of their second or higher order partial b , we derive derivatives agree. Since ℓn (y, ·) attains its maximum at β n i h 1 ℓn (y, β n,0 ) = ℓen (y, v) = ℓen (0) − vT ∂ 2 ℓen (y, 0)/∂β2 v 2 i 1 X h 3e − ∂ ℓn (y, β ∗ )/∂βj ∂βk ∂βl vj vk vl 6 j,k,l X    b ) − 1 vT ∂ 2 ηen (−v)/∂β2 v − 1 = ℓn (y, β ∂ 3 ηen (β ∗∗ )/∂βj ∂βk ∂βl vj vk vl , n 2 6 j,k,l b ), β lies on the line segment joining v and 0, and β = β −v. where v = (v1 , · · · , vd )T = n−1/2 Cn (βn,0 − β n ∗ ∗∗ ∗ 3 It follows from supβ maxj,k,l |∂ ηen (β)/∂βj ∂βk ∂βl | = o(n3/2 ) in Condition 6 that |∂ 3 ηen (β ∗∗ )/∂βj ∂βk ∂βl | = o(n3/2 ) and ∂ 2 ηen (β)/∂β2 is Lipschitz with Lipschitz constant o(n3/2 ). Thus     vT ∂ 2 ηen (−v)/∂β2 v = vT ∂ 2 ηen (0)/∂β2 v + o(n3/2 )kvk3  −1 v + o(n3/2 )kvk3 = nvT C−1 n A n Cn   −1 1/2 v + o(n3/2 )kvk3 . = nvT B1/2 n An Bn D b − β ) −→ b − β )k3+α = O(1) for some α > 0 by Since Cn (β N (0, Id ) by Theorem 7 and EkCn (β n n,0 n n,0 Condition 6, Theorem 6.2 in DasGupta (2008) applies to show that for any j and k, E(nvj vk ) → δjk  These along with tr A−1 n Bn = O(1) yield b )− ηn (β n,0 ) = Eℓn (y, βn,0 ) = Eℓn (y, β n and  E(n3/2 kvk3 ) = O(1).  1  1/2 −1 1/2  tr Bn An Bn + o(1) + o(n3/2 )O(n−3/2 ) 2  b ) − 1 tr A−1 Bn + o(1), = Eℓn (y, β n n 2 which completes the proof. A.4. Proof of Theorem 4 Since the model is correctly specified, that is, Gn = Fn (·, β n,0 ), we have the identity An = Bn , yielding −1 Hn = A−1 Bn are bounded n Bn = Id . Note that by assumption, the smallest and largest eigenvalues of n −1 b b b away from 0 and ∞. To prove the consistency of the estimator Hn = A Bn , it suffices to show that n b n = n−1 Bn + oP (1) n−1 A and b n = n−1 Bn + oP (1). n−1 B b By the proof of Theorem 6, we have B1/2 n (β n − β n,0 ) = OP (1), which along with the assumption that −1 λmin (n Bn ) is bounded away from 0 gives b = β + OP (n−1/2 ). β n n,0 By Condition 7, n−1 An (β) is Lipschitz in an asymptotically shrinking neighborhood of β n,0 given by Nn (δ) = {β ∈ Rd : kB1/2 n (β − β n,0 )k ≤ δ}. It follows from the proof of Theorem 6 that o n b ∈ Nn (δ) → 1 P β n as n → ∞. Model Selection Principles in Misspecified Models 21 b yields Combining this result with the Lipschitz continuity of n−1 An (β) and the consistency of β n b n = n−1 Bn + oP (1). n−1 A b n = n−1 Bn + oP (1). To analyze n−1 B b n , we decompose it into three terms It remains to prove n−1 B nh i h io b n = n−1 XT diag y − µ(Xβ b ) ◦ y − µ(Xβ b ) X ≡ G1 + G2 + G3 , n−1 B n n with G1 = n−1 XT diag{(y − Ey) ◦ (y − Ey)}X, b ) − µ(Xβ G2 = −2n−1 XT diag{(y − Ey) ◦ [µ(Xβ n G3 = n −1 n,0 )]}X, b ) − µ(Xβ )] ◦ [µ(Xβ b ) − µ(Xβ )]}X, X diag{[µ(Xβ n n,0 n n,0 T Pn since Ey = µ(Xβn,0 ) by (3). Since G1 = n−1 i=1 {xi xTi (Yi − EYi )2 } is the mean of n independent random variables and has asymptotically vanishing second central moment by Condition 7, it follows from the law of large numbers that G1 = EG1 + oP (1) = n−1 Bn + oP (1). By Condition 7, n−1 XT diag{[µ(Xβ) − µ(Xβ n,0 )] ◦ [µ(Xβ) − µ(Xβ n,0 )]}X is Lipschitz in the neighborhood b n , we can show that Nn (δ). Thus similarly as for n−1 A G3 = oP (1). We finally prove G2 = oP (1). By Condition 7, Yi − EYi are uniformly bounded by Kn = o(n1/2 ) with asymptotic probability one, that is, P (maxni=1 |Yi − EYi | ≤ Kn ) → 1 as n → ∞. Note that on the above event, the largest absolute eigenvalue of the matrix G2 is bounded by the largest eigenvalue of b ) − µ(Xβ )|}X 2n−1 XT diag{|y − Ey| ◦ |µ(Xβ n n,0 b ) − µ(Xβ )|}X, ≤ 2Kn n−1 XT diag{|µ(Xβ n n,0 where the absolute value is understood componentwise and the inequality means the order for symmetric positive semidefinite matrices. By Condition 7, n−1 XT diag{|µ(Xβ) − µ(Xβ n,0 )|} is Lipschitz in the neighb = β + OP (n−1/2 ), we have G2 = oP (1). Combining the borhood Nn (δ). Thus by Kn = o(n1/2 ) and β n n,0 above results concludes the proof. A.5. Proof of Theorem 6 It is easy to see that Nn (δ) is a convex set by its definition. Denote by n o ∂Nn (δ) = β ∈ Rd : kB1/2 n (β − β n,0 )k = δ the boundary of the closed set Nn (δ). We define an event ( Qn = ℓn (y, βn,0 ) > ) max ℓn (y, β) . β ∈∂Nn (δ) We observe that if the event Qn occurs, the continuous function ℓn (y, ·) has a local maximum in the interior of Nn (δ). Since the first part of Condition 1 implies that ℓn (y, ·) is strictly concave, this maximum must be b . This shows that located at β n b ∈ Nn (δ)}. Qn ⊂ {β n 22 J. Lv and J. S. Liu Next we construct a lower bound on P (Qn ). By Taylor’s theorem, we have for any β, 1 ℓn (y, β) − ℓn (y, β n,0 ) = (β − βn,0 )T Ψn (βn,0 ) − (β − β n,0 )T An (β ∗ )(β − β n,0 ), 2 where β ∗ lies on the line segment joining β and β n,0 . We make a transformation of the variable by letting u = δ −1 B1/2 n (β − β n,0 ). Then it follows that ℓn (y, β) − ℓn (y, βn,0 ) = δuT Bn−1/2 Ψn (β n,0 ) − δ 2 uT Vn (β ∗ )u/2. Note that β ∈ ∂Nn (δ) if and only if kuk = 1, and that β ∈ ∂Nn (δ) implies β ∗ ∈ Nn (δ) by the convexity of Nn (δ). Clearly max uT Bn−1/2 Ψn (β n,0 ) = kBn−1/2 Ψn (β n,0 )k kuk=1 and by the second part of Condition 2, for n sufficiently large we have min uT Vn (β ∗ )u ≥ kuk=1 Thus we have max β∈∂Nn (δ) min λmin {Vn (β)} ≥ c. β∈Nn (δ) ℓn (y, β) − ℓn (y, βn,0 ) ≤ δ(kBn−1/2 Ψn (β n,0 )k − cδ/2), which along with Markov’s inequality entails that Observe that    EkBn−1/2 Ψn (β n,0 )k2 . P (Qn ) ≥ P kBn−1/2 Ψn βn,0 k2 < c2 δ 2 /4 ≥ 1 − c2 δ 2 /4     T −1 EkBn−1/2 Ψn (β n,0 )k2 = Etr Ψn (β n,0 )T B−1 n Ψn (β n,0 ) = Etr Ψn (β n,0 )Ψn (β n,0 ) Bn    = tr(Id ) = d. = tr E Ψn (βn,0 )Ψn (β n,0 )T B−1 n For any given η ∈ (0, 1), letting δ = (2d1/2 )/(cη 1/2 ) thus makes P (Qn ) ≥ 1 − 4d = 1 − η. c2 δ 2 b ∈ Nn (δ)} and the first part of Condition 2 proves β b −β This together with Qn ⊂ {β n n n,0 = oP (1), which completes the proof. A.6. Proof of Theorem 7 We condition on the event Qn = {ℓn (y, β n,0 ) > maxβ∈∂Nn (δ) ℓn (y, β)} defined in the proof of Theorem 6, b ∈ Nn (δ). By the mean value theorem applied componentwise and which has been shown to entail that β n (31), we obtain b ) = Ψn (β ) − A b −β ) e n (β 1 , · · · , βd )(β 0 = Ψn (β n n,0 n n,0 e n (β , · · · , β )(β b − β ), = XT (y − Ey) − A 1 d n n,0 b and β . Let Cn = B−1/2 An . Then we have where each of β 1 , · · · , β d lies on the line segment joining β n n,0 n b − β ) = un + wn , where un = −B−1/2 XT (y − Ey) and Cn (β n n,0 n ih i h e n (β , · · · , β ) − Vn B1/2 (β b −β ) . wn = − V 1 d n n n,0 Model Selection Principles in Misspecified Models 23 D b − β ) −→ N (0, Id ), it suffices By Slutsky’s lemma and the proof of Theorem 6, we see that to show Cn (β n n,0 D to prove un −→ N (0, Id ) and wn = oP (1). b ∈ Nn (δ)} and Condition 3. Finally we show that The result wn = oP (1) follows from Qn ⊂ {β n D un −→ N (0, Id ). Fix an arbitrary unit vector a ∈ Rd . We consider the asymptotic distribution of the Pn linear combination vn = aT un = −aT Bn−1/2 XT (y − Ey) = i=1 zi , where zi = −aT Bn−1/2 xi (yi − Eyi ), P i = 1, · · · , n. Clearly zi ’s are independent and have mean 0, and ni=1 var(zi ) = aT Bn−1/2 Bn Bn−1/2 a = 1. By Condition 4, E|yi − Eyi |3 ≤ M for some positive constant M . Thus we derive n X i=1 E|zi |3 = n X |aT Bn−1/2 xi |3 E|yi − Eyi |3 ≤ M |aT Bn−1/2 xi |3 i=1 i=1 ≤M n X n X kak3 kBn−1/2 xi k3 = M n X 3/2 → 0, (xTi B−1 n xi ) i=1 i=1 where we used the Cauchy-Schwarz inequality and Condition 4. Applying Lyapunov’s theorem yields aT un = Pn D d i=1 zi −→ N (0, 1). Since this asymptotic normality holds for any unit vector a ∈ R , we conclude that D un −→ N (0, Id ), which concludes the proof. B. Three commonly used GLMs b n and B b n in (29)–(30), when the working model Fn is In this section, we provide the formulas for matrices A chosen to be one of the three commonly used GLMs: the linear regression model, logistic regression model, and Poisson regression model. B.1. Linear regression The linear regression model is given by y = Xγ + ε, (47) where y is an n-dimensional response vector, X is an n × d design matrix, γ is a d-dimensional regression coefficient vector, and ε ∼ N (0, σ 2 In ) is an n-dimensional error vector. Let β = γ/σ 2 and b(θ) = σ 2 θ2 /2, θ ∈ R. Then the quasi-log-likelihood of the sample in (6) becomes kyk22 n n log 2π − log σ 2 − 2σ 2 2 2 n n log 2π ky − Xγk22 − log σ 2 − . =− 2σ 2 2 2 ℓn (y, β) = yT Xβ − 1T b(Xβ) − b = (XT X)−1 Xy. We estimate Maximizing ℓn (y, β) with respect to γ yields the least-squares estimator γ 2 2 the error variance σ using the residual sum of squares (RSS), σ b = ky − Xb γ k22 /(n − d). Then we obtain an 2 ′ 2 ′′ 2 b b /b estimate βn = γ σ . Since b (θ) = σ θ and b (θ) = σ , we have bn = σ A b2 XT X and b n = XT diag {[y − Xb B γ ] ◦ [y − Xb γ ]} X, (48) where ◦ denotes the Hadamard (componentwise) product. An interesting special case is when the true model is indeed linear, but may involve a different set of covariates. Then Bn = τ 2 XT X, where τ 2 is the true variance of the response variable Y had we known the true model precisely. The GBICp just involves an additional term penalizing the inflation of the error variance due to model misspecification. B.2. Logistic regression In the logistic regression model, b(θ) = log(1 + eθ ), θ ∈ R and the quasi-log-likelihood of the sample is ℓn (y, β) = yT Xβ − 1T b(Xβ) with the last constant term in (6) ignored, which attains its maximum at 24 J. Lv and J. S. Liu b . Since b′ (θ) = eθ /(1 + eθ ) and b′′ (θ) = eθ /(1 + eθ )2 , matrices A b n and B b n are given in (29)–(30) with β n T θ θ θ θ θ b ) = diag{e 1 /(1 + eθ1 )2 , · · · , eθn /(1 + eθn )2 }, and b ) = (e 1 /(1 + e 1 ), · · · , e n /(1 + e n )) , Σ(Xβ µ(Xβ n n b . (θ1 , · · · , θn )T = Xβ n B.3. Poisson regression In the Poisson regression model, b(θ) = eθ , θ ∈ R and the quasi-log-likelihood of the sample is ℓn (y, β) = b . Since yT Xβ − 1T b(Xβ) with the last constant term in (6) ignored, which attains its maximum at β n b ) = (eθ1 , · · · , eθn )T and b n and B b n are given in (29)–(30) with µ(Xβ b′ (θ) = eθ and b′′ (θ) = eθ , matrices A n b . b ) = diag{eθ1 , · · · , eθn }, and (θ1 , · · · , θn )T = Xβ Σ(Xβ n n References [1] Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In Second International Symposium on Information Theory (eds. B. N. Petrov and F. Csaki), Akademiai Kiado, Budapest, 267–281. [2] Akaike, H. (1974). A new look at the statistical model identification. IEEE Trans. Auto. Control 19, 716–723. [3] Bogdan, M., Ghosh, J. K. and Doerge, R. W. (2004). Modifying the Schwarz Bayesian information criterion to locate multiple interacting quantitative trait loci. Genetics 167, 989–999. [4] Bozdogan, H. (1987). Model selection and Akaike’s information criterion (AIC): The general theory and its analytical extensions. Psychometrika 52, 345–370. [5] Bozdogan, H. (2000). Akaike’s information criterion and recent developments in information complexity. J. Math. Psychol. 44, 62–91. [6] Burnham, K. P. and Anderson, D. R. (1998). Model Selection and Inference: A Practical InformationTheoretic Approach. Springer, New York. [7] Casella, G., Girón, F. J., Martı́nez, M. L. and Moreno, E. (2009). Consistency of Bayesian procedures for variable selection. Ann. Statist. 37, 1207–1228. [8] Cavanaugh, J. E. and Neath, A. A. (1999). Generalizing the derivation of the Schwarz information criterion. Commun. Statist. - Theory and Methods 28, 49–66. [9] Chen, J. and Chen, Z. (2008). Extended Bayesian information criteria for model selection with large model spaces. Biometrika 95, 759–771. [10] DasGupta, A. (2008). Asymptotic Theory of Statistics and Probability. New York: Springer-Verlag. [11] Efron, B. (1979). Bootstrap methods: Another look at the jackknife. Ann. Statist. 7,1–26. [12] Fahrmeir, L. and Kaufmann, H. (1985). Consistency and asymptotic normality of the maximum likelihood estimator in generalized linear models. Ann. Statist. 13, 342–368. [13] Fan, J. and Lv, J. (2008). Sure independence screening for ultrahigh dimensional feature space (with discussion). J. Roy. Statist. Soc. Ser. B 70, 849–911. [14] Fan, J. and Lv, J. (2010). A selective overview of variable selection in high dimensional feature space (invited review article). Statistica Sinica 20, 101–148. [15] Fan, J. and Lv, J. (2011). Nonconcave penalized likelihood with NP-dimensionality. IEEE Transactions on Information Theory 57, 5467–5484. [16] Fan, Y. and Tang, C. (2012). Tuning parameter selection in high dimensional penalized likelihood. J. Roy. Statist. Soc. Ser. B, to appear. Model Selection Principles in Misspecified Models 25 [17] Foster, D. and George, E. (1994). The risk inflation criterion for multiple regression. Ann. Statist. 22, 1947–1975. [18] Gelman, A., Carlin, J. B., Stern, H. S. and Rubin, D. B. (2004). Bayesian Data Analysis (2nd ed.). Chapman & Hall/CRC. [19] Hall, P. (1990). Akaike’s information criterion and Kullback-Leibler loss for histogram density estimation. Probab. Theory Relat. Fields 85, 449–467. [20] Hosking, J. R. M. (1980). Lagrange-multiplier tests of time-series models. J. Roy. Statist. Soc. Ser. B 42, 170–181. [21] Konishi, S. and Kitagawa, G. (1996). Generalised information criterion in model selection. Biometrika 83, 875–890. [22] Kullback, S. and Leibler, R. (1951). On information and sufficiency. Ann. Math. Statist. 22, 79–86. [23] Liu, W. and Yang, Y. (2011). Parametric or nonparametric? A parametricness index for model selection. Ann. Statist., to appear. [24] Lv, J. and Fan, Y. (2009). A unified approach to model selection and sparse recovery using regularized least squares. Ann. Statist. 37, 3498–3528. [25] Lv, J. and Liu, J. S. (2010). Model selection principles in misspecified models. Technical Report. Available on the arXiv preprint server: math.ST/1005.5483. [26] McCullagh, P. and Nelder, J. A. (1989). Generalized Linear Models. Chapman and Hall, London. [27] Schwartz, G. (1978). Estimating the dimension of a model. Ann. Statist. 6, 461–464. [28] Shibata, R. (1989). Statistical aspects of model selection. In From Data to Model (Ed. J. C. Willems), 215–240. New York: Springer-Verlag. [29] Spiegelhalter, D. J., Best, N. G., Carlin, B. P. and van der Linde, A. (2002). Bayesian measures of model complexity and fit (with discussion). J. Roy. Statist. Soc. Ser. B 64, 583–639. [30] Stone, M. (1977). An asymptotic equivalence of choice of model by cross-validation and Akaike’s criterion. J. Roy. Statist. Soc. Ser. B 39, 44–47. [31] Takeuchi, K. (1976). Distribution of information statistics and criteria for adequacy of models. Mathematical Sciences 153, 12–18 (in Japanese). [32] Tian, L., Cai, T., Goetghebeur, E. and Wei, L.J. (2007). Model evaluation based on the sampling distribution of estimated absolute prediction error. Biometrika 94, 297–311. [33] Wang, H., Li, R. and Tsai, C.-L. (2007). Tuning parameter selectors for the smoothly clipped absolute deviation method. Biometrika 94, 553–568. [34] White, H. (1982). Maximum likelihood estimation of misspecified models. Econometrica 50, 1–25. [35] Yang, Y. and Barron, A. R. (1998). An asymptotic property of model selection criteria. IEEE Trans. Inform. Theory 44, 95–116. [36] Żak-Szatkowska, M. and Bogdan, M. (2011). Modified versions of Bayesian information criterion for sparse generalized linear models. Computational Statistics and Data Analysis 55, 2908–2924.
10math.ST
1 SOME GENERALIZATIONS OF SECOND SUBMODULES arXiv:1609.08054v1 [math.AC] 26 Sep 2016 H. ANSARI-TOROGHY AND F. FARSHADIFAR Abstract. In this paper, we will introduce two generalizations of second submodules of a module over a commutative ring and explore some basic properties of these classes of modules 1. Introduction Throughout this paper, R will denote a commutative ring with identity and ”⊂” will denote the strict inclusion. Further, Z will denote the ring of integers. Let M be an R-module. A proper submodule P of M is said to be prime if for any r ∈ R and m ∈ M with rm ∈ P , we have m ∈ P or r ∈ (P :R M ) [14]. A nonzero submodule S of M is said to be second if for each a ∈ R, the homomorphism a S → S is either surjective or zero [19]. In this case AnnR (S) is a prime ideal of R. Badawi gave a generalization of prime ideals in [9] and said such ideals 2- absorbing ideals. A proper ideal I of R is a 2-absorbing ideal of R if whenever a, b, c ∈ R and abc ∈ I, then ab ∈ I or ac ∈ I or bc ∈ I. He proved that I is a 2-absorbing ideal of R if and only if whenever I1 , I2 , and I3 are ideals of R with I1 I2 I3 ⊆ I, then I1 I2 ⊆ I or I1 I3 ⊆ I or I2 I3 ⊆ I. Yousefian Darani and Soheilnia in [12] extended 2-absorbing ideals to 2-absorbing submodules. A proper submodule N of M is called a 2-absorbing submodule of M if whenever abm ∈ N for some a, b ∈ R and m ∈ M , then am ∈ N or bm ∈ N or ab ∈ (N :R M ). Several authors investigated properties of 2-absorbing submodules, for example see [12, 17, 18]. A submodule N of an R-module M is called strongly 2-absorbing if IJL ⊆ N for some ideals I, J of R and a submodule L of M , then IL ⊆ N or JL ⊆ N or IJ ∈ (N :R M ) [13]. The purpose of this paper is to introduce the dual notions of 2-absorbing and strongly 2-absorbing submodules and obtain some related results. Also, as we can see in Corollary 3.19, these are two generalizations of second submodules. In [18, 2.3], the authors show that N is a 2-absorbing submodule of an R-module M if and only if N is a strongly 2-absorbing submodule of M . The Example 3.2 shows that the dual of this fact is not true in general. 2. 2-absorbing second submodules Let M be an R-module. A proper submodule N of M is said to be completely T irreducible if N = i∈I Ni , where {Ni }i∈I is a family of submodules of M , implies that N = Ni for some i ∈ I. It is easy to see that every submodule of M is an intersection of completely irreducible submodules of M [15]. We frequently use the following basic fact without further comment. 1 This research was in part supported by a grant from IPM (No. 94130048) 2000 Mathematics Subject Classification. 13C13, 13C99. Key words and phrases. 2-absorbing second, completely irreducible, and strongly 2-absorbing second. 1 2 H. ANSARI-TOROGHY AND F. FARSHADIFAR Remark 2.1. Let N and K be two submodules of an R-module M . To prove N ⊆ K, it is enough to show that if L is a completely irreducible submodule of M such that K ⊆ L, then N ⊆ L. Definition 2.2. Let N be a non-zero submodule of an R-module M . We say that N is a 2-absorbing second submodule of M if whenever a, b ∈ R, L is a completely irreducible submodule of M , and abN ⊆ L, then aN ⊆ L or bN ⊆ L or ab ∈ AnnR (N ). This can be regarded as a dual notion of the 2-absorbing submodule. A non-zero R-module M is said to be secondary if for each a ∈ R the endomorphism of M given by multiplication by a is either surjective or nilpotent [16]. Theorem 2.3. Let M be an R-module. Then we have the following. (a) If either N is a second submodule of M or N is a sum of two second submodules of M , then N is 2-absorbing second. (b) If N is a secondary submodule of M and R/AnnR (N ) has no non-zero nilpotent element, then N is 2-absorbing second. Proof. (a) The first assertion is clear. To see the second assertion, let N1 and N2 be two second submodules of M . We show that N1 + N2 is a 2-absorbing second submodule of M . Assume that a, b ∈ R, L is a completely irreducible submodule of M , and ab(N1 + N2 ) ⊆ L. Since N1 is second, abN1 = 0 or N1 ⊆ L by [3, 2.10]. Similarly, abN2 = 0 or N2 ⊆ L. If abN1 = 0 = abN2 (resp. N1 ⊆ L and N2 ⊆ L), then we are done. Now let abN1 = 0 and N2 ⊆ L. Then aN1 = 0 or bN1 = 0 because AnnR (N1 ) is a prime ideal of R. If aN1 = 0, then a(N1 +N2 ) ⊆ aN1 +N2 ⊆ N2 ⊆ L. Similarly, if bN1 = 0, we get b(N1 + N2 ) ⊆ L as desired. (b) Let a, b ∈ R, L be a completely irreducible submodule of M , and abN ⊆ L. Then p if aN ⊆ L or bN ⊆ L, we are done. Let aN 6⊆ L and bN 6⊆ L. Then a, b ∈ AnnR (N ). Thus, (ab)s ∈ AnnR (N ) for some positive integer s. Therefore, ab ∈ AnnR (N ) because R/AnnR (N ) has no non-zero nilpotent element.  Lemma 2.4. Let I be an ideal of R and N be a 2-absorbing second submodule of M . If a ∈ R, L is a completely irreducible submodule of M , and IaN ⊆ L, then aN ⊆ L or IN ⊆ L or Ia ∈ AnnR (N ). Proof. Let aN 6⊆ L and Ia 6∈ AnnR (N ). Then there exists b ∈ I such that abN 6= 0. Now as N is a 2-absorbing second submodule of M , baN ⊆ L implies that bN ⊆ L. We show that IN ⊆ L. To see this, let c be an arbitrary element of I. Then (b + c)aN ⊆ L. Hence, either (b + c)N ⊆ L or (b + c)a ∈ AnnR (N ). If (b + c)N ⊆ L, then since bN ⊆ L we have cN ⊆ L. If (b + c)a ∈ AnnR (N ), then ca 6∈ AnnR (N ), but caN ⊆ L. Thus cN ⊆ L. Hence, we conclude that IN ⊆ L.  Lemma 2.5. Let I and J be two ideals of R and N be a 2-absorbing second submodule of M . If L is a completely irreducible submodule of M and IJN ⊆ L, then IN ⊆ L or JN ⊆ L or IJ ⊆ AnnR (N ). Proof. Let IN 6⊆ L and JN 6⊆ L. We show that IJ ⊆ AnnR (N ). Assume that c ∈ I and d ∈ J. By assumption there exists a ∈ I such that aN 6⊆ L but aJN ⊆ L. Now Lemma 2.5 shows that aJ ⊆ AnnR (N ) and so (I \ (L :R N ))J ⊆ AnnR (N ). Similarly there exists b ∈ (J \ (L :R N )) such that Ib ⊆ AnnR (N ) and also I(J \(L :R N )) ⊆ AnnR (N ). Thus we have ab ∈ AnnR (N ), ad ∈ AnnR (N ) and SOME GENERALIZATIONS OF SECOND SUBMODULES 3 cb ∈ AnnR (N ). As a + c ∈ I and b + d ∈ J, we have (a + c)(b + d)N ⊆ L. Therefore, (a + c)N ⊆ L or (b + d)N ⊆ L or (a + c)(b + d) ∈ AnnR (N ). If (a + c)N ⊆ L, then cN 6⊆ L. Hence c ∈ I \ (L :R N ) which implies that cd ∈ AnnR (N ). Similarly if (b + d)N ⊆ L, we can deduce that cd ∈ AnnR (N ). Finally if (a + c)(b + d) ∈ AnnR (N ), then ab + ad + cb + cd ∈ AnnR (N ) so that cd ∈ AnnR (N ). Therefore, IJ ⊆ AnnR (N ).  Corollary 2.6. Let M be an R-module and N be a 2-absorbing second submodule of M . Then IN is a 2-absorbing second submodules of M for all ideals I of R with I 6⊆ AnnR (N ). Proof. Let I be an ideal of R with I 6⊆ AnnR (N ), a, b ∈ R, L be a completely irreducible submodule of M , and abIN ⊆ L. Then aN ⊆ L or bIN ⊆ L or abIN = 0 by Lemma 2.4. If bIN ⊆ L or abIN = 0, then we are done. If aN ⊆ L, then aIN ⊆ aN implies that aIN ⊆ L, as needed.  An R-module M is said to be a multiplication module if for every submodule N of M there exists an ideal I of R such that N = IM [10]. Corollary 2.7. Let M be a multiplication 2-absorbing second R-module. Then every non-zero submodule of M is a 2-absorbing second submodule of M . Proof. This follows from Corollary 2.6.  The following example shows that the condition “M is a multiplication module” in Corollary 2.7 can not be omitted. Example 2.8. For any prime integer p, let M = Zp∞ and N = h1/p3 + Zi. Then clearly, M is a 2-absorbing second Z-module but p2 h1/p3 + Zi ⊆ h1/p + Zi implies that N is not a 2-absorbing second submodule of M . We recall that an R-module M is said to be a cocyclic module if SocR (M ) is a large and simple submodule of M [21]. (Here SocR (M ) denotes the sum of all minimal submodules of M .). A submodule L of M is a completely irreducible submodule of M if and only if M/L is a cocyclic R-module [15]. Proposition 2.9. Let N be a 2-absorbing second submodule of an R-module M . Then we have the following. (a) If L is a completely irreducible submodule of M such that N 6⊆ L, then (L :R N ) is a 2-absorbing ideal of R. (b) If M is a cocyclic module, then AnnR (N ) is a 2-absorbing ideal of R. (c) If a ∈ R, then an N = an+1 N , for all n ≥ 2. (d) If AnnR (N ) is a prime ideal of R, then (L :R N ) is a prime ideal of R for all completely irreducible submodules L of M such that N 6⊆ L. Proof. (a) Since N 6⊆ L, we have (L :R N ) 6= R. Let a, b, c ∈ R and abc ∈ (L :R N ). Then abN ⊆ (L :M c). Thus aN ⊆ (L :M c) or bN ⊆ (L :M c) or abN = 0 because by [8, 2.1], (L :M c) is a completely irreducible submodule of M . Therefore, ac ∈ (L :R N ) or bc ∈ (L :R N ) or ab ∈ (L :R N ). (b) Since M is cocyclic, the zero submodule of M is a completely irreducible submodule of M . Thus the result follows from part (a). (c) It is enough to show that a2 N = a3 N . It is clear that a3 N ⊆ a2 N . Let L be a completely irreducible submodule of M such that a3 N ⊆ L. Then a2 N ⊆ (L :R a). Since N is 2-absorbing second submodule and (L :R a) is a completely irreducible 4 H. ANSARI-TOROGHY AND F. FARSHADIFAR submodule of M by [8, 2.1], aN ⊆ (L :R a) or a2 N = 0. Therefore, a2 N ⊆ L. This implies that a2 N ⊆ a3 N . (d) Let a, b ∈ R, L be a completely irreducible submodule of M such that N 6⊆ L, and ab ∈ (L :R N ). Then aN ⊆ L or bN ⊆ L or abN = 0. If abN = 0, then by assumption, aN = 0 or bN = 0. Thus in any cases we get that, aN ⊆ L or bN ⊆ L.  Theorem 2.10. Let N be a 2-absorbing second submodule of an R-module M . Then we have the following. p (a) If AnnR (N ) = P for some prime ideal P of R and p L is a completely irreducible submodule of M such that N 6⊆ L, then (L :R N ) is a prime ideal p of R containing P . (b) If AnnR (N ) = P ∩ Q for some prime ideals P and Q of R, p L is a completely irreducible submodule of M such that N ⊆ 6 L, and P ⊆ (L :R N ), p then (L :R N ) is a prime ideal of R. p Proof. (a) Assume that a, b ∈ R and ab ∈ (L :R N ). Then there is a positive integer t such that at bt N ⊆ L. By hypotheses, N is a 2-absorbing second submodule t of M , thus at N ⊆ L or bt N ⊆ L or at bt ∈ AnnnR (N ). If either ap N ⊆ L or bt N ⊆ t t L, we are done. So assume that a b ∈ Ann p ∈ AnnR (N ) = P pR (N ). Then ab and p so a ∈ P or b ∈ P .pIt is clear that P = AnnR (N ) ⊆ (L :R N ). Therefore, a ∈ (L :R N ) or b ∈ (L :R N ). (b) The proof is similar to that of part (a).  Proposition 2.11. Let M be an R-module and let {Ki }i∈I be a chain of 2absorbing second submodules of M . Then ∪i∈I Ki is a 2-absorbing second submodule of M . Proof. Let a, b ∈ R, L be a completely irreducible submodule of M , and ab(∪i∈I Ki ) ⊆ L. Assume that a(∪i∈I Ki ) 6⊆ L and b(∪i∈I Ki ) 6⊆ L. Then there are m, n ∈ I, where aKn 6⊆ L and bKm 6⊆ L. Hence, for every Kn ⊆ Ks and Km ⊆ Kd we have aKs 6⊆ L and bKd 6⊆ L. Therefore, for each submodule Kh such that Kn ⊆ Kh and Km ⊆ Kh we have abKh = 0. Hence ab(∪i∈I Ki ) = 0, as needed.  Definition 2.12. We say that a 2-absorbing second submodule N of an R-module M is a maximal 2-absorbing second submodule of a submodule K of M , if N ⊆ K and there does not exist a 2-absorbing second submodule H of M such that N ⊂ H ⊂ K. Lemma 2.13. Let M be an R-module. Then every 2-absorbing second submodule of M is contained in a maximal 2-absorbing second submodule of M . Proof. This is proved easily by using Zorn’s Lemma and Proposition 2.11.  Theorem 2.14. Every Artinian R-module has only a finite number of maximal 2-absorbing second submodules. Proof. Suppose that there exists a non-zero submodule N of M such that it has an infinite number of maximal 2-absorbing second submodules. Let S be a submodule of M chosen minimal such that S has an infinite number of maximal 2-absorbing second submodules. Then S is not 2-absorbing second submodule. Thus there exist a, b ∈ R and a completely irreducible submodule L of M such that abS ⊆ L but SOME GENERALIZATIONS OF SECOND SUBMODULES 5 aS 6⊆ L, bS 6⊆ L, and abS 6= 0. Let V be a maximal 2-absorbing second submodule of M contained in S. Then aV ⊆ L or bV ⊆ L or abV = 0. Thus V ⊆ (L :M a) or V ⊆ (L :M b) or V ⊆ (0 :M ab). Therefore, V ⊆ (L :S a) or V ⊆ (L :S b) or V ⊆ (0 :S ab). By the choice of S, the modules (L :S a), (L :S b), and (0 :S ab) have only finitely many maximal 2-absorbing second submodules. Therefore, there is only a finite number of possibilities for the module S which is a contradiction.  3. Strongly 2-absorbing second submodules Definition 3.1. Let N be a non-zero submodule of an R-module M . We say that N is a strongly 2-absorbing second submodule of M if whenever a, b ∈ R, L1 , L2 are completely irreducible submodules of M , and abN ⊆ L1 ∩ L2 , then aN ⊆ L1 ∩ L2 or bN ⊆ L1 ∩ L2 or ab ∈ AnnR (N ). This can be regarded as a dual notion of the strongly 2-absorbing submodule. Example 3.2. Clearly every strongly 2-absorbing second submodule is a 2-absorbing second submodule. But the converse is not true in general. For example, consider Z as a Z-module. Then 2Z is a 2-absorbing second submodule of Z but it is not a strongly 2-absorbing second submodule of Z. Theorem 3.3. Let N be a submodule of an R-module M . The following statements are equivalent: (a) N is a strongly 2-absorbing second submodule of M ; (b) If N 6= 0, IJN ⊆ K for some ideals I, J of R and a submodule K of M , then IN ⊆ K or JN ⊆ K or IJ ∈ AnnR (N ); (c) N 6= 0 and for each a, b ∈ R, we have abN = aN or abN = bN or abN = 0. Proof. (a) ⇒ (b). Assume that IJN ⊆ K for some ideals I, J of R, a submodule K of M , and IJ 6⊆ AnnR (N ). Then by Lemma 2.5, for all completely irreducible submodules L of M with K ⊆ L either IN ⊆ L or JN ⊆ L. If IN ⊆ L (resp. JN ⊆ L) for all completely irreducible submodules L of M with K ⊆ L, we are done. Now suppose that L1 and L2 are two completely irreducible submodules of M with K ⊆ L1 , K ⊆ L2 , IN 6⊆ L1 , and JN 6⊆ L2 . Then IN ⊆ L2 and JN ⊆ L1 . Since IJN ⊆ L1 ∩ L2 , we have either IN ⊆ L1 ∩ L2 or JN ⊆ L1 ∩ L2 . As IN ⊆ L1 ∩ L2 , we have IN ⊆ L1 which is a contradiction. Similarly from JN ⊆ L1 ∩ L2 we get a contradiction. (b) ⇒ (a). This is clear. (a) ⇒ (c). By part (a), N 6= 0. Let a, b ∈ R. Then abN ⊆ abN implies that aN ⊆ abN or bN ⊆ abN or abN = 0. Thus abN = aN or abN = bN or abN = 0. (c) ⇒ (a). This is clear.  Lemma 3.4. Let M be an R-module, N ⊂ K be two submodules of M , and K be a strongly 2-absorbing second submodule of M . Then K/N is a strongly 2-absorbing second submodule of M/N . Proof. This is straightforward.  Proposition 3.5. Let N be a strongly 2-absorbing second submodule of an Rmodule M . Then we have the following. (a) AnnR (N ) is a 2-absorbing ideal of R. (b) If K is a submodule of M such that N 6⊆ K, then (K :R N ) is a 2-absorbing ideal of R. 6 H. ANSARI-TOROGHY AND F. FARSHADIFAR (c) If I is an ideal of R, then I n N = I n+1 N , for all n ≥ 2. (d) If (L1 ∩ L2 :R N ) is a prime ideal of R for all completely irreducible submodules L1 and L2 of M such that N 6⊆ L1 ∩ L2 , then AnnR (N ) is a prime ideal of R. Proof. (a) Let a, b, c ∈ R and abc ∈ AnnR (N ). Then abN ⊆ abN implies that aN ⊆ abN or bN ⊆ abN or abN = 0 by Theorem 3.3. If abN = 0, then we are done. If aN ⊆ abN , then caN ⊆ cabN = 0. In other case, we do the same. (b) Let a, b, c ∈ R and abc ∈ (K :R N ). Then acN ⊆ K or bcN ⊆ K or abcN = 0. If acN ⊆ K or bcN ⊆ K, then we are done. If abcN = 0, then the result follows from part (a). (c) It is enough to show that I 2 N = I 3 N . It is clear that I 3 N ⊆ I 2 N . Since N is strongly 2-absorbing second submodule, I 3 N ⊆ I 3 N implies that I 2 N ⊆ I 3 N or IN ⊆ I 3 N or I 3 N = 0 by Theorem 3.3. If I 2 N ⊆ I 3 N or IN ⊆ I 3 N , then we are done. If I 3 N = 0, then the result follows from part (a). (d) Suppose that a, b ∈ R and abN = 0. Assume contrary that aN 6= 0 and bN 6= 0. Then there exist completely irreducible submodules L1 and L2 of M such that aN 6⊆ L1 and bN 6⊆ L2 . Now since (L1 ∩ L2 :R N ) is a prime ideal of R, 0 = abN ⊆ L1 ∩ L2 implies that bN ⊆ L1 ∩ L2 or aN ⊆ L1 ∩ L2 . In any cases, we have a contradiction.  Remark 3.6. ([9, Theorem 2.4]). If I is a 2-absorbing ideal of R, then one of the following statements must hold: √ (a) I = P is a prime ideal of R such that P 2 ⊆ I; √ 2 √ (b) I = P ∩ Q, P Q ⊆ I, and I ⊆ I where P and Q are the only distinct prime ideals of R that are minimal over I. Theorem 3.7. If N is a strongly 2-absorbing second submodule of M and N 6⊆ K, then either (K :R N ) is a prime ideal of R or there exists an element a ∈ R such that (K :R aN ) is a prime ideal of R. Proof. By Preposition 3.5 and Remark 3.6, we have one of the following two cases. p (a) Let AnnR (N ) = P , where P is a prime ideal of R. We show that (K :R N ) is a prime ideal of R when P ⊆ (K :R N ). Assume that a, b ∈ R and ab ∈ (K :R N ). Hence aN ⊆ K or bN ⊆ K or ab ∈ AnnR (N ). If either aN ⊆ K or bN ⊆ K, we are done. Now assume that ab ∈ AnnR (N ). Then ab ∈ P and so a ∈ P or b ∈ P . Thus, a ∈ (K :R N ) or b ∈ (K :R N ) and the assertion follows. If P 6⊆ (K :R N ), then there exists a ∈ P such that aN 6⊆ K. By Remark 3.6, P 2 ⊆ AnnR (N ) ⊆ (K :R N ), thus P ⊆ (K :R aN ). Now a similar argument shows that (K :R aN ) is a prime idealpof R. (b) Let AnnR (N ) = P ∩ Q, where P and Q are distinct prime ideals of R. If P ⊆ (K :R N ), then the result follows by a similar proof to that of part (a). Assume that P 6⊆ (K :R N ). Then there exists a ∈ P such that aN 6⊆ K. By Remark 3.6, we have P Q ⊆ AnnR (N ) ⊆ (K :R N ). Thus, Q ⊆ (K :R aN ) and the result follows by a similar proof to that of part (a).  SOME GENERALIZATIONS OF SECOND SUBMODULES 7 Let M be an R-module. A prime ideal P of R is said to be a coassociated prime of M if there exists a cocyclic homomorphic image T of M such that P = AnnR (T ). The set of all coassociated prime ideals of M is denoted by CoassR (M ) [20]. Theorem 3.8. Let N be a strongly 2-absorbing second submodule of an R-module M . Then we have the following. p (a) If AnnR (N ) = P for some prime ideal P of R, L1 and L2 are completely p irreducible submodules of M such , and N 6⊆ L2 , then p p that N 6⊆ L1p either (L1 :R N ) ⊆ (L2 :R N ) or (L2 :R N ) ⊆ (L1 :R N ). Hence, Coass p R (N ) is a totally ordered set. (b) If AnnR (N ) = P ∩Q for some prime ideals P and Q of R, L1 and L2 are completely irreducible that N 6⊆ L1 and p p submodules of M such p pN 6⊆ L2 , and P ⊆ (L : N ) ∩ (L : N ), then either (L : N ) ⊆ (L2 :R N ) or 1 R 2 R 1 R p p (L2 :R N ) ⊆ (L1 :R N ). Hence, CoassR (N ) is the union of two totally ordered sets. p p p (L : N ) ⊆ 6 (L : N ). We show that (L2 :R N ) ⊆ Proof. (a) Assume that 1 R 2 R p p p (L2 :R N ). Suppose that a ∈ (L1 :R N ) and b ∈ (L2 :R N ). Then there exists a positive integer s such that as N ⊆ L1 ,pbs N ⊆ L2 , and bs N 6⊆ L1 . If (L2 :R N ). Now assume that as N ⊆ L1 ∩ L2 , then as N ⊆ L2 and so a ∈ as N 6⊆ L1 ∩ L2 . Then as bs ∈ AnnR (N ) because as bs N ⊆ L1 ∩ L2 , as N 6⊆ L1 ∩ L2 , and bs N 6⊆ L1 ∩L2 . Thus, p ab ∈ P . If b ∈ P , then bs N ⊆ L1 which is a contradiction. Hence a ∈ P and so a ∈ (L2 :R N ). Let P, Q ∈ CoassR (N ). Then there exist completely irreducible submodules p L1 and L2 of M such p that P = (L1 :R N ) and Q = (L2 :R N ). Thus, P = (L1 :R N ) and Q = (L2 :R N ). Hence, either P ⊆ Q or Q ⊆ P and this completes the proof. (b) The proof is similar to that of part (a).  In [17, 2.10], it is shown that, if R be a Noetherian ring, M a finitely generated multiplication R-module, N a proper submodule of M such that AssR (M/N ) is a totally ordered set, and (N :R M ) is a 2-absorbing ideal of R, then N is a 2absorbing submodule of M . In the following theorem we see that some of this conditions are redundant. Theorem 3.9. Let N be a submodule of a multiplication R-module M such that (N :R M ) is a 2-absorbing ideal of R. Then N is a 2-absorbing submodule of M . Proof. As (N :R M ) 6= R, N 6= M . Let a, b ∈ R, m ∈ M , and abm ∈ N . Since M is a multiplication R-module, there exists an ideal I of R such that Rm = IM . Thus abIM ⊆ N . Hence, abI ⊆ (N :R M ). Now by assumption, ab ∈ (N :R M ) or aI ⊆ (N :R M ) or bI ⊆ (N :R M ). Therefore, ab ∈ (N :R M ) or aIM ⊆ N or bIM ⊆ N . Thus ab ∈ (N :R M ) or am ∈ N or bm ∈ N .  An R-module M is said to be a comultiplication module if for every submodule N of M there exists an ideal I of R such that N = (0 :M I), equivalently, for each submodule N of M , we have N = (0 :M AnnR (N )) [7]. Theorem 3.10. Let N be a submodule of a comultiplication R-module M . Then we have the following. (a) If AnnR (N ) is a 2-absorbing ideal of R, then N is a strongly 2-absorbing second submodule of M . In particular, N is a 2-absorbing second submodule of M . 8 H. ANSARI-TOROGHY AND F. FARSHADIFAR (b) If M is a cocyclic module and N is a 2-absorbing second submodule of M , then N is a strongly 2-absorbing second submodule of M . Proof. (a) Let a, b ∈ R, K be a submodule of M , and abN ⊆ K. Then we have AnnR (K)abN = 0. So by assumption, AnnR (K)aN = 0 or AnnR (K)bN = 0 or abN = 0. If abN = 0, we are done. If AnnR (K)aN = 0 or AnnR (K)bN = 0, then AnnR (K) ⊆ AnnR (aN ) or AnnR (K) ⊆ AnnR (bN ). Hence, aN ⊆ K or bN ⊆ K since M is a comultiplication R-module. (b) By Proposition 2.9, AnnR (N ) is a 2-absorbing ideal of R. Thus the result follows from part (a).  The following example shows that Theorem 3.10 (a) is not satisfied in general. Example 3.11. By [7, 3.9], the Z-module Z is not a comultiplication Z-module. The submodule N = pZ of Z, where p is a prime number, is not strongly 2-absorbing second submodule. But AnnZ (pZ) = 0 is a 2-absorbing ideal of R. For a submodule N of an R-module M the the second radical (or second socle) of N is defined as the sum of all second submodules of M contained in N and it is denoted by sec(N ) (or soc(N )). In case N does not contain any second submodule, the second radical of N is defined to be (0) (see [11] and [2]). Theorem 3.12. Let M be a finitely generated comultiplication R-module. If N is a strongly 2-absorbing second submodule of M , then sec(N ) s a strongly 2-absorbing second submodule of M . Proof. Let N be a strongly 2-absorbing second submodule of M .pBy Proposition 3.5 (a), AnnR (N ) is a 2-absorbing ideal of R. Thus by [9, p 2.1], AnnR (N ) is a 2-absorbing ideal of R. By [5, 2.12], AnnR (sec(N )) = AnnR (N ). Therefore, AnnR (sec(N )) is a 2-absorbing ideal of R. Now the result follows from Theorem 3.10 (a).  Lemma 3.13. Let f : M → Ḿ be a monomorphism of R-modules. If Ĺ is a completely irreducible submodule of f (M ), then f −1 (Ĺ) is a completely irreducible submodule of M . Proof. This is strighatforward.  Lemma 3.14. Let f : M → Ḿ be a monomorphism of R-modules. If L is a completely irreducible submodule of M , then f (L) is a completely irreducible submodule of f (M ). Proof. Let {Ńi }i∈I be a family of submodules of f (M ) such that f (L) = ∩i∈I Ńi . Then L = f −1 f (L) = f −1 (∩i∈I Ńi ) = ∩i∈I f −1 (Ńi ). This implies that there exists i ∈ I such that L = f −1 (Ńi ) since L is a completely irreducible submodule of M . Therefore, f (L) = f f −1 (Ńi ) = f (M ) ∩ Ńi = Ńi , as requested.  Theorem 3.15. Let f : M → Ḿ be a monomorphism of R-modules. Then we have the following. (a) If N is a strongly 2-absorbing second submodule of M , then f (N ) is a 2-absorbing second submodule of Ḿ . (b) If N is a 2-absorbing second submodule of M , then f (N ) is a 2-absorbing second submodule of f (M ). SOME GENERALIZATIONS OF SECOND SUBMODULES 9 (c) If Ń is a strongly 2-absorbing second submodule of Ḿ and Ń ⊆ f (M ), then f −1 (Ń ) is a 2-absorbing second submodule of M . (d) If Ń is a 2-absorbing second submodule of f (M ), then f −1 (Ń ) is a 2absorbing second submodule of M . Proof. (a) Since N 6= 0 and f is a monomorphism, we have f (N ) 6= 0. Let a, b ∈ R, Ĺ be a completely irreducible submodule of Ḿ , and abf (N ) ⊆ Ĺ. Then abN ⊆ f −1 (Ĺ). As N is strongly 2-absorbing second submodule, aN ⊆ f −1 (Ĺ) or bN ⊆ f −1 (Ĺ) or abN = 0. Therefore, or af (N ) ⊆ f (f −1 (Ĺ)) = f (M ) ∩ Ĺ ⊆ Ĺ bf (N ) ⊆ f (f −1 (Ĺ)) = f (M ) ∩ Ĺ ⊆ Ĺ or abf (N ) = 0, as needed. (b) This is similar to the part (a). (c) If f −1 (Ń ) = 0, then f (M ) ∩ Ń = f f −1 (Ń ) = f (0) = 0. Thus Ń = 0, a contradiction. Therefore, f −1 (Ń ) 6= 0. Now let a, b ∈ R, L be a completely irreducible submodule of M , and abf −1 (Ń ) ⊆ L. Then abŃ = ab(f (M ) ∩ Ń ) = abf f −1 (Ń ) ⊆ f (L). As Ń is strongly 2-absorbing second submodule, aŃ ⊆ f (L) or bŃ ⊆ f (L) or abŃ = 0. Hence af −1 (Ń ) ⊆ f −1 f (L) = L or bf −1 (Ń ) ⊆ f −1 f (L) = L or abf −1 (Ń ) = 0, as desired. (d) By using Lemma 3.14, this is similar to the part (c).  Corollary 3.16. Let M be an R-module and N ⊆ K be two submodules of M . Then we have the following. (a) If N is a strongly 2-absorbing second submodule of K, then N is a 2absorbing second submodule of M . (b) If N is a strongly 2-absorbing second submodule of M , then N is a 2absorbing second submodule of K. Proof. This follows from Theorem 3.15 by using the natural monomorphism K → M.  A non-zero submodule N of an R-module M is said to be a weakly second submodule of M if rsN ⊆ K, where r, s ∈ R and K is a submodule of M , implies either rN ⊆ K or sN ⊆ K [4]. Proposition 3.17. Let N ba a non-zero submodule of an R-module M . Then N is a weakly second submodule of M if and only if N is a strongly 2-absorbing second submodule of M and AnnR (N ) is a prime ideal of R. Proof. Clearly, if N is a weakly second submodule of M , then N is a strongly 2absorbing second submodule of M and by [4, 3.3], AnnR (N ) is a prime ideal of R. For the converse, let abN ⊆ H for some a, b ∈ R and submodule K of M such that neither aN ⊆ H nor bN ⊆ H. Then ab ∈ AnnR (N ) and so either a ∈ AnnR (N ) or b ∈ AnnR (N ). This contradiction shows that N is weakly second.  The following example shows that the two concepts of strongly 2-absorbing second submodule and weakly second submodule are different in general. 10 H. ANSARI-TOROGHY AND F. FARSHADIFAR Example 3.18. Let p, q be two prime numbers, N =< 1/p + Z >, and K =< 1/q + Z >. Then N ⊕ K is not a weakly second submodule of the Z-module Zp∞ ⊕ Zq∞ . But N ⊕ K is a strongly 2-absorbing second submodule of the Zmodule Zp∞ ⊕ Zq∞ . Corollary 3.19. Let N be a submodule of an R-module M . Then N is second ⇒ N is weakly second ⇒ N is strongly 2 − absorbing second ⇒N is 2 − absorbing second. In general, none of the above implications is reversible. Proof. The first assertion follows from [4, 3.2], Proposition 3.17, and Example 3.2. The second assertion follows from [4, 3.2], Example 3.18, and Example 3.2.  Proposition 3.20. Let M be an R-module and {Ki }i∈I be a chain of strongly 2absorbing second submodules of M . Then ∪i∈I Ki is a strongly 2-absorbing second submodule of M . Proof. Let a, b ∈ R, H be a submodule of M , and ab(∪i∈I Ki ) ⊆ H. Assume that a(∪i∈I Ki ) 6⊆ H and b(∪i∈I Ki ) 6⊆ H. Then there are m, n ∈ I, where aKn 6⊆ H and bKm 6⊆ H. Hence, for every Kn ⊆ Ks and Km ⊆ Kd , we have that aKs 6⊆ H and bKd 6⊆ H. Therefore, for each submodule Kh such that Kn ⊆ Kh and Km ⊆ Kh we have abKh = 0. Hence ab(∪i∈I Ki ) = 0, as needed.  Definition 3.21. We say that a 2-absorbing second submodule N of an R-module M is a maximal strongly 2-absorbing second submodule of a submodule K of M , if N ⊆ K and there does not exist a strongly 2-absorbing second submodule H of M such that N ⊂ H ⊂ K. Lemma 3.22. Let M be an R-module. Then every strongly 2-absorbing second submodule of M is contained in a maximal strongly 2-absorbing second submodule of M . Proof. This is proved easily by using Zorn’s Lemma and Proposition 3.20.  Definition 3.23. Let N be a submodule of an R-module M . We define the strongly 2-absorbing second radical of N as the sum of all strongly 2-absorbing second submodules of M contained in N and we denote it by s.2.sec(N ). In case N does not contain any strongly 2-absorbing second submodule, the strongly 2-absorbing second radical of N is defined to be (0). We say that N 6= 0 is a strongly 2-absorbing second radical submodule of M if s.2.sec(N ) = N . Proposition 3.24. Let N and K be two submodules of an R-module M . Then we have the following. (a) If N ⊆ K, then s.2.sec(N ) ⊆ s.2.sec(K). (b) s.2.sec(N ) ⊆ N . (c) s.2.sec(s.2.sec(N )) = s.2.sec(N ). (d) s.2.sec(N ) + s.2.sec(K) ⊆ s.2.sec(N + K). (e) s.2.sec(N ∩ K) = s.2.sec(s.2.sec(N ) ∩ s.2.sec(K)). (g) If N + K = s.2.sec(N ) + s.2.sec(K), then s.2.sec(N + K) = N + K. SOME GENERALIZATIONS OF SECOND SUBMODULES Proof. These are straightforward. 11  Corollary 3.25. Let N be a submodule of an R-module M . If s.2.sec(N ) 6= 0, then s.2.sec(N ) is a strongly 2-absorbing second radical submodule of M . Proof. This follows from Proposition 3.24 (c).  Theorem 3.26. Let M be an R-module. If M satisfies the descending chain condition on strongly 2-absorbing second radical submodules, then every non-zero submodule of M has only a finite number of maximal strongly 2-absorbing second submodules. Proof. Suppose that there exists a non-zero submodule N of M such that it has an infinite number of maximal strongly 2-absorbing second submodules. Then s.2.sec(N ) is a strongly 2-absorbing second radical submodule of M and s.2.sec(N ) has an infinite number of maximal strongly 2-absorbing second submodules. Let S be a strongly 2-absorbing second radical submodule of M chosen minimal such that S has an infinite number of maximal strongly 2-absorbing second submodules. Then S is not strongly 2-absorbing second. Thus there exist r, t ∈ R and a submodule L of M such that rtS ⊆ L but rS 6⊆ L, tS 6⊆ L, and rtS 6= 0. Let V be a maximal strongly 2-absorbing second submodule of M contained in S. Then V ⊆ (L :S r) or V ⊆ (L :S t) or V ⊆ (0 :S rt) so that V ⊆ s.2.sec((K :S r)) or V ⊆ s.2.sec((K :S t)) or V ⊆ s.2.sec((0 :S rt)). By the choice of S, the modules s.2.sec((K :S r)), s.2.sec((K :S t)), and s.2.sec((0 :S rt)) have only finitely many maximal strongly 2-absorbing second submodules. Therefore, there is only a finite number of possibilities for the module S, which is a contradiction.  Corollary 3.27. Every Artinian R-module has only a finite number of maximal strongly 2-absorbing second submodules. Theorem 3.28. Let M be an R-module. If E is an injective R-module and N is a 2-absorbing submodule of M such that HomR (M/N, E) 6= 0, then HomR (M/N, E) is a strongly 2-absorbing second R-module. Proof. Let r, s ∈ R. Since N is a 2-absorbing submodule of M , we can assume that (N :M rs) = (N :M r) or (N :M rs) = M . Since E is an injective R-module, by replacing M with M/N in [4, 3.13 (a)], we have HomR (M/(N :M r), E) = rHomR (M/N, E). Therefore, rsHomR (M/N, E) = HomR (M/(N :M rs), E) = HomR (M/(N :M r), E) = rHomR (M/N, E) or rsHomR (M/N, E) = HomR (M/(N :M rs), E) = HomR (M/M, E) = 0, as needed  Theorem 3.29. Let M be a strongly 2-absorbing second R-module and F be a right exact linear covariant functor over the category of R-modules. Then F (M ) is a strongly 2-absorbing second R-module if F (M ) 6= 0. Proof. This follows from [4, 3.14] and Theorem 3.3 (c) ⇔ (d).  12 H. ANSARI-TOROGHY AND F. FARSHADIFAR References 1. Anderson, W. and Fuller, K. R. Rings and Categories of Modules, Springer-Verlag, New York-Heidelberg-Berlin, 1974. 2. Ansari-Toroghy, H. and Farshadifar, F. On the dual notion of prime submodules, Algebra Colloq. 19 (Spec 1)(2012), 1109-1116. 3. Ansari-Toroghy, H. and Farshadifar, F. On the dual notion of prime submodules (II), Mediterr. J. Math., 9 (2) (2012), 329-338. 4. Ansari-Toroghy, H. and Farshadifar, F. The dual notion of some generalizations of prime submodules, Comm. Algebra, 39 (2011), 2396-2416. 5. Ansari-Toroghy, H. and Farshadifar, F. On the dual notion of prime radicals of submodules, Asian Eur. J. Math. 6 (2) (2013), 1350024 (11 pages). 6. Ansari-Toroghy, H., Farshadifar, F., Pourmortazavi, S. S., and Khaliphe F. On secondary modules, International Journal of Algebra, 6 (16) (2012), 769-774. 7. Ansari-Toroghy, H. and Farshadifar, F. The dual notion of multiplication modules, Taiwanese J. Math. 11 (4) (2007), 1189–1201. 8. Ansari-Toroghy, H., Farshadifar, F., and Pourmortazavi, S. S. On the P -interiors of submodules of Artinian modules, Hacettepe Journal of Mathematics and Statistics, to appear. 9. Badawi, A. On 2-absorbing ideals of commutative rings, Bull. Austral. Math. Soc. 75 (2007), 417-429. 10. Barnard, A. Multiplication modules, J. Algebra 71 (1981), 174-178. 11. Ceken, S., Alkan, M., and Smith, P. F. The dual notion of the prime radical of a module, J. Algebra 392 (2013), 265-275. 12. Darani, A. Y. and Soheilnia, F. 2-absorbing and weakly 2-absorbing submoduels, Thai J. Math. 9(3) (2011), 577584. 13. Darani, A. Y. and Soheilnia, F. On n-absorning submodules, Math. Commun., 17(2012), 547-557. 14. Dauns, J. Prime submodules, J. Reine Angew. Math. 298 (1978), 156–181. 15. Fuchs, L., Heinzer, W., and Olberding, B. Commutative ideal theory without finiteness conditions: Irreducibility in the quotient filed, in : Abelian Groups, Rings, Modules, and Homological Algebra, Lect. Notes Pure Appl. Math. 249 (2006), 121–145. 16. Macdonald, I. G. Secondary representation of modules over a commutative ring, Sympos. Math. XI (1973), 23-43. 17. Payrovi, Sh. and Babaei, S. On 2-absorbing submodules, Algebra Collq., 19 (2012), 913-920. 18. Payrovi, Sh. and Babaei, S. On the 2-absorbing submodules, Iran. J. Math. Sci. Inform., 10 (1) (2015), 131-137. 19. Yassemi, S. The dual notion of prime submodules, Arch. Math. (Brno) 37 (2001), 273–278. 20. Yassemi, S. Coassociated primes, Comm. Algebra. 23 (1995), 1473-1498. 21. Yassemi, S. The dual notion of the cyclic modules, Kobe. J. Math. 15 (1998), 41–46. Department of pure Mathematics, Faculty of mathematical Sciences, University of Guilan, P. O. Box 41335-19141, Rasht, Iran. E-mail address: [email protected] University of Farhangian, P. O. Box 19396-14464, Tehran, Iran. E-mail address: [email protected] School of Mathematics, Institute for Research in Fundamental Sciences (IPM), P.O. Box: 19395-5746, Tehran, Iran.
0math.AC
LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi William McDoniel1 , Markus Höhnerbach1 , Rodrigo Canales1 Ahmed E. Ismail2 , and Paolo Bientinesi1 1 arXiv:1702.04250v1 [cs.CE] 14 Feb 2017 2 RWTH Aachen University, Aachen, Germany 52062 E-Mail: [email protected] West Virginia University, Morgantown, USA 26506 Abstract. Molecular Dynamics is an important tool for computational biologists, chemists, and materials scientists, consuming a sizable amount of supercomputing resources. Many of the investigated systems contain charged particles, which can only be simulated accurately using a longrange solver, such as PPPM. We extend the popular LAMMPS molecular dynamics code with an implementation of PPPM particularly suitable for the second generation Intel Xeon Phi. Our main target is the optimization of computational kernels by means of vectorization, and we observe speedups in these kernels of up to 12x. These improvements carry over to LAMMPS users, with overall speedups ranging between 2-3x, without requiring users to retune input parameters. Furthermore, our optimizations make it easier for users to determine optimal input parameters for attaining top performance. 1 Introduction Molecular dynamics simulations are used to compute the evolution of systems of atoms in fields as diverse as biology, chemistry, and materials science. Such simulations target millions or billions of particles, are frequently run in parallel, and consume a sizable portion of supercomputers’ cycles. Since in principle each atom interacts with all the other atoms in the system, efficient methods to compute the pairwise forces are vital. The most widespread method for electrostatic interactions is the “Particle-Particle Particle-Mesh” (PPPM) method [1], which makes it possible to efficiently compute even the interactions between distant particles. Due to its popularity, we target the open-source LAMMPS code [2], which offers the PPPM method. LAMMPS is a C++ code designed for large parallel simulations using MPI, and is written to be modular and extensible. LAMMPS can be compiled with a variety of packages that provide different implementations of key methods for the calculation of short-range and long-range interactions. For example, the USER-OMP package includes versions of methods such as PPPM which are specifically designed for shared-memory parallelism. In this paper, we extend the LAMMPS molecular dynamics simulator with a version of PPPM that is especially suitable for architectures with wide vector registers, 2 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi such as the Xeon Phi. In the past, long-ranged solvers have been optimized for GPUs, with issues similar to those encountered with Xeon Phi accelerators [3,4]. On these systems, one of the main routes towards high-performance is the exploitation of the wide (512-bit) vector registers. To this end, we create vectorized kernels for all the computational components that are not directly supported by highly optimized math libraries (e.g. FFTs). These routines account for between 20% and 80% of the time spent in PPPM. As such, their optimization leads to notable speedups in the overall performance of the simulation. One challenge is that the innermost loops of said computational routines are very short, with trip-counts between 3 and 7. This is a common problem for vectorizing molecular dynamics even outside of PPPM. For example, it was encountered by Höhnerbach et al. in their multi-platform vectorization of the extremely short loops of the Tersoff potential [5]. It turns out that work can be saved elsewhere by increasing these trip counts, simultaneously enabling efficient vectorization. Similarly, work can be shifted away from poorly-scaling FFTs and into newly-optimized functions, and, within the optimized functions, memory bandwidth can be traded against additional computation. In this paper, in addition to discussing vectorization techniques, we also provide insights into the parametrization of PPPM for performance. In particular, we consider three tunable parameters: the real-space cutoff, the interpolation order, and the differentiation mode. Many users will stick to the default choices where such exist, since these promise accurate and reasonably performant calculations. Others will have taken time to tune these parameters for their particular problems, but even expert users often make suboptimal choices that can up to double time-to-solution for a given desired accuracy, depending on the problem [6]. We achieve 2-3x speedups for a wide range of input parameters, and our optimizations also make the careful tuning of several parameters unnecessary by making particular options superior to the others for almost all cases. The code presented in this paper is contributed to the USER-INTEL package of LAMMPS [7]. It has been shown that this package can not just yield impressive speedups on Intel architecture, but also improve the energy efficiency of the calculation [8]. 2 2.1 Molecular Dynamics and PPPM An algorithmic overview The interaction between atoms in a molecular dynamics simulation is governed by a so-called potential function. For example, the Lennard-Jones (LJ) and the Coulombic (Coul) potentials are given by: " 12  6 # C qi qj σij σij ij ij , and VCoul = . (1) − VLJ = 4ǫij rij rij ε rij For a given pair of atoms (i, j), the potential depends on the distance between them, rij , as well as their charges qi and qj (in the Coulombic case), or the LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 3 parameters ǫij and σij (in the Lennard-Jones case), which describe the minimum of the potential function and its root. In order to obtain the forces on atoms, MD simulations can compute these potential functions for all pairs of atoms, but O(n2 ) pairs have to be evaluated, and this quickly becomes infeasible. A simple solution is to introduce a cutoff. One only considers interactions among atoms within a given cutoff radius rC of each other. Consequently, the 3 number of pairs to be evaluated decreases to O(nrC ). Since all the potential functions (e.g., Eqn. 1) fall off with distance, the cutoff provides a reasonable strategy to approximate the total potential on atoms. There are, however, numerous situations in which long-range interactions between atoms cannot be neglected, and instead have to be approximated numerically. A plain cutoff strategy does not work well for Coulomb interactions, which are relevant when a system contains charged particles or polar molecules, because the potential falls off only as r−1 . In contrast, the cutoff is perfectly fine for the Lennard-Jones potential, as long as the system is uniform. In non-uniform problems, such as those featuring an interface, even LennardJones interactions may need to be calculated using a long-ranged solver and can not be approximated [9]. In these cases, it is necessary to approximate these longrange interactions without explicitly computing pair-wise potential functions; for this task, Particle-Particle Particle-Mesh is often the method of choice. PPPM approximates long-range interactions in a periodic system by obtaining the potential of the entire system of atoms as a function of space, discretized to a grid [1]. While originally developed for electrostatics, the method was later adapted to the r−6 term of the Lennard-Jones potential [10]. In this work, we focus on PPPM for electrostatics, i.e., the Coulomb potential. PPPM uses an idea due to Ewald, and splits the potential into two components [11]. The first component, the “short-ranged” part of PPPM, contains the discontinuity due to the r−1 term, and a smooth screening term that limits the support to a small spherical region around a given atom; this component can be calculated directly between each atom and its neighbors in a certain cutoff radius rC . The second component is the “long-ranged” part of PPPM; due to its smooth nature, this can be solved accurately on a grid. The efficient solution of the long-ranged component is the key ingredient of the PPPM method. Since we are operating with smooth quantities, the electrostatic potential is related to the charge distribution ρ via Poisson’s equation ρ (2) ∇2 Φ = − . ǫ0 From the electrical potential Φ, one can compute the forces on all the atoms due to it. The forces on an atom j with charge qj can be obtained from the gradient of the potential evaluated at the particle’s position: F j = −qj ∇Φ. (3) PPPM approximates these forces on each particle by proceeding in three steps: 1. First, particle charges are mapped to a grid using a stencil, obtaining a discretized form of the charge distribution ρ. 4 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi 2. Second, Poisson’s equation (Eqn. 2) is solved in order to obtain the potential Φ. This is done by first taking the 3D Fourier transform of the charge distribution, as Poisson’s equation is easier to solve in reciprocal space, and then performing one or more inverse FFTs to obtain a result in real space. 3. Third, this result is mapped back to the atoms with the same stencil used when mapping charges. The forces are obtained from the gradient of the potential, and this gradient can be taken in reciprocal or real space, determined by the user-specified differentiation mode. For ik differentiation, the gradient is calculated in reciprocal space, immediately after solving Poisson’s equation, and three inverse FFTs bring it back into real space, where its components are mapped to the atoms. For ad differentiation, one inverse FFT yields the scalar potential in real space, and this is mapped to the atoms using different sets of coefficients for each component of the gradient to be obtained. Our optimizations focus especially on the mapping steps (steps 1 and 3). Step 2 is not as interesting for manual optimization since it is dominated by FFT calculations, for which highly optimized libraries exist. The mapping steps, on the contrary, are deeply nested loops performing calculations on data that is likely already in cache. We will show that optimizations, especially proper vectorization, will speed up these steps by at least a factor of four. 2.2 Related Work Besides LAMMPS, many other popular molecular dynamics codes contain longranged solvers. Examples include, but are not limited to, Gromacs [12], DL POLY [13], AMBER [14], Desmond [15], and NAMD [16]. These codes tend not to implement PPPM itself, in favor of related schemes such as PME [17], SPME [18], and k-GSE [19]. The main differences with respect to PPPM lie in the function used to interpolate atom charges onto the grid and back, and in the corresponding Green’s function used to solve for the smooth part of the potential. There also exist schemes for long-ranged force evaluation that are not based on Fourier transforms, such as lattice Gaussian multigrid [20], Multilevel Summation [21], and r-GSE [19]. 2.3 Parametrization of PPPM Since LAMMPS is used for a wide variety of problems, users have many choices about input parameters for the target physical system. Several of these parameters influence the accuracy and/or speed of the simulation, including the cutoff distance (rC ), the prescribed error in forces relative to a reference (ǫ), the stencil size (S), and the differentiation mode, ik or ad. rC expresses the distance within which pair-wise interactions are computed directly, and outside of which the interactions are approximated using the PPPM 3 grid; the short-ranged calculations scale with rC . The work done when computing FFTs is controlled by ǫ; LAMMPS automatically determines the coarseness LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 5 of the FFT grid to satisfy this accuracy constraint, depending on the values chosen for the other parameters. A 73 stencil (S = 7) causes writing to, and reading from, about 2.7 times as many grid cells compared to the default 53 stencil. A higher-order stencil produces more accurate results, and LAMMPS takes this into account when deciding the resolution of the PPPM grid. Therefore, a higher-order stencil shifts work out of the FFT functions, and into the mapping functions. Users can also choose between the ik and ad differentiation modes described above, and LAMMPS again takes their different accuracies into account when setting up the FFT grid, with the ik mode yielding a slightly coarser grid. Users will typically want to use a set of inputs that nearly minimize runtime, subject to an accuracy constraint. Unfortunately, short of trial-and-error for a specific problem it can be difficult to find a good set of parameters. In a recent work [6], Fabregat et al. developed a method for automatically searching the space of input parameters to find a good set, guided by cost and accuracy models; their case studies suggest that even expert users systematically underestimate the expense of PPPM: they invariably predicted lower-than-optimal cutoffs, which minimize the work done in computing pair interactions while forcing a finer FFT grid. The impact of stencil size was not considered, leaving the choice at LAMMPS’ default. In the next sections we demonstrate that an appropriate choice of stencil size is needed to achieve good vectorization. 2.4 Profiling In order to investigate the effects of the input parameters on runtime, we execute our baseline on a single core of a KNL machine with a single thread. The system is an Intel Xeon Phi 7210 chip (64 cores and 16GB of HBM RAM) in quadrant and flat memory mode, connected to other nodes via OmniPath. Our software is based on the May 11, 2016 version of LAMMPS with the RIGID, USER-OMP and USER-INTEL packages enabled. It was compiled using the Intel C++ Compiler version 16.01 (build 20151021), and uses Intel MPI 5.0 (build 20150128). The reference runs use the code provided by the USER-OMP package, and our runs are based on code from USER-INTEL package running in mixed precision mode. Our benchmark is an SPC/E water simulation [22], a benchmark provided with LAMMPS. We modified it to have a cubic domain. Since all the atoms in the system carry partial charges, the simulation uses PPPM to calculate forces. Unless otherwise specified, the default settings that we use are relative error ǫ = 10−4 , and short-range cutoff rC = 5Å. The basecase contains 36,000 atoms, and will later be scaled up for more extensive benchmarks. Fig. 1 shows timings as the cutoff, relative error, and differentiation mode vary. The vertical sections denote the time spent in FFTs (“PPPM FFT”), and in PPPM aside from FFTs (“PPPM non-FFT”), the time spent in the pair-wise short-ranged interactions (“Pair”), and everything else (“Other”). For cutoff, there actually is a minimum of the runtime, i.e., reducing the cutoff will not reduce runtime beyond a certain point where the long-ranged part gets less efficient: The rC = 3Å case spends a disproportionate amount of 6 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi Time (s) Reference: Impact of Cutoff Reference: Impact of Error 100 40 50 20 0 Ad Ik Ad Ik Ad Ik Ad Ik Ad Ik 3 4 5 6 7 0 Ad Ik Ad Ik Ad Ik 5e-5 1e-4 2e-4 4e-4 Relative Error ǫ Cutoff (angstroms) PPPM non-FFT Ad Ik PPPM FFT Pair Other Fig. 1. Profile of SPC/E water test case running single-threaded on one core of a KNL. Left bar: ad differentiation, right bar: ik differentiation. time in PPPM. The cutoff mostly impacts the “Pair” time—since it scales as 3 O(rC )—and the “PPPM FFT” time—since it forces the grid to grow or shrink. For ǫ, there of course is no minimum—lower accuracy results in faster simulations— mostly due to less time spent in FFT calculations (i.e. smaller grids). Outliers in FFT performance can be attributed to pathological cases (in terms of size) of the FFT library. In both panels of Fig. 1, the “Other” and the “PPPM non-FFT” sections are largely unaffected by changes in cutoff or relative error. In both, ad differentiation performs best (except for one outlier). For cutoff-optimal cases, the majority of the runtime is spent on long-ranged calculation, suggesting that optimization in that area might be quite fruitful. 3 Optimizations The optimizations for the different stages of the algorithm are discussed here. In particular, we cover the functions that map atoms to grid points and grid values to atoms, the Poisson solver, and the routines responsible for the short-ranged contribution. 3.1 Mapping Functions All three mapping functions—Map-Charge and both the ik and the ad versions of Distribute-Force—share the same structure: a loop over all atoms, the calculation of stencil coefficients, and then a loop over stencil points. Map-Charge multiplies the particle charge by the stencil coefficient and adds that value to a point on the grid. Distribute-Force proceeds in a slightly different way depending on the differentiation mode. The ik mode multiplies the grid values for each spatial dimension at each grid point by the corresponding stencil coefficient, then adds them to three totals, one for each dimension; after the loop over stencil points, these components are multiplied by the atom’s charge and a scaling factor to obtain force components. The ad mode multiplies the scalar potential at LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 7 a grid point by three different stencil coefficients to obtain a vector, which is added on the atom; after the loop over stencil points, substantially more calculation than is required for ik differentiation transforms these totals into the components of the force vector. The stencil coefficients are the product of three polynomials of order equal to the stencil size, one for each dimension. The iteration over stencil points consists of a triple loop (one for each dimension of the stencil). This represents the bulk (80%+) of the work, and accounts for almost all the memory accesses in the mapping functions. Map-Charge accesses only a single value at each grid point, but does very little computation. The ik mode of Distribute-Force uses three different values at each grid point. The ad mode uses only one value at each grid point, but performs more floating point operations. The arithmetic intensity of all these routines is relatively low, and memory access patterns will determine the best approach to vectorization. Since the number of grid points is typically comparable to or smaller than the number of atoms, and N S 3 stencil points are touched when looping over N atoms, there is a great deal of data reuse. With so few calculations being performed on data which is almost always found in cache, managing vectorization overhead will prove to be vital. In general, we find that it is important to minimize the amount of data shuffling or masking required to prepare for vector operations; whenever possible, a full vector should be pulled from memory, operated on, and returned. With an understanding of the structure of the mapping functions, we now walk through our process of optimizing each one, pointing out what worked and what did not. A summary of progressive speedups for each function is shown in Fig. 2. Map-Charge Distribute-Force ik Function reference vector split atom 5 reference atom simd inner simd repacking precompute 10 reference rethread vector simd8 precompute Speedup relative to USER-OMP 0 Distribute-Force ad Fig. 2. Speedups for different implementations of each of the three mapping functions relative to the USER-OMP baseline version. Charge mapping timings were obtained from simulations using ik differentiation. 8 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi Function Map-Charge Rethread: To avoid race conditions when writing to the grid, the USEROMP package has threads own disjoint chunks of the grid, and uses conditional statements in the innermost loop over stencil points. By giving threads disjoint sets of atoms and maintaining private copies of the grid—which are then summed together—we achieve a ∼2x speedup. Vector: We vectorize the innermost loop over stencil points, which features unit stride memory accesses as it iterates through grid points. We target a new default stencil size of 7, instead of 5, to make better use of 256-bit vector registers. This implementation achieves another factor of ∼2 speedup (“vector” implementation), which is significant but not close to the theoretical 7x we might hope for. Simd8: Masking associated with the 7-iteration loop is a significant overheard. By explicitly setting the loop length to 8 and padding the stencil coefficient arrays with zeros, we avoid masking and obtain a total of ∼6x speedup over the re-threaded scalar version. Precompute: Rather than evaluating polynomials to obtain the stencil coefficients for each atom every time step, we precompute 5000 values for each polynomial and refer to the nearest entry in this lookup table instead. This brings total speedup to over 12x of the baseline. Function Distribute-Force (ik Differentiation) Atom Simd: Since Distribute-Force performs reads from the grid rather than writes, the atom loop can be vectorized easily, yielding a ∼2x speedup. The gather operations required to read grid point values cause this to be a poor choice. Inner Simd: Reproducing the inner loop vectorization from Map-Charge, setting the loop length to 8, produces a ∼3.7x speedup over the scalar implementation. Repacking: Distribute-Force for ik differentiation uses three different grids with their own force components. By modifying the Poisson solver to instead output the x and y components interweaved, and the z component interweaved with 0s, the innermost loop can be extended to 16 iterations and the x and y components can be computed together by taking advantage of the 512-bit vector register on Xeon Phi. This provides an additional ∼1.1x speedup. Precompute: As with Map-Charge, the polynomial evaluations to obtain stencil coefficients can be replaced with references to a lookup table, for a similar ∼1.1x additional speedup and a total speedup of ∼4.4x relative to the reference. Function Distribute-Force (ad Differentiation) Vector: Transferring over all of the optimizations from the ik mode of Distribute-Force, except the inapplicable repacking of the Poisson solver output, yields speedup below 3x relative to the reference. This is because the extra work after the loop over stencil points has become relatively expensive. LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 9 Split Atom: We split the loop over atoms in two. The first atom loop ends after the triple loop over stencil points, having summed weighted potentials into three arrays of length equal to the number of atoms. The second atom loop operates on these arrays to obtain force components, and can be vectorized as it contains no inner loops and has unit stride access to the weighted potential arrays. This brings the overall speedup to just above 4x. 3.2 Poisson Solver The Poisson solver is a poorly-scaling, communication-intense function which performs 3D FFTs, solves Poisson’s equation in reciprocal space, and then performs a number of inverse 3D FFTs depending on the differentiation mode (3 for ik and 1 for ad). These 3D FFTs are performed in parallel as a series of 1D FFTs with communication steps in between. The FFT functions are from high-performance libraries (in our case MKL) and we do not attempt to optimize them. Our optimization of the solver comes from three ideas. Shift Work: Switching to a stencil size of 7 creates more work in the mapping functions, but causes LAMMPS to choose a coarser grid resolution, requiring fewer calculations to perform the FFTs. 2D FFTs: The series of 1D FFTs is inefficient [23]. We replace it with a 2D FFT followed by a 1D FFT, and in the first communication step we ensure that planes of data are located on each MPI rank. This saves one communication step and is roughly (∼10%) faster. Even for poorly load-balanced cases, where the number of necessary 2D FFTs is only slightly greater than the number of MPI ranks, it does not perform worse. Adjust Grid Sizes: The FFT calls of Intel’s MKL library do not perform well for particular unfortunate values, which can catch users by surprise (compare time spent in FFTs across the cases in Fig. 1). A simple fix that catches many problem cases is to check whether the number FFT grid points in any dimension is a multiple of 16, and increase it by 1 if necessary. Users will now only rarely find that their simulations run substantially slower after making a tiny change to their input file, and, as an added bonus, these simulations will gain slightly improved accuracy. 3.3 Short-Ranged Interactions To avoid shifting the bottleneck to the short-range calculation, it is desirable that it be vectorized. Mike Brown of Intel contributed code vectorizing the pair potential used in simulations containing electrostatic interactions (optionally with cut off Lennard-Jones interactions), where his strategy was to vectorize the loop over each atom’s neighbors. This achieves a ∼3x speedup (for example, compare the time spent in “Pair” between the reference and optimized versions in Fig. 3). We provide similar code compatible with the Buckingham potential, optimized for PPPM and USER-INTEL, and also versions of pair potentials compatible with PPPM for dispersion. 10 4 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi Results We now present comparisons between the reference and optimized versions of LAMMPS using full simulations, profiling the code as in Fig. 1, to show how the various parts of the code contribute to total runtime. We also investigate the opaque way in which the user-facing knobs impact accuracy, and provide evidence that our optimizations do not sacrifice accuracy. The experiments were conducted on a single core, a full node, and multiple nodes. While the speedup is both problem dependent and parameter dependent, the optimized version is faster in every case simulated. Because of our decision to target a new default stencil size of 7, it would not be fair to make like-to-like comparisons between the reference and our optimized versions. Further, LAMMPS’ input files do not even require an explicit choice of stencil size, so many users will just allow it to take on its default value. Fig. 3 compares the two versions as stencil order varies for our baseline test cases, using ik differentiation to demonstrate that the new value is faster for the optimized version. We simulate the standard 5Å case on a single core and a 64x scaled-up 7Å case on a full KNL node, which are nearly-optimal cutoff radii for each case. The trend in total runtime is expected: on both a single core and the full node the reference version is fastest with a stencil size of 5 while the new version is fastest with a value of 7. For all future cases presented, the reference code uses S = 5 while ours uses S = 7. Stencil Size Comparison, ik Time (s) 100 50 0 Ref Opt Ref Opt Ref Opt Ref Opt Ref Opt 3 5 7 5 (x64) 7 (x64) Stencil Order, S PPPM non-FFT PPPM FFT Pair Other Fig. 3. Profiles of SPC/E water as stencil size varies for both single-core and scaled-up full-node cases. Left bar: reference, right bar: optimized. 4.1 Accuracy Since the optimizations proposed involve both parameter-tuning and numerical approximations, we now verify that our code is as accurate as the reference. To this end, we compare to an Ewald summation run with a relative error of 10−5 , and a cutoff of 10Å. LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi Version mode rc S ref ik 7Å 7 opt ik 7Å 7 opt ik 7Å 7 opt ik 7Å 7 opt ad 7Å 7 Table 1. RMS errors 11 precompute RMS error Version mode rc S RMS error 0.0186 ref ad 7Å 7 0.0189 ref ik 3Å 7 0.5853 0.0186 500 points 0.0313 ref ik 5Å 7 0.0124 ref ik 7Å 3 0.0197 5000 points 0.0188 5000 points 0.0188 ref ik 7Å 5 0.0194 for force after one timestep compared to Ewald summation As seen in Table 4.1, without stencil coefficient precomputation, the optimized and reference versions obtain almost identical forces for both differentiation modes. 5000 precomputed stencil polynomial evaluations are sufficient to retain overall accuracy with our approximation. In addition, the optimized version conserves momentum (the sum of forces on all atoms remains nearly zero) and the macroscopic temperature difference between reference and optimized simulations after 100 time steps is always small (∼0.1%), and nearly zero without stencil precomputation. Many users may not expect that their choice of cutoff can have a large effect on accuracy, and LAMMPS’ internal accuracy model does not do as good of a job with stencil size as it does with differentiation mode. After 100 time steps, the temperature is almost 10 degrees higher for a 3Å cutoff than for cutoffs greater than or equal to 4Å. In addition to speedup, our optimized version becomes slightly more accurate by moving to a stencil size of 7. 4.2 Single-Core Simulations We first compare simulations using our optimized version to the reference cases we presented earlier in Fig. 1. Fig. 4 shows both versions as cutoff varies for ik and ad differentiation, respectively. As with the reference version, there is a runtime-optimal cutoff for the optimized version at 5Å where a balance is struck between the pair interactions and the FFTs. Total speedup at this optimal cutoff is 2.21x for ik and 2.75x for ad differentiation. With our optimizations, ad differentiation goes from being only marginally faster at the runtime-optimal cutoff to being 32% faster, making it a compelling choice even for serial simulations where the FFTs do not take up much time. The calculation of long-range interactions, inclusive of the mapping functions, the FFTs, and various minor functions (PPPM FFT plus PPPM non-FFT), is sped up by a factor of 3.44x for ad differentiation. The calculation of the longrange interactions excluding the FFTs has actually sped up by a higher factor of 3.61x despite the larger stencil requiring looping over 2.74 times as many grid points. The calculation of pair interactions is sped up by about 2.5x. ad differentiation is now faster than ik differentiation for every cutoff, due to the smooth decrease in time spent performing FFTs as cutoff increases. The relative penalty for choosing a poor cutoff has not changed much except for cases where an unfortunate number of FFT grid points was doubling the cost of FFTs. In general, an overestimate of the runtime-optimal cutoff is much less 12 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi 1c/1t KNL Comparison, ad Time (s) 1c/1t KNL Comparison, ik 100 100 50 50 0 Ref Opt Ref Opt Ref Opt Ref Opt Ref Opt 3 4 5 6 7 0 Ref Opt Ref Opt Ref Opt Ref Opt Ref Opt 3 4 5 6 7 Cutoff (angstroms) Cutoff (angstroms) PPPM non-FFT PPPM FFT Pair Other Fig. 4. Profiles of SPC/E water test case running single-threaded on one core of a KNL as cutoff varies. Left bar: reference, right bar: optimized. penalizing than an underestimate because the cost of the FFTs increases rapidly as cutoff decreases. Because the optimized long-range calculations are sped up by about as much as the optimized short-range calculations, users will find that pre-existing input files and intuitions about runtime-optimal cutoffs still yield good results. Fig. 5 compares the optimized implementation to the reference as relative error varies. Speedups are between 2.1x and 2.77x for all cases, without an apparent pattern other than that ad differentiation has gained more from the optimizations than ik differentiation. There is not a clear optimal relative error, since users will want to adjust this parameter depending on how important accuracy is in the long-range calculation for their specific problems. Time (s) 1c/1t Accuracy Comparison, ik 1c/1t Accuracy Comparison, ad 60 60 40 40 20 20 0 Ref Opt Ref Opt Ref Opt Ref Opt 5e-5 1e-4 2e-4 4e-4 0 Ref Opt Ref Opt Ref Opt Ref Opt 5e-5 1e-4 2e-4 4e-4 Relative Error ǫ PPPM non-FFT Relative Error ǫ PPPM FFT Pair Other Fig. 5. Profiles of SPC/E water test case running single-threaded on one core of a KNL as PPPM relative error varies. Left bar: reference, right bar: optimized. LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 4.3 13 OpenMP and MPI Parallelism With the additional complication of parallelism, we do not attempt to determine optimal choices of input parameters for our test case, though users will go through this complex process for their individual problems, often settling on a suboptimal set of parameters [6]. Here we just show that our optimized version is much faster than the reference for a range of cutoffs on a full KNL node, for varying numbers of cores on up to two full nodes, and for varying numbers of OpenMP threads per rank. LAMMPS is intended to be scalable to very large numbers of cores, but this scalability is highly dependent on the details of the simulation. As the number of MPI ranks increases, the runtime-optimal input parameters change. Using just one set of input parameters might result in poor scalability (if the chosen set is optimal for small numbers of ranks) or good scalability (if the chosen set is optimal for a large number of ranks). As the number of ranks grows, FFTs and other functions requiring communication become relatively more expensive. This increases the runtime-optimal cutoff and can also make using a stencil size of 7 more efficient even for reference LAMMPS. Parallelism provides yet more knobs for users to consider. These include the number of MPI ranks per node and a number of OpenMP threads per rank. The optimal choice is again problemdependent, but generally LAMMPS should be run with around 1 core per rank and 1-2 threads per core. Fig. 6 contains results for running a proportionally scaled-up benchmark on an entire KNL node with all 64 of its cores. Now we present results for cutoffs from 4 to 9Å instead of 3 to 7 Å, since at 3Å the FFTs for both versions take much longer. For reference LAMMPS the runtime-optimal cutoff is now at 7Å. The optimized version is fastest at 6Å, although 7Å is only slightly slower. This set of simulations features the same number of atoms per core as Fig. 4, but its efficiency is reduced by parallelism overhead. For the single-core optimal cutoff of 5Å, this scaled-up simulation takes 2.5 times as long per atom with our optimized code. It still takes about twice as long even at the new optimal cutoff of 6Å. The reference version fares a little better, taking “only” twice as long at 5Å and 1.4 times as long at its new optimal cutoff of 7Å. If instead we compare the times required at the new runtime-optimal cutoffs to that required for the single-core optimal cutoff, the full node simulations take 1.8 and 2.1 times longer for the reference and optimized codes, respectively. Scalability aside, however, the same general patterns are apparent here as were seen earlier. Total speedup is about 2.4x for optimal cutoffs, lower than for the single-core case due to the relative increase in the expense of communication-intensive functions. As it appears on the LAMMPS website, the SPC/E water benchmark we use here defaults to a cutoff of 9.8Å. This is of course far higher than the runtimeoptimal cutoff on a single core—the simulation takes more than twice as long as at 5Å for reference LAMMPS and about twice as long for our optimized version. However, this exhibits much better scalability since runtime-optimal cutoffs are higher for higher core counts. This is because less time is spent performing poorly-scaling FFTs while more time is spent computing short-range pair in- 14 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi 64c/1t KNL Cutoff Comparison, ad Time (s) 100 50 0 Ref Opt Ref Opt Ref Opt Ref Opt Ref Opt Ref Opt 4 5 6 7 8 9 Cutoff (angstroms) PPPM non-FFT PPPM FFT Pair Other Fig. 6. Profiles of SPC/E water test case scaled up by 64x running single-threaded on a full KNL node as cutoff varies, for ad differentiation. Left bar: reference, right bar: optimized. teractions. Fig. 7a shows core-seconds taken to simulate a fixed-size problem as the number of cores used increases. There is one MPI rank per core and 1 thread per rank. For the 10Å case this scales well up to 32 cores, but for the full KNL node parallel efficiencies are 82% for reference LAMMPS and 63% for optimized LAMMPS. Running on 128 cores across two full nodes is very inefficient; the optimized version actually runs faster on one node, in part due to using an unfortunate number of FFT grid points, although it remains faster than the reference. Both versions see a comparable increase in core-seconds as communication costs rise, and this has a larger relative impact on the optimized version because it was faster to begin with. These observations are consistent with benchmarks published on the LAMMPS website, which exhibit large losses in parallel efficiency after about 16 processors for a variety of systems when running fixed-size benchmarks. 10Å KNL Weak Scalability, ad 100 1,000 Time (s) Core-seconds 10Å KNL Strong Scalability, ad 1,500 500 0 RO RO RO RO RO RO RO RO 1 2 4 8 16 32 64 128 50 0 RO RO RO RO RO RO RO RO 1 2 8 16 32 64 128 Cores Cores PPPM non-FFT 4 PPPM FFT Pair Other Fig. 7. Strong and weak scalability comparisons up to 2 full KNL nodes. Left bar: reference, right bar: optimized. LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 15 More commonly, users will simulate large problems on large numbers of cores. Fig. 7b shows core-seconds per atom as problem size and core count both vary, such that there are 36k atoms per core in each simulation. Parallel efficiencies on a full KNL node are now 85% and 71% for the reference and optimized versions, respectively, and 79% and 60% for two full nodes. Again we see the optimized version scaling less well because the rise in communication costs with core count is roughly the same for both versions, but it remains 2-3x faster over the entire range. Users can also make use of OpenMP parallelism, by either assigning multiple cores to each MPI rank or using multiple threads per physical core, or both. Fig. 8 shows profiles for the same 64x-scale water test case being simulated on a full KNL node, where the number of MPI ranks and OpenMP threads per rank is varied. We use a cutoff of 6Å, as this was close to the runtime-optimal cutoff for this case on the full node when using 64 MPI ranks and 1 thread per rank. Best results are obtained when using one MPI rank per core, which is expected when not running on many nodes—the behavior on two full nodes is similar. Slight performance gain is obtained by using two OpenMP threads per core, which helps a little when computing the short-range interactions. The optimized version behaves similarly to the reference, and is at least twice as fast except when using too few MPI ranks. Full Node KNL Hybrid MPI OpenMP Comparison, ad Time (s) 80 60 40 20 0 Ref Opt Ref Opt Ref Opt Ref Opt 16/4 32/2 64/1 64/2 MPI Ranks / Threads per Rank PPPM non-FFT PPPM FFT Pair Other Fig. 8. Profiles of 64x-scale SPC/E water test case running on a full KNL node, for ad differentiation, varying the number of MPI ranks and OpenMP threads per rank. The reference user-omp implementation is on the left and our optimized implementation is on the right. The reference cases were run with a stencil size of 5 and the optimized cases with a stencil size of 7. Left bar: reference, right bar: optimized. 5 Conclusion Efficient vectorization proved to be key to attaining significant speedups over reference LAMMPS. For the PPPM functions, we tested several approaches and found memory access patterns to be particularly important. However, because 16 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi the contiguous memory accesses were to be found in loops over stencil points, the stencil size limited vectorization efficiency. At the same time, as other parts of the code were optimized, the FFTs became relatively more expensive. And from the beginning we were concerned with users having difficulty choosing an optimal stencil size. All of these problems turn out to have the same solution. Targeting a higher default stencil size allowed whole rows of a larger stencil to be computed at once, enabling efficient vectorization. Work shifted away from the FFTs and into newly-optimized functions when LAMMPS automatically adjusted the FFT grid to preserve accuracy. And users who do not test a variety of stencil sizes are no longer missing out on potential performance, because S = 7 is optimal for every case and can be made the default. The relatively more expensive FFTs also made another previously-hard choice much easier, as now ad differentiation is significantly faster than ik differentiation due to its requiring only half as many FFTs. Although not discussed here, most of our optimizations are applicable to 256-bit vector registers and yield significant speedup on Xeon architectures, and similar speedup is also observed for different types of physical problems, such as an interfacial system where half of the domain is a vacuum. LAMMPS is an extremely flexible program that allows and requires users to make numerous choices when simulating their different physical problems, and our optimized code is a significant improvement over reference LAMMPS, regardless of a user’s particular needs, for simulations which make use of the PPPM method for electrostatics. We achieve 2-3x speedup across a wide range of cutoff radii, for different accuracy requirements of the long-range solver, for both differentiation modes, and for different approaches to parallelization. Many of these choices have a large impact on performance and even on simulation accuracy, often in ways that are not intuitive and not transparent to users as they try to work out how best to approach their problems. Some, like the choice of stencil size, are sufficiently obscure that many users likely use the default value, some without even knowing that they even had a choice. Other users will have gone to great lengths to set up their simulations in the best possible way, and will have made nearly-optimal choices for their specific problems. Our optimizations are particularly helpful to the first group because several of the user-facing knobs now have clearly best settings for a range of problem sizes, and these settings can be clearly communicated without much qualification as to which cases they work for, or they can even be made the default selections. Users with long experience and carefully-crafted input files will benefit from significant speedup for their existing set of inputs and can also expect that the optimal inputs for the new version are close to what they were already using. Acknowledgments The authors gratefully acknowledge financial support from the Deutsche Forschungsgemeinschaft (German Research Association) through grant GSC 111, and from Intel Corporation via the Intel Parallel Computing Center initiative. LAMMPS’ PPPM Long-Range Solver for the Second Generation Xeon Phi 17 References 1. R. W. Hockney and J. W. Eastwood, Computer simulation using particles. Bristol: Hilger, 1988. 2. S. Plimpton, “Fast parallel algorithms for short-range molecular dynamics,” Journal of Computational Physics, vol. 117, no. 1, pp. 1 – 19, 1995. 3. W. M. Brown, A. Kohlmeyer, S. J. Plimpton, and A. N. Tharrington, “Implementing molecular dynamics on hybrid high performance computers particleparticle particle-mesh,” Computer Physics Communications, vol. 183, no. 3, pp. 449 – 459, 2012. 4. M. J. Harvey and G. De Fabritiis, “An implementation of the Smooth Particle Mesh Ewald method on GPU hardware,” Journal of Chemical Theory and Computation, vol. 5, no. 9, pp. 2371–2377, 2009. [Online]. Available: http://dx.doi.org/10.1021/ct900275y 5. M. Höhnerbach, A. E. Ismail, and P. Bientinesi, “The vectorization of the tersoff multi-body potential: An exercise in performance portability,” in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, ser. SC ’16. Piscataway, NJ, USA: IEEE Press, 2016, pp. 7:1–7:13. 6. D. Fabregat-Traver, A. E. Ismail, and P. Bientinesi, “Accelerating scientific codes by performance and accuracy modeling,” CoRR, vol. abs/1608.04694, 2016. [Online]. Available: http://arxiv.org/abs/1608.04694 7. W. M. Brown, J.-M. Y. Carrillo, N. Gavhane, F. M. Thakkar, and S. J. Plimpton, “Optimizing legacy molecular dynamics software with directive-based offload,” Computer Physics Communications, vol. 195, pp. 95 – 101, 2015. 8. W. M. Brown, A. Semin, M. Hebenstreit, S. Khvostov, K. Raman, and S. J. Plimpton, “Increasing molecular dynamics simulation rates with an 8-fold increase in electrical power efficiency,” in Proceedings of the 2016 ACM/IEEE Conference on Supercomputing, ser. SC ’16. New York, NY, USA: IEEE, 2016. 9. P. J. in ’t Veld, A. E. Ismail, and G. S. Grest, “Application of Ewald summations to long-range dispersion forces,” The Journal of Chemical Physics, vol. 127, no. 14, p. 144711, 2007. 10. R. E. Isele-Holder, W. Mitchell, and A. E. Ismail, “Development and application of a particle-particle particle-mesh Ewald method for dispersion interactions,” The Journal of Chemical Physics, vol. 137, no. 17, p. 174107, 2012. 11. P. P. Ewald, “Die Berechnung optischer und elektrostatischer Gitterpotentiale,” Annalen der Physik, vol. 369, no. 3, pp. 253–287, 1921. 12. H. Berendsen, D. van der Spoel, and R. van Drunen, “GROMACS: A messagepassing parallel molecular dynamics implementation,” Computer Physics Communications, vol. 91, no. 1, pp. 43 – 56, 1995. 13. I. T. Todorov, W. Smith, K. Trachenko, and M. T. Dove, “DL POLY 3: new dimensions in molecular dynamics simulations via massive parallelism,” J. Mater. Chem., vol. 16, pp. 1911–1918, 2006. 14. R. Salomon-Ferrer, D. A. Case, and R. C. Walker, “An overview of the Amber biomolecular simulation package,” Wiley Interdisciplinary Reviews: Computational Molecular Science, vol. 3, no. 2, pp. 198–210, 2013. 15. K. J. Bowers, E. Chow, H. Xu, R. O. Dror, M. P. Eastwood, B. A. Gregersen, J. L. Klepeis, I. Kolossvary, M. A. Moraes, F. D. Sacerdoti, J. K. Salmon, Y. Shan, and D. E. Shaw, “Scalable algorithms for molecular dynamics simulations on commodity clusters,” in Proceedings of the 2006 ACM/IEEE Conference on Supercomputing, ser. SC ’06. New York, NY, USA: ACM, 2006. 18 W. McDoniel, M. Höhnerbach, R. Canales, A. E. Ismail, P. Bientinesi 16. J. C. Phillips, R. Braun, W. Wang, J. Gumbart, E. Tajkhorshid, E. Villa, C. Chipot, R. D. Skeel, L. Kal, and K. Schulten, “Scalable molecular dynamics with NAMD,” Journal of Computational Chemistry, vol. 26, no. 16, pp. 1781– 1802, 2005. 17. T. Darden, D. York, and L. Pedersen, “Particle mesh Ewald: An n log(n) method for Ewald sums in large systems,” The Journal of Chemical Physics, vol. 98, no. 12, pp. 10 089–10 092, 1993. 18. U. Essmann, L. Perera, M. L. Berkowitz, T. Darden, H. Lee, and L. G. Pedersen, “A smooth particle mesh Ewald method,” The Journal of Chemical Physics, vol. 103, no. 19, pp. 8577–8593, 1995. 19. Y. Shan, J. L. Klepeis, M. P. Eastwood, R. O. Dror, and D. E. Shaw, “Gaussian split Ewald: A fast Ewald mesh method for molecular simulation,” The Journal of Chemical Physics, vol. 122, no. 5, p. 054101, 2005. 20. C. Sagui and T. Darden, “Multigrid methods for classical molecular dynamics simulations of biomolecules,” The Journal of Chemical Physics, vol. 114, no. 15, pp. 6578–6591, 2001. 21. D. J. Hardy, Z. Wu, J. C. Phillips, J. E. Stone, R. D. Skeel, and K. Schulten, “Multilevel summation method for electrostatic force evaluation,” Journal of Chemical Theory and Computation, vol. 11, no. 2, pp. 766–779, 2015, pMID: 25691833. [Online]. Available: http://dx.doi.org/10.1021/ct5009075 22. H. J. C. Berendsen, J. R. Grigera, and T. P. Straatsma, “The missing term in effective pair potentials,” The Journal of Physical Chemistry, vol. 91, no. 24, pp. 6269–6271, 1987. 23. F. Wende, M. Marsman, and T. Steinke, “On enhancing 3d-FFT performance in VASP,” in CUG Proceedings, 2016.
5cs.CE
The Graph Grammar Library - a generic framework for chemical graph rewrite systems Martin Mann1 , Heinz Ekker2 , and Christoph Flamm2 1 arXiv:1304.1356v1 [cs.MS] 4 Apr 2013 2 Bioinformatics, Institut for Computer Science, University of Freiburg, 79106 Freiburg, Germany [email protected] Institute for Theoretical Chemistry, University of Vienna, Währingerstrasse 17, 1090 Vienna, Austria [email protected] Abstract. Graph rewrite systems are powerful tools to model and study complex problems in various fields of research. Their successful application to chemical reaction modelling on a molecular level was shown but no appropriate and simple system is available at the moment. The presented Graph Grammar Library (GGL) implements a generic Double Push Out approach for general graph rewrite systems. The framework focuses on a high level of modularity as well as high performance, using state-of-the-art algorithms and data structures, and comes with extensive documentation. The large GGL chemistry module enables extensive and detailed studies of chemical systems. It well meets the requirements and abilities envisioned by Yadav et al. (2004) for such chemical rewrite systems. Here, molecules are represented as undirected labeled graphs while chemical reactions are described by according graph grammar rules. Beside the graph transformation, the GGL offers advanced cheminformatics algorithms for instance to estimate energies ofmolecules or aromaticity perception. These features are illustrated using a set of reactions from polyketide chemistry a huge class of natural compounds of medical relevance. The graph grammar based simulation of chemical reactions offered by the GGL is a powerful tool for extensive cheminformatics studies on a molecular level. The GGL already provides rewrite rules for all enzymes listed in the KEGG LIGAND database is freely available at http://www.tbi.univie.ac.at/software/GGL/. 1 Background Graphs are powerful tools to represent and study all kind of data in any field of research. In order to generate graph structures of interest or to alter them according to some directive, graph transformations can be applied. A common approach is to formulate such transformations in terms of graph grammars or graph rewrite systems [5, 7, 37]. This enables a compact but very expressive representation of allowed alterations and allows for sound mathematical analyses of the problems [2, 19]. Here, we present our Graph Grammar Library (GGL), a fast and generic C++ framework to formulate and apply graph grammars. Beside the general Fig. 1. Two graph representations of the same molecule at different levels of detail (a, b). Graphical depiction of the Diels-Alder reaction (d) for two molecules that enables two different result molecules. (c) The corresponding graph grammar rule L → R. graph rewrite system, we provide a specialized module to enable efficient graph grammar applications in chemical context. The power of such systems for chemical studies was highlighted by Yadav et al. [49] who emphasized the lack and need for an efficient implementation. The requirements and abilities sketched by Yadav et al. are well met by the capabilites of the GGL framework as presented within this manuscript. To represent molecules in graph notation is well known in chemistry and found in any text book. Therein, atoms are represented by labeled nodes in the graph and the connecting chemical bonds are depicted by according edges (see Fig. 1 a) and b)). Such molecule graphs can be used to model chemical reactions by the application of graph grammar rules as shown in Fig. 1 c) and d). This small example shows already the power of graph rewrite systems, since a single graph grammar rule encodes all possible interaction combinations of the chemical reaction encoded (within the example two possible product molecules are possible, see Fig. 1 d)). In the following, we will introduce the concept of graph rewrite systems in general and how it is implemented in detail within the GGL framework. We give insight into the techniques applied and the efforts done in order to gain an efficient and flexible framework for graph grammar applications. A major contribution of the GGL is its chemistry module tailored to fulfill the needs when representing chemical reactions via graph transformations as requested by Yadav et al. [49]. We show the generality of the GGL via several applications and elaborate its use for chemical studies. The latter is extended by providing a full set of predefined graph grammar rules for all enzymes listed in the KEGG LIGAND database [30] (Release 58.1 June 2011). Graph Grammars and their Applications in Chemistry For simplicity, we will focus on labeled, undirected graphs in the following. Such a graph is given by a tuple (V, E, lV , lE ) that is defined by the set of n nodes V = {v1 , . . . , vn }, the set of edges E = {{vi , vj } | vi , vj ∈ V }, and the label functions lV : V → Σ ∗ and lE : E → Σ ∗ that assign a label based on some alphabet Σ to each node and edge, respectively. Graph rewrite systems are an algebraic approach to apply graph transformations [36]. It is defined by a set of rewriting rules of the form L → R, with L defining the subgraph to be replaced during the transformation, the pattern or left side of the rule, and R stating the transformation result, i.e. the replacement or right side of the rule. Thus, graph rewriting requires the location of the pattern graph within the graph to transform. This subgraph monomorphism problem is a hard computational problem depending on the graph type [18]. Formally, L G ), one has to find ) and L = (V L , E L , lVL , lE given two graphs G = (V G , E G , lVG , lE L G an injective mapping m : V → V such that it holds ∀vi ,vj ∈V L : m(vi ) 6= m(vj ) ∧ ∀{vi ,vj }∈E L : {m(vi ), m(vj )} ∈ E G lVL (vi ) = lVG (m(vi )) ∧ L G lE ({vi , vj }) = lE ({m(vi ), m(vj )}) In the following, such a mapping m is called a match of the pattern L within target graph G and defines the subgraph of G isomorph to L. When applying a graph grammar rule L → R, one can follow the Double Push Out (DPO) approach [12, 36]. Therein, given a match m of L in some target graph G, the result graph G0 is derived from G by (I) a relabeling of all matched nodes present in both V L and V R but showing different labels according to lVL , lVR , (II) the deletion of all nodes (and adjacent edges) present only in V L but absent in V R , and (III) the adding of all nodes exclusively present in V R . Edges are handled accordingly based on E L and E R . For further details please refer to the standard literature, e.g. [12, 36]. Such graph grammar rules have been successfully applied to model chemical reactions with molecular detail [6, 19, 35]. Therein, a graph grammar rule encodes the molecule graph transformations resulting from a chemical reaction as exemplified in Fig. 1. The figure shows the power of such an encoding: the reaction is as much abstracted from the specific molecules as possible and implicitely encodes all interaction configurations. At a higher abstraction level, frameworks have been introduced to encode and alter metabolic and signal-transduction networks based on graph rewrite systems [7, 9, 15, 16, 26, 48]. The focus here is to encode the kinetics and interactions of chemical reactions and not the mechanisms underlying them. All the above mentioned frameworks are either prototypical implementations not tailored for a extensive application or very specialized systems designed for a specific type of experiment/problem. Within the context of general graph rewrite systems, other implementations have been introduced. Among them are the AGG [42, 43] and the GrGen.NET [21, 28] frameworks. While the AGG implementation was shown to be not well performing for larger data sets [21], we found the very general GrGen.NET system not well placed to meet the requirements formulated by Yadav et al. [49]. The compilation of the graph grammar rules into executable code including the planned search strategy used to locate the patterns and the very expressive but complicated rule encoding makes the package powerful but not well placed for its integration into tools for chemical modelling to be used by chemists. Here, we introduce the Graph Grammar Library (GGL) as a generic graph grammar framework with a strong focus on chemical applications as sketched by Yadav et al.. The GGL is not as general as e.g. the GrGen.NET system, since it currently allows only for a single label attribute associated to each node and edge, but it features an easy rule encoding in combination with a flexible and efficient rule application framework. In the following, we will introduce the GGL and the applied methods in detail. 2 The Graph Grammar Library The Graph Grammar Library (GGL) is a generic C++ programming library that enables an easy setup of graph rewrite systems for labeled graphs. During the design of the library, we have focused on the following features: Generality The GGL is built as a generic framework to be used for graph grammars on labeled graphs. The implementation uses the generic Boost Graph Library (BGL) [39] for its core graph representations. This enables the embedding of the graph rewrite functionalities into existing BGL-based projects. Our chemistry module supports the full atom range as well as standard chemoinformatics formats and libraries [33, 46] Modularity The object-oriented modular design of the library enables a clear separation of functional units and the straight-forward implementation and use of specific functionalities. The interconnection of the modules is defined by clear and slim interfaces to enable a high level of transparency. The separation into context-specific sublibraries enables a selective use of the operations needed for a specific task. Performance The main goal of the library is to provide a generic framework for computationally extensive applications. Thus, the implementation is tuned to be as fast as possible while maintaining a high level of generality and modularity. We apply efficient state-of-the-art algorithms [11, 23, 24] and data structures [13, 39], as detailed later, and have profiled and improved the code for a maximal performance. Documentation In order to make the GGL easily applicable, we provide a well documented Application Programming Interface (API) for programmers as well as tutorials for end users focusing e.g. on the graph grammar rule encoding. In the following, we will present the core functionalities of the library and how graph grammar rules are formulated and applied. Afterwards, we focus on the chemistry module of the GGL and the provided features and functionalities for chemoinformatical applications. 2.1 Subgraph Matching As introduced above, the identification of matches m of a given left side pattern L of a graph grammar rule L → R is the central task of rule applications. The applied algorithm to solve the subgraph isomorphism problem is thus defining the performance of the whole rewrite engine [21]. Within the GGL, we apply the efficient VF2-algorithm and implementation introduced by Cordella et al. [11], which is among the fastest available [10]. We slightly adapted and extended the fast C-implementation and provide it within the GGL v4.0 package. We have extended the implementation in two directions. First, we have introduced the handling of wildcard labels. This is needed to specify the existence of a given node without specifying the concrete label, e.g. to define an adjacent residual group of a molecule without any details. Furthermore, we have added an advanced constraint handling that can be used to enforce additional matching constraints. Among them are degree and adjacency constraints, negative application conditions (NAC), like the non-existence of an edge, as well as advanced chemistry related confinements. Since we focused on a high level of modularity, we use a clear interface to provide the subgraph matching functionalities within the GGL. The VF2-algorithm is ported via this interface for its application. This enables the use of the available efficient VF2-implementation as well as the replacement of the VF2-algorithm with other subgraph matching approaches if needed. Since it was shown that the isomorphism problem can be solved efficiently for some types of graphs [18], it might be useful to apply a dedicated matching algorithm depending on the problem at hand. Furthermore, other matching approaches can be easily integrated [17, 37, 45]. The whole subgraph matching module is encapsulated into an independent library module, the SubGraph Matching (SGM) library, which is part of the GGL distribution. 2.2 Rule Encoding Before we give details on the graph grammar rule applications we first introduce how rules are represented and to be specified within the GGL framework. Within the library, a graph grammar rule is represented by a specific graph object that encodes both, the left (L) and right side part (R) of a rule L → R. Thus, it holds for each node and edge if it is present in L or R together with the according L R label. Formally, it is defined by the extended graph tuple (V, E, lVL , lVR , lE , lE ), which encodes the mapping of left and right side graphs. A node v ∈ V not present within L will have an empty left side node label lVL (v) = λ. The same L holds for edges. Thus we can derive the left side pattern L = (V L , E L , lVL , lE ) by L V L = {v ∈ V | lVL (v) 6= λ} and E L = { {vi , vj } ∈ E | lE ({vi , vj }) 6= λ}. The right side graph R is derived accordingly. Based on this representation, we have all the information at hand to apply the rule for each match m of L within some target graph G, since we know exactly the corresponding nodes/edges of L and R. rule [ ruleID "Diels-Alder reaction" context [ node [ id 1 label "C" ] node [ id 2 label "C" ] node [ id 3 label "C" ] node [ id 4 label "C" ] node [ id 5 label "C" ] node [ id 6 label "C" ] ] left [ edge [ source 1 target 2 label "=" ] edge [ source 2 target 3 label "-" ] edge [ source 3 target 4 label "=" ] edge [ source 5 target 6 label "=" ] constrainNoEdge [ source 1 target 5 ] constrainNoEdge [ source 4 target 6 ] ] right [ edge [ source 1 target 2 label "-" ] edge [ source 2 target 3 label "=" ] edge [ source 3 target 4 label "-" ] edge [ source 4 target 5 label "-" ] edge [ source 5 target 6 label "-" ] edge [ source 6 target 1 label "-" ] ] ] Fig. 2. The GML rule encoding of the graph grammar rule presented in Fig. 1. For an easy and readable specification of graph grammar rules, we use an encoding in the Graph Modelling Language (GML) format [25]. This key-value pair structured format enables a compact and human-readable encoding while it is still machine-parsable due to its simple grammar. Figure 2 shows the GML encoding of the rule presented in Fig. 1. Note, all unchanging nodes and edges part of L and R are defined within the context section (contributing to both lVL and lVR ), while left/right side graph specific nodes/edges and their labels are given in the according left/right sections and will only define the according lVL / lVR data, respectively. If the label of some nodes/edges of the pattern is of no interest for the matching, one can specify a wildcard label (e.g. *) by adding the according key-value entry wildcard "*" . The subgraph matching engine will now match all nodes/edges from the left side pattern L that show the wildcard label, e.g. node [ id 1 label "*" ] , to any other nodes/edges in the target graph without further label comparisons. Often, the specification of wildcard labels makes the rule too general and might enable unintended rule applications. To tackle this problem, we support the specification of additional matching constraints that have to be ensured by the matching procedure. The simplest example is to restrict the allowed labels for a node defined with wildcard label to a given set of labels: constrainNode [ id 1 op = nodeLabels [ label "C" label "N" ] ] The reverse constraint can be encoded by changing the operator value from “=” to “!” to disallow the given labels. Other constraints supported for general graph grammars are the restriction of edge labels or node degree, the specification of required/forbidden adjacent nodes or edges, or the explicit prohibition of the existance of an edge between two nodes. For further details on the constraints supported and their encoding we refer to the according tutorial part of the GGL v4.0 distribution. 2.3 Rule Application The rule application follows the Double PushOut (DPO) approach [12,36]. Given L R a graph grammar rule L → R encoded by a rule graph (V, E, lVL , lVR , lE , lE ) as defined above and a target graph G onto which the rule is to be applied. First, all matches m of the rule’s left side pattern L within G have to be indentified. The GGL uses to this end its subgraph matching interface and (as default) the VF2algorithm [11] as already introduced. For each match m, the following procedure is applied to generate the result graph G0 for the current match and rule: 1. Remove from G all nodes exclusive within L 0 V G = V G \ {m(v) | v ∈ V ∧ lVR (v) = λ} and all edges exclusive within L or adjacent to removed nodes. 0 E G = E G \ { {m(vi ), m(vj )} | {m(vi ), m(vj )} ∈ E R ∧ (lE ({m(vi ), m(vj )}) = λ ∨ lVR (vi ) = λ ∨ lVR (vj ) = λ) } 2. Relabel within G0 all nodes/edges showing different (non-empty) labels within L and R. 3. Add to G0 all nodes/edges exclusive within R and label accordingly. All resulting graphs G0 are then forwarded to a provided instance of a well defined graph reporter interface. This enables application specific post-processing and storing of the graphs resulting from the graph rewrite. Within the chemistry module, described next, this is for instance used to apply sanity checks on the produced molecule graphs, to convert and store molecule graphs into canonical string formats, to gather reaction product information, or to compute the reaction rate of the specific reaction defined by the rule application. In a more algorithmic context, such a graph reporter can also trigger another recursive iteration of rule applications resulting in a depth-first search/traversal of the graph space encoded by the graph grammar. An according generic implementation is provided and applied within the GGL framework. 2.4 Chemistry Package As discussed in the introduction, chemistry and especially chemical reactions are a well placed target for the application of graph rewrite systems [6, 35]. The GGL provides a specialized chemistry module tailored for such needs. It enables a flexible but fast and efficient implementation of graph grammar based algorithms to solve chemical reaction related problems. In the following, we will present the features provided by the module and the available data structures and algorithms. Molecules as Graphs Figure 1 illustrate the definition of molecules in terms of graphs and the relation of chemical reactions and graph grammar rules. In detail, a molecule is represented as a graph M where the node (lVM ) and edge M labels (lE ) are restricted to the existing atom and bond types, respectively. As suggested by Yadav et al. [49] and applied in literature [6, 35], we follow the SMILES encoding of atoms and bonds [46]. Therein, bond labels are confined M to lE (..) ∈ {-,=,#,:}, encoding for single, double, triple, or aromatic bonds respectively. Atom labels lVM are either one of the labels known from the periodic table of elements, e.g. C or Br, an organic atom participating in an aromatic ring (encoded by lower case symbols, e.g. c or n), or a “complex” label encoding additional charge information, e.g. O-. Within the GGL chemistry module we enforce an explicit encoding of hydrogen information as atoms (see Fig. 1b)), even if the SMILES notation allows for their encoding within complex node labels. This was done a) to ensure explicit and complete chemical rule encodings, b) to enable sanity checks for molecules and rules, c) to allow for the prediction of aromaticity information, and d) to ensure an efficient matching of chemical rule patterns onto molecule graphs, which is needed for their application. Based on our internal molecule graph representation, the GGL chemistry module features a couple of functionalities needed within the context of chemical reaction problems. This includes sanity checks for molecules (e.g. correct label usage, valence constraints, etc.), the SMILES string encoding (discussed within next section), and automatic hydrogen prediction. Furthermore, we have reimplemented the efficient free energy prediction algorithm introduced by Jankowski et al. [29]. It enables a fast energy approximation of a given molecule graph based on a decomposition into defined atomic groups and their energy contributions. Again, we take advantage of the fast subgraph matching module part of the GGL v4.0 to allow for a performant decomposition. The implementation and use of other energy estimation approaches is easily possible due to the modular design of the library. The estimation of a molecule’s energy usually requires knowledge about (hetero) aromatic rings within the molecule [38]. Since the property of aromaticity might emerge or vanish due to chemical reactions, we provide an aromaticity prediction framework. It is based on a ring perception using an extension of the fast algorithm suggested by Hanser et al. [24] in combination with a support vector machine learning approach for the aromaticity prediction based on the NSPDK graph feature kernel [13]. Canonical SMILES The SMILES notation was actually introduced to enable a string representation of chemical molecules, i.e. SMILES strings are a string encoding of molecule graphs [46]. Furthermore, they allow for a canonical, i.e. unique, representation of molecules [47]. This is especially useful when storing molecule information in databases or when molecules are to be given as program input (see [49]). The GGL features a full-fledged canonical SMILES writer implementation as well as an according SMILES parser to enable SMILES as the chemical communication language for applications. Internally, molecules are represented as graphs as given above. Chemical Reactions Chemical reactions are special graph grammar rules since they have certain essential side constraints to be fulfilled. First and most important: conservation of mass, i.e. no atom can appear or vanish. Thus, a chemical reaction is – as a coarse grained sketch – a “rewiring” of bonds within or between molecule graphs. Technically, we can encode chemical reactions as graph grammar rules in GML notation as introduced above. Therein, atom and node labels are restricted to the encoding supported by SMILES (see above), while wildcard labels are allowed to enable more general encodings. All chemical rules can be and are checked for their correctness within the GGL chemistry framework. Among the tests are checks for mass conservation, label use, or reasonable valence changes. Another important check is to ensure that no bond is formed twice, which is done by implicitely adding according “no-edge” constraints for all bonds formed within the chemical rule. When applying chemical rules on molecule graphs we can use the generic graph grammar rule application framework described above. No adjustments for the rule applications are needed. Since some chemical rewrites might result in non-realistic molecules, e.g. due to steric constraints not covered by the rule [49], we provide a post-application verification step. Here, the output molecules are postprocessed, e.g. to correct the molecules aromaticity, and checked for sanity. A chemical rewrite only results in a chemical reaction, if all result molecules have been shown to be valid. The canonical SMILES encoding introduced above is used to derive a compact string representation of both the resulting molecules as well as the whole reaction. Chemical reaction networks are often subject of reaction pathway analyses. For this purpose one has to know or estimate the reaction rates to be associated to individual chemical reactions e.g. as produced by a graph grammar rule application. The GGL chemistry framework fully supports such requirements. Based on the approach by Jankowski et al. [29], we estimate the energy difference ∆E of the input and output molecules of a reaction. This enables the estimate of the reaction rate using the well known Arrhenius law, i.e. the reaction rate is approximated by exp−∆E/RT for a given temperature T using the gas constant R. Other approaches, e.g. the machine learning approach by Kayala et al. [31], can be easily integrated and used within the GGL chemistry framework if needed due to its modular architecture. Molecular Group Specification The specification of (bio)chemical reactions often requires the representation of large (unchanged) parts of molecules in order to make the rule as specific as the chemical reaction. A classic example is the involvement of helper molecules like ATP, NADH, etc. that are only slightly changed but have to be represented completely to avoid the application of the rule using similar molecules. Fig. 3. The depiction of the Diels-Alder reaction network for the two input molecules depicted in Fig. 1d) (with SMILES C=CC(C)=C and C=CC) and the rule encoding from Fig. 2 using two rule application iterations. To this end, the GGL supports the specification of molecular groups as pseudo-atoms within chemical rule definitions. They allow for a much easier and compact rule definition and avoid potential typos and mistakes. Section B of the suppl. material exemplifies the problem. Visualization To enable an easier definition and evaluation of chemical reaction data, visualization scripts are provided. 2D-layouting of molecule graphs is done via the OpenBabel framework [33] and scalable vector graphics in SVG or PDF format are generated. For instance, given a valid GML encoding of a chemical rule, the script chemrule2svg.pl can be used to generate an according depiction. Figure S.1 (suppl. material) exemplifies the application for the GML rule encoding given in Fig. 2. The GGL v4.0 package provides a reimplementation of the reaction network expansion approach presented in [6] named toyChem. Given a set of molecules and chemical reactions, toyChem expands the according reaction network via an iterative application of the reaction rules. Along the expansion, it automatically computes according reaction rates and produces a graph encoding of the reaction network. The script printReactionNetwork.pl visualizes the network including depictions of the molecules and rate information. For an example see Fig. 3. Set of Enzymatic Reaction Data Provided For the application of the GGL to simulations of biochemical reactions within metabolic networks, 5133 unique GML-encoded graph grammar rules for enzymatic reactions are included in the GGL v4.0 distribution. The rules are derived from the KEGG LIGAND database [30], Release 58.1 June 2011. For each enzyme listed in the database, a rewrite rule for each reaction annotated to that enzyme has been created automatically. To this end, an atomto-atom correspondence between the substrate and product molecules has been determined to identify the broken and formed bonds along the given reaction. The atom mapping was generated using a greedy heuristic losely based on the Cut Successive Largest algorithm proposed in [14]. The predicted mappings follow the Principle of Minimal Chemical Distance, which states that the mech- anism involving the least reconfigurations of valence electrons (i.e. edge additions/removals) is most likely the true reaction mechanism. Reactions that are unbalanced or contain compounds with missing or faulty molecular structure data cannot be mapped and are therefore not included. Since there is no data on reaction reversibility in the database, only the forward direction as given in the database is represented. OpenBabel Port The GGL chemistry module is of course not the only available cheminformatics package on the market. It is neither intended nor designed to enable very sophisticated chemical informations as molecule mass or to provide specific tools like graphical depiction algorithms already available in other libraries. A powerful and freely available library is provided by the OpenBabel project [33] that was initially started to enable an easy conversion between the various chemical data formats. Nowadays, various tools and solutions are provided to tackle chemoinformatics problems. Since we focus on a highly modular design of the GGL, we provide an easy port to convert our internal molecule graph representation into an OpenBabel object. This port can be used to get access to the full set of functionality provided by the OpenBabel library if needed [33]. 2.5 Further Library Features Beside the features introduced we want to give some further remarks on the GGL programming library. The object-oriented C++ source code is fully ANSIconform and extensively documented. This enables the generation of the provided Application Programming Interface using the doxygen system. The dependency checking and compilation process is tailored for Unix-like systems (including Cygwin for MS Windows) and is based on the established GNU autotools resulting in an easy and automatic setup and installation of the libraries and tools. The GGL v4.0 comes with an extensive test set framework to ensure the correctness of the build on the used platform and to ensure the stability and maintainability of the library. In addition, we provide Perl-5 bindings to enable the application of the GGL functionalities within fast prototypical Perl developments, e.g. in combination with the PerlMol package [44]. Last but not least, the GGL v4.0 package is freely available at: http://www.tbi.univie.ac.at/software/GGL/ 3 Application and Examples The graph grammar library is designed to support a wide range of graph rewrite systems on any type of graph. For illustration, we have implemented a few example applications that cover different aspects of graph rewrite. All are distributed within the GGL v4.0 package and described in Sec. C of the suppl. material. Fig. 4. Autocatalytic core network (a) of the formose process, keto-enol tautomerization of a carbonyl compounds (b), and aldol addition (c) between two carbonyl compounds. Depending on the reaction direction the aldol addition forms or breaks a C–C bond (). In the case of α-hydroxy-carbonyl compounds (HO–C–C=O), the ketoenol tautomerization provides a mechanism for the carbonyl functionality (C=O) to shift along the backbone of the sugar (). Since the GGL v4.0 supports an extensive module for chemical graph rewrite systems, we will focus on chemical applications in the following. The graph grammar approach to chemical transformation gives a very compact description of a whole “chemical universe”, i.e. the language of all chemical graphs, which are reachable from an initial set of chemical “starting graphs” by iterative application of the reaction rules. The iterative expansion of a particular graph grammar yields a directed, potentially infinit reaction network, where the chemical graphs are connected by hyperedges representing the reaction rules. These reaction networks can be further analysed statistically or with methodologies from network theory to uncover unexpected relations between network nodes and their properties [22, 41]. The toyChem utility distributed with the GGL implements only simple exhaustive iterative expansion of a chemical universe. For the efficient exploration of a chemical universe a sofisticated strategy framework is required (see [1]) to avoid combinatorial explosion. The GGL is a major improvement over the prototypical implementation presented in [6]. Besides the extention to the full chemical atom set GGL implements an energy increment system as well as a rate calculation approach for chemical reactions. Furthermore GGL provides an interface to the OpenBabel library and therefore the whole functionality of this important open source cheminformatics library can be harnessed from within the GGL. On the basis of the formose process [8], we illustrate, that the graph grammar approach is indeed a sensible model of chemical reaction networks and nicely captures the algebraic properties of chemistry itself. The formose process condenses formaldehyde, the simplest possible sugar, into a combinatorial complex Fig. 5. Hypergraph of the resulting reaction network after 4 iterations of the formose process grammar. mixture of higher sugars by repeatedly involving only two reversible reactions, the aldol reaction and the keto-enol tautomerization (see Fig. 4 b, c). The corresponding graph grammar rule encodings are depicted in Fig. S.5 and S.6 (suppl. material). An autocatalytic loop, which produces glycolaldehyd and consumes formaldehyde, is located at the core of the formose process (see Fig. 4 a). Figure 5 depicts the growing reaction network of the formose process. The following table 1 shows the exponential explosion of the molecular space for the formose process and the according runtime of our toyChem tool. Note, the vast majority of the runtime is consumed by canonical SMILES generation for the molecule graphs resulting from graph grammar rule applications. Still this step is essential to distinguish new from already known molecules and it is much faster than graph isomorphism based comparisons. Iteration Molecules Time 1 3 0 2 5 0 3 9 0 4 37 0 5 302 0.2s 6 10,572 10.5s Table 1. Exponential explosion of the molecular space for the formose process starting from OCC=O and C=O along with the runtimes of toyChem. The second example shows the reaction network for the enzyme mechanism of β-lactamase (see Fig. S.7) as found in the MACiE database [27] entry M0002. Specificity of the amino acide side chains of Lys, Ser and Glu in the active site of the enzyme EC 3.5.2.6 was achieved by marking the Cα atom labels of the aminoacides with a SMILES class flag (see Fig. S.8 suppl. material). In that way reactions between amino acide side-chains are suppressed within the graph grammar rule application. Figure S.9 (suppl. material) depicts the first step within the enzyme mechanism. 4 Summary The Graph Grammar Library (GGL) is a powerful framework for cheminformatics applications based on graph rewrite. It meets very well the mandatory requirements for such studies as discussed by Yadav et al. [49] and comes with a powerful chemistry module providing essential algorithms. With the advent of genome-scale metabolic networks, formalisms such as the GGL to handle chemical transformation will become an important factor for the analysis, interpretation, and manipulation of these networks. Acknowledgements This work was supported in part by the Vienna Science and Technology Fund (WWTF) proj. no. MA07-030, the Austrian GEN-AU project “Bioinformatics Integration Network III”, and the COST Action CM0703 “Systems Chemistry”. Furthermore, we thank the users of the GGL framework for their ongoing contributions, bug reports and suggestions. References 1. Andersen, J., Flamm, C., Merkle, D., Stadler, P.F.: Generic strategies for chemical space exploration. In: 24th International Conference on Rewriting Techniques and Applications. Eindhoven, The Netherlands (2013), submitted to RTA 2013 2. Andersen, J.L., Flamm, C., Merkle, D., Stadler, P.F.: Maximizing output and recognizing autocatalysis in chemical reaction networks is np-complete. J. Syst. Chem. (2011) 3. Archdeacon, D., Colbourn, C.J., Gitler, I., Provan, J.S.: Four-terminal reducibility and projective-planar wye-delta-wye-reducible graphs. J. Graph Theory 33, 83–93 (1998) 4. Baran, M., Staton, E.: Distribution transformer models for branch current based feeder analysis. Power Systems, IEEE Transactions on 12(2), 698–703 (1997) 5. Beck, M., Benkö, G., Eble, G., Flamm, C., Müller, S., Stadler, P.F.: Graph grammars as models for the evolution of developmental pathways. In: Proc. of GWAL’04. pp. 8–15 (2004) 6. Benkö, G., Flamm, C., Stadler, P.F.: A graph-based toy model of chemistry. J Chem. Inf. and Comp. Sci. 43(4), 1085–1093 (2003) 7. Blinov, M., Yang, J., Faeder, J., Hlavacek, W.: Graph theory for rule-based modeling of biochemical networks. In: Transactions on Computational Systems Biology VII, LNCS, vol. 4230, pp. 89–106. Springer (2006) 8. Butlerov, A.M.: Einiges über die chemische structur der körper. Zeitschrift für Chemie 4, 549–560 (1861) 9. Colvin, J., Monine, M., Gutenkunst, R., Hlavacek, W., Von Hoff, D., Posner, R.: RuleMonkey: software for stochastic simulation of rule-based models. BMC Bioinformatics 11(1), 404 (2010) 10. Cordella, L.P., Foggia, P., Sansone, C., Vento, M.: Performance evaluation of the VF graph matching algorithm. In: Proc. of ICIAP’99. p. 1172 (1999) 11. Cordella, L., Foggia, P., Sansone, C., Vento, M.: A (sub)graph isomorphism algorithm for matching large graphs. Pattern Analysis and Machine Intelligence, IEEE Transactions on 26(10), 1367–1372 (2004) 12. Corradini, A., , Montanari, U., , Rossi, F., Ehrig, H., Heckel, R., Loewe, M.: Algebraic approaches to graph transformation part I: Basic concepts and double pushout approach. In: Handbook of Graph Grammars and Computing by Graph Transformation, Volume 1: Foundations. vol. 97, pp. 163–245 (1997) 13. Costa, F., De Grave, K.: Fast neighborhood subgraph pairwise distance kernel. In: Proc. of ICML’10. pp. 255–262 (2010) 14. Crabtree, J.D., Mehta, D.P.: Automated reaction mapping. J. Exp. Algo. 13, 1.15– 1.29 (2009) 15. Danos, V., Feret, J., Fontana, W., Harmer, R., Krivine, J.: Rule-based modelling of cellular signalling. In: Proc. of Concurrency Theory (CONCUR). pp. 17–41 (2007) 16. Danos, V., Feret, J., Fontana, W., Harmer, R., Krivine, J.: Rule-based modelling, symmetries, refinements. In: Proc. of Formal Methods in Systems Biology (FMSB). pp. 103–122 (2008) 17. Dörr, H.: Efficient Graph Rewriting and its Implementation. LNCS, Springer (1995) 18. Eppstein, D.: Subgraph isomorphism in planar graphs and related problems. In: Proc. of SODA’95. pp. 632–640 (1995) 19. Flamm, C., Ullrich, A., Ekker, H., Mann, M., Hoegerl, D., Rohrschneider, M., Sauer, S., Scheuermann, G., Klemm, K., Hofacker, I.L., Stadler, P.F.: Evolution of metabolic networks: A computational framework. J Syst. Chem. 1(1), 4 (2010) 20. Gardner, M.: The fantastic combinations of John Conway’s new solitaire game “life”. Scientific American 223, 120–123 (1970) 21. Geiss, R., Batz, G., Grund, D., Hack, S., Szalkowski, A.: GrGen: A fast SPObased graph rewriting tool. In: Proc. of ICGT’06), LNCS, vol. 4178, pp. 383–397. Springer (2006) 22. Grzybowski, B.A., Bishop, K.J.M., Kowalczyk, B., Wilmer, C.E.: The ẃiredúniverse of organic chemistry. Nature Chemistry 1, 31–36 (2009) 23. Guzman, J.d., Nuffer, D.: The Spirit Library: Inline parsing in C++. C/C++ Users Journal 21(9), 22 (2003) 24. Hanser, T., Jauffret, P., Kaufmann, G.: A new algorithm for exhaustive ring perception in a molecular graph. J. Chem. Inf. Comp. Sci. 36(6), 1146–1152 (1996) 25. Himsolt, M.: GML: A portable graph file format. Tech. rep., University of Passau, Germany (1999) 26. Hlavacek, W.S., Faeder, J.R., Blinov, M.L., Posner, R.G., Hucka, M., Fontana, W.: Rules for modeling signal-transduction systems. Sci. STKE 2006(344), re6 (2006) 27. Holliday, G.L., Andreinj, C., Fischer, J., Rahman, S.A., Almonacid, D.E., Williams, S.T., Pearson, W.R.: MACiE: exploring the diversity of biochemical reactions. Nuc. Acids Res. 40, D783–D789 (2012) 28. Jakumeit, E., Buchwald, S., Kroll, M.: GrGen.NET. STTT J. 12(3), 263–271 (2010) 29. Jankowski, M.D., Henry, C.S., Broadbelt, L.J., Hatzimanikatis, V.: Group contribution method for thermodynamic analysis of complex metabolic networks. Biophys. J. 95(3), 1487–1499 (2008) 30. Kanehisa, M., Goto, S., Sato, Y., Furumichi, M., Tanabe, M.: KEGG for integration and interpretation of large-scale molecular data sets. Nuc. Acids Res. (2011) 31. Kayala, M.A., Azencott, C.A., Chen, J.H., Baldi, P.: Learning to predict chemical reactions. J. Chem. Inf. and Modeling 51(9), 2209–2222 (2011) 32. Lynce, I., Ouaknine, J.: Sudoku as a SAT problem. In: Proc. of AIMATH’06. p. 9 (2006) 33. O’Boyle, N.M., Banck, M., James, C.A., Morley, C., Vandermeersch, T., Hutchison, G.R.: Open Babel: An open chemical toolbox. J. Cheminf. 3(1), 33+ (2011) 34. Roos-Kozel, B.L., Jorgensen, W.L.: Computer-assisted mechanistic evaluation of organic reactions. 2. perception of rings, aromaticity, and tautomers. J. Chem. Inf. Comp. Sci. 21, 101–111 (1981) 35. Rosselló, F., Valiente, G.: Chemical graphs, chemical reaction graphs, and chemical graph transformation. Electron. Notes Theor. Comput. Sci. 127, 157–166 (2005) 36. Rozenberg, G. (ed.): Handbook of graph grammars and computing by graph transformation: volume I. foundations. World Scientific Publishing Co., Inc. (1997) 37. Rudolf, M.: Utilizing constraint satisfaction techniques for efficient graph pattern matching. In: Theory and Application of Graph Transformations, LNCS, vol. 1764, pp. 381–394. Springer (2000) 38. Schleyer, P.v.R., Jiao, H.: What is aromaticity? Pure and Applied Chem. 68(2), 209–218 (1996) 39. Siek, J.G., Lee, L.Q., Lumsdaine, A.: The Boost Graph Library: User Guide and Reference Manual (C++ In-Depth Series). Addison-Wesley Professional (2001) 40. Simonis, H.: Sudoku as a constraint problem. In: CP Workshop on Modeling and Reformulating CSPs. pp. 13–27 (2005), http://www.icparc.ic.ac.uk/∼hs/sudoku.pdf 41. Soh, S., Wei, Y., Kowalczyk, B., Gothard, C.M., Baytekin, B., Gothard, N., Grzybowski, B.A.: Estimating chemical reactivity and cross-influence from collective chemical knowledge. Chemical Science 3(5), 1497–1502 (2012) 42. Taentzer, G.: AGG: A tool environment for algebraic graph transformation. In: Applications of Graph Transformations with Industrial Relevance, LNCS, vol. 1779, pp. 333–341. Springer (2000) 43. Taentzer, G.: AGG: A graph transformation environment for modeling and validation of software. In: Applications of Graph Transformations with Industrial Relevance, LNCS, vol. 3062, pp. 446–453. Springer (2004) 44. Tubert-Brohman, I.: Perl and chemistry. The Perl Journal 8, 3–5 (2004) 45. Varró, G., Friedl, K., Varró, D.: Adaptive graph pattern matching for model transformations using model-sensitive search plans. Electron. Notes Theor. Comput. Sci. 152, 191–205 (2006) 46. Weininger, D.: SMILES, a chemical language and information system. 1. introduction to methodology and encoding rules. J. Chem. Inf. Comp. Sci. 28(1), 31–36 (1988) 47. Weininger, D.: SMILES, a chemical language and information system. 2. algorithm for generation of unique SMILES notation. J. Chem. Inf. Comp. Sci. 29(2), 97–101 (1989) 48. Xu, W., Smith, A.M., Faeder, J.R., Marai, G.E.: RuleBender: a visual interface for rule-based modeling. Bioinformatics 27(12), 1721–1722 (2011) 49. Yadav, M.K., Kelley, B.P., Silverman, S.M.: The potential of a chemical graph transformation system. In: ICGT. LNCS, vol. 3256, pp. 83–95. Springer (2004) Supplementary Material A Visualization C6 = C5 C2 C3 - C2 = = C4 C1 - C1 - C6 = - C3 C5 - C4 - Fig. S.1. The depiction of the Diels-Alder GML graph grammar rule encoding using the provided visualization script chemrule2svg.pl. The presentation highlights the altered bonds within the left and right side graph of the reaction in red and green, resp., to enable the identification of the underlying reaction mechanism. B Molecular Groups One field of application for the definition and use of molecular groups is the specification of molecules that differ only in a few atoms or bonds. In such cases, it can be convenient to specify only the dissimilar parts of the molecules and to use group placeholders for the equal parts. That way, the similarity becomes easy to see and the SMILES easier to read. As an example, we use the molecules NADH and NAD+ depicted in Fig. S.2 sporting 66 and 65 atoms, respectively. The difference basically comprises only an additional proton within NADH and a charge change within the lower ring while the rest of the molecules are identically. Note, these two changes alter the ring from non-aromatic (NADH) to aromatic (NAD+ ). Minimal SMILES encodings of the molecules (highlighting the differing ring in red) are NC(=O)C1[CH2]C=CN(C=1)C2OC(COP(O)(=O)O.. ..P(O)(=O)OCC3OC(C(O)C3O)n4cnc5c(N)ncnc54)C(O)C2O for NADH and NC(=O)c1ccc[n+](c1)C2OC(COP(O)(=O)O.. ..P(O)(=O)OCC3OC(C(O)C3O)n4cnc5c(N)ncnc54)C(O)C2O for NAD+ . In contrast, when using group declarations for the identical parts, namely the CONH2 group and the ribo-adenosine, the SMILES shrinks to N N H2N N H2N OH N N OH N N OH N OH O O OH HO HO O P O N H2N HO HO O O O OH O P O P O OH H O O O + N H2N O O P O OH H Fig. S.2. The molecules NADH (left) and NAD+ (right). [{CONH2}]C1[CH2]C=CN(C=1)[{Ribo-ADP}] for NADH and [{CONH2}]c1ccc[n+](c1)[{Ribo-ADP}] for NAD+ , both depicted in Fig. S.3a) and b). C2 = C1 - {Ribo-ADP}7 - N0 - C2 - {CONH2} C1 - {Ribo-ADP}7 - a) {CONH2}6 c3 : : c4 c2 N0 - C3 C5 = C4 6 = - : : H 9 - C3 C5 = C4 H8 - c5 c1 {CONH2} 6 : n+0 : {CONH2}6 c3 : : c4 c2 H4 b) N2 - C0 = O1 : : c5 c1 H3 {Ribo-ADP}7 - c) C.1 n+0 : {Ribo-ADP}7 Fig. S.3. The molecules NADH (a) and NAD+ (b) described using group identifiers. Note, only for C3 within NADH explicit proton information is given; all other carbons have one not depicted adjacent proton. (c) Depiction of the {CONH2} group using the script molcomp2svg.pl. Note, the proxy node is highlighted in red. C : General Graph Rewrite Examples Game of Life In the 60th, John Conway created a cellular automaton named Game of Life [20] that reflects the basic principles of birth, death, and survival within populations. Each cell represents an individual that is either alive or dead depending on the state of the neighbored individuals. The problem can be represented as a graph relabeling problem where each node represents a cell and edges connect neighbored cells. The formulation of the birth, death, and survival rules defined by Conway as graph grammar rules is straight forwardly described by graph grammar rules. Each of the three rules resembles a single node and according adjacency constraints for the matching and the according recoloring of the node in match case. In combination with an exhaustive application of the rules, this results in a complete Game of Life solver based on a graph rewrite system distributed with the package. C.2 Sudoku Sudoku is a combinatorial problem where a given 9×9 grid has to be filled with numbers from 1 to 9, such that each number appears only once in each row, column, and defined 3×3 sub-grids. The task is to fill a given partially filled grid such that all constraints are fullfilled [32, 40]. Similar to Game of Life, one can encode the Sudoku grid within a graph where each cell is represented by a node. Each node is connected to all other cells that have to have a different label. Thus, it resembles the dependency graph of the problem. In order to find a solution, a Depths-First-Search (DFS) of the exponential search space can be applied, where each search step is defined by the valid application of a graph grammar rule. Each rule does the assignment of a number to a non-assigned node while respecting all constraints. The GGL v4.0 package features a generic DFS implementation for such purposes. Given a set of graph grammar rules and a start graph, a DFS exploration of the search space is done and solutions are identified. C.3 Ring Perception The enumeration of all rings within a graph can be done using the algorithm proposed by Hanser et al. [24]. Such ring perceptions are important e.g. in chemistry to do structure classifications or aromaticity identification [34]. The algorithm by Hanser et al. creates an image of the studied graph that represents the node adjacency within its edge labels, a so called path graph. This path graph is progressively collapsed in a way that the final path graph contains only loops, each representing a ring from the original graph. We have implemented this general approach for ring perception based on a small set of graph grammar rules and a simple rule application iteration. This shows once more the expressivity of graph rewrite systems. A rule-based example as well as an efficient native C++ implementation of the ring perception algorithm is part of GGL v4.0 package. C.4 Y-∆-equivalence problem The Y-∆-equivalence problem, also known by name wye-delta or delta-wye, stardelta, star-mesh, or T-Π, is an important problem from graph theory [3] with application in electrical resistor network optimization [4]. In short, two graphs are defined to be Y-∆-equivalent if and only if they can be transformed into each other by applying a series of Y-∆-transformations. These transformations are either to convert a ∆ triangle subgraph into a Y-like subgraph (by adding a new central node in combination with the necessary rewiring) or the reverse operation, i.e. transforming a Y-subgraph into a triangle (via center deletion and rewiring). For instance, this property is fulfill by the Peterson graph family forming a Y-∆-equivalence class [3]. Using two simple graph grammar rules that encode the allowed Y-∆-transformations, we can easily setup a search engine to check if two graphs are Y∆-equivalent or not. To this end, one starts two independent Breadth-FirstSearches (BFS) starting from the two graphs of interest. Within each BFS all graphs are generated that can be obtained from the start graph by applying Y-∆-transformations. The Y-∆-equivalence is proven as soon as the two sets of graphs produced by the independent BFS intersect. The according graph grammar rules in GML notation are given in Fig. S.4. rule [ ruleID "wye to delta" wildcard "*" context [ node [ id 1 label "*" ] node [ id 2 label "*" ] node [ id 3 label "*" ] ] left [ node [ id 4 label "*" ] edge [ source 4 target 1 edge [ source 4 target 2 edge [ source 4 target 3 constrainAdj [ id 4 op = count 3 edgeLabels [ label "*" nodeLabels [ label "*" ] constrainNoEdge [ source constrainNoEdge [ source constrainNoEdge [ source ] right [ edge [ source 1 target 2 edge [ source 1 target 3 edge [ source 2 target 3 ] ] label "*" ] label "*" ] label "*" ] ] ] 1 target 2 ] 1 target 3 ] 2 target 3 ] label "*" ] label "*" ] label "*" ] Fig. S.4. The GML rule encoding “wye to delta” graph grammar rule used for Y∆ transformations. The reverse “delta to wye” rule can be easily obtained by exchanging the left and right content of the rule, while all constraints can be omitted. D D.1 Chemical Reactions as Graph Grammars Formose Process rule [ ruleID "Keto-Enol Isomerization" context [ node [ id 1 label "C" ] node [ id 2 label "C" ] node [ id 3 label "O" ] node [ id 4 label "H" ] ] left [ edge [ source 1 target 4 label edge [ source 1 target 2 label edge [ source 2 target 3 label constrainAdj [ id 2 op = count ] right [ edge [ source 1 target 2 label edge [ source 2 target 3 label edge [ source 3 target 4 label ] ] "-" ] "-" ] "=" ] 1 nodeLabels [ label "O" ] ] "=" ] "-" ] "-" ] Fig. S.5. The GML rule encoding the “keto-enol tautomerization” graph grammar rule used. The reverse rule can be easily obtained by exchanging the left and right content of the rule, while all constraint can be omitted. rule [ ruleID "Aldol Condensation" context [ node [ id 1 label "C" ] node [ id 2 label "C" ] node [ id 3 label "O" ] node [ id 4 label "H" ] node [ id 5 label "O" ] node [ id 6 label "C" ] ] left [ edge [ source 1 target 2 label "=" ] edge [ source 2 target 3 label "-" ] edge [ source 3 target 4 label "-" ] edge [ source 5 target 6 label "=" ] constrainAdj [ id 2 op = count 1 nodeLabels [ label "O" ] ] constrainAdj [ id 6 op = count 1 nodeLabels [ label "O" ] ] ] right [ edge [ source 1 target 2 label "-" ] edge [ source 2 target 3 label "=" ] edge [ source 5 target 6 label "-" ] edge [ source 4 target 5 label "-" ] edge [ source 6 target 1 label "-" ] ] ] Fig. S.6. The GML rule encoding the “aldol condensation” graph grammar rule. The reverse rule for the retro-aldol can be easily obtained by exchanging the left and right content of the rule, while all constraint can be omitted. D.2 β-Lactamase Enzyme Mechanism Fig. S.7. Hypergraph of the enzyme mechanism for β-lactamase (EC 3.5.2.6). # Beta-lactamase (class A) # MACiE version: 3 # MACiE-entry: M0002, 3.5.2.6, Step 01 rule [ ruleID "3.5.2.6-M0002-S01" left [ node [ id 8 label "N" ] node [ id 5 label "O" ] edge [ source 1 target 5 label "=" ] edge [ source 6 target 7 label "-" ] ] context [ node [ id 1 label "C" ] node [ id 2 label "C" ] node [ id 3 label "C" ] node [ id 4 label "N" ] node [ id 6 label "O" ] node [ id 7 label "H" ] node [ id 9 label "H" ] node [ id 10 label "H" ] node [ id 100 label "*"] node [ id 101 label "*"] edge [ source 1 target 2 label "-" ] edge [ source 2 target 3 label "-" ] edge [ source 3 target 4 label "-" ] edge [ source 4 target 1 label "-" ] edge [ source 8 target 9 label "-" ] edge [ source 8 target 10 label "-" ] edge [ source 6 target 100 label "-" ] edge [ source 8 target 101 label "-" ] constrainNode [ id 100 op = nodeLabels [ label "C:1" ] ] constrainAdj [ id 100 op = count 1 nodeLabels [ label "O" ] ] constrainNode [ id 101 op = nodeLabels [ label "C:1" ] ] ] right [ node [ id 8 label "N+" ] node [ id 5 label "O-" ] edge [ source 1 target 5 label "-" ] edge [ source 1 target 6 label "-" ] edge [ source 8 target 7 label "-" ] ] ] Fig. S.8. Rewrite Rule in the enzyme mechanism of β-lactamase (EC 3.5.2.6). The distinction between enzyme and the substrate(s) is achieved by using SMILES class number for atom labels belonging to amino acid side chains of the enzyme. H10 C2 - C1 - H9 - - N8 - O5 = *100 - O6 - O-5 H7 - N+8 - H10 H9 *101 - C 3 - N4 - *101 *100 O6 C1 - N 4 - - C2 - C3 H7 Fig. S.9. First step in the enzyme mechanism of β-lactamase (EC 3.5.2.6)
5cs.CE
A More General Robust Loss Function Jonathan T. Barron arXiv:1701.03077v5 [cs.CV] 11 Feb 2018 [email protected] Abstract 1. Derivation We will derive our loss function from the “generalized Charbonnier” loss [14], which is commonly used in flow and depth estimation tasks that require robustness [4, 10]. The generalized Charbonnier loss builds upon the Charbonnier loss function [3], which is generally defined as: p (1) d (x, c) = x2 + c2 We present a two-parameter loss function which can be viewed as a generalization of many popular loss functions used in robust statistics: the Cauchy/Lorentzian, GemanMcClure, Welsch/Leclerc, and generalized Charbonnier loss functions (and by transitivity the L2, L1, L1-L2, and pseudo-Huber/Charbonnier loss functions). If this penalty is viewed as a negative log-likelihood, it yields a general probability distribution that includes normal and Cauchy distributions as special cases. We describe and visualize this loss and its corresponding distribution, and document several of their useful properties. This loss sometimes is written in a reparameterized form: q 2 d (x, c) = c (x/c) + 1 (2) This form of the loss is sometimes referred to as “L1-L2” loss (as it behaves like quadratic loss near the origin and like absolute loss far from the origin) or a Pseudo-Huber loss (due to its resemblance to the classic Huber loss function [7]). The generalized Charbonnier loss function takes the Charbonnier loss and, instead of applying a square-root, raises the loss to an arbitrary shape parameter α: α/2 g (x, α, c) = (x/c)2 + 1 (3) Many problems in statistics [8] and optimization [6] require robustness — that a model be insensitive to outliers. This idea is often used in parameter estimation tasks, where a non-robust loss function such as the L2 norm is replaced with some most robust alternative in the face of non-Gaussian noise. Practitioners, especially in the image processing and computer vision literature, have developed a large collection of different robust penalties with different parametrizations and properties (some of which are summarized well in [2, 15]). These loss functions are often used within gradient-descent or second-order methods, or as part of M-estimation or some more specialized optimization approach. Unless the optimization strategy is co-designed with the loss being minimized, these losses are often “plug and play”: only a loss and its gradient is necessary to integrate a new loss function into an existing system. When designing new models or experimenting with different design choices, practitioners often swap in different loss functions to see how they behave. In this paper we present a single loss function that is a superset of many of these common loss functions. A single continuous-valued parameter in our loss function can be set such that our penalty is exactly equal to several traditional loss functions, but can also be tuned arbitrarily to model a wider family of loss functions. As as result, this loss may be useful to practitioners wishing to easily and continuously explore a wide variety of robust loss functions. Here we use a slightly different parametrization from [14] and use α/2 as the exponent instead of just α. This makes the generalized Charbonnier somewhat easier to reason about with respect to standard loss functions: g (x, 2, c) resembles L2 loss, g (x, 1, c) resembles L1 loss, etc. We also omit the c scale factor in Equation 2, which gives us scale-invariance with respect to c: g(kx, α, kc) = g(x, α, c) (4) for any non-negative scale factor k. This allows us to view the c “padding” variable as a “scale” parameter, similar to other common robust loss functions. But this formulation of the generalized Charbonnier still has several unintuitive properties: the loss is non-zero when x = 0 (assuming a non-zero values of c), and the curvature of the quadratic “bowl” near x = 0 varies as a function of c and α. We therefore construct a shifted and scaled version of Equation 3 that does not have these properties:   a/2 g (x, α, c) − g (0, α, c) 1 x 2 = ( / c) + 1 − 1 (5) c2 g 00 (0, α, c) α 1 3. Loss Function This loss has the unfortunate side-effect of flattening out to 0 for large negative values of α, which we address by modifying the 1/α scale factor while preserving scaleinvariance.   !(α/2) 2 |2 − α|  (x/c) +1 − 1 (6) h(x, α, c) = α |2 − α| With this analysis in place, we can present our final loss function. Our loss is simply our normalized variant of the generalized Charbonnier loss, where we have introduced special cases to cover the otherwise-undefined limits as α approaches 2, 0, and −∞, as without these special cases the loss is technically undefined for these values. This loss resembles a normalized, centered, and scaleinvariant version of the loss shown in Equation 2. ρ (x, α, c) = 1 x/c)2   2 (    2 1 x   ( / c ) + 1 log  2   2 1 − exp − 12 (x/c)      (α/2)   (x/c)2 |2−α|   α −1 |2−α| + 1 2. Special Cases As is already well-known, L2 loss is a special case of the generalized Charbonnier. Though our reparametrization is technically undefined when α = 2, we also observe that it approaches L2 loss in the limit: lim h (x, α, c) = α→2 1 x 2 ( /c) 2 (12) if α = 2 if α = 0 if α = −∞ otherwise As we have shown, this loss function is a superset of the generalized Charbonnier loss function (and therefore the the Charbonnier / L1-L2 / pseudo-Huber, quadratic and absolute loss functions by transitivity) and is also a superset of the Cauchy / Lorentzian, Geman-McClure, and Welsch / Leclerc loss functions. As a reference, we provide the derivative of ρ (x, α, c) with respect to x, for use in gradient-based optimization: (7) Though L1 loss is a special case of the generalized Charbonnier loss in its traditional form, true L1 loss is not actually expressible in the normalized form in Equation 6 due to the division by c. But if we assume that x is much greater than c, we see that the normalized form approaches L1 loss: |x| − 1 if x  c (8) c Unlike the generalized Charbonnier loss, the normalized loss can be shown to be a generalization of three other common loss functions. Though h (x, 0, c) is undefined due to a division by zero, we can take the limit of h (x, α, c) as α approaches zero:   1 x 2 lim h (x, α, c) = log ( /c) + 1 (9) α→0 2 h (x, 1, c) ≈ dρ (x, α, c) = dx   cx2     2 2x 2  x +2c   2 1 x x exp − ( / c )  2  c2   (α/2−1)  x/c)2  ( x  2 c |2−α| + 1 h (x, −2, c) = 2 1 dρ (x, α, c) = x dx   c12     22 2  x +2c   2 1 − 21 (x/c) 2 exp  c    (α/2−1)    12 (x/c)2 + 1 c |2−α| 2 (x/c) + 4 if α = 2 if α = 0 if α = −∞ otherwise This is also known as the influence function ψ (x, α, c) viewed through the framework of M-estimation. As a reference for M-estimation, we also provide the weight function to be used during iteratively reweighted least squares that corresponds to our loss: Perhaps surprisingly, this yields the Cauchy (aka Lorentzian) loss function [1]. Though this does not appear to be common practice, the shape parameter α in a generalized Charbonnier can be set to negative values, and this is also true for the normalized variant. By setting α = −2, our loss is equivalent to Geman-McClure loss [5]: 2 (x/c) (13) (10) In the limit as α approaches negative infinity, our loss becomes Welsch [9] (aka Leclerc [11]) loss:   1 2 lim h (x, α, c) = 1 − exp − (x/c) (11) α→−∞ 2 (14) if α = 2 if α = 0 if α = −∞ otherwise Curiously, these IRLS weights resemble a non-normalized form of Student’s t-distribution. From our robust loss function we can derive a Ψfunction, a penalty function for use in an analog outlier pro- The Cauchy, Geman-McClure, and Welsch losses are therefore special cases of our loss, or equivalently, our loss function can be viewed as a generalization of those loss functions. 2 For all values of x, α, and c > 0 the loss increases monotonically with respect to α: cess, using the procedure of Black and Rangarajan [2]: Ψ(z, α) =    − log(z) + z − 1 z log(z)  − z +1 α    |2−α| 1 − α z (α−2) + α 2 (15) dρ (x, α, c) ≥ 0 dα if α = 0 if α = −∞ αz 2  −1 This property is convenient when annealing the loss with respect to α in a graduated non-convexity framework. We can take the limit of the loss as α approaches infinity: if α < 2 Note that Ψ(z, α) is not defined when α ≥ 2, which is understandable given that when α ≥ 2 the loss is no longer robust, and is therefore ill-suited to being described in terms of a process that rejects outliers. This Ψ-function lets us establish an equivalence between our robust loss function and an outlier process:   1 x 2 ( /c) z + Ψ(z, α) (16) ρ(x, α, c) = min 0≤z≤1 2  lim ρ (x, α, c) = exp α→∞ dΨ (z, α) ≥ 0 dα Let us now enumerate some properties of our loss function. The loss function is valid for all real values of α and for all real, positive values of c (although it can only be used as a valid outlier process when α < 2). The loss increases monotonically with the magnitude of x:   dρ (x, α, c) = sgn(x) (17) sgn dx ρ (x, α, c) ≈ ∀α,c ρ (0, α, c) = 0 1 dρ 1 ∀α,c (0, α, c) = 2 x dx c −1 (23) if 0 ≤ z ≤ 1 (24) 1 x 2 ( /c) 2 if |x| < c (25) Because the second derivative of the loss is maximized at x = 0, this quadratic approximation tells us that the second derivative is bounded from above: d2 ρ 1 (x, α, c) ≤ 2 dx2 c The loss function is scale invariant with respect to c and x: At the origin the loss is zero and the IRLS weight is  This function is strictly increasing when 0 < z < 1, or when z = 0 and α < 0 (when α ≥ 0 we see that Ψ(0, α) = +∞). For all values of α, when |x| is small with respect to c the loss is well-approximated by a quadratic: 4. Properties ρ(kx, α, kc) = ρ(x, α, c) 1 x 2 ( /c) 2 This limit serves as an upper bound on the loss. Curiously, this limit resembles Welsch/Leclerc loss, which is the limit of the loss as α approaches −∞. Similarly, the loss’s Ψ-function increases monotonically with respect to α for all values of z in [0, 1]: A visualization of our loss and its derivative/influence, weight functions, and outlier processes for different values of α can be seen in Figures 1, 2, 3, and 4. In Figures 1, 2, and 3, because c only controls the scale of the loss on the x-axis, we do not vary c in our visualizations and instead annotate the x-axis of our plots in units of c. ∀k>0 (22) (18) (26) This property is useful when deriving approximate Jacobi preconditioners for optimization problems that minimize this loss. When α is negative the loss approaches a constant as |x| approaches infinity, which lets us provide an upper bound on the loss: 1 c2 : (19) (20) The roots of the second derivative of ρ (x, α, c) are: r α−2 x = ±c (21) α−1 ∀x,c ρ (x, α, c) ≤ α−2 α if α < 0 (27) Additionally, when α is less than or equal to 1 we can provide an upper bound on the magnitude of the gradient of the loss: This tells us at what value of x the loss begins to re-descend. This point has a magnitude of c when α = −∞, and that magnitude increases as α increases. The root is undefined when α ≥ 1, from which we can infer that the loss is redesending iff α < 1. ∀x,c dρ 1 (x, α, c) ≤ dx c   α−1 α−2 ( 2 ) α−1 if α ≤ 1 (28) 3 Figure 3: Our loss’s IRLS weight for different values of the shape parameter α. Figure 1: Our loss for different values of the shape parameter α. When α = 2 we have L2 loss, when α = 1 we smoothly approximate L1 loss, when α = 0 we have Cauchy/Lorentzian loss, when α = −2 we have GemanMcClure loss, and as α approaches negative infinity we have Welsch loss. Figure 4: Our loss’s Ψ-function for use in an outlier process [2]. Ψ(z, 2) is not defined, and so is not visible here. Figure 2: Our loss’s gradient for different values of the shape parameter α. 4 5. Probability Density Function With our robust loss function we can construct a probability density function, such that the negative log-likelihodd of that PDF is a shifted version of the robust loss function: 1 exp (−ρ (x − µ, α, c)) cZ (α) Z ∞ exp (−ρ (x, α, 1)) Z (α) = f (x | µ, α, c) = (29) (30) −∞ where f (x | µ, α, c) is only defined if α ≥ 0, as Z (α) is infinite when α < 0. For some values of α, the partition function has a straightforward analytical form: √ Z (0) = π 2 Z (1) = 2eK1 (1) √ Z (2) = 2π 1 Z (4) = e /4 K1/4 (1/4) (31) where Kn (·) is the modified Bessel function of the second kind. A closed form for the most general case of the partition function is difficult to obtain, though if α is a rational number the partition function can be expressed in a somewhat reasonable form. For any rational number in α ∈ (0, 2) where α = n/d with n, d ∈ N, we see that q 2d  2d !  n  e( n −1) 2d 1 1 n − 1 q,0 ap Z Gp,q − = q−p bq d n 2d 2( 2 −1) π (d−1)   i ap = i = 1, . . . , n − 1 n   i 3 bq = − i = 1, . . . , n n 2n   i ∪ i = 1, . . . , d − 1 (32) d Figure 5: The negative log-likelihood of the probability distribution corresponding to our loss function when the PDF is defined (α ≥ 0). where G(·) is the Meijer G-function. Just as our general loss function includes several common loss function as special cases, our general PDF includes several common PDFs as special cases. When α = 2, our PDF becomes a normal (or Gaussian) distribution. When α = 0, our PDF becomes a Cauchy distribution. These two distributions are also both special cases of Student’s t-distribution, though these appear to be the only two points where these two familes of functions intersect. In general, this distribution resembles the generalized Gaussian distribution [13, 12], but one that approaches a Gaussian distribution near the origin regardless of the shape parameter α. The PDF and negative log-likelihoods of this distribution for different values of the α can be seen in Figures 5 and 6, respectively. The complicated nature of the partition function is troublesome if we want to evaluate it efficiently for any real Figure 6: The probability density function corresponding to our loss function when the PDF is defined (α ≥ 0). 5 6. Conclusion We have presented a two-parameter loss function that generalizes many existing one-parameter robust loss functions: the Cauchy/Lorentzian, Geman-McClure, Welsch, and generalized Charbonnier, pseudo-Huber, L2, and L1 loss functions. We have presented the loss’s gradient, Mestimator weight, and Ψ-function as a reference, in addition to enumerating several convenient properties of the loss. When used as a negative log-likelihood, this penalty gives a general probability distribution that includes normal and Cauchy distributions as special cases. By reducing a family of discrete single-parameter losses into a single loss with two continuous parameters, our loss function enables the convenient exploration and comparison of different robust penalties. References [1] M. J. Black and P. Anandan. The robust estimation of multiple motions: Parametric and piecewise-smooth flow fields. CVIU, 1996. [2] M. J. Black and A. Rangarajan. On the unification of line processes, outlier rejection, and robust statistics with applications in early vision. IJCV, 1996. [3] P. Charbonnier, L. Blanc-Feraud, G. Aubert, and M. Barlaud. Two deterministic half-quadratic regularization algorithms for computed imaging. ICIP, 1994. [4] Q. Chen and V. Koltun. Fast mrf optimization with application to depth reconstruction. CVPR, 2014. [5] S. Geman and D. E. McClure. Statistical methods for tomographic image reconstruction. Bulletin de l’Institut international de statistique, 1987. [6] T. Hastie, R. Tibshirani, and M. Wainwright. Statistical Learning with Sparsity: The Lasso and Generalizations. Chapman and Hall/CRC, 2015. [7] P. J. Huber. Robust estimation of a location parameter. Annals of Mathematical Statistics, 1964. [8] P. J. Huber. Robust Statistics. Wiley, 1981. [9] J. E. D. Jr and R. E. Welsch. Techniques for nonlinear least squares and robust regression. Communications in Statisticssimulation and Computation, 1978. [10] P. Krähenbühl and V. Koltun. Efficient nonlocal regularization for optical flow. ECCV, 2012. [11] Y. G. Leclerc. Constructing simple stable descriptions for image partitioning. IJCV, 1989. [12] S. Nadarajah. A generalized normal distribution. Journal of Applied Statistics, 2005. [13] M. T. Subbotin. On the law of frequency of error. Matematicheskii Sbornik, 1923. [14] D. Sun, S. Roth, and M. J. Black. Secrets of optical flow estimation and their principles. CVPR, 2010. [15] Z. Zhang. Parameter estimation techniques: A tutorial with application to conic fitting, 1995. Figure 7: Because our PDF’s partition function Z (α) is difficult to evaluate for arbitrary inputs, we approximate it using cubic hermite spline interpolation for values of α in [0, 2]. α 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 p 4.44288 3.91245 3.63899 3.43939 3.27231 3.11904 2.96592 2.79405 2.50663 m −0.87456 −0.34937 −0.23171 −0.18280 −0.16069 −0.15478 −0.16515 −0.20658 −0.51451 Table 1: The spline coefficients that produce a least-squares fit to the true partition function, as shown in Figure 7. For each knot at location α we present the spline value p and tangent m. number, and especially troublesome if we want to differentiate Z (α) with respect to α. We therefore approximate Z (α) with a cubic hermite spline, for values of α in [0, 2] with spline knots spaced apart by 1/4. The tangent values at each knot are set to minimize the squared error between the spline and the true partition function. For values of α in [0, 2], this approximation has an RMSE of less than 10−3 , and a maximum error of less than 4 × 10−3 , which is sufficient for our purposes. This spline parametrization can be seen in Figure 7 and Table 1. 6
1cs.CV
1 Storage, Communication, and Load Balancing Trade-off in Distributed Cache Networks arXiv:1706.10209v1 [cs.IT] 30 Jun 2017 Mahdi Jafari Siavoshani, Member, IEEE, Ali Pourmiri, Seyed Pooya Shariatpanahi Abstract—We consider load balancing in a network of caching servers delivering contents to end users. Randomized load balancing via the so-called power of two choices is a wellknown approach in parallel and distributed systems. In this framework, we investigate the tension between storage resources, communication cost, and load balancing performance. To this end, we propose a randomized load balancing scheme which simultaneously considers cache size limitation and proximity in the server redirection process. In contrast to the classical power of two choices setup, since the memory limitation and the proximity constraint cause correlation in the server selection process, we may not benefit from the power of two choices. However, we prove that in certain regimes of problem parameters, our scheme results in the maximum load of order Θ(log log n) (here n is the network size). This is an exponential improvement compared to the scheme which assigns each request to the nearest available replica. Interestingly, the extra communication cost incurred by our proposed scheme, compared to the nearest replica strategy, is small. Furthermore, our extensive simulations show that the trade-off trend does not depend on the network topology and library popularity profile details. Keywords Randomized Algorithms, Distributed Caching Servers, Request Routing, Load Balancing, Communication Cost, Ballsinto-Bins, Content Delivery Networks. I. I NTRODUCTION A. Problem Motivation Advancement of technology leads to the spread of smart multimedia-friendly communication devices to the masses which causes a rapid growth of demands for data communication [2]. Although Telcos have been spending hugely on telecommunication infrastructures, they cannot keep up with this data demand explosion. Caching predictable data in network off-peak hours, near end users, has been proposed as a promising solution to this challenge. This approach has been used extensively in content delivery networks (CDNs) such as Akamai, Azure, Amazon CloudFront, etc. [3], [4], and mobile video delivery [5]. In this approach, a cache network is usually referred to as a set of caching servers that are connected over a network, giving content delivery service to end users. As a schematic view of a typical cache network see Figure 1. This figure shows caching servers connected through a The authors’ names appear in alphabetical order. This work has been presented in part at IPDPS 2017, [1]. M. Jafari Siavoshani is with the Department of Computer Engineering, Sharif University of Technology, Tehran, Iran (email: [email protected]). A. Pourmiri is with the Department of Computer Engineering, University of Isfahan, Isfahan, Iran (email: [email protected]). S. P. Shariatpanahi is with the School of Computer Science, Institute for Research in Fundamental Sciences (IPM), Tehran, Iran (email: [email protected]). Assigned Requests Incoming Requests Backhaul Network Request Redirection Fig. 1: A general distributed cache network. backhaul network. These servers are responsible for delivering contents requested by customers. Each server should assign the demand to a responding server (which could be itself) via an assignment strategy. In every cache network we have three critical parameters, namely, Storage Resource, Communication Cost, and Network Imbalance. Storage, or memory characterizes what percentage of the total content library can be cached at each server. Communication cost is the amount of data transferred inside the backhaul network to satisfy content requests. Finally, network imbalance characterizes how uniformly the requested contents’ loads are distributed among different responding servers. This is usually measured by comparing the load of the busiest server with the average load of all servers after request assignments. Every request assignment strategy, in fact, leads to a trade-off between these three quantities. From a practical viewpoint, we are interested in distributed server selection strategies which are scalable in large networks. Randomized load balancing via the so-called “power of two choices” is a well-investigated paradigm in parallel and distributed settings [6], [7], [8], [9]. In this approach, upon arrival of a request, the corresponding user will query about the current loads of two independently at random chosen servers, and then allocates the request to the least loaded server. Considering only the load balancing perspective, Berenbrink et al., [10], showed that in this scheme after allocating m balls (requests, tasks, etc.) to n bins (servers, machines, etc.) the maximum number of balls assigned to any bin, called maximum load, is at most m/n + O(log log n) with high probability. This only deviates O(log log n) from the average 2 ↵ load and the deviation depends on the number of servers. Although the power of two choices strategy addresses the load balancing issue in a distributed manner, it does not consider the role of two other important quantities, namely, memory and communication cost. Our goal in this paper is to extend the power of two choices framework in order to characterize the trade-off between these three quantities. Our results show that the maximum load, communication cost, and servers’ memory are three entangled parameters. Thus, the previous studies are not sufficient for designing a practical load balancing strategy in cache networks. B. Problem Setting and Our Contributions In this paper, we consider a general cache network model that entails basic characteristics of many practical scenarios. We consider a network of n servers and a library of size K files. Each server can cache M files in network lowtraffic hours. Let us assume a popularity distribution P = {p1 , . . . , pK } on the library. We assume that the cache content placement at each server is proportional to this popularity distribution. In high-traffic hours there are n sequential file requests, from the library, distributed among servers uniformly at random. Every server either serves its requests or redirects them (via an assignment scheme) to other nodes which have cached the files. We define the maximum load L of an assignment scheme as the maximum number of allocations to any single server after assigning all requests. The communication cost C is the average number of hops required to deliver the requested file to its request origin. As the baseline assignment scheme, we consider that each request arrived at every server is dispatched to the nearest file replica. This scheme results in the minimum communication cost, while ignoring maximum load of servers. We show that, for a grid topology and every constant 0 < α < 1/2, if K = n, M = nα , and P is a uniform distribution, this scheme will result in the maximum load L in the interval [Ω(log n/ log log n), O(log n)] with high probability1 (w.h.p.). Moreover, for every constant 0 <  < 1, if K = n1− and M = Θ(1), then the maximum load is Θ(log n) w.h.p. We also investigate the communication cost incurred in this scheme for Uniform and Zipf popularity distributions. In p particular, we derive the communication cost C of order Θ( K/M ) for the Uniform distribution in a grid topology. In contrast, we propose a new scheme which considers memory, maximum load, and communication cost, simultaneously. For each request, this scheme chooses two random candidate servers that have cached the request while putting a constraint on their distance r to the requesting node (i.e., the proximity constraint). Due to cache size limitation and the proximity constraint, current results in the balanced allocation literature cannot be carried over to our setting. Basically, we show that here the two chosen servers will become correlated and this might diminish the power of two choices. Since this correlation arises from both memory limitation and proximity constraint, the main challenge we address in this paper is 1 With high probability refers to an event that happens with probability 1 − 1/nc , for some constant c > 0. 1 Power of two choices is achievable 1/2 Fig. 2: Suppose M = nα and r = nβ . Then the shaded area shows the region where the power of two choices is asymptotically achievable (for more details, refer to Theorem 4). characterizing the regimes where we can benefit from the power of two choices and at the same time have a low communication cost. In particular, suppose 0 < α, β < 1/2 be two constants and let K = n, M = nα , r = nβ , and P be a Uniform distribution. Then, for grid topology, provided α + 2β ≥ 1 + 2(log log n/ log n), the maximum load is Θ(log log n) w.h.p., and the communication cost is Θ(r). Therefore, if we set β = 1−α 2 +log log n/ log n we achieve the power of two choices with  the communication cost of order  1−α Θ(r) = Θ n 2 log n . This communication cost is only log n factor above the communicationpcost achieved by the 1−α nearest replica strategy, which is Θ( K/M ) = Θ(n 2 ). Figure 2 shows the region of parameters α and β where the power of two choices is asymptotically achievable. It should be noted that while our theoretical results are derived for grid networks, the main reason for assuming a grid is presentation clarity and the results can be extended to other topologies. While our theoretical results are derived for large networks (i.e., asymptotic analysis), our simulation results show their validity even for finite sized networks. Also, in simulations we investigate the problem in more diverse settings such as considering other network topologies. C. Related Work Load balancing has been the focus of many papers on cache networks [11], [12], [13], among which distributed approaches have attracted a lot of attention (e.g., see [14], [8], and [15]). Randomized load balancing via the power of two choices, is a popular approach in this direction [7]. Chen et al. [16] consider the two choices selection process, where the second choice is the next neighbor of the first choice. In [17], Xia et al. use the length of common prefix (LCP)-based replication to arrive at a recursive balls and bins problem. In [16] and [17], the authors benefit from the metaphor of power of two choices to design algorithms for randomized load balancing. In contrast to these works, we follow a theoretical approach to derive provable results for cache networks. Theoretical works investigating the power of two choices in cache networks all just consider the role of two parameters among Memory Resource, Load Balancing, and Communica- 3 tion Cost. These works can be summarized in three categories as follow. Memory Resource vs. Communication Cost trade-off has been investigated in many works such as [5], [18], [19], [20], and [21]. Non of these papers have considered the load balancing issue, in cache networks which is very important in practice. Load Balancing vs. Memory Resource trade-off has been investigated in [22] and [23]. In [22] the authors consider the supermarket model for performance evaluation of CDNs. Although the work [22] considers the memory limitation into account, it does not consider the proximity principle which is a central issue in our paper. Liu et al. [23] study the setting where the clients compare the servers in terms of hit-rate (for web applications), or bit-rate (for video applications) to choose their favourite ones. Their setup and objectives are different from those we consider here. Moreover, they have not considered the effect of their randomized load balancing scheme on communication cost. Communication Cost vs. Load Balancing trade-off has been investigated in [24], [25], [26], [27], [28], [29], and [30], without considering the effect of cache size limitation. Although the works [24], [25], and [26] have mentioned this trade-off, non of them provides a rigorous analysis. In contrast to the standard balls and bins model, the works [27], [28], [29], and [30] introduced the effect of proximity constraint to the ball and bins framework. In the standard balls and bins model, each ball (request) picks two bins (servers) independently and uniformly at random and it is then allocated to the one with lesser load [6]. However, in many settings, selecting any two random servers might be infeasible or costly. In other words, this proximity constraint translates to a correlation between the two choices, i.e., the balls and bins model with related choices. The most related work to our paper is [28]. Kenthapadi and Panigrahi [28] proposed a model where n bins are connected as a d-regular graph. Corresponding to each ball, a node is chosen uniformly at random as the first candidate. Then, one of its neighbours is chosen uniformly at random as the second candidate and the ball is allocated to the one with the minimum load. Under this assumption, they proved that if the graph is sufficiently dense (i.e., the average degree is nΩ(log log n/ log n) ), then after allocating n balls, the maximum load is Θ(log log n) w.h.p. Although the model used in [28] considers the proximity principle by assigning each request to the origin neighbors, it cannot be directly applied to our cache network setup. First, they do not consider multi-hop communication, while in practice the communication is done in a multi-hop fashion. Second, the above model cannot accommodate the cache size limitation of servers. Cache size limitation introduces the notion of cache content placement which should be based on the popularity profile. In addition, this limitation will introduce a new source of correlation between choices which is not considered in [28]. The organization of the paper is as follows. In Section II, we present our notation and problem setup. Then, in Section III the nearest replica strategy, is investigated as the baseline scheme. In Section IV, we propose and analyze the proximityaware two choices strategy, which at the same time considers memory limitation, proximity constraint, and benefits from the power of two choices. In Section V the performance of these two schemes are investigated via extensive simulations. Finally, our discussions and concluding remarks are presented in Section VI. II. N OTATION AND P ROBLEM S ETTING A. Notation Throughout the paper, with high probability refers to an event that happens with probability 1−1/nc , for some constant c > 0. Let G = (V, E) be a graph with vertex set V and edge set E where e(G) := |E|. For u ∈ V let d(u) denote for the degree of u in G. For every pair of nodes u, v ∈ V , dG (u, v) denotes the length of a shortest path from u to v in G. The neighborhood of u at distance r is defined as Br (u) := {v : dG (u, v) ≤ r and v ∈ V (G)} . Finally, we use Po(λ) to denote for the Poisson distribution with parameter λ. B. Problem Setting We consider a cache network consisting of n caching servers (also called cache-enabled nodes) √ and√edges connecting neighboring servers forming a n × n grid. Direct communication is possible only between adjacent nodes, and other communications should be carried out in a multi-hop fashion. Remark 1. Throughout the paper for the sake of presentation clarity we may consider a torus with n nodes. This helps to avoid boundary effects of grid and all the asymptotic results hold for the grid as well. Suppose that the cache network is responsible for handling a library of K files W = {W1 , . . . , WK }, whereas the popularity profile follows a known distribution P = {p1 , . . . , pK }. The network operates in two phases, namely, cache content placement and content delivery. In the cache content placement phase each node caches M ≤ K files randomly from the library according to their popularity distribution P = {p1 , . . . , pK } with replacement, independent of other nodes. Also note that, throughout the paper we assume that M  K, unless otherwise stated. Consider a time block during which n files are requested from the servers sequentially that are chosen uniformly at random. Let Di denote the number of requests (demands) arrived at server i. Then for large n we have Di ∼ Po(1) for all 1 ≤ i ≤ n. For library popularity profile P, we consider two probability distributions, namely, Uniform and Zipf with parameter γ. In the Uniform distribution we have pi = 1 , K i = 1, . . . , K, 4 which considers equal popularity for all the files. In Zipf distribution the request probability of the i-th popular file is inversely proportional to its rank as follows γ pi = 1/i , K P γ 1/j i = 1, . . . , K, j=1 which has been confirmed to be the case in many practical applications [31], [32]. For any given cache content placement, an assignment strategy determines how each request is mapped to a server. Let Ti denote the number of requests assigned to server i at the end of mapping process. Now, for each strategy we define the following metrics. respect to u and some positive number r > 0 define four areas as follows A1 (u) := {(x, y) : 0 ≤ y ≤ x/2 and (x, y) ∈ Br (u)}, A2 (u) := {(x, y) : 0 ≤ −x ≤ y/2 and (x, y) ∈ Br (u)}, A3 (u) := {(x, y) : 0 ≤ −y ≤ −x/2 and (x, y) ∈ Br (u)}, A4 (u) := {(x, y) : 0 ≤ x ≤ −y/2 and (x, y) ∈ Br (u)}, which are shown in Fig. 3. It is easy to see that all four areas have the same size, that is |A1 (u)| = • The communication cost of a strategy is the average number of hops between the requesting node and the serving node, denoted by C. The maximum load of a strategy is the maximum number of requests assigned to a single node, denoted by L = max1≤i≤n Ti . III. N EAREST R EPLICA S TRATEGY The simplest strategy for assigning requests to servers is to allocate each request to the nearest node that has cached the file. This strategy, formally defined below, leads to the minimum communication cost, while does not try to reduce maximum load. Definition 2 (Strategy I: Nearest Replica Strategy). In this strategy each request is assigned to the nearest node –in the sense of the graph shortest path distance– which has cached the requested file. If there are multiple choices ties are broken randomly. Consider the set of nodes that have cached file Wj , say Sj . According to Strategy I, each demand from node u for file Wj will be served by arg minv∈Sj dG (u, v). This induces a Voronoi Tessellation on the torus corresponding to file Wj which we denote by Vj . Then, alternatively, we can define Strategy I as assigning each request of file Wj to the corresponding Voronoi cell center. In order to analyze the maximum load imposed on each node, we should investigate the size of such Voronoi regions. The following Lemma is in this direction. Lemma 1. Under the Uniform popularity distribution, the maximum cell size (number of nodes inside each cell) of Vj , 1 ≤ j ≤ K, is at most O (K log n/M ) w.h.p. In particular, every Voronoi cell centered at  any node is contained in a sub p K log n/M . Furthermore, grid of size r × r with r = O if K = n1− , for some constant 0 <  < 1, and M = Θ(1), then there exists a Voronoi cell of size Θ (K log n/M ) w.h.p. Proof of Lemma 1. Upper Bound – Fix a node u and w.l.o.g. assume that u is denoted by pair (0, 0) in the torus. With 1 y=0 x=2y br/3c = X (r − 3y + 1) y=0 Definition 1 (Communication Cost and Maximum Load). • br/3c r−y X X br/3c ≥ X 3y y=0 2 ≥ r /8. (1) Let us fix some arbitrary 1 ≤ j ≤ K and for every node u define indicator random variable Xu,j taking value 1 if u has cached file Wj and there is no node in A1 (u) that has cached file Wj , and 0 otherwise. Then, M !  M (|A1 (u)|−1)  1 1 Pr [Xu,j = 1] = 1 − 1 − 1− , K K where the first term determines the probability that u caches Wj and the second one determines the probabilitypthat nodes in A1 (u) \ {u} do not cache Wj . By setting r = 5 K log n/M and applying Inequality (1) we have,  M (|A1 (u)|−1) 25 log n 1 1− = e− 8 (1 + o(1)) K = O(n−3 ), (2) where it follows from 1 − 1/K = e−1/K (1 + o(1)) and M/K = o(1). Moreover, by using the approximation 1 − (1 − 1/K)M = M (1 + o(1))/K, we have M (1 + o(1)) . K · n3 Therefore applying the union bound over all n nodes and K files implies that w.h.p. for every u there exists at least one node in A1 (u) which shares a common file with u, supported p that we choose r = 5 K log n/M . We can similarly prove the same argument for A2 (u), A3 (u) and A4 (u). Suppose that u has cached file Wj , and we want to find an upper bound for the size of the Voronoi cell centered at u corresponding to Wj . In order to do this let us define v 1 = (vx1 , vy1 ) ∈ A1 (u) to be the nearest node to u with file Wj . Similarly define v i ∈ Ai (u), 2 ≤ i ≤ 4. W.l.o.g. assume that u is the origin and the nodes are in a xy-coordinate system. Define Pr [Xu,j = 1] ≤ B := {(x, y) : vx3 ≤ x ≤ vx1 and vy4 ≤ y ≤ vy2 }. Now we show that the Voronoi cell of u is contained in B, and thus the size of B is an upper bound to the size of the 5 Also, we know that X Var [Yj ] = Cov(Yu,j , Yv,j ) u,v = X E [Yu,j Yv,j ] − E [Yu,j ] E [Yv,j ] u,v = X Pr [Yu,j = 1, Yv,j = 1] u,v  − Pr [Yu,j = 1] · Pr [Yv,j = 1] , (3) where the last equality holds because Yu,j ’s are indicator random variables. It is easy to see that for every u and v with dG (u, v) > 2r, Cov(Yu,j , Yv,j ) = 0 as cache content placement at different nodes are independent processes. So we only consider pairs u and v, with dG (u, v) ≤ 2r. Then for each pair of nodes three following cases should be considered: • u = v: In this case we have Pr [Yu,j = 1, Yv,j = 1] − Pr [Yu,j = 1] · Pr [Yv,j = 1] Fig. 3: Demonstration of regions A1 (u), . . . , A4 (u) used in the upper bound proof of Lemma 1. Voronoi cell. Consider Fig. 3. Let us consider node w in the complement of B with wy > vy2 and wx > 0. Assume that Puw is a shortest path from w to u that passes node (0, vy2 ). By definition of A2 (u), we know the length of a shortest path from (0, vy2 ) to (vx2 , vy2 ) is |vx2 | ≤ vy2 /2. This shows that w is closer to v 2 than u, and by definition it does not belong to the Voronoi cell centered at u. We similarly can show that each arbitrary node w ∈ B c is closer to either v i ’s rather than u. Since we arbitrarily choose u and 1 ≤ j ≤ K, there is sub-grid B that contains every Voronoi cell in Vj , centered at any given u. So the size of any Voronoi cell centered at an arbitrary node u is bounded from above by |B|, which is at most 4r2 = O(K log n/M ). Lower Bound – Let us define indicator random variable Yu,j for every u and some fixed j taking value 1 if u has cached file Wj and there is no v ∈ Br (u) that has cached file Wj , and 0 otherwise. Note that |Br (u) \ {u}| = 2r(r + 1). Then we have  M !  M [2r(r+1)] 1 1 Pr [Yu,j = 1] = 1 − 1 − 1− . K K p By setting r =  · K · log n/4M and using similar approximations used in (2) we have M (1 + o(1)) p , Pr [Yu,j = 1] = . K · n/2 P Let Yj = u Yu,j . Then, we have the following claim. Claim 1. For every j we have Yj ≥ 1 with probability 1−o(1). This claim shows that there exists at least a Voronoi cell of size Θ(r2 ) = Θ(K log n/M ) which concludes the proof. Now, in order to prove the claim note that X M (1 + o(1)) E [Yj ] = E [Yu,j ] = n · = M n/2 (1 + o(1)). /2 K · n u = Pr [Yu,j = 1] − p2 = p(1 − p). (4) • 0 < dG (u, v) ≤ r: By definition of indicator random variables Yu,j ’s, we have Pr [Yu,j = 1, Yv,j = 1] − Pr [Yu,j = 1] · Pr [Yv,j = 1] = 0 − p2 . • (5) r < dG (u, v) ≤ 2r: In this case we have Pr [Yu,j = 1, Yv,j = 1] − Pr [Yu,j = 1] · Pr [Yv,j = 1] = Pr [Yu,j = 1|Yv,j = 1] Pr [Yv,j = 1] − p2 2M M (1 + o(1)) p − p2 ≤ p. (6) ≤ K K Now let us split the summation (3) based on dG (u, v) as follows X Var [Yj ] = Cov(Yu,j , Yu,j ) u + X X Cov(Yu,j , Yv,j ) u v:0<dG (u,v)≤r + X X Cov(Yu,j , Yv,j ). u v:r<dG (u,v)≤2r Applying results (4-6) yields Var [Yj ] ≤ np(1 − p) − n|Br (u)|p2 + n|B2r (u)| ≤ np + 4nr(2r + 1) 2M p K 2M p K ≤ np + 6np log n ≤ 7np log n, where we use the fact that 4r(2r + 1) ≤ 9r2 ≤ 3K log n. Applying Chebychev’s inequality leads to 4 Var [Yj ] Pr [|Yj − E [Yj ] | ≥ E [Yj ] /2] ≤ 2 E [Yj ] 28np log n ≤ n2 p 2 28 log n = = o(1). np 6 Therefore, Yj concentrates around its mean, i.e., np = Θ(n/2 ), which proves the claim. K − |T |. Then probability that a node in Br (u) caches Wj is at most M/(K − t). Hence, for every Wj ∈ S, Now, we are ready to present our main results for this section which characterize the maximum load of Strategy I, for two different parameter regimes, in Theorems 1 and 2. Pr [Xu,j = 1|{Xu,j 0 = xu,j 0 , Wj 0 ∈ S \ {Wj }}] !2r(r+1) M P ≥ 1− K − Wj0 ∈S\{Wj } xu,j 0  2r(r+1) M = e−Ω(1) = p, ≥ 1− K −M +1 Theorem 1. Suppose that K = n1− , for some constant 0 <  < 1, and M = Θ(1). Then, under Uniform distribution P, Strategy I achieves maximum load of L = Θ(log n) w.h.p. Proof. Consider node u which has cached a set of distinct files, say S, with |S| ≤ M . Applying Lemma 1 shows that all Voronoi cells centered at u corresponding to cached files at u are contained in a sub-grid of size at most O(K log n/M ) w.h.p. Also in each round, every arbitrary node requests for a file in S with probability |S|/nK ≤ M/nK, as each request randomly chooses its origin and type. Hence, by union bound, a node in the sub-grid may request for a file in S with probability at most O(K log n/M ) · (M/nK) = O(log n/n). Since there are n requests, the expected number of requests imposed to node u is O(log n). Now using a Chernoff bound (e.g., see Appendix A) shows that w.h.p. u has to handle at most O(log n) requests. On the other hand, to establish a lower bound on the maximum load we proceed as follows. Lemma 1 shows that there exits a Voronoi cell in Vj , for some j, such that the center node should handle the requests of at least Θ(K log n/M ) nodes w.h.p. Also each node in the cell may request for file Wj with probability 1/nK. So on average there are Θ(log n/M ) requests imposed on the cell center. Similarly, by a Chernoff bound, one can see that this node experiences the load Θ(log n/M ), which concludes the proof for constant M. Remark 2. It should be noted that the same result of Θ(log n) for the maximum load can also be proved for the Zipf distribution. That is because the content placement distribution is chosen proportional to the file popularity distribution P, and consequently this result is insensitive to P. However, the proof involves lengthy technical discussions which we omit in this paper. For further numerical investigation on this remark refer to Section V. Theorem 2. Suppose that K = n and M = nα , for some 0 < α < 1/2. Then, under the Uniform distribution, the maximum load is in the interval [Ω(log n/ log log n), O(log n)] w.h.p. Proof of Theorem 2. To establish upper bound O(log n) for the maximum load, we follow the first part of proof of Theorem 1. To obtain a lower bound, consider an arbitrary server u that has cached file set S with s distinct files. Note that by Lemma 2, we have for every node u, s = Θ(M ) with high probability. Let us define the indicator random variable Xu,j , Wj ∈ S, taking p 1 if the nearest replica of Wj is outside of Br (u), where r = K/2M and zero otherwise. It is easy to see that Xu,j ’s are correlated. For example, consider the set of files T = {Wj1 , Wj2 , . . . , Wjt } ⊂ S, where Xu,j 0 = 1 for every Wj 0 ∈ T . Then conditioned on this event, each node in Br (u) has cached files from a subset of the library of size where |Br (u)\{u}|P= 2r(r +1) = Θ(K/M ) and hence p is a constant. Let Z = Wj ∈S Xu,j and then E [Z] ≥ s · p. Using a Chernoff bound for moderately correlated indicator random variables (e.g., see Lemma 4) implies that Pr [Z < sp/2] = o(1/n2 ). Therefore Br (u) does not contain any replica of at least p/2 fraction of files cached at u, namely S 0 . Using the union bound over all nodes we deduce the similar statement for every node with probability at least 1 − o(1/n). Therefore, for every u we have, Pr [u severs a request] ≥ |Br/2 (u)| |S 0 | · = Ω(1/n) n K where it follows from |S 0 | = Θ(M ), |Br/2 (u)| = Θ(K/M ). Since there are n requests, it is easy to see that the load of each server is bounded from below by a Poisson distribution Po(c), where c is a constant. On the other hand, it is known that (e.g., see [33]) the maximum number taken by n Poisson distribution Po(c) is Ω(log n/ log log n) w.h.p. and hence the lower bound is proved. Next, we investigate the communication cost of Strategy I in the following theorem. Theorem 3. Under the Uniform popularity distribution, p Strategy I achieves the communication cost C = Θ( K/M ), for every M  K. Under Zipf popularity distribution with M = Θ(1), it achieves  p   Θ K/M : 0 < γ < 1,    p     Θ K/M log K : γ = 1,     √  1−γ/2 C= Θ K / M : 1 < γ < 2, (7)    √    Θ log K/ M : γ = 2,     √     Θ 1/ M : γ > 2. Proof of Theorem 3. Assume a request from an arbitrary node u for file Wj . The probability that this file is cached at another node v is qj := 1 − (1 − pj )M . Cache content placement at different nodes is independent. Thus, the number of nodes which should be probed is a geometric random variable with success probability qj . This results in the average 1/qj trials that leads to expected distance of !   1 1 Θ √ =Θ p . (8) qj 1 − (1 − pj )M 7 When averaged over different files we will have ! K X 1 C= pj Θ p . 1 − (1 − pj )M j=1 cached the requested file. Then, the request is assigned to the node with lesser load. Ties are broken randomly. (9) For the sake of illustration, first, we consider some examples in the following. • For Uniform distribution we have pj = 1/K and then p C = Θ( K/M ). (10) • For Zipf distribution with M = Θ(1) we have ! K X 1 C= pj Θ p 1 − (1 − pj )M j=1 ! K X 1 = pj Θ p pj M j=1   PK −γ/2 j   j=1 = Θ  . PK −γ 1/2  M j=1 j Example 1 (M = K and r = ∞2 ). In this example each node can store all the library and there is no constraint on proximity. As mentioned in Section I, the number of files that should be handled by each node (i.e., Di for i = 1, . . . , n) will be a Po(1) random variable. In this case, according to Strategy II, two random nodes are chosen from all network nodes and the request is assigned to the node with lesser load. Therefore, in terms of maximum load, this problem is reduced to the standard power of two choices model in the balanced allocations literature [6]. In this model there are n bins and n sequential balls which are randomly allocated to bins. In every round each ball picks two random bins uniformly, and it is then allocated to the bin with lesser load [6]. Then it is shown that the maximum load of network is L = maxi Ti = log log n(1 + o(1)) w.h.p. [6], which is an exponential improvement compared to Strategy I. (11) PK Define Λ(γ) := j=1 j −γ , for every γ. On the other hand it is known that for every γ > 0 (e.g., see [34])   0 < γ < 1,  Θ K 1−γ , Θ (log K) , γ = 1, Λ(γ) = (12)  Θ(1), γ > 1. Now inserting the above equations into (11) completes the proof. Theorem 3 shows how non-uniform file popularity reduces communication cost. The skew in file popularity is determined by the parameter γ which will affect the communication cost. For example, for γ < 1 communication cost is similar to the Uniform distribution, while for γ > 2, it becomes independent of K. Since in Strategy I we have assigned each request to the nearest replica, Theorem 3 characterizes the minimum communication cost one can achieve. However, Theorems 1 and 2 show a logarithmic growth for the maximum load as a function of network size n. This imbalance in the network load is because in Strategy I each request assignment does not consider the current load of servers. A natural question is whether, at each request allocation, one can use a very limited information of servers’ current load in order to reduce the maximum load. Also one can ask how does this affect the communication cost. We address these questions in the following section. IV. P ROXIMITY-AWARE T WO C HOICES S TRATEGY Strategy I introduced in the previous section will result in the minimum communication cost, while, the maximum load for that strategy is of order Ω (log n/ log log n). In this section we investigate an strategy which will result in an exponential decrease in the maximum load, i.e., reduces maximum load to Θ (log log n), formally defined as follows. Definition 3 (Proximity-Aware Two Choices Strategy). For each request born at an arbitrary node u consider two uniformly at random chosen nodes from Br (u), that have However, in contrast to Example 1, in cache networks usually each node can store only a subset of files, and this makes the problem different from the standard balls and bins model, considered in [6]. Here, due to the memory constraint at each node, the choices are much more limited than the M = K case. In other words here we have the case of related choices. In the related choices scenario, the event of choosing the second choice is correlated with the first choice; this correlation may annihilate the effect of power of two choices as demonstrated in Example 2. Example 2 (K = n, M = Θ(1), and r = ∞). In this regime, there is a subset of the library, say S, with |S| = Θ(n), whose files are cached inside the network. On the other hand, each file type is requested Po(1) times and hence w.h.p. there will be a file in S which is requested Θ(log n/ log log n) times (e.g., see [33]). Since each file in S is replicated at most M times, requests for the file are distributed among at most M nodes and thus the maximum load of the corresponding nodes will be at least Θ(log n/ log log n)/M . Hence, due to memory limitation we cannot benefit from the power of two choices. Although Example 2 shows that memory limitation can annihilate the power of two choices but this is not always the case. Example 3 shows even for M = 1 for some scenarios we can achieve L = O(log log n). Example 3 (K = n1− for every constant 0 <  < 1, M r = ∞). For any popularity distribution P where PK= 1, and −c = o(1), Strategy II achieves maximum load j=1 (pj n) L = O(log log n) w.h.p. Also, notice that Uniform and Zipf  , 1 distributions satisfy this requirement, whenever  ∈ γ−1 γ for γ ≥ 1, where γ is the Zipf parameter. Roughly speaking, when M = 1, we may partition the servers based on their cached file and hence we have K “dis√ r = ∞) is equivalent to √should be noted that r ≥ n (including √ r = n. Thus in this paper we use r = n and r = ∞ alternatively. 2 It 8 joint” subsets of servers. Similarly there are K request types where each request should be addressed by the corresponding subset of servers. Thus, here we have K disjoint Balls and Bins sub-problems, and the sub-problem with maximum load determines the maximum load of the original setup. The reason that here, in contrast to Example 2, we can benefit from power of two choices is the assumption of K  n. Proof of Example 3. It is easy to see that for M = 1, the number of caching servers with a specific file, say Wj denoted by Sj , is distributed as a Bin(n, pj ). Thus applying a Chernoff bound for Sj (e.g., see Appendix A) implies that Pr [|Sj − E [Sj ] | ≥ E [Sj ] /2] ≤ 2 exp(−pj n/12). Moreover, let Rj denote the number of requests for file Wj , which is the sum of n i.i.d. Bin(n, pj ) random variables. Again applying a Chernoff bound (e.g., see Appendix A) for Poisson random variables yields that Pr [|Rj − E [Rj ] | ≥ E [Rj ] /2] ≤ 2 exp(−pj n/12). Notice that E [Sj ] = E [Rj ] = npj . Suppose that Aj denotes the event that |Sj − E [Sj ] | ≤ E [Sj ] /2 and |Rj − E [Rj ] | ≤ E [Rj ] /2. Then we have that Pr [Aj ] ≥ 1 − 4 exp(−pj n/12). Also define Ej to be the event that the two-choice model with Sj bins (caching servers) and Rj balls (requests) achieves maximum load Rj /Sj + Θ(log log Sj ). It is shown that this event happens with probability 1−O(1/Sjc ), for every constant c (e.g., see [6]). So we have that Pr [Ej ] = Pr [Ej |Aj ] Pr [Aj ] + Pr [Ej |¬Aj ] Pr [¬Aj ] > (1 − 2(pj n)−c )(1 − 4 exp(−pj n/12)) + (1 − 2(pj n)−c )(4 exp(−pj n/12)) ≥ 1 − 8(pj n)−c . Since we have K disjoint subsystems, the union bound over all subsystems shows that the two choice model P does achieve the K desired maximum load with probability 1−8 j=1 (npj )−c = 1 − o(1) which concludes the proof due to example’s assumption on popularity profile. Now we show that the Uniform and Zipf distributions satisfy the example’s assumption. When P is the Uniform distribution over K files, ∀j, pj · n = n . Now by setting c = 3/, we have that K X (npj )−c = K(1/n )c = K/n3 = o(1/n2 ). • 0 < β < 1: By setting c = 2/γ and using the fact that K < n, we have  c  (1−γ)c  Λ(γ) K ≤ n(1−γ)c−c Λ(γc) Λ(γc) =Θ n nc =n−γc Λ(γc) = o(1), where we applied (12). Above examples bring to attention the following question. Question 1. In view of the memory limitation at each server in cache networks, what are the regimes (in terms of problem parameters) one can benefit from the power of two choices to balance out the load? Addressing Question 1, for the general M > 1 case, is more challenging than Example 3 and needs a completely different approach. The simplicity of case M = 1 is that there is no interaction between K Balls and Bins sub-problems. On the other hand, consider M > 1. If a request, say Wj , should be allocated to a server then the load of two candidate bins that have cached Wj should be compared. However, load of other file types will also be accounted for in this comparison. So there is flow of load information between different subproblems which makes them entangled. In all above examples, we have not considered the proximity constraint, i.e., r = ∞, yet.√ This results in a fairly high communication cost C = Θ ( n). However, in general since parameter r controls the communication cost, it can √ be chosen to be much less than the network diameter, i.e., Θ( n). This proximity awareness introduces another source of correlation (other than the memory limitation) between the two choices. Thus, considering the proximity constraint may annihilate the power of two choices even in large memory cases as demonstrated in the following example. Example 4 (M = K and r = 1). In this example, when a request arrives at a server, the server chooses two random choices among itself and its neighbours. Then the request is allocated to the one with lesser load. Since there exists a server at which maxi Di = Θ(log n/ log log n) requests arrive, maximum load of network (i.e., L = maxi Ti ) will be at least Θ(log n/ log log n)/5. Thus, similar to Question 1 regarding the memory limitation effect, one can pose the following question regarding proximity principle. j=1 Also, for Zipf distribution we have j −γ j −γ = . pj = PK −γ Λ(γ) j=1 j Depending on γ, we consider two cases: • γ ≥ 1: For every c > 1 we have  c  c  Λ(γ) log K Λ(γc) = Θ Λ(γc) = o(1), n nc where we used K < n and (12). Question 2. In view of the proximity constraint of Scheme II, what are the regimes (in terms of problem parameters) one can benefit from the power of two choices to balance out the load? In order to completely analyze load balancing performance of Scheme II, one should consider both sources of correlation simultaneously (which is not the case in above examples). To this end, in the following, we investigate two memory regimes, namely M = K and M = nα for some 0 < α < 1/2. Our main result for M = nα is presented in the following theorem. 9 Theorem 4. Suppose that 0 < α, β < 1/2 be two constants and let K = n, M = nα , and r = nβ . Then if α + 2β ≥ 1 + 2 log log n/ log n, under the Uniform popularity distribution, Strategy II achieves maximum load L = Θ(log log n) and communication cost C = Θ(r) w.h.p. Remark 3. To have a more accessible proof, in Theorem 4, we have assumed that K = n. Note that the proof techniques can also be extended to the case where K = O(n). In order to prove the theorem, let us first present an interesting result that was shown in [28] as follows. Theorem 5 ([28]). Given an almost ∆-regular graph3 G with e(G) edges and n nodes representing n bins, if n balls are thrown into the bins by choosing a random edge with probability at most O(1/e(G)) and placing into the smaller of the two bins connected by the edge,  then the maximum load  log n + O(1) w.h.p. is Θ(log log n) + O log(∆/ log4 n) Remark 4. Note that in the original theorem presented in [28], it is assumed that each edge is chosen uniformly among all edges of graph G. However, here we slightly generalize the result so that each edge is chosen with probability at most O(1/e(G)). The proof follows the original proof’s idea with some modifications in computation parts, where due to lack of space we omit. In order to apply Theorem 5, we first need to define a new graph H as follows. Definition 4 (Configuration Graph). For the given parameter r, configuration graph H is defined as a graph whose nodes represent the servers and two nodes, say u and v, are connected if and only if u and v have cached a common file and d(u, v) ≤ 2r in the torus. For every two servers u and v, let T (u, v) be the set of distinct files that have been cached in both nodes u and v. Also denote |T (u, v)| by t(u, v). Define t(u) to be the number of distinct cached files in u. Now, let us define goodness of a placement strategy as follows. Definition 5 (Goodness Property). For every positive constant δ ∈ [0, 1] and µ = O(1), we say the file placement strategy is (δ, µ)-good, if for every u and v, t(u) ≥ δM and t(u, v) < µ. Lemma 2. The proportional cache placement strategy introduced in Section II, is (δ, µ)-good w.h.p. Proof. Clearly, every set of cached files in every node (with replacement) can be one-to-one PK mapped to a non-negative integral solution of equation i=1 xi = M , where each xi expresses the number of times that file i has been cached in the node. A combinatorial argument shows that, the equation  −1 has K+M non-negative integer solutions. So for each M 1 ≤ s ≤ M , we have   K M −1 Pr [t(u) = s] = 3A s M −s  K+M −1 M , (13) graph is said to be almost ∆-regular, if each vertex has degree Θ(∆). where we first fixed a set of file indexes of size s, say I = {i1 , i2 , . . . , is }, and P then count the number of integral solutions to the equation i∈I xi = M − s. In order to  bound (13), we note that for every 1 ≤ a ≤ b, (b/a)a ≤ ab ≤ ba and also ab ≤ 2b . Recall that we assumed K = n and M = nα , 0 < α < 1/2. Hence for every 1 ≤ s ≤ δM , we have Pr [t(u) = s] ≤ K s 2M  ≤ K M K s 2M = (2M )M K s−M (K/M )M ≤ (2nα nδ−1 )M . Thus, by choosing δ = (1 − α)/3, for every 1 ≤ s ≤ δM , we have Pr [t(u) = s] ≤ (2nα+δ−1 )M = (2n2α/3−2/3 )M ≤ (2n−1/3 )M = n−ω(1) , where the last equality follows from M = nα = ω(1). Now the union bound over all 1 ≤ s ≤ δM and n nodes yields Pr [∃u ∈ V : t(u) ≤ δM ] = n−ω(1) . (14) By a similar argument, for each 1 ≤ t ≤ M and every u and v, we have  !2   K+M −t−1 K M −t Pr [t(u, v) ≥ t] = .  K+M −1 t M Thus, for any constant µ ≥ 5/(1 − 2α), we can write Pr [t(u, v) ≥ µ] 2  (K + M − µ − 1)!M ! µ ≤K (K + M − 1)!(M − µ)!  µ 2 M M 2µ ≤ Kµ = n(2α−1)µ = O(1/n5 ). ≤ Kµ Kµ By applying the union bound over all pairs of servers, for every u and v we have Pr [t(u, v) ≥ µ] = O(1/n3 ). (15) Hence, t(u, v) < µ w.h.p. Putting (14) and (15) together concludes the proof. The following lemma presents some useful properties of H and Strategy II. Lemma 3. Conditioning on “goodness” of the file placement and assuming K = n, M = nα and r = nβ with α + 2β ≥ 1 + 2 log log n/ log n, we have  2 2 (a) W.h.p. H is almost ∆-regular with ∆ = Θ MKr . (b) For each request, Strategy II samples an edge of H (two servers) with probability O(1/e(H)). Proof. Consider an arbitrary node u with s distinct files. Then by definition of H, for every node v we have  M K −s ps := Pr [t(u, v) ≥ 1|t(u) = s] = 1 − K sM = (1 + o(1)), K 10 where 1 ≤ s ≤ M . On the other hand u and v are connected in H, if in addition we have dG (u, v) ≤ 2r. Therefore for every given node u with s distinct cached files, d(u) in H (degree of u in H) has a binomial distribution Bin(b2r (u), ps ), where b2r (u) = |B2r (u)|. Hence applying a Chernoff bound implies that with probability 1 − n−ω(1) , we have d(u) = sM b2r (u) (1 + o(1)). K Conditioning on the goodness of file placement, s = t(u) = Θ(M ). Also by symmetry of torus, we have b2r (u) = Θ(r2 ), for every u. So, with high probability for every u, we have  d(u) = Θ M 2 r2 /K , where this concludes the proof of part (a). Now it remains to show that Strategy II picks an edge of H, with probability O(1/e(H)). First, notice that  e(H) = Θ nM 2 r2 /K = Θ(M 2 r2 ), (16) as K = n. Then recall that each file is cached in every node with probability p = 1 − (1 − 1/K)M = M/K(1 + o(1)), independently. For any given node u and file Wj , let Fj (u) be the number of nodes at distance at most r that have cached file Wj . Then Fj (u) has a binomial distribution Bin(br (u), p), where br (u) = |Br (u)|. So E [Fj (u)] = br (u) · p = Θ(r2 M/K), where br (u) = Θ(r2 ) for every u. Since α + 2β ≥ 1 + 2 log log n/ log n, we have E [Fj (u)] = ω(log n), for every u and j. Now, applying a Chernoff bound for Fj (u) implies that with probability 1 − n−ω(1) , Fj (u) concentrates around its mean and hence, w.h.p., we have for every u and j Fj (u) = Θ(r2 M/K) = Θ(r2 M/n). Consider an edge (u, v) ∈ E(H), with t(u, v) = t. Define Su,v to be the set of nodes that may pick pair u and v randomly in Strategy II. It is not hard to see that |Su,v | = O(r2 ). Now we have, Pr [(u, v) ∈ E(H) is picked by Strategy II|t(u, v) = t] X 1 X 1 1 =  K n Fj (w) j∈T (u,v) 1 = 2 n = 1 n2 X w∈Su,v X 2 1 Fj (w) 2  j∈T (u,v) w∈Su,v X X Θ(n2 /r4 M 2 ). (17) j∈T (u,v) w∈Su,v Conditioned on “goodness,” we have for every (u, v) ∈ E(H), 1 ≤ t(u, v) < µ. So (17) can be simplified as Pr [(u, v) ∈ E(H) is picked by Strategy II] ≤ Θ(µ|Su,v |/r4 M 2 ) = O(1/r2 M 2 ) = O(1/e(H)), where the last equality follows from (16). Proof of Theorem 4. Applying Lemma 3 shows that w.h.p. the configuration graph H is an almost ∆-regular graph where ∆ = M 2 r2 /n. Moreover, in each step, every edge of H is chosen randomly with probability O(1/e(H)). Hence, we can apply Theorem 5 and conclude that w.h.p. the maximum load is at most   log n = Θ(log log n) + O(1), Θ(log log n) + O log(∆/ log4 n) where it follows because α + 2β ≥ 1 + 2 log log n/ log n and hence ∆ = M 2 r2 /n = n2α+2β−1 > nα . Now let us present our next result regarding to the M = K regime. Theorem 6. Suppose M = K and Uniform distribution P over the file library. Then Strategy II achieves the maximum load L = Θ (log log n) and communication cost C = Θ nβ for any β = Ω(log log n/ log n). Proof. Let us choose r = nβ , for some β = Ω(log log n/ log n). By the assumption M = K, the configuration graph H (corresponding to r) is a graph in which two nodes u and v are connected if and only if d(u, v) ≤ 2r. Since our network is symmetric, for every u, |Br (u)| = Θ(r2 ) and hence H is a regular graph with ∆ = Θ(r2 ). Also it is not hard to see that Strategy II is equivalent to choosing an edge uniformly from H. Applying Theorem 5 ([28]) to H results in the maximum load of Θ(log log(n)). In addition, choosing two random nodes in |Br (u)| = Θ(r2 ) results in communication cost of C = Θ(r) = Θ nβ . The main point of Theorem 6 is that we should just endure C = Θ nβ , for β = Ω(log log n/ log n), to benefit from the luxury of power of two choices, which is a very encouraging result. V. S IMULATIONS In this section, we demonstrate the simulation results for two strategies introduced in the previous sections, namely, nearest replica and proximity aware two choices strategies. Our simulations are implemented in Python where the code is available online at [35]. Figure 4 shows the maximum load of Strategy I as a function of the number of servers where different curves correspond to different cache sizes. The network graph is a torus, where 100 files with Uniform popularity are placed uniformly at random in each node. Each point is an average of 10000 simulation runs. This figure is in agreement with the logarithmic growth of the maximum load, asymptotically proved in Section III, even for the intermediate values of n ≈ 100, . . . , 3000, which makes the results of Section III more general. Comparing different curves reveals the fact that in larger cache size setting, we have a more balanced network. That happens because enlarging cache sizes results in a more uniform Voronoi tessellation, i.e., having cells with smaller variation in size. Furthermore, Figure 5 shows the communication cost of Strategy I as a function of cache size where different curves 8 9 7.5 8 7 7 Maximum load maximum load 11 6.5 6 5.5 Cache size = 1 Cache size = 2 5 4 0 500 1000 1500 2000 2500 5 4 3 Cache size = 10 Cache size = 100 4.5 Strat. I, cache size = 1 Strat. II, cache size = 1 Strat. II, cache size = 2 Strat. II, cache size = 10 6 2 3000 3500 # of servers 1 0 1000 2000 3000 4000 5000 6000 # of servers Fig. 4: The maximum load versus number of servers for Strategy I. Here, the network topology is a torus, the file popularity is Uniform, and we have K = 100. average cost (# of hops) 25 Library size = 100 Library size = 1000 Library size = 2000 20 15 10 5 0 0 10 20 30 40 50 60 70 80 90 100 Cache size (# of files) Fig. 5: The communication cost versus cache size for Strategy I. Here, the network topology is a torus of size 2025 and the file popularity is Uniform. correspond to different library sizes. Here, the network graph is a torus of size 2025 and each point is an average of 10000 simulation runs. This figure is in agreement with the result of Theorem 3. In order to simulate Strategy II, first we set r = ∞ to study the effect of cache size on the maximum load and 11 Cache size = 1 Cache size = 2 Cache size = 10 Cache size = 100 10 maximum load 9 8 7 6 5 4 3 0 2 4 6 # of servers 8 10 12 4 x 10 Fig. 6: The maximum load versus number of servers for Strategy II. Here, the network topology is torus, the file popularity is Uniform, and the library size is K = 2000. Moreover, we assume r = ∞. Fig. 7: The maximum load versus number of servers for Strategies I and II. Here, the network topology is torus, the file popularity is Uniform, and the library size is K = 100. Moreover, we assume r = ∞. communication cost, and then consider the effect of limited r on the performance of the system. Figure 6 shows the maximum load of the network versus number of servers where each curve demonstrates a different cache size. The network graph is a torus, where 2000 files with Uniform popularity are placed uniformly at random in each node. Each point is an average of 800 simulation runs. In each curve, since cache size and number of files are fixed, increasing the number of servers translates to increasing each file replication. Figure 6 demonstrates the system performance for large system sizes, i.e., n ≈ 104 , . . . , 105 . However, to get a better understanding of network behavior, let us compare the load balancing performance of Strategies I and II in Figure 7 where the file library size is K = 100 and n ≈ 103 . In Figure 7, when the file replication is low, due to high correlation between the two choices of Strategy II, power of two choices is not expected. This is reflected in Figure 7; for example in the curve corresponding to M = 1 for n ≤ 400 we have a fast growth in maximum load which mimics the load balancing performance of Strategy I. We see the same trend for the curve corresponding to M = 2 for n ≤ 200. However, assuming M ≥ 2, for n > 1000, since there is enough file replication in the network, the load balancing performance is greatly improved due to the power of two choices. This is in accordance with the lessons learned from Section IV. Also, in between, we have a transition region where a mixed behavior is observed. Observations made above from Figure 7 have an important practical implication. Since employing Strategy II is only beneficial in networks with high file replication, for other situations with limited cache size, the less sophisticated Strategy I is a more proper choice. Figure 8 draws the communication cost versus number of servers for various cache sizes for similar setting used in Figure 6. Since in this figure there is no constraint on√the proximity, the communication cost growth is of order Θ( n). In simulations presented so far, we only considered the case r = ∞. In order to investigate the effect of parameter r on the performance of the system, in Figure 9, we have simulated network operation for different values of r. This results in a 12 8 100 90 7 average cost (# of hops) 80 Maximum load 70 60 50 40 Cache size = 1 Cache size = 2 Cache size = 10 Cache size = 100 30 20 10 0 2 4 6 8 10 5 4 3 12 # of servers Strat. I, Zipf (gamma=0.0) Strat. II, Zipf (gamma=0.0) Strat. I, Zipf (gamma=1.0) Strat. II, Zipf (gamma=1.0) Strat. I, Zipf (gamma=1.5) Strat. II, Zipf (gamma=1.5) 6 2 4 x 10 0 1000 2000 3000 4000 5000 6000 # of servers Fig. 8: The communication cost versus number of servers for Strategy II. Here, the settings are similar to that of Figure 6. 9 Cache size = 1 Cache size = 2 Cache size = 5 Cache size = 10 Cache size = 20 Cache size = 50 Cache size = 200 7 16 6 14 5 12 4 3 0 2 4 6 8 10 12 14 16 18 20 average cost (# of hops) Fig. 9: The trade-off between the maximum load and communication cost for Strategy II. Here, the network topology is a torus of size 2025, the file popularity is Uniform, and the library size is K = 500. trade-off between the maximum load and communication cost, as shown in Figure 9. Here we consider a torus with 2025 servers, where 500 files with Uniform popularity are placed uniformly at random in each node. Each point is an average of 5000 simulation runs. In this figure, like before (i.e., Figure 7), we observe two performance regimes based on the file replication in the network. In high memory regime, e.g., for curves corresponding to M = 50 and M = 200, we can achieve the power of two choices by sacrificing a negligible communication cost. On the other hand, in low memory regime, i.e., M = 1, we cannot decrease the maximum load even at the expense of high communication cost values. For intermediate values of M , we clearly observe the trade-off between the maximum load and communication cost. All above simulations investigated the performance for networks with torus topology and Uniform file popularity distribution, being in agreement with our theoretical results’ indications. However, one may ask how sensitive are our findings to the network topology and file popularity choices. Thus, in the following, we examine network performance for Zipf file popularity profile and more practical network topologies, namely, random geometric graph (RGG) and power law random graph model [36]. Maximum load maximum load 8 Fig. 10: The maximum load versus number of servers for Strategies I and II. Here, the network topology is torus, the file popularity is Zipf, the library size is K = 64, and the cache size is M = 2. Moreover, we assume r = ∞. Each point is an average over 1000 independent simulation runs. Strat. I, Zipf (gamma=0.0) Strat. II, Zipf (gamma=0.0) Strat. I, Zipf (gamma=1.0) Strat. II, Zipf (gamma=1.0) Strat. I, Zipf (gamma=1.5) Strat. II, Zipf (gamma=1.5) 10 8 6 4 2 0 1000 2000 3000 4000 5000 6000 # of servers Fig. 11: The maximum load versus number of servers for Strategies I and II. Here, the network topology is RGG. The remaining settings are similar to that of Figure 10. Figures 10, 11, and 12, show the maximum load versus the number of servers for different network topologies (namely, torus, RGG, and power law model) and Zipf distribution with parameter4 γ ∈ {0, 1, 1.5}. Also Figures 13, 14, and 15, demonstrate the performance trade-off between maximum load and communication cost for different network topologies (namely, torus, random RGG, and power law model) and Zipf distribution with parameter γ ∈ {0, 1, 1.5, 2}. All these simulations show that the trends and the trade-off we found in our theoretical results are also valid for more practical network settings. For convenience, a summary of simulation parameters are stated in Table I. VI. D ISCUSSION AND C ONCLUDING R EMARKS In this section, we first discuss three important practical issues related to our proposed scheme, then we will conclude the paper. 4 Note that the Zipf distribution with γ = 0 corresponds to the Uniform distribution. 13 16 90 Maximum load 70 60 50 maximum load (# of requests) Strat. I, Zipf (gamma=0.0) Strat. II, Zipf (gamma=0.0) Strat. I, Zipf (gamma=1.0) Strat. II, Zipf (gamma=1.0) Strat. I, Zipf (gamma=1.5) Strat. II, Zipf (gamma=1.5) 80 40 30 20 Gamma = 0.0 Gamma = 1.0 Gamma = 1.5 Gamma = 2.0 14 12 10 8 6 4 10 2 0 0 0 1000 2000 3000 4000 5000 6000 Fig. 12: The maximum load versus number of servers for Strategies I and II. Here, the network topology is power law random graph. The remaining settings are similar to that of Figure 10. maximum load (# of requests) Gamma = 0.0 Gamma = 1.0 Gamma = 1.5 Gamma = 2.0 5.5 5 4.5 4 3.5 3 0 2 4 6 8 10 12 14 average cost (# of hops) Fig. 13: The trade-off between the maximum load and communication cost for Strategy II. Here, the network topology is a torus of size 2025, the file popularity is Zipf, the library size is K = 500, and the cache size is M = 10. Each point is an average over 5000 independent simulation runs. maximum load (# of requests) 5.5 Gamma = 0.0 Gamma = 1.0 Gamma = 1.5 Gamma = 2.0 5 4.5 4 3.5 3 0 1 2 3 4 5 6 average cost (# of hops) Fig. 14: The trade-off between the maximum load and communication cost for Strategy II. Here, the network topology is a RGG of size 2025. The remaining settings are similar to that of Figure 13. 2 3 4 5 6 7 Fig. 15: The trade-off between the maximum load and communication cost for Strategy II. Here, the network topology is a power law random graph of size 2025. The remaining settings are similar to that of Figure 13. Fig. Number 4, 5 6, 8 7 9 10 11 12 13 14 15 6 1 average cost (# of hops) # of servers Net. Topology Torus Torus Torus Torus Torus RGG Power Law Torus RGG Power Law Strategy Strategy I Strategy II (r = ∞) Strategy I, II (r = ∞) Strategy II (r varying) Strategy I, II (r = ∞) Strategy I, II (r = ∞) Strategy I, II (r = ∞) Strategy II (r varying) Strategy II (r varying) Strategy II (r varying) Popularity Uniform Uniform Uniform Uniform Zipf Zipf Zipf Zipf Zipf Zipf TABLE I: Summary of the simulation parameters for each figure. Our theoretical results in Sections III and IV are stated for a 2D-Grid topology. The main reason for assuming this rather unrealistic topology is developing the main idea of the paper clearly. However, it should be noticed that our approach can be extended to more general graph models at the expense of lengthy proofs and calculations. For example, as mentioned in Section IV, |Br (u)| is the size of the ball of radius r around node u. The main feature of the 2D-Grid which affects our results is that |Br (u)| = Θ(r2 ) for all u. Now suppose that, instead of assuming a 2D-Grid, we consider a graph in which |Br (u)| = Θ(rdim ), w.h.p. Then the parameter dim will appear in our results instead of dim = 2 in the special case of 2D-Grid. For example, the term α + 2β in the statement of Theorem 4 would be generalized to α + dim × β. More generally, even for |Br (u)| = Θ(f (r)), our basic technicalities can be extended too. However, in this paper we investigate other network topologies, such as Random Geometric Graphs and Scale-Free (power law) networks via extensive simulations in Section V. As we have discussed it there, the main trends are also valid for these topologies as well. Thus, our findings cover a wider class of graph models which are more similar to real-world CDN network topologies. The proposed proximity-aware two choices scheme can be implemented in a distributed manner. To see why, notice 14 that upon arrival of each request at each server, this strategy needs two kinds of information to redirect the request. This information can be provided to the requesting server without the need for a centralized authority in the following way. The first one is the cache content of other users in its neighborhood with radius r. Since, the cache content dynamic of servers is much slower than the requests arrival, this can be done by periodic polling of nearby servers without introducing much overhead (also see Distributed Hash Table (DHT) schemes, e.g., [37] and [38]). The second type of information is the queue length information of two randomly chosen nodes inside its neighborhood with radius r, which can also be efficiently done in a distributed manner by polling or piggybacking. In practice, request arrivals and servers’ operation happen in continuous time which needs a queuing theory based performance analysis. However, as shown in [7] and [39], the behaviour of load balancing schemes in continuous time (i.e., known as the supermarket model) and static balls and bins problems are closely related. Thus, we conjecture that our proposed scheme will also have the same performance in the queuing theory based model. We postpone a rigorous analysis of such scenario to future work. In summary, in this work, we have considered the problem of randomized load balancing and its tension with communication cost and memory resources in cache networks. By proposing two request assignment schemes, this trade-off has been investigated analytically. Moreover, extensive simulation results support our theoretical findings and provide practical design guidelines. ACKNOWLEDGMENT The authors would like to thank Seyed Abolfazl Motahari, Omid Etesami, Thomas Sauerwald and Farzad Parvaresh for helpful discussions and feedback. R EFERENCES [1] M. Jafari Siavoshani, A. Pourmiri, and S. P. Shariatpanahi, “Proximityaware balanced allocations in cache networks,” in IEEE International Parallel & Distributed Processing Symposium (IPDPS), 2017. [2] Cisco, “Cisco visual networking index: global mobile data traffic forecast update, 20132018,” White Paper, 2014. [3] G. Zhang, Y. Li, and T. Lin, “Caching in information centric networking: A survey,” Computer Network, vol. 57, pp. 3128–3141, 2013. [4] E. Nygren, R. K. Sitaraman, and J. Sun, “The akamai network: a platform for high-performance internet applications,” Operating Systems Review, vol. 44, no. 3, pp. 2–19, 2010. [5] N. Golrezaei, K. Shanmugam, A. G. Dimakis, A. F. Molisch, and G. Caire, “Femtocaching: Wireless video content delivery through distributed caching helpers,” in INFOCOM, 2012 Proceedings IEEE, March 2012, pp. 1107–1115. [6] Y. Azar, A. Z. Broder, A. R. Karlin, and E. Upfal, “Balanced allocations,” SIAM J. Comput., vol. 29, no. 1, pp. 180–200, 1999. [7] M. Mitzenmacher, “The power of two choices in randomized load balancing,” IEEE Trans. Parallel Distrib. Syst., vol. 12, no. 10, pp. 1094– 1104, 2001. [8] M. Adler, S. Chakrabarti, M. Mitzenmacher, and L. E. Rasmussen, “Parallel randomized load balancing,” Random Struct. Algorithms, vol. 13, no. 2, pp. 159–188, 1998. [9] C. Lenzen and R. Wattenhofer, “Tight bounds for parallel randomized load balancing,” Distributed Computing, vol. 29, no. 2, pp. 127–142, 2016. [10] P. Berenbrink, A. Czumaj, A. Steger, and B. Vöcking, “Balanced allocations: The heavily loaded case,” SIAM J. Comput., vol. 35, no. 6, pp. 1350–1385, 2006. [11] G. Peng, “CDN: content distribution network,” CoRR, vol. cs.NI/0411069, 2004. [Online]. Available: http://arxiv.org/abs/cs.NI/ 0411069 [12] M. Roussopoulos and M. Baker, “Practical load balancing for content requests in peer-to-peer networks,” Distributed Computing, vol. 18, no. 6, pp. 421–434, 2006. [Online]. Available: http: //dx.doi.org/10.1007/s00446-005-0150-7 [13] M. Leconte, M. Lelarge, and L. Massoulié, “Bipartite graph structures for efficient balancing of heterogeneous loads,” in ACM SIGMETRICS/PERFORMANCE Joint International Conference on Measurement and Modeling of Computer Systems, SIGMETRICS ’12, London, United Kingdom, June 11-15, 2012, 2012, pp. 41–52. [14] S. Manfredi, F. Oliviero, and S. P. Romano, “A distributed control law for load balancing in content delivery networks,” IEEE/ACM Trans. Netw., vol. 21, no. 1, pp. 55–68, 2013. [15] F. Xia, A. M. Ahmed, L. T. Yang, and Z. Luo, “Community-based event dissemination with optimal load balancing,” IEEE Trans. Computers, vol. 64, no. 7, pp. 1857–1869, 2015. [16] C. Chen, Y. Ling, M. Pang, W. Chen, S. Cai, Y. Suwa, and O. Altintas, “Scalable request routing with next-neighbor load sharing in multiserver environments,” in 19th International Conference on Advanced Information Networking and Applications (AINA 2005), 28-30 March 2005, Taipei, Taiwan, 2005, pp. 441–446. [17] Y. Xia, A. Dobra, and S. C. Han, “Multiple-choice random network for server load balancing,” in INFOCOM 2007. 26th IEEE International Conference on Computer Communications, Joint Conference of the IEEE Computer and Communications Societies, 6-12 May 2007, Anchorage, Alaska, USA, 2007, pp. 1982–1990. [18] A. Meyerson, K. Munagala, and S. Plotkin, “Web caching using access statistics,” in Proceedings of the Twelfth Annual ACM-SIAM Symposium on Discrete Algorithms, ser. SODA ’01, 2001, pp. 354–363. [19] S. Borst, V. Gupta, and A. Walid, “Distributed caching algorithms for content distribution networks,” in 2010 Proceedings IEEE INFOCOM, March 2010, pp. 1–9. [20] M. A. Maddah-Ali and U. Niesen, “Fundamental limits of caching,” IEEE Trans. Information Theory, vol. 60, no. 5, pp. 2856–2867, 2014. [21] S. Gitzenis, G. S. Paschos, and L. Tassiulas, “Asymptotic laws for joint content replication and delivery in wireless networks,” IEEE Transactions on Information Theory, vol. 59, no. 5, pp. 2760–2776, May 2013. [22] V. Shah and G. de Veciana, “High-performance centralized content delivery infrastructure: Models and asymptotics,” IEEE/ACM Trans. Netw., vol. 23, no. 5, pp. 1674–1687, 2015. [23] C. Liu, R. K. Sitaraman, and D. Towsley, “Go-with-the-winner: Performance based client-side server selection,” in 2016 IFIP Networking Conference, Networking 2016 and Workshops, Vienna, Austria, May 1719, 2016, 2016, pp. 404–412. [24] A.-M. K. Pathan, C. Vecchiola, and R. Buyya, “Load and proximity aware request-redirection for dynamic load distribution in peering cdns,” in On the Move to Meaningful Internet Systems: OTM 2008, OTM 2008 Confederated International Conferences, CoopIS, DOA, GADA, IS, and ODBASE 2008, Monterrey, Mexico, November 9-14, 2008, Proceedings, Part I, 2008, pp. 62–81. [25] J. Tang, W.-P. Tay, and Y. Wen, “Dynamic request redirection and elastic service scaling in cloud-centric media networks,” IEEE Trans. Multimedia, vol. 16, no. 5, pp. 1434–1445, 2014. [26] R. Stanojevic and R. Shorten, “Load balancing vs. distributed rate limiting: An unifying framework for cloud control,” in Proceedings of IEEE International Conference on Communications, ICC 2009, Dresden, Germany, 14-18 June 2009, 2009, pp. 1–6. [27] P. Berenbrink, A. Brinkmann, T. Friedetzky, and L. Nagel, “Balls into bins with related random choices,” J. Parallel Distrib. Comput., vol. 72, no. 2, pp. 246–253, 2012. [28] K. Kenthapadi and R. Panigrahy, “Balanced allocation on graphs,” in Proc. 17th Symp. Discrete Algorithms (SODA), 2006, pp. 434–443. [29] B. Godfrey, “Balls and bins with structure: balanced allocations on hypergraphs,” in Proc. 19th Symp. Discrete Algorithms (SODA), 2008, pp. 511–517. [30] A. Pourmiri, “Balanced allocation on graphs: A random walk approach,” in Computing and Combinatorics - 22nd International Conference, COCOON 2016, Ho Chi Minh City, Vietnam, August 2-4, 2016, Proceedings, 2016, pp. 330–341. [31] L. Breslau, P. Cao, L. Fan, G. Phillips, and S. Shenker, “Web caching and zipf-like distributions: evidence and implications,” in INFOCOM ’99. Eighteenth Annual Joint Conference of the IEEE Computer and Communications Societies. Proceedings. IEEE, vol. 1, Mar 1999, pp. 126–134 vol.1. 15 [32] M. Cha, H. Kwak, P. Rodriguez, Y.-Y. Ahn, and S. Moon, “I tube, you tube, everybody tubes: Analyzing the world’s largest user generated content video system,” in Proceedings of the 7th ACM SIGCOMM Conference on Internet Measurement, ser. IMC ’07. New York, NY, USA: ACM, 2007, pp. 1–14. [33] L. Devroye, “The expected length of the longest probe sequence for bucket searching when the distribution is not uniform,” J. Algorithms, vol. 6, no. 1, pp. 1–9, 1985. [34] M. Ji, A. M. Tulino, J. Llorca, and G. Caire, “Order-optimal rate of caching and coded multicasting with random demands,” CoRR, vol. abs/1502.03124, 2015. [Online]. Available: http://arxiv.org/abs/1502. 03124 [35] [Online]. Available: https://github.com/mahdijafaris/Balls and Bins [36] R. Albert and A.-L. Barabási, “Statistical mechanics of complex networks,” Reviews of modern physics, vol. 74, no. 1, p. 47, 2002. [37] D. Bauer, P. Hurley, and M. Waldvogel, “Replica placement and location using distributed hash tables,” in 32nd Annual IEEE Conference on Local Computer Networks (LCN 2007), 15-18 October 2007, Clontarf Castle, Dublin, Ireland, Proceedings, 2007, pp. 315–324. [38] D. R. Karger, E. Lehman, F. T. Leighton, R. Panigrahy, M. S. Levine, and D. Lewin, “Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the world wide web,” in Proceedings of the Twenty-Ninth Annual ACM Symposium on the Theory of Computing, El Paso, Texas, USA, May 4-6, 1997, 1997, pp. 654–663. [39] M. Mitzenmacher, A. W. Richa, and R. Sitaraman, “The power of two random choices: A survey of technique and results,” In Handbook of Randomized Computation Volume 1, pp. 255–312, 2001. [40] D. P. Dubhashi and A. Panconesi, Concentration of Measure for the Analysis of Randomized Algorithms. Cambridge University Press, 2009. [41] A. Auger and B. Doerr, Theory of Randomized Search Heuristics: Foundations and Recent Developments. River Edge, NJ, USA: World Scientific Publishing Co., Inc., 2011. A PPENDIX A S OME TAIL B OUNDS Theorem 7 (Chernoff Bounds). Suppose that X1 , X2 , . . . , X ∈ {0, 1} are independent random variables Pnn and let X = i=1 Xi . Then for every δ ∈ (0, 1) the following inequalities hold: Pr [X ≥ (1 + δ) E [X]] ≤ exp(−δ 2 E [X] /2), Pr [X ≤ (1 − δ) E [X]] ≤ exp(−δ 2 E [X] /3). In particular, Pr [|X − E [X] | ≥ δ E [X]] ≤ 2 exp(−δ 2 E [X] /3). For a proof see [40]. To deal with moderate independency we can state the following lemma. Lemma 4 (Deviation bounds for moderate independency, see [41, Lemma 1.18]). Let X1 , . . . , Xn be arbitrary binary random variables. Let X1∗ , X2∗ , . . . , Xn∗ be binary random variables that are mutually independent and such that for all i, Xi is independent of X1 , . . . , Xi−1 . Assume that for all i and all x1 , . . . , xi−1 ∈ {0, 1}, Pr [Xi = 1|X1 = x1 , . . . , Xi−1 = xi−1 ] ≥ Pr [Xi∗ = 1] . Then for all k ≥ 0, we have " n # " n # X X ∗ Pr Xi ≤ k ≤ Pr Xi ≤ k i=1 i=1 and the latter term can be bounded by any deviation bound for independent random variables.
7cs.IT
Workshop track - ICLR 2017 E XPLORING LOSS FUNCTION TOPOLOGY WITH CYCLICAL LEARNING RATES Leslie N. Smith U.S. Naval Research Laboratory, Code 5514 4555 Overlook Ave., SW., Washington, D.C. 20375 arXiv:1702.04283v1 [cs.LG] 14 Feb 2017 [email protected] Nicholay Topin University of Maryland, Baltimore County Baltimore, MD 21250 [email protected] A BSTRACT We present observations and discussion of previously unreported phenomena discovered while training residual networks. The goal of this work is to better understand the nature of neural networks through the examination of these new empirical results.1 These behaviors were identified through the application of Cyclical Learning Rates (CLR) and linear network interpolation. Among these behaviors are counterintuitive increases and decreases in training loss and instances of rapid training. For example, we demonstrate how CLR can produce greater testing accuracy than traditional training despite using large learning rates. 1 I NTRODUCTION A core branch of physical sciences over the centuries has been the development of tools to experimentally probe invisible aspects of nature. Revolutionary discoveries, such as the structure of atoms and DNA, would not have been possible without clues from previous experimental evidence. Currently, most deep learning experimental results are reported in a limited number of standard ways. When using convolutional neural networks (CNNs) for classification, authors generally report the top-k accuracy or error/loss on held out test or validation samples after training the network. Optionally, a plot of these values over the course of training is provided. Though it is certainly important to report these results because they are a measure of success, we argue that it is valuable to take a new perspective: to investigate and report additional behaviors during training. (a) Test accuracy during standard training for three different initial learning rates. (b) Test accuracy for learning rate range =0.001 - 1 for ResNet-52, ResNet-56, and ResNet-60. Figure 1: Test accuracies for ResNet-56 on Cifar-10 While running experiments on Cifar-10 with a ResNet-56 architecture using Caffe (?) we noticed some unusual behavior and decided to investigate it. Experiments with various learning rates (LR) illustrate this unusual behavior, which can be seen in Figure 1a. When using an initial LR of 0.14 (the yellow curve in Figure 1a), the test accuracy climbs, then dips, and then continues to increase, which is unlike the curves for LR = 0.24 or 0.35. This strange phenomena caused us to look at the data in new ways and discover additional surprising results. The learning rate (LR) range test and cyclical learning rates (CLR) are described in (Smith, 2015) and (Smith, 2017). In a LR range test, training starts with a very small learning rate which is 1 Files to replicate these results are available at https://github.com/lnsmith54/exploring-loss 1 Workshop track - ICLR 2017 then linearly increased throughout training. This provides information on how well the network converges over a range of learning rates. By starting with a small LR, the network starts converging, and as the LR rate becomes too large, it causes the training/test accuracies to decrease and the losses to increase. To investigate this dip in accuracy with certain learning rates, our first step was to run a learning rate range test (see Figure 1b), which displays two noteworthy features. First is the dip in accuracy around LR=0.1. Second is the consistently high test accuracy over a large span of learning rates (LR = 0.25 to 1.0), which is unusual. (b) Super-convergence with CLR = 0.1 - 1.0 (stepsize=10k) versus standard training with initial LR=0.35. (a) Cyclical learning rate between LR=0.1 and LR=0.35 with stepsize=10K. Figure 2: Test accuracies for ResNet-56 on Cifar-10. Note the log scale used for the vertical axis. 2 S UPER - CONVERGENCE Our next step was to try cyclical learning rates with a triangular policy for a number of cycles with the LR between 0.1 and 0.35. A triangular policy is a learning rate schedule that repeatedly linearly increases then decreases the learning rate between specified bounds (i.e., a minimum and maximum learning rate). A cycle consists of two steps and the stepsize is the number of iterations over which the learning rate transitions from the minimum to the maximum value or vice versa. Several counterintuitive results appear in Figure 2a, which shows the test accuracy, test loss, and training loss for CLR with a stepsize of 10,000 iterations. This Figure shows an anomaly that occurs as the LR increases from 0.1 to 0.35. The training loss increases sharply by four orders of magnitude at a learning rate of approximately 0.255 (note the log scale used for the vertical axis) but training convergence resumes at larger learning rates. In addition, there are divergent behaviors between test accuracy and loss curves that are not easily explained. In the first cycle, when the learning rate is increasing from 0.13 to 0.18, the test loss increases but the test accuracy is also increasing. This simultaneous increase in both the test loss and test accuracy also occurs in the second cycle as the learning rate decreases from 0.35 to 0.1 and in various portions of subsequent cycles. Another surprising result can be seen in Figure 2b. The red curve in this figure shows a run with a triangular policy and a stepsize of 10,000 iterations (LR is between 0.1 and 1.0, as indicated at the top of the figure). The red curve shows rapid training of the network with a final test accuracy of 93% in only one cycle of 20,000 iterations. For comparison, the blue curve shows a typical training process with an initial learning rate of 0.35, which drops by a factor of 10 at iterations 50,000, 75,000, and 85,000, and the final test accuracy is only 91%. We coin the term “super-convergence” to refer to this phenomenon where a network is trained to a better final test accuracy compared to traditional training, but with fewer iterations and a much larger learning rate. 3 N ETWORK I NTERPOLATION On the basis of our findings described above, we believe it is reasonable to wonder if the solutions at each of the five peaks in Figure 2b are just the same minimum being rediscovered. We adopted the method of Goodfellow et al. (2014) and Im et al. (2016) to compare the solutions obtained at the end of each learning rate cycle (i.e., at iterations 20, 000, 40, 000, ...). Briefly, a series of network 2 Workshop track - ICLR 2017 configurations were created by performing an element-wise linear interpolation between a pair of solution weights (i.e., netnew = α ∗ net1 + (1 − α) ∗ net2 , for a range of α values). If the pair of solutions represent the same minimum, interpolation should show a single concave shape, as seen in Figure 3a, which is the result of interpolating between states found during a regular training process. If there is a “peak” in loss between the two solutions, as seen in Figure 3b, then the two minima are different solutions. We found that the solution at the end of each cycle is distinct, which is in line with the results reported in (Im et al., 2016), where the authors show that different initializations lead to different solutions. Since the network is initialized differently at the beginning of each cycle, it is intuitive that each cycle produces a different solution. (a) Training and test loss for interpolations between two network states from regular ResNet training after 10,000 and 25,000 iterations. (b) Training and test loss for interpolations between two CLR “solutions” - after 40,000 and 60,000 iterations, as seen in Figure 2b. Figure 3: Results of network interpolation for differently trained networks. The shape seen in Figure 3b reveals an additional noteworthy feature: some amount of regularization is possible through interpolating between two solutions. The minima for training loss are at α = 0.0 and 1.0, as expected, but the test loss minima are slightly offset, towards the center. This was consistent for all interpolations between minima found by CLR. We are still investigating the causes of this phenomenon but it implies that interpolating between two such minima can improve performance and this might be useful for regularization. Another relevant feature shown in Figure 3a is that the training and test loss minimum were consistently close to the center. This is in line with the results shown in Goodfellow et al. (2014) (Figures 1 and 2), though the authors do not discuss this not its potential to improve test accuracy. This behavior leads us to believe that interpolation of weights at different iterations could be used to improve the quality of solutions found during regular training, in addition to those solutions found by CLR. 4 C ONCLUSION This paper shows new phenomena obtained with ResNet-56 on Cifar-10 while using cyclical learning rates and the learning rate range test. We believe that the underlying reasons for these observed patterns are a reflection of the loss function topology and that a continuously changing learning rate provides information about this topology. Furthermore, we believe that this loss function topology information will lead to insights in training neural networks and we are actively searching for a collaborator to help us produce a theoretical analysis of these phenomena. The results presented here represent just a fraction of the results we have obtained. Similar results are obtained using ResNet-20, ResNet-56, and ResNet-110 on Cifar-10 and Cifar-100. We are cataloging the effect of different solvers, hyper-parameter values, and architectures. Every architecture, hyper-parameter value assignment, and data-set has its own patterns; some of them follow a usual pattern and others follow an unusual/unexpected pattern. In addition, we are investigating if the phenomena of high accuracies over a large range of learning rates (from the LR range test) might provide a measure of an architecture’s robustness during training. While our work has so far been with Caffe, we plan to perform equivalent investigations with other frameworks (e.g., TensorFlow, Torch, MXNet). Furthermore, we are continuing to investigate how interpolation of network weights can be used to improve a network’s performance. The results of these investigations are being compiled into an NRL Technical Report and will be publicly released. 3 Workshop track - ICLR 2017 R EFERENCES Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014. Daniel Jiwoong Im, Michael Tao, and Kristin Branson. An empirical analysis of deep network loss surfaces. arXiv preprint arXiv:1612.04010, 2016. Leslie N. Smith. Cyclical learning rates for training neural networks. arXiv:1506.01186, 2015. arXiv preprint Leslie N. Smith. Cyclical learning rates for training neural networks. In Proceedings of the IEEE Winter Conference on Applied Computer Vision, 2017. 4
9cs.NE
arXiv:cs/0407045v2 [cs.LO] 3 Oct 2004 The First-Order Theory of Sets with Cardinality Constraints is Decidable Viktor Kuncak and Martin Rinard Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02139, USA {vkuncak,rinard}@csail.mit.edu MIT CSAIL Technical Report 958 VK0120, July 2004 Abstract 1 Data structures often use an integer variable to keep track of the number of elements they store. An invariant of such data structure is that the value of the integer variable is equal to the number of elements stored in the data structure. Using a program analysis framework that supports abstraction of data structures as sets, such constraints can be expressed using the language of sets with cardinality constraints. The same language can be used to express preconditions that guarantee the correct use of the data structure interfaces, and to express invariants useful for the analysis of the termination behavior of programs that manipulate objects stored in data structures. In this paper we show the decidability of valid formulas in one such language. Specifically, we examine the first-order theory that combines 1) Boolean algebras of sets of uninterpreted elements and 2) Presburger arithmetic operations. Our language allows relating the cardinalities of sets to the values of integer variables. We use quantifier elimination to show the decidability of the resulting firstorder theory. We thereby disprove a recent conjecture that this theory is undecidable. We describe a basic quantifier-elimination algorithm and its more sophisticated versions. From the analysis of our algorithms we obtain an elementary upper bound on the complexity of the resulting combination. Furthermore, our algorithm yields the decidability of a combination of sets of uninterpreted elements with any decidable extension of Presburger arithmetic. For example, we obtain decidability of monadic second-order logic of n-successors extended with sets of uninterpreted elements and their cardinalities, a result which is in contrast to the undecidability of extensions of monadic-second order logic over strings with equicardinality operator on sets of strings. Program analysis and verification tools can greatly contribute to software reliability, especially when used throughout the software development process. Such tools are even more valuable if their behavior is predictable, if they can be applied to partial programs, and if they allow the developer to communicate the design information in the form of specifications. Combining the basic idea of [21] with decidable logics leads to analysis tools that have these desirable properties, examples include [34, 25, 4, 41, 54, 29, 30]. These analyses are precise (because they represent loop-free code precisely) and predictable (because the checking of verification conditions terminates either with a realizable counterexample or with a sound claim that there are no counterexamples). The key challenge in this approach to program analysis and verification is to identify a logic that captures an interesting class of program properties, but is nevertheless decidable. In [30, 29] we identify the firstorder theory of Boolean algebras as a useful language for languages with dynamically allocated objects: this language allows expressing generalized typestate properties and reasoning about data structures as dynamically changing sets of objects. The results of this paper are motivated by the fact that we often need to reason not only about the data structure content, but also about the size of the data structure. For example, we may want to express the fact that the number of elements stored in a data structure is equal to the value of an integer variable that is used to cache the data structure size, or we may want to introduce a decreasing integer measure on the data structure to show program termination. These considerations lead to a natural generalization of the first-order theory of Boolean algebra of sets, a generalization that allows integer variables in addition to set variables, and allows stating relations of the form |A| = k meaning Version compiled December 26, 2017, 3:46am. Introduction that the cardinality of the set A is equal to the value of the integer variable k. Once we have integer variables, a natural question arises: which relations and operations on integers should we allow? It turns out that, using only the Boolean algebra operations and the cardinality operator, we can already define all operations of Presburger arithmetic. This leads to the structure BAPA, which properly generalizes both Boolean algebras (BA) and Presburger arithmetic (PA). Our paper shows that the first-order theory of structure BAPA is decidable. A special case of BAPA was recently shown decidable in [57], which allows only quantification over elements but not over sets of elements. (Note that quantification over sets of elements subsumes quantification over elements because singleton sets can represent elements.) In fact, [57] identifies the problem of decidability of BAPA and conjectures that it is undecidable. Our result proves this conjecture false by showing that BAPA is decidable. Moreover, we give a translation of BAPA sentences into PA sentences and derive an elementary upper bound on the worst-case complexity of the validity problem for BAPA. Contributions and Overview. We can summarize our paper as follows. complexity of the validity problem for BAPA sentences that is close to the bound on PA sentences themselves (Section 6). 5. We show that PA sentences generated by translating pure BA sentences can be checked for validity in the space optimal for Boolean algebras (Section 6.2). 6. We extend our algorithm to infinite sets and predicates for distinguishing finite and infinite sets (Section 7). 7. We examine the relationship of our results to the monadic second-order logic (MSOL) of strings (Section 8). In contrast to the undecidability of MSOL with equicardinality operator (Section 11.2), we identify a combination of MSOL over trees with BA that is decidable. This result follows from the fact that our algorithm α enables adding BA operations to any extension of Presburger arithmetic, including decidable extensions such as MSOL over strings (Section 8.1). 2 1. We motivate the use of sets with cardinality constraints through an example (Section 2) and show how to reduce the validity of annotated recursive program schemas (which are a form of imperative programs) to the validity of logic formulas (Section 3). Example Figure 1 presents a procedure insert in a language that directly manipulates sets. Such languages can either be directly executed [14, 45] or can be derived from executable programs using an abstraction process [29, 30]. The program in Figure 1 manipulates a global set of objects content and an integer field size. The program maintains an invariant I that the size of the set content is equal to the value of the variable size. The insert procedure inserts an element e into the set and correspondingly updates the integer variable. The requires clause (precondition) of the insert procedure is that the parameter e is a non-null reference to an object that is not stored in the set content. The ensures clause (postcondition) of the procedure is that the size variable after the insertion is positive. Note that we represent references to objects (such as the procedure parameter e) as sets with at most one element. An empty set represents a null reference; a singleton set {o} represents a reference to object o. The value of a variable after procedure execution is indicated by marking the variable name with a prime. In addition to the explicit requires and ensures clauses, the insert procedure maintains an invariant, I, which captures the relationship between the size of the set content and the integer variable size. The invariant I is implicitly conjoined with the requires and the ensures clause of the procedure. The Hoare triple [18, 21] in Figure 2 summarizes the resulting correctness condition for the insert procedure. 2. We show the decidability of Boolean algebras with Presburger arithmetic (BAPA) using quantifier elimination in Section 5.2. This result immediately implies decidability of the verification problem for schemas whose specifications are expressed in BAPA. As a preparation for this result, we review the quantifier elimination technique in Section 4.1 and show its application to the decidability of Boolean algebras (Section 4.2) and Presburger arithmetic (Section 11.1). We also explain why adding the equicardinality operator to Boolean algebras allows defining Presburger arithmetic operations on equivalence classes of sets (Section 5.1). 3. We present an algorithm α (Section 5.4) that translates BAPA sentences into PA sentences by translating set quantifiers into integer quantifiers. This is the central result of this paper and shows a natural connection between Boolean algebras and Presburger arithmetic. 4. We analyze our algorithm α and show that it yields an elementary upper bound on the worst-case 2 var content : set; var size : integer; invariant I ⇐⇒ (size = |content|); procedure insert(e : element) maintains I requires |e| = 1 ∧ |e ∩ content| = 0 ensures size′ > 0 { content := content ∪ e; size := size + 1; } |e| = 1 ∧ |e ∩ content| = 0 ∧ size = |content| n content := content ∪ e; size := size + 1; o size′ > 0 ∧ size′ = |content′ | − s ::= specp ::= schema ::= Figure 4: Schemas Figure 1: An Example Procedure n F first-order formula F | p | s ; s | s ✷ s | var x : T. s procedure p requires prep ensures postp {sbody(p) } (var x : T )∗ (spec)∗ Syntax of First-Order Logic Program the meaning of specifications:: specp = (prep ⇒ postp ) o rules for reducing statements to formulas:: p → specp F1 ; F2 Figure 2: Hoare Triple for insert Procedure → ∃x̄0 .(F1 [x̄′ := x̄0 ] ∧ F2 [x̄ := x̄0 ]) x̄ - variables in pre-state x̄′ - variables in post-state ∀e. ∀content. ∀content ′ . ∀size. ∀size′ . (|e| = 1 ∧ |e ∩ content| = 0 ∧ size = |content| ∧ content′ = content ∪ e ∧ size′ = size + 1) ⇒ size′ > 0 ∧ size′ = |content′ | F1 ✷ F2 → F1 ∨ F2 var x : T. F → ∃x : T. F correctness condition for p:: ∀∗ (Fbody(p) ⇒ specp ) Figure 3: Verification Condition for Figure 2 where Figure 5: Rules that Reduce Procedure Body to a Formula Figure 3 presents a verification condition corresponding to the Hoare triple in Figure 2. Note that the verification condition contains both set and integer variables, contains quantification over these variables, and relates the sizes of sets to the values of integer variables. Our small example leads to a particularly simple formula; in general, formulas that arise in compositional analysis of set programs with integer variables may contain alternations of existential and universal variables over both integers and sets. This paper shows the decidability of such formulas. 3 ∗ sbody(p) → Fbody(p) using rules above a collection of annotated recursive procedures that manipulate global state given by finitely many variables. A recursive program schema is parameterized by a specification language which determines 1) a signature of the specification language, which is some variant of firstorder logic and 2) the interpretation of the language, which is some family of multisorted first-order structures. The interpretations of types of global and local variables correspond to the interpretations of sorts in the multisorted language. We use the term “S-schema” for a schema parameterized by a specification language S. The language S is used to encode all basic statements of the schema and to write requires and ensures clauses. The only control structures in a schema are sequential composition “;”, nondeterministic choice “✷”, and procedure call (denoted using procedure name). For simplicity, procedures in a schema have no parameters; parameter passing can be simulated using assignments to global and local variables. Provided that variables in S range over sufficiently complex data types (such as integers or terms), schemas are a Turing-complete language. Indeed, the first-order logic can encode assignment statement (x := t is repV resented by formula x′ = t ∧ y6≡x y ′ = y), as well First-Order-Logic Program Schemas To formalize the verification of programs with specifications written in first-order logic, we introduce the notion of first-order-logic program schemas (or schemas for short). The schemas motivate the main result of this paper because the decidability of a class of logic formulas implies the decidability of the schema verification problem. The abstraction of programs in generalpurpose languages into verifiable schemas can be used to verify partial correctness of programs, and is a particular instance of abstract interpretation [12]. Program schemas have been studied in the past, with the focus primarily on purely functional schemas [2, 8]. Figure 4 presents the syntax of schemas. A schema is 3 as assume statements (assume F is just F ⇒ skip V where skip is y y ′ = y); nondeterministic choice and assume-statements can encode the if statements; recursion with assume statements can encode while loops. As a consequence of Turing-completeness, the verification of schemas without specifications would be undecidable. Because we are assuming that procedures are annotated, the correctness of our recursive program schema reduces to the validity of a set of formulas in the logic, using standard technique of assume-guarantee reasoning. The idea of this reduction is to replace each call to procedure p with the specification given by requires and ensures clause of p, as in Figure 5. After this replacement, the body of each procedure contains only sequential composition, basic statements, and nondeterministic choice. The remaining rules in Figure 5 then reduce the body of a procedure to a single formula.1 We check the correctness of the procedure by checking that the formula corresponding to the body of the procedure implies the specification of the procedure. We conclude that if the validity of first-order formulas in the language S is decidable, then the verification problem of an S-schema parameterized by those formulas is decidable. By considering different languages S whose first-order theory is decidable, we obtain different verifiable S-schemas. Example languages whose first-order theories are decidable are term algebras and their generalizations [26], Boolean algebras of sets [31] and Presburger arithmetic [37]. In this paper we establish the decidability of the first-order theory BAPA that combines the quantified formulas of Boolean algebras of sets and Presburger arithmetic. Our result therefore implies the verifiability of a new class of schemas, namely BAPA-schemas. Schemas and Boolean programs. For a fixed set of predicates, Boolean programs used in predicate abstraction [4, 3, 20] can be seen as a particular form of schemas where the first-order variables range over finite domains. The assumption about finiteness of the domain has important consequences: in the finite domain case the first-order formulas reduce to quantified Boolean formulas, the schemas are not Turing-complete but reduce to pushdown automata, and procedure specifications are not necessary because finite-state properties can be checked using context-free reachability. In this paper we consider schemas where variables may range over infinite domains, yet the verification problem in the presence of specifications is decidable. The advantage of expressive program schemas is that they are closer to the implementation languages, which makes the abstraction of programs into schemas potentially simpler and more precise. Verification using quantifier-free formulas. Note that the rules in Figure 5 do not introduce quantifier alternations. This means that we obtain verifiable Sschemas even if we restrict S to be a quantifier-free language whose formulas have decidable satisfiability problem. The advantage of using languages whose full first-order theory is decidable is that this approach allows specifications of procedures to use quantifiers to express parameterization (via universal quantifier) and information hiding (via existential quantifier). Moreover, the quantifier elimination technique which we use in this paper shows how to eliminate quantifiers from a formula while preserving its validity. This means that, instead of first applying rules in Figure 5 and then applying quantifier elimination, we may first eliminate all quantifiers from specifications, and then apply rules in Figure 5 yielding a quantifier-free formula. This approach may be more efficient because the decidability of quantifierfree formulas is easier to establish [56, 35, 42, 55, 49]. 4 Overview of Quantifier Elimination For completeness, this section introduces quantifier elimination; quantifier elimination is the central technique used in this paper. After reviewing the basic idea of quantifier elimination in Section 4.1, we explain how to use quantifier elimination to show the decidability of Boolean algebras in Section 4.2. We show the decidability of Presburger arithmetic in Section 11.1. 4.1 Quantifier Elimination According to [22, Page 70, Lemma 2.7.4], to eliminate quantifiers from arbitrary formulas, it suffices to eliminate ∃y from formulas of the form ∃y. ^ ψi (x̄, y) (1) 0≤i<n where x̄ is a tuple of variables and ψi (x̄, y) is a literal whose all variables are among x̄, y. The reason why eliminating formulas of the form (1) suffices is the following. Suppose that the formula is in prenex form and consider the innermost quantifier of a formula. Let φ be the subformula containing the quantifier along with the subformula that is the scope of that quantifier. If φ is of the form ∀x. φ0 we may replace φ with ¬∃x.¬φ0 . Hence, we may assume that φ is of the form ∃x. φ0 . We then transform φ0 into disjunctive normal form and use the fact 1 Note that our formulas encode transition relation as opposed to weakest precondition, so we use ∨ to encode non-deterministic choice and ∀ for uninitialized variables. ∃x. (φ2 ∨ φ3 ) ⇐⇒ (∃x. φ2 ) ∨ (∃x. φ3 ) 4 (2) F ::= A ::= A | F1 ∧ F2 | F1 ∨ F2 | ¬F | ∃x.F | ∀x.F B1 = B2 | B1 ⊆ B2 | |B| = C | |B| ≥ C B ::= x | 0 | 1 | B1 ∪ B2 | B1 ∩ B2 | B c C ::= 0 | 1 | 2 | ... We conclude that elimination of quantifiers from formulas of form (1) suffices to eliminate the innermost quantifier. By repeatedly eliminating innermost quantifiers we can eliminate all quantifiers from a formula. We may also assume that y occurs in every literal ψi , otherwise we would place the literal outside the existential quantifier using the fact ∃y. (A ∧ B) ⇐⇒ (∃y.A) ∧ B for y not occurring in B. To eliminate variables we often use the following identity of theory with equality: (3) The quantifier elimination procedures we present imply the decidability of the underlying theories, because the interpretations of function and relation symbols on some domain A turn out to be effectively computable functions and relations on A. Therefore, the truth-value of every formula without variables is computable. The quantifier elimination procedures we present are all effective. To determine the truth value of a closed formula φ on a given model, it therefore suffices to apply the quantifier elimination procedure to φ, yielding a quantifier free formula ψ, and then evaluate the truth value of ψ. 4.2 ≡ true |b| ≥ k+1 ≡ ∃x. x ⊂ b ∧ |x| ≥ k |b| = k ≡ |b| ≥ k ∧ ¬|b| ≥ k+1 We call a language which contains terms |b| ≥ k and |b| = k the language of Boolean algebras with finite constant cardinality constraints. Figure 6 summarizes the syntax of this language, which we denote BA. Because finite constant cardinality constraints are first-order definable, the language with finite constant cardinality constraints has the same expressive power as the language of Boolean algebras. Removing the restriction that integers are constants is, in fact, what leads to the generalization from Boolean algebras to Boolean algebras with Presburger arithmetic in Section 5, and is the main topic of this paper. Preliminary observations. Every subset relation b1 ⊆ b2 is equivalent to |b1 ∩ bc2 | = 0, and every equality b1 = b2 is equivalent to a conjunction of two subset relations. It is therefore sufficient to consider the firstorder formulas whose only atomic formulas are of the form |b| = k and |b| ≥ k. Furthermore, because k denotes constants, we can eliminate negative literals as follows: Figure 6: Formulas of Boolean Algebra (BA) ∃x.x = t ∧ φ(x) ⇐⇒ φ(t) |b| ≥ 0 ¬|b| = k ⇐⇒ |b| = 0 ∨ · · · ∨ |b| = k−1 ∨ |b| ≥ k+1 ¬|b| ≥ k ⇐⇒ |b| = 0 ∨ · · · ∨ |b| = k−1 (4) Every formula in the language of Boolean algebras can therefore be written in prenex normal form where the matrix (quantifier-free part) of the formula is a disjunction of conjunctions of atomic formulas of the form |b| = k and |b| ≥ k, with no negative literals. If a term b contains at least one operation of arity one or more, we may assume that the constants ∅ and U do not appear in b, because ∅ and U can be simplified away. Furthermore, the expression |∅| denotes the integer zero, so all terms of form |∅| = k or |∅| ≥ k evaluate to true or false. We can therefore simplify every term b so that either 1) b contains no occurrences of constants ∅ and U, or 2) b ≡ U. The following lemma is the main idea behind the quantifier elimination for both BA in this section and BAPA in Section 5. Quantifier Elimination for BA This section presents a quantifier elimination procedure for Boolean algebras of finite sets. We use the symbols for the set operations as the language of Boolean algebras. b1 ∩ b2 , b1 ∪ b2 , bc1 , ∅, U, correspond to set intersection, set union, set complement, empty set, and full set, respectively. We write b1 ⊆ b2 for b1 ∩ b2 = b1 , and b1 ⊂ b2 for the conjunction b1 ⊆ b2 ∧ b1 6= b2 . For every nonnegative integer constant k we introduce formulas of the form |b| ≥ k expressing that the set denoted by b has at least k elements, and formulas of the form |b| = k expressing that the set denoted by b has exactly k elements. In this section, cardinality constraints always relate cardinality of a set to a constant integer. These properties are first-order definable within Boolean algebra itself: Lemma 1 Let b1 , . . . , bn be finite disjoint sets, and l1 , . . . , ln , k1 , . . . , kn be natural numbers. Then the following two statements are equivalent: 1. There exists a finite set y such that n ^ i=1 5 |bi ∩ y| = ki ∧ |bi ∩ y c | = li (5) eliminated form original formula ∃y. . . . |b ∩ y| ≥ k ∧ |b ∩ y c | ≥ l . . . |b| ≥ k + l 2. n ^ ∃y. . . . |b ∩ y| = k ∧ |b ∩ y c | ≥ l . . . |bi | = ki + li (6) Figure 7: Rules for Eliminating Quantifiers from Boolean Algebra Expressions Proof. (⇒) Suppose that there exists a set y satisfying (5). Because bi ∩ y and bi ∩ y c are disjoint, |bi | = |bi ∩ y| + |bi ∩ y c |, so |bi | = ki + li when the conjuncts are |bi ∩ y| = ki ∧ |bi ∩ y c | = li , and |bi | ≥ ki + li if any of the original conjuncts have inequality. (⇐) Suppose that (6) holds. First consider the case of equalities. Suppose that |bi | = ki + li for each of the pairwise disjoint sets b1 , . . . , bn . For each bi choose a subset yi ⊆ bi such that |yi | = ki . Because |bi | = ki + li , we have |bi ∩ yic | = li . Having chosen y1 , . . . , yn , let y = S n c i=1 yi . For i 6= j we have bi ∩yj = ∅ and bi ∩yj = bi , so c c bi ∩ y = yi and bi ∩ y = bi ∩ yi . By the choice of yi , we conclude that y is the desired set for which (5) holds. The case of inequalities is analogous: for example, in the case |bi ∩ y| ≥ ki ∧ |bi ∩ y c | = li , choose yi ⊆ bi such that |yi | = |bi | − li . (u1 ∩ y) ∪ · · · ∪ (up ∩ y)∪ (t1 ∩ y c ) ∪ · · · ∪ (tq ∩ y c ) where u1 , . . . , up ∈ P are pairwise distinct elements from the partition and t1 , . . . , tq ∈ P are pairwise distinct elements from the partition. Because |(u1 ∩ y) ∪ · · · ∪ (up ∩ y) ∪ (t1 ∩ y c ) ∪ · · · ∪ (tq ∩ y c )| = |u1 ∩ y| + · · · + |up ∩ y| + |t1 ∩ y c | + · · · + |tq ∩ y c | a formula of the form |b| = k can be written as _ (|u1 ∩ y| = k1 ∧ · · · ∧ |up ∩ y| = kp ∧ k1 ,...,kp ,l1 ,...,lq |t1 ∩ y c | = l1 ∧ · · · ∧ |tq ∩ y c | = lp ) where the disjunction ranges over nonnegative integers k1 , . . . , kp , l1 , . . . , lq ≥ 0 that satisfy Quantifier elimination for BA. We next describe a quantifier elimination procedure for BA. This procedure motivates our algorithm in Section 5. We first transform the formula into prenex normal form and then repeatedly eliminate the innermost quantifier. As argued in Section 4.1, it suffices to show that we can eliminate an existential quantifier from any existentially quantified conjunction of literals. Consider therefore an arbitrary existentially quantified conjunction of literals ^ |b| = k + l ∃y. . . . |b ∩ y| = k ∧ |b ∩ y | = l . . . Moreover, the statement continues to hold if for any subset of indices i the conjunct |bi ∩ y| = ki is replaced by |bi ∩y| ≥ ki or |bi ∩y c | = li is replaced by |bi ∩y c | ≥ li , provided that |bi | = ki + li is replaced by |bi | ≥ ki + li , as indicated in Figure 7. ∃y. |b| ≥ k + l c ∃y. . . . |b ∩ y| ≥ k ∧ |b ∩ y | = l . . . i=1 |b| ≥ k + l c k1 + · · · + kp + l 1 + · · · + l q = k (7) From (4) it follows that we can perform a similar transformation for formulas of form |b| ≥ k (by representing |b| ≥ k as boolean combination of |b| = k formulas, applying (7), and traslating the result back into |b| ≥ k formulas). After performing this transformation, we bring the formula into disjunctive normal form and continue eliminating the existential quantifier separately for each disjunct, as argued in Section 4.1. We may therefore assume that all conjuncts ψi are of one of the forms: |s ∩ y| = k, |s ∩ y c | = k, |s ∩ y| ≥ k, and |s ∩ y c | ≥ k where s ∈ P . If there are two conjuncts both of which contain |s ∩ y| for the same s, then either they are contradictory or one implies the other. We therefore assume that for any s ∈ P , there is at most one conjunct ψi containing |s∩y|. For analogous reasons we assume that for every s ∈ P there is at most one conjunct ψi containing |s ∩ y c |. The result of eliminating the variable y is then given in Figure 7. These rules are applied for all distinct partitions s for which |s ∩ y| or |s ∩ y c | occurs. The case when one of the literals containing |s∩y| does not occur is covered by the case |s ∩ y| ≥ k for k = 0, similarly for a literal containing |s ∩ y c |. ψi (x̄, y) 1≤i≤n where ψi is of the form |b| = k or of the form |b| ≥ k. We assume that y occurs in every formula ψi . It follows that no ψi contains |∅| or |U|. Let x1 , . . . , xm , y be the set of variables occurring in formulas ψi for 1 ≤ i ≤ n. First consider the more general case m ≥ 1. Let for i1 , . . . , im ∈ {0, 1}, si1 ...im = xi11 ∩ · · · ∩ ximm where x0 = xc and x1 = x. The terms in the set P = {si1 ...im | i1 , . . . , im ∈ {0, 1}} form a partition. Moreover, every Boolean algebra term whose variables are among xi can be written as a disjoint union of some elements of the partition P . Any Boolean algebra term containing y can be written, for some p, q ≥ 0 as 6 F It remains to consider the case m = 0. Then y is the only variable occurring in conjuncts ψi . Every cardinality expression t containing only y reduces to one of |y| or |y c |. If there are multiple literals containing |y|, they are either contradictory or one implies the others. We may therefore assume there is at most one literal containing |y| and at most one literal containing |y c |. We eliminate quantifier by applying rules in Figure 7 putting formally b = U, yielding quantifier-free cardinality constraint of the form |U| = k or of the form |U| ≥ k, which does not contain the variable y. This completes the description of quantifier elimination from an existentially quantified conjunction. By repeating this process for all quantifiers we arrive at a quantifier-free formula ψ. Hence, we have the following fact. A ::= B1 = B2 | B1 ⊆ B2 | T1 = T2 | T1 < T2 | C dvd T B ::= x | 0 | 1 | B1 ∪ B2 | B1 ∩ B2 | B c T ::= k | C | MAXC | T1 + T2 | T1 − T2 | C · T | |B| C ::= . . . −2 | −1 | 0 | 1 | 2 . . . Figure 8: Formulas of Boolean Algebras with Presburger Arithmetic (BAPA) Define the equicardinality relation eqcard(b, b′ ) to hold iff |b| = |b′ |, and consider BA extended with relation eqcard(b, b′ ). Define the ternary relation plus(b, b1 , b2 ) ⇐⇒ (|b| = |b1 | + |b2 |) by the formula ∃x1 . ∃x2 . x1 ∩ x2 = ∅ ∧ b = x1 ∪ x2 ∧ eqcard(x1 , b1 ) ∧ eqcard(x2 , b2 ) The relation plus(b, b1 , b2 ) allows us to express addition using arbitrary sets as representatives for natural numbers. Moreover, we can represent integers as equivalence classes of pairs of natural numbers under the equivalence relation (x, y) ∼ (u, v) ⇐⇒ x + v = u + y. This construction allows us to express the unary predicate of being non-negative. The quantification over pairs of sets represents quantification over integers, and quantification over integers with the addition operation and the predicate “being non-negative” can express all operations in Figure 11. This leads to our formulation of the language BAPA in Figure 8, which contains both the sets and the integers themselves. Note the language has two kinds of quantifiers: quantifiers over integers and quantifiers over sets; we distinguish between these two kinds by denoting integer variables with symbols such as k, l and set variables with symbols such as x, y. We use the shorthand ∃+ k.F (k) to denote ∃k.k ≥ 0 ∧ F (k) and, similarly ∀+ k.F (k) to denote ∀k.k ≥ 0 ⇒ F (k). Note that the language in Figure 8 subsumes the language in Figure 11. Furthermore, the language in Figure 8 contains the formulas of the form |b| = k whose Boolean combinations can encode all atomic formulas in Figure 6, as in Section 4.2. This implies that the language in Figure 8 properly generalizes both the language in Figure 11 and the language in Figure 6. Finally, we note that the MAXC constant denotes the size of the finite universe, so we require MAXC = |U| (see Section 7 for infinite universe case). First-Order Theory of BAPA is Decidable This section presents the main result of this paper: the first-order theory of Boolean algebras with Presburger arithmetic (BAPA) is decidable. We first motivate the operations of the structure BAPA in Section 5.1. We prove the decidability of BAPA in Section 5.2 using a quantifier elimination algorithm that interleaves quantifier elimination for the Boolean algebra part with quantifier elimination for the Presburger arithmetic part. In Section 5.4 we present another algorithm (α) for deciding BAPA, based on the replacement of set quantifiers with integer quantifiers. The analysis of the algorithm α is the subject of Section 6, which derives a worst-case complexity bound on the validity problem for BAPA. In this section, we interpret Boolean algebras over the family of all powersets of finite sets. Our quantifier elimination is uniform with respect to the size of the universal set. Section 7 extends the result to allow infinite universal sets and reasoning about finiteness of sets. 5.1 A | F1 ∧ F2 | F1 ∨ F2 | ¬F | ∃x.F | ∀x.F | ∃k.F | ∀k.F Fact 1 For every first-order formula φ in the language of Boolean algebras with finite cardinality constraints there exists a quantifier-free formula ψ such that ψ is a disjunction of conjunctions of literals of form |b| ≥ k and |b| = k (for k denoting constant non-negative integers) where b are terms of Boolean algebra, the free variables of ψ are a subset of the free variables of φ, and ψ is equivalent to φ on all Boolean algebras of finite sets. 5 ::= From Equicardinality to PA To motivate the extension of Boolean algebra with all operations of Presburger arithmetic, we derive these operations from a single construct: the equicardinality of sets. 7 5.2 Basic Algorithm ∃ + l 1 , . . . , l m . ∃ + k1 , . . . , kp . Vp Vm/2 ′ i=1 ti = ki ∧ F1 (k1 , . . . , kp ) i=1 |si | = lai + lbi ∧ We first present a simple quantifier-elimination algorithm for BAPA. As explained in Section 4.1, it suffices to eliminate an existential quantifier from a conjunction F of literals of Figure 8. We need to show how to eliminate an integer existential quantifier, and how to eliminate a set existential quantifier. By Section 4.2, assume that all occurrences of set expressions b are within expressions of the form |b|. Introduce an integer variable ki for each such expression |bi |, and write F in the form F ≡ ∃ + k1 , . . . , kp . p ^ |bi | = ki ∧ F1 (k1 , . . . , kp ) and contains no set quantifiers, but contains existential integer quantifiers. We have already seen how to eliminate existential integer quantifiers; by repeating the elimination for each of l1 , . . . , lm , k1 , . . . , kp , we obtain a quantifier-free formula. (We can trivially eliminate each ki by replacing it with ti , but it remains to eliminate the exponentially many variables l1 , . . . , lm .) This completes the description of the basic quantifier elimination algorithm. This quantifier-elimination algorithm is a decision procedure for formulas in Figure 8. We have therefore established the decidability of the language BAPA that combines Boolean algebras and Presburger arithmetic, solving the question left open in [57] for the finite universe case. (8) i=1 where F1 is a PA formula. To eliminate an existential integer quantifier ∃k from the formula ∃k.F , observe that ∃k.F (k) is equivalent to ∃ + k1 , . . . , kp . p ^ Theorem 2 The validity of BAPA sentences over the family of all models with finite universe of uninterpreted elements is decidable. |bi | = ki ∧ ∃k.F1 (k, k1 , . . . , kp ) i=1 because k does not occur in the first part of the formula. Using quantifier elimination for Presburger arithmetic, eliminate ∃k from ∃k.F1 yielding a quantifier-free formula F2 (k1 , . . . , km ). The formula ∃k.F (k) is then equivalent to F2 (|b1 |, . . . , |bm |) and the quantifier has been eliminated. To eliminate an existential set quantifier ∃y from the formula ∃y.F , proceed as follows. Start again from (8), and split each |bi | into sums of partitions as in Section 4.2. Specifically, let x1 , . . . , xn where y ∈ {x1 , . . . , xn } be all free set variables in b1 , . . . , bp , and let s1T , . . . , sm for m = 2n be all set expressions of α n the form j=1 xj j for α1 , . . . , αn ∈ {0, 1}. Every expression P of the form |b| is equal to an expression of the form qj=1 |sij | for some i1 , . . . , iq . Introduce an integer variable li for each |si | where 1 ≤ i ≤ m, and write F in the form ∃+V l 1 , . . . , l m . ∃ + k1 , V . . . , kp . m p i=1 |si | = li ∧ i=1 ti = ki ∧ F1 (k1 , . . . , kp ) Comparison with Quantifier Elimination for BA. Note the difference in the use of Lemma 1 in the quantifier elimination for BA in Section 4.2 compared to the use of Lemma 1 in this section: Section 4.2 uses the statement of the lemma when the cardinalities of sets are known constants, whereas this section uses the statement of the lemma in a more general way, creating the appropriate symbolic sum expression for the cardinality of the resulting sets. On the other hand, the algorithm in this section does not need to consider the case of inequalities for cardinality constraints, because the handling of negations of cardinality constraints is hidden in the subsequent quantifier elimination of integer variables. This simplification indicates that the first-order theories BA and PA naturally fit together; the algorithm in Section 5.4 further supports this impression. (9) 5.3 Pq where each ti is of the form j=1 lij for some q and some i1 , . . . , iq specific to ti . Note that only the part V m i=1 |si | = li contains set variables, so ∃y.F is equivalent to Reducing the Number of Introduced Integer Variables This section presents two observations that may reduce the number of integer variables introduced in the elimination of set quantifier in Section 5.2. The algorithm in Section 5.2 introduces 2n integer variables where n is the number of set variables in the formula F of (8). First, we observe that it suffices to eliminate the quantifier ∃y from the conjunction of the conjuncts |bi | = ki where y occurs in bi . Let a1 (y), . . . , aq (y) be those terms among b1 , . . . , bp that contain y, and let x1 , . . . , xn1 be the free variables in a1 (y), . . . , aq (y). Then it suffices to introduce 2n1 integer variables corresponding to the the partitions with respect to ∃+ l1 , . .V. , lm . ∃+ k1 , . . . , kV p. p (∃y. m i=1 ti = ki ∧ F1 (k1 , . . . , kp ) i=1 |si | = li ) ∧ (10) Next, group each si of the form |s ∩ y| with the corresponding |s ∩ y c | and apply Lemma 1 to replace each pair |s ∩ y|V= la ∧ |s ∩ y c | = lb with |s| = la + lb . As a m result, ∃y. i=1 |si | = li is replaced by a quantifier-free Vm/2 formula of the form i=1 |s′i | = lai + lbi . The entire resulting formula is 8 x1 , . . . , xn1 , which may be an improvement because n1 ≤ n. The second observation is useful if the number q of terms a1 (y), . . . , aq (y) satisfies the property 2q+1 < n1 , i.e. there is a large number of variables, but a small number of terms containing them. In this case, consider all Boolean combinations t1 , . . . , tu of the 2q expressions a1 (∅), a1 (U), a2 (∅), a2 (U), . . . , aq (∅), aq (U). For each ai , we have eliminating the integer quantifiers, it accumulates them in a PA formula. As the first step of the algorithm, transform F0 into prenex form Qp vp . . . . Q1 v1 . F (v1 , . . . , vp ) where F is quantifier-free, and each quantifier Qi vi is of one the forms ∃k, ∀k, ∃y, ∀y where k denotes an integer variable and y denotes a set variable. As in Section 5.2, separate F into the set part and the purely Presburger arithmetic part by expressing all set relations in terms of |b| terms and by naming each |b|, obtaining a formula of the form (8). Next, split all sets into disjoint union of cubes s1 , . . . , sm for m = 2n where n is the number of all set variables, obtaining a formula of the form Qp vp . . . . Q1 v1 .F where F is of the form (9). Letting G1 = F1 (t1 , . . . , tp ), we obtain a formula of the form ai (y) = (y ∩ ai (∅)) ∪ (y c ∩ ai (U)) Each ai (∅) and each ai (U) is a disjoint union of the Boolean combinations of t1 , . . . , tu , so each ai (y) is a disjoint union of Boolean combinations of y and the expressions t1 , . . . , tu that do not contain y. It therefore suffices to introduce 22q+1 integer variables denoting all terms of the form y ∩ ti and y c ∩ ti , as opposed to 2n1 integer variables. 5.4 (11) Qp vp . . . . Q1 v1 . V ∃ + l1 , . . . , lm . m i=1 |si | = li ∧ G1 Reduction to Quantified PA Sentences (12) where G1 is a PA formula and m = 2n . Formula (12) is the starting point of the main phase of algorithm α. The main phase of the algorithm successively eliminates quantifiers Q1 v1 , . . . , Qp vp while maintaining a formula of the form This section presents an algorithm, denoted α, which reduces a BAPA sentence to an equivalent PA sentence with the same number of quantifier alternations and an exponential increase in the total size of the formula. Although we have already established the decidability of BAPA in Section 5.2, the algorithm α of this section is important for several reasons. Qp vp . . . Qr vr . V ∃+ l1 . . . lq . qi=1 |si | = li ∧ Gr 1. Given the space and time bounds for Presburger arithmetic sentences [40], the algorithm α yields reasonable space and time bounds for BAPA sentences. (13) where Gr is a PA formula, r grows from 1 to p + 1, and q = 2e where e for 0 ≤ e ≤ n is the number of set variables among vp , . . . , vr . The list s1 , . . . , sq is the list of all 2e partitions formed from the set variables among vp , . . . , vr . We next show how to eliminate the innermost quantifier Qr vr from the formula (13). During this process, the algorithm replaces the formula Gr with a formula Gr+1 which has more integer quantifiers. If vr is an integer variable then the number of sets q remains the same, and if vr is a set variable, then q reduces from 2e to 2e−1 . We next consider each of the four possibilities ∃k, ∀k, ∃y, ∀y for the quantifier Qr vr . Consider first the case ∃k. Because k does not occur V in qi=1 |si | = li , simply move the existential quantifier to Gr and let Gr+1 = ∃k.Gr , which completes the step. For universal quantifiers, observe that 2. Unlike the algorithm in Section 5.2, the algorithm α does not perform any elimination of integer variables, but instead produces an equivalent quantified PA formula. The resulting PA formula can be decided using any decision procedure for PA, including the decision procedures based on automata and model-checking [23, 19]. 3. The algorithm α can eliminate set quantifiers from any extension of Presburger arithmetic. We thus obtain a technique for adding a particular form of set reasoning to every extension of Presburger arithmetic, and the technique preserves the decidability of the extension. An example extension where our construction applies is second-order linear arithmetic i.e. monadic second-order logic of one successors, as well monadic second order logic of n-successors, as we note in Section 8. ¬(∃+ l1 . . . lq . q ^ |si | = li ∧ Gr ) i=1 is equivalent to ∃ + l1 . . . lq . We next describe the algorithm α for transforming a BAPA sentence F0 into a PA sentence. The algorithm α is similar to the algorithm in Section 5.2, but, instead of q ^ i=1 9 |si | = li ∧ ¬Gr because the existential quantifier is used as a letbinding, so we may first substitute all values li into Gr , then perform the negation, and then extract back the definitions of all values li . Given that the universal quantifier ∀k can be represented as a sequence of unary operators ¬∃k¬, from the elimination of ∃k we immediately obtain the elimination of ∀k; it turns out that it suffices to let Gr+1 = ∀k.Gr . We next show how to eliminate an existential set quantifier ∃y from q ^ ∃y. ∃+ l1 . . . lq . |si | = li ∧ Gr ∀+ l1 .∀+ l0 . MAXC = l1 + l0 ⇒ ∀+ l11 .∀+ l01 .∀+ l10 .∀+ l00 . l1 = l11 + l01 ∧ l0 = l10 + l00 ⇒ ∀+ l111 . ∀+ l011 . ∀+ l101 . ∀+ l001 . ∀+ l110 . ∀+ l010 . ∀+ l100 . ∀+ l000 . l11 = l111 + l011 ∧ l01 = l101 + l001 ∧ l10 = l110 + l010 ∧ l00 = l100 + l000 ⇒ ∀size.∀size ′ . (l111 + l011 + l101 + l001 = 1 ∧ l111 + l011 = 0 ∧ l111 + l011 + l110 + l010 = size ∧ l100 = 0 ∧ l011 + l001 + l010 = 0 ∧ size ′ = size + 1) ⇒ (0 < size ′ ∧ l111 + l101 + l110 + l100 = size ′ ) (14) i=1 which is equivalent to ∃+ l1 . . . lq . (∃y. q ^ Figure 9: The translation of the BAPA sentence from Figure 3 into a PA sentence |si | = li ) ∧ Gr (15) i=1 Theorem 3 The algorithm α described above maps each BAPA-sentence F0 into an equivalent PA-sentence α(F0 ). Without loss of generality assume that the set variables s1 , . . . , sq are numbered such that s2i−1 ≡ s′i ∩ y c and s2i ≡ s′i ∩y for some cube s′i . Then apply again Lemma 1 and replace each pair of conjuncts |s′i ∩ y c | = l2i−1 ∧ |s′i ∩ y| = l2i Formalization of the algorithm α. To formalize the algorithm α, we have implemented it in the functional programming language O’Caml (Section 11.3).2 As an illustration, when we run the implementation on the BAPA formula in Figure 3 which represents a verification condition, we immediately obtain the PA formula in Figure 9. Note that the structure of the resulting formula mimics the structure of the original formula: every set quantifier is replaced by the corresponding block of quantifiers over non-negative integers constrained to partition the previously introduced integer variables. Figure 10 presents the correspondence between the set variables of the BAPA formula and the integer variables of the translated PA formula. Note that the relationship content′ = content ∪ e translates into the conjunction of the constraints |content′ ∩ (content ∪ e)c | = 0 c ∧ |(content ∪ e) ∩ content′ | = 0, which reduces to the conjunction l100 = 0 ∧ l011 + l001 + l010 = 0 using the translation of set expressions into the disjoint union of partitions, and the correspondence in Figure 10. The subsequent sections explore further consequences of the existence of the algorithm α, including an upper bound on the computational complexity of BAPA sentences and the combination of BA with proper extensions of PA. (16) with the conjunct |s′i | = l2i−1 + l2i , yielding formula ′ ∃ + l1 . . . lq . q ^ |s′i | = l2i−1 + l2i ∧ Gr (17) i=1 for q ′ = 2e−1 . Finally, to obtain a formula of the form (13) for r + 1, introduce fresh variables li′ constrained by li′ = l2i−1 + l2i , rewrite (17) as ′ ∃+ l1′ . . . lq′ ′ . q ^ ′ |s′i | = li′ ∧ (∃l1 . . . lq . i=1 q ^ li′ = l2i−1 +l2i ∧ Gr ) i=1 and let ′ + Gr+1 ≡ ∃ l1 . . . lq . q ^ li′ = l2i−1 + l2i ∧ Gr (18) i=1 This completes the description of elimination of an existential set quantifier ∃y. To eliminate a set quantifier ∀y, proceed analogously: introduce fresh variables li′ = l2i−1 + l2i and Vq ′ let Gr+1 ≡ ∀+ l1 . . . lq . ( i=1 li′ = l2i−1 + l2i ) ⇒ Gr , which can be verified by expressing ∀y as ¬∃y¬. After eliminating all quantifiers as described above, we obtain a formula of the form ∃+ l. |U| = l ∧ Gp+1 (l). We define the result of the algorithm, denoted α(F0 ), to be the PA sentence Gp+1 (MAXC). This completes the description of the algorithm α. Given that the validity of PA sentences is decidable, the algorithm α is a decision procedure for BAPA sentences. 6 Complexity In this section we analyze the algorithm α from Section 5.4 and obtain space and time bounds on BAPA from the corresponding space and time bounds for PA. 2 The implementation is available from http://www.cag.lcs.mit.edu/~vkuncak/artifacts/bapa/. 10 |b| = 0. Introducing set variables for each partition and replacing each |b| with a sum of integer variables yields formula G1 whose size is bounded by O(n2S S) (the last S factor is because representing a variable from the set of K variables requires space log K). The subsequent transformations introduce the existing integer quantifiers, whose size is bounded by n, and introduce additionally 2S−1 + . . . + 2 + 1 = 2S − 1 new integer variables along with the equations that define them. Note that the defining equations always have the form li′ = l2i−1 +l2i and have size bounded by S. We therefore conclude that the size of α(F0 ) is O(nS(2S + 2S )) and therefore O(nS2S ), which is certainly O(2cn ) for any c > 1. Moreover, note that we have obtained a more precise bound O(nS2S ) indicating that the exponential explosion is caused only by set variables. Finally, the fact that the number of quantifier alternations is the same in F0 and α(F0 ) is immediate because the algorithm replaces one set quantifier with a block of corresponding integer quantifiers. general relationship: i 2 li1 ,...,ik = |setiq1 ∩ setiq+1 ∩ . . . ∩ setSk | q = S − (k − 1), S − number of set variables l000 l001 l010 l011 l100 l101 l110 l111 = = = = = = = = in this example: set1 = content ′ set2 = content set3 = e |content ′ c ∩ contentc ∩ ec | |content ′ c ∩ contentc ∩ e| |content ′ c ∩ content ∩ ec | |content ′ c ∩ content ∩ e| |content ′ ∩ contentc ∩ ec | |content ′ ∩ contentc ∩ e| |content ′ ∩ content ∩ ec | |content ′ ∩ content ∩ e| Figure 10: The Correspondence between Integer Variables in Figure 9 and Set Variables in Figure 3 We then show that the new decision procedure meets the optimal worst-case bounds for Boolean algebras if applied to purely Boolean algebra formulas. Moreover, by construction, our procedure reduces to the procedure for Presburger arithmetic formulas if there are no set quantifiers. In summary, our decision procedure is optimal for BA, does not impose any overhead for pure PA formulas, and the complexity of the general BAPA validity is not much worse than the complexity of PA itself. 6.1 We next consider the worst-case space bound on BAPA. Recall first the following bound on space complexity for PA. Fact 2 [16, Chapter 3] The validity of a PA sentence of length n can be decided in space exp2 (O(n)). From Lemma 4 and Fact 2 we conclude that the validity of BAPA formulas can be decided in space exp3 (O(n)). It turns out, however, that we obtain better bounds on BAPA validity by analyzing the number of quantifier alternations in BA and BAPA formulas. An Elementary Upper Bound We next show that the algorithm in Section 5.4 transforms a BAPA sentence F0 into a PA sentence whose size is at most one exponential larger and which has the same number of quantifier alternations. If F is a formula in prenex form, let size(F ) denote the size of F , and let alts(F ) denote the number of quantifier alternations in F . Define the iterated exponentiation function expk (x) by exp0 (x) = x and expk+1 (x) = 2expk (x) . We have the following lemma. Fact 3 [40] The validity of a PA sentence of length n and the number of quantifier alternations m can be deO(m) cided in space 2n . From Lemma 4 and Fact 3 we obtain our space upper bound, which implies the upper bound on deterministic time. Theorem 5 The validity of a BAPA sentence of length n and the number of quantifier alternations m can be decided in space exp2 (O(mn)), and, consequently, in deterministic time exp3 (O(mn)). Lemma 4 For the algorithm α from Section 5.4 there is a constant c > 0 such that size(α(F0 )) ≤ 2c·size(F0 ) alts(α(F0 )) = alts(F0 ) If we approximate quantifier alternations by formula size, we conclude that BAPA validity can be decided in space exp2 (O(n2 )) compared to exp2 (O(n)) bound for Presburger arithmetic from Fact 2. Therefore, despite the exponential explosion in the size of the formula in the algorithm α, thanks to the same number of quantifier alternations, our bound is not very far from the bound for Presburger arithmetic. Moreover, the algorithm α runs in 2O(size(F0 )) space. Proof. To gain some intuition on the size of α(F0 ) compared to the size of F0 , compare first the formula in Figure 9 with the original formula in Figure 3. Let n denote the size of the initial formula F0 and let S be the number of set variables. Note that the following operations are polynomially bounded in time and space: 1) transforming a formula into prenex form, 2) transforming relations b1 = b2 and b1 ⊆ b2 into the form 11 6.2 Conversely, suppose that Gr+1 (w1′ , . . . , wq′ ′ ) holds. Then there are w1 , . . . , wq such that Gr (w1 , . . . , wq ) and wi′ = w2i−1 + w2i . If w2i−1 ≤ 2r−1 and w2i ≤ w2i then wi′ ≤ 2r so let u2i−1 = w2i−1 and u2i = w2i . If w2i−1 > 2r−1 and w2i > w2i then let u2i−1 = 2r−1 and u2i = 2r−1 . If w2i−1 > 2r−1 and w2i ≤ 2r−1 then let u2i−1 = 2r − w2i and u2i = w2i . By induction hypothesis we have Gr (u1 , . . . , uq ) = Gr (w1 , . . . , wq ). Furthermore, u2i−1 + u2i = w̄i′ , so Gr+1 (w̄1′ , . . . , w̄q′ ′ ) by definition of Gr+1 . Boolean Algebras as a Special Case We next analyze the result of applying the algorithm α to a pure BA sentence F0 . By a pure BA sentence we mean a BA sentence without cardinality constraints, containing only the standard operations ∩, ∪, c and the relations ⊆, =. At first, it might seem that the algorithm α is not a reasonable approach to deciding pure BA formulas given that the best upper bounds for PA are worse than the corresponding bounds for BA. However, we identify a special form of PA sentences PABA = {α(F0 ) | F0 is in pure BA} and show that such sentences can be decided in 2O(n) space, which is optimal for Boolean algebras [24]. Our analysis shows that using binary representations of integers that correspond to the sizes of sets achieves a similar effect to representing these sets as bitvectors, although the two representations are not identical. Let S be the number of set variables in the initial formula F0 (recall that set variables are the only variables in F0 ). Let l1 , . . . , lq be the set of free variables of the formula Gr (l1 , . . . , lq ); then q = 2e for e = S +1−r. Let w1 , . . . , wq be integers specifying the values of l1 , . . . , lq . We then have the following lemma. Now consider a formula F0 of size n with S free variables. Then α(F0 ) = GS+1 . By Lemma 4, size(α(F0 )) is O(nS2S ). By Lemma 6, it suffices for the outermost variable k to range over the integer interval [0, 2S ], and the range of subsequent variables is even smaller. Therefore, the value of each of the 2S+1 −1 variables can be represented in O(S) space, which is the same order of space used to represent the names of variables themselves. This means that evaluating the formula α(F0 ) can be done in the same space O(nS2S ) as the size of the formula. Representing the valuation assigning values to variables can be done in O(S2S ) space, so the truth value of the formula can be evaluated in O(nS2S ) space, which is certainly 2O(n) . We obtain the following theorem. Lemma 6 For each r where 1 ≤ r ≤ S the truth value of Gr (w1 , . . . , wq ) is equal to the the truth value of Gr (w̄1 , . . . , w̄q ) where w̄i = min(wi , 2r−1 ). Theorem 7 If F0 is a pure BA formula with S variables and of size n, then the truth value of α(B0 ) can be computed in O(nS2S ) and therefore 2O(n) space. Proof. We prove the claim by induction. For r = 1, observe that the translation of a quantifier-free part of the pure BA formula yields a PA formula F1 whose all atomic formulas are of the form li1 + . . . + lik = 0, Wk which are equivalent to j=1 lij = 0. Therefore, the truth-value of F1 depends only on whether the integer variables are zero or non-zero, which means that we may restrict the variables to interval [0, 1]. For the inductive step, consider the elimination of a set variable, and assume that the property holds for Gr and for all q tuples of non-negative integers w1 , . . . , wq . Let q ′ = q/2 and w1′ , . . . , wq′ ′ be a tuple of non-negative integers. We show that Gr+1 (w1′ , . . . , wq′ ′ ) is equivalent to Gr+1 (w̄1′ , . . . , w̄q′ ′ ). Suppose first that Gr+1 (w̄1′ , . . . , w̄q′ ′ ) holds. Then for each wi′ there are w2i−1 and w2i such that w̄i′ = u2i−1 + u2i and Gr (u1 , . . . , uq ). We define witnesses w1 , . . . , wq as follows. If wi′ ≤ 2r , then let w2i−1 = u2i−1 and w2i = u2i . If wi′ > 2r then either u2i−1 > 2r−1 or u2i > 2r−1 (or both). If u2i−1 > 2r−1 , then let w2i−1 = wi′ − u2i and w2i = u2i . Note that Gr (. . . , w2i−1 , . . .) ⇐⇒ Gr (. . . , u2i−1 , . . .) ⇐⇒ Gr (. . . , 2r−1 , . . .) by induction hypothesis because both u2i−1 > 2r−1 and w2i−1 > 2r−1 . For w1 , . . . , wq chosen as above we therefore have wi′ = w2i−1 + w2i and Gr (w1 , . . . , wq ), which by definition of Gr+1 means that Gr+1 (w1′ , . . . , wq′ ′ ) holds. 7 Allowing Infinite Sets We next sketch the extension of our algorithm α (Section 5.4) to the case when the universe of the structure may be infinite, and the underlying language has the ability to distinguish between finite and infinite sets. Infinite sets are useful in program analysis for modelling pools of objects such as those arising in dynamic object allocation. We generalize the language of BAPA and the interpretation of BAPA operations as follows. 1. Introduce unary predicate fin(b) which is true iff b is a finite set. The predicate fin(b) allows us to generalize our algorithm to the case of infinite universe, and additionally gives the expressive power to distinguish between finite and infinite sets. For example, using fin(b) we can express bounded quantification over finite or over infinite sets. 2. Define |b| to be the integer zero if b is infinite, and the cardinality of b if b is finite. 3. Introduce propositional variables denoted by letters such as p, q, and quantification over propositional variables. Extend also the underlying PA 12 formulas with propositional variables, which is acceptable because a variable p can be treated as a shorthand for an integer from {0, 1} if each use of p as an atomic formula is interpreted as the atomic formula (p = 1). Our extended algorithm uses the equivalences fin(b) ⇔ p to represent the finiteness of sets just as it uses the equations |b| = l to represent the cardinalities of finite sets. 4. If pi and qi are both false, then bi is also infinite; every infinite set can be written as a disjoint union of two infinite sets, so let yi be one such set. Sn Let y = i=1 yi . As in the proof of Lemma 1, we have bi ∩y = yi and bi ∩y c = yic . By construction of y1 , . . . , yn we conclude that (19) holds. The algorithm α for BAPA∞ is analogous to the algorithm for BAPA. In each step, the new algorithm maintains a formula of the form 4. Introduce a propositional constant FINU such that fin(U) ⇔ FINU. This propositional constant enables equivalence preserving quantifier elimination over the set of models that includes both models with finite universe U and the models with infinite universe U. Qp vp . . . Qr vr . ∃+ lV 1 . . . lq . ∃p1 . . . pq . ( qi=1 |si | = li ∧ (fin(si ) ⇔ pi )) ∧ Gr As in Section 5.4, the algorithm eliminates an integer quantifier ∃k by letting Gr+1 = ∃k.Gr and eliminates an integer quantifier ∀k by letting Gr+1 = ∀k.Gr . Furthermore, just as the algorithm in Section 5.4 uses Lemma 1 to reduce a set quantifier to integer quantifiers, the new algorithm uses Lemma 8 for this purpose. The algorithm replaces Denote the resulting extended language BAPA∞ . The following lemma generalizes Lemma 1 for the case of equalities. Lemma 8 Let b1 , . . . , bn be disjoint l1 , . . . , ln , k1 , . . . , kn be natural numbers, p1 , . . . , pn , q1 , . . . , qn be propositional values. the following two statements are equivalent: sets, and Then ∃y. ∃+Vl1 . . . lq . ∃p1 . . . pq . ( qi=1 |si | = li ∧ (fin(si ) ⇔ pi )) ∧ Gr 1. There exists a set y such that n ^ i=1 |bi ∩ y| = ki ∧ (fin(bi ∩ y) ⇔ pi ) ∧ |bi ∩ y c | = li ∧ (fin(bi ∩ y c ) ⇔ qi ) with ∃+ l1′ . . . lq′ ′ . ∃p′1 . . . p′q′ . V ′ ( qi=1 |s′i | = li′ ∧ (fin(s′i ) ⇔ p′i )) ∧ Gr+1 (19) for q ′ = q/2, and 2. n ^ i=1 (pi ∧ qi ⇒ |bi | = ki + li ) ∧ (fin(bi ) ⇔(pi ∧ qi )) Gr+1 ≡ ∃+ l1 . . . lq . ∃p1 , . . . , pq . Vq′ ′ i=1 (p2i−1 ∧ p2i ⇒ li =l2i−1 + l2i ) ∧ ′ (pi ⇔(p2i−1 ∧ p2i )) ∧ Gr (20) For the quantifier ∀y the algorithm analogously generates Proof. (⇒) Suppose that there exists a set y satisfying (19). From bi = (bi ∩ y) ∪ (bi ∩ y c ), we have fin(bi ) ⇔(pi ∧ qi ). Furthermore, if pi and qi hold, then both bi ∩ y and bi ∩ y c are finite so the relation |bi | = |bi ∩ y| + |bi ∩ y c | holds. (⇐) Suppose that (20) holds. For each i we choose a subset yi ⊆ bi , depending on the truth values of pi and qi , as follows. Gr+1 ≡ ∀+ l1 . . . lq . ∀p1 , . . . , pq . Vq′ ′ i=1 (p2i−1 ∧ p2i ⇒ li =l2i−1 + l2i ) ∧ (p′i ⇔(p2i−1 ∧ p2i )) ⇒ Gr After eliminating all quantifiers, the algorithm obtains a formula of the form ∃+ l.∃p. |U| = l ∧ (fin(U) ⇔ p) ∧ Gp+1 (l, p). We define the result of the algorithm to be the PA sentence Gp+1 (MAXC, FINU). This completes our description of the generalized algorithm α for BAPA∞ . The complexity analysis from Section 6 also applies to the generalized version. We also note that our algorithm yields an equivalent formula over any family of models. A sentence is valid in a set of models iff it is valid on each model. Therefore, the validity of a BAPA∞ sentence F0 is given by applying to the formula α(F0 )(MAXC, FINU) a form of universal quantifier over all pairs (MAXC, FINU) that 1. If both pi and qi are true, then fin(bi ) holds, so bi is finite. Choose yi as any subset of bi with ki elements, which is possible since bi has ki + li elements. 2. If pi does not hold, but qi holds, then fin(bi ) does not hold, so bi is infinite. Choose yi′ as any finite set with li elements and let yi = bi \ yi′ be the corresponding cofinite set. 3. Analogously, if pi holds, but qi does not hold, then bi is infinite; choose yi as any finite subset of bi with ki elements. 13 determine the characteristics of the models in question. For example, for the validity over the models with infinite universe we use α(F0 )(0, false), for validity over all finite models we use ∀k.α(F0 )(k, true), and for the validity over all models we use the PA formula 8.1 Consider the multisorted language BAMSOL defined as follows. First, BAMSOL contains all relations of monadic second-order logic of n-successors, whose variables range over strings over an n-ary alphabet and sets of such strings. Second, BAMSOL contains sets of uninterpreted elements and boolean algebra operations on them. Third, BAMSOL allows stating relationships of the form |x| = k where x is a set of uninterpreted elements and k is a string representing a natural number. Because all PA operations are definable in MSOL of 1successor, the algorithm α applies in this case as well. Indeed, the algorithm α only needs a “lower bound” on the expressive power of the theory of integers that BA is combined with: the ability to state constraints of the form li′ = l2i−1 + l2i , and quantification over integers. Therefore, applying α to a BAMSOL formula results in an MSOL formula. This shows that BAMSOL is decidable and can be decided using a combination of algorithm α and tool such as [23]. By Lemma 4, the decision procedure for BAMSOL based on translation to MSOL has upper bound of expn (O(n)) using a decision procedure such as [23] based on tree automata [10]. The corresponding non-elementary lower bound follows from the lower bound on MSOL itself [48]. α(F0 )(0, false) ∧ ∀k.α(F0 )(k, true). We therefore have the following result, which answers a generalized version of the question left open in [57]. Theorem 9 The algorithm above effectively reduces the validity of BAPA∞ sentences to the validity of Presburger arithmetic formulas with the same number of quantifier alternations, and the increase in formula size exponential in the number of set variables; the reduction works for each of the following: 1) the set of all models, 2) the set of models with infinite universe only, and 3) the set of all models with finite universe. 8 Decidability of MSOL with Cardinalities on Uninterpreted Sets Relationship with MSOL over Strings The monadic second-order logic (MSOL) over strings is a decidable logic that can encode Presburger arithmetic by encoding addition using one successor symbol and quantification over sets. This logic therefore simultaneously supports sets and integers, so it is natural to examine its relationship with BAPA. It turns out that there are two important differences between MSOL over strings and BAPA: 9 1. BAPA can express relationships of the form |A| = k where A is a set variable and k is an integer variable; such relation is not definable in MSOL over strings. Related Work Presburger arithmetic. The original result on decidability of Presburger arithmetic is [37] (see [51, Page 24] for review). This decision procedure was improved in [11] and subsequently in [36]. The best known bound on formula size is obtained using bounded model property techniques [16]. An analysis based on the number of quantifier alternations is presented in [40]. [7] presents a proof-generating version of [11]. The omega test as a decision procedure for Presburger arithmetic is described in [39]. [38] describes how to compute the number of satisfying assignments to free variables in a Presburger arithmetic formula, and describes the applications for computing those numbers for the purpose of program analysis and optimization. Some bounds on quantifier-elimination procedures for Presburger arithmetic are presented in [52]. Automata-theoretic [23, 5] and model checking approaches [19, 46] can also be used to decide Presburger arithmetic and its fragments. Boolean Algebras. The first results on decidability of Boolean algebras are from [47, 31, 50], [1, Chapter 4] and use quantifier elimination, from which one can derive small model property; [24] gives the complexity of the satisfiability problem. [6] gives an overview of several fragments of set theory including theories with 2. In MSOL over strings, the sets contain integers as elements, whereas in BAPA the sets contain uninterpreted elements. Given these differences, a natural question is to consider the decidability of an extension of MSOL that allows stating relations |A| = k where A is a set of integers and k is an integer variable. Note that by saying ∃k.|A| = k ∧|B| = k we can express |A| = |B|, so we obtain MSOL with equicardinality constraints. However, extensions of MSOL over strings with equicardinality constraints are known to be undecidable; we review some reductions in Section 11.2. Undecidability results such as these are what perhaps led to the conjecture that BAPA itself is undecidable [57, Page 12]. In this paper we have shown that BAPA is, in fact, decidable and has an elementary decision procedure. Moreover, we next present a combination of BA with MSOL over n-successors that is still decidable. 14 quantifiers but no cardinality constraints and theories with cardinality constraints but no quantification over sets. Combinations of Decidable Theories. The techniques for combining quantifier-free theories [35, 42] and their generalizations such as [55, 56] are of great importance for program verification. This paper shows a particular combination result for quantified formulas, which add additional expressive power in writing specifications. Among the general results for quantified formulas are the Feferman-Vaught theorem for products [15], and term powers [26, 27]. Our decidability result is closest to [57] which gives a solution for the combination of Presburger arithmetic with a notion of sets and quantification of elements, and conjectures that adding the quantification over sets leads to an undecidable theory. The results of this paper prove that the conjecture is false and give an elementary upper bound on the complexity of the combined theory. Analyses of Dynamic Data Structures. Our new decidability result enables verification tools to reason about sets and their sizes. This capability is particularly important for analyses that handle dynamically allocated data structures where the number of objects is statically unbounded [29, 30, 28, 54, 53, 43, 44]. Recently, these approaches were extended to handle the combinations of the constraints representing data structure contents and constraints representing numerical properties of data structures [43, 9]. Our result provides a systematic mechanism for building precise and predictable versions of such analyses. References 10 [11] D. C. Cooper. Theorem proving in arithmetic without multiplication. In B. Meltzer and D. Michie, editors, Machine Intelligence, volume 7, pages 91–100. Edinburgh University Press, 1972. [1] W. Ackermann. Solvable Cases of the Decision Problem. North Holland, 1954. [2] Edward Ashcroft, Zohar Manna, and Amir Pnueli. Decidable properties of monadic functional schemas. J. ACM, 20(3):489–499, 1973. [3] Thomas Ball, Rupak Majumdar, Todd Millstein, and Sriram K. Rajamani. Automatic predicate abstraction of C programs. In Proc. ACM PLDI, 2001. [4] Thomas Ball and Sriram K. Rajamani. Boolean programs: A model and process for software analysis. Technical Report MSR-TR-2000-14, Microsoft Research, 2000. [5] Alexandre Boudet and Hubert Comon. Diophantine equations, presburger arithmetic and finite automata. In 21st International Colloquium on Trees in Algebra and Programming - CAAP’96, volume 1059 of LNCS. Springer, 1996. [6] Domenico Cantone, Eugenio Omodeo, and Alberto Policriti. Set Theory for Computing. Springer, 2001. [7] Amine Chaieb and Tobias Nipkow. Generic proof synthesis for presburger arithmetic. Technical report, Technische Universität München, October 2003. [8] Ashok K. Chandra. On the decision problems of program schemas with commutative and invertible functions. In Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 235– 242. ACM Press, 1973. [9] Wei-Ngan Chin, Siau-Cheng Khoo, and Dana N. Xu. Extending sized types with with collection analysis. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics Based Program Manipulation (PEPM’03), 2003. [10] H. Comon, M. Dauchet, R. Gilleron, F. Jacquemard, D. Lugiez, S. Tison, and M. Tommasi. Tree automata techniques and applications. Available on: http://www.grappa.univ-lille3.fr/tata, 1997. release 1999. Conclusion Motivated by static analysis and verification of relations between data structure content and size, we have introduced the first-order theory of Boolean algebras with Presburger arithmetic (BAPA), established its decidability, presented a decision procedure via reduction to Presburger arithmetic, and showed an elementary upper bound on the worst-case complexity. We expect that our decidability result will play a significant role in verification of programs [35, 13, 17, 32], especially for programs that manipulate dynamically changing sets of objects [29, 30, 28, 54, 53, 43, 44]. [12] Patrick Cousot and Radhia Cousot. Systematic design of program analysis frameworks. In Proc. 6th POPL, pages 269–282, San Antonio, Texas, 1979. ACM Press, New York, NY. [13] David L. Detlefs, K. Rustan M. Leino, Greg Nelson, and James B. Saxe. Extended static checking. Technical Report 159, COMPAQ Systems Research Center, 1998. [14] Robert K. Dewar. Programming by refinement, as exemplified by the SETL representation sublanguage. Transactions on Programming Languages and Systems, July 1979. [15] S. Feferman and R. L. Vaught. The first order properties of products of algebraic systems. Fundamenta Mathematicae, 47:57–103, 1959. Acknowledgements. The first author would like to thank the members of the Stanford REACT group and the members of the Berkeley CHESS group on useful discussions on decision procedures and program analysis, and Bruno Courcelle on remarks regarding undecidability of MSOL with equicardinality constraints. [16] Jeanne Ferrante and Charles W. Rackoff. The Computational Complexity of Logical Theories, volume 718 of Lecture Notes in Mathematics. Springer-Verlag, 1979. [17] Cormac Flanagan, K. Rustan M. Leino, Mark Lilibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended Static Checking for Java. In Proc. ACM PLDI, 2002. [18] Robert W. Floyd. Assigning meanings to programs. In Proc. Amer. Math. Soc. Symposia in Applied Mathematics, volume 19, pages 19–31, 1967. 15 [19] Vijay Ganesh, Sergey Berezin, and David L. Dill. Deciding presburger arithmetic by model checking and comparisons with other methods. In Formal Methods in Computer-Aided Design. Springer-Verlag, November 2002. [40] C. R. Reddy and D. W. Loveland. Presburger arithmetic with bounded quantifier alternation. In Proceedings of the tenth annual ACM symposium on Theory of computing, pages 320–325. ACM Press, 1978. [20] Thomas A. Henzinger, Ranjit Jhala, Rupak Majumdar, and Kenneth L. McMillan. Abstractions from proofs. In 31st POPL, 2004. [41] Thomas Reps, Mooly Sagiv, and Greta Yorsh. Symbolic implementation of the best transformer. In Proc. 5th International Conference on Verification, Model Checking and Abstract Interpretation, 2004. [21] C. A. R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576–580, 1969. [42] Harald Ruess and Natarajan Shankar. shostak. In Proc. 16th IEEE LICS, 2001. [22] Wilfrid Hodges. Model Theory, volume 42 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, 1993. Deconstructing [43] Radu Rugina. Quantitative shape analysis. In Static Analysis Symposium (SAS’04), 2004. [23] Nils Klarlund, Anders Møller, and Michael I. Schwartzbach. MONA implementation secrets. In Proc. 5th International Conference on Implementation and Application of Automata. LNCS, 2000. [44] Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Parametric shape analysis via 3-valued logic. ACM TOPLAS, 24(3):217–298, 2002. [45] E. Schonberg, J. T. Schwartz, and M. Sharir. An automatic technique for selection of data representations in Setl programs. Transactions on Programming Languages and Systems, 3(2):126–143, 1991. [24] Dexter Kozen. Complexity of boolean algebras. Theoretical Computer Science, 10:221–247, 1980. [25] Viktor Kuncak and Martin Rinard. On role logic. Technical Report 925, MIT CSAIL, 2003. [46] Sanjit A. Seshia and Randal E. Bryant. Deciding quantifier-free presburger formulas using parameterized solution bounds. In 19th IEEE LICS, 2004. [26] Viktor Kuncak and Martin Rinard. On the theory of structural subtyping. Technical Report 879, Laboratory for Computer Science, Massachusetts Institute of Technology, 2003. [47] Thoralf Skolem. Untersuchungen über die Axiome des Klassenkalküls and über “Produktations- und Summationsprobleme”, welche gewisse Klassen von Aussagen betreffen. Skrifter utgit av Vidnskapsselskapet i Kristiania, I. klasse, no. 3, Oslo, 1919. [27] Viktor Kuncak and Martin Rinard. Structural subtyping of non-recursive types is decidable. In Eighteenth Annual IEEE Symposium on Logic in Computer Science, 2003. [28] Viktor Kuncak and Martin Rinard. Generalized records and spatial conjunction in role logic. In 11th Annual International Static Analysis Symposium (SAS’04), Verona, Italy, August 26–28 2004. [48] Larry Stockmeyer and Albert R. Meyer. Cosmological lower bound on the circuit complexity of a small problem in logic. J. ACM, 49(6):753–784, 2002. [29] Patrick Lam, Viktor Kuncak, and Martin Rinard. Generalized typestate checking using set interfaces and pluggable analyses. SIGPLAN Notices, 39:46–55, March 2004. [49] A. Stump, C. Barrett, and D. Dill. CVC: a Cooperating Validity Checker. In 14th International Conference on Computer-Aided Verification, 2002. [30] Patrick Lam, Viktor Kuncak, and Martin Rinard. Modular pluggable analyses, 2004. Submitted to POPL’05. [50] Alfred Tarski. Arithmetical classes and types of boolean algebras. Bull. Amer. Math. Soc., 55, 64, 1192, 1949. [31] L. Loewenheim. Über mögligkeiten im relativkalkül. Math. Annalen, 76:228–251, 1915. [51] Ralf Treinen. First-order theories of concrete domains. http: //www.lsv.ens-cachan.fr/~treinen/publications.html, January 2002. [32] Zohar Manna and The STeP Group. Step: Deductivealgorithmic verification of reactive and real-time systems. In 8th CAV, volume 1102, pages 415–418, 1996. [52] Volker Weispfenning. Complexity and uniformity of elimination in presburger arithmetic. In Proceedings of the 1997 international symposium on Symbolic and algebraic computation, pages 48–53. ACM Press, 1997. [33] Yuri V. Matiyasevich. Enumerable sets are Diophantine. Soviet Math. Doklady, 11(2):354–357, 1970. [34] Anders Møller and Michael I. Schwartzbach. The Pointer Assertion Logic Engine. In Proc. ACM PLDI, 2001. [53] Eran Yahav and Ganesan Ramalingam. Verifying safety properties using separation and heterogeneous abstractions. In PLDI, 2004. [35] Greg Nelson. Techniques for program verification. Technical report, XEROX Palo Alto Research Center, 1981. [54] Greta Yorsh, Thomas Reps, and Mooly Sagiv. Symbolically computing most-precise abstract operations for shape analysis. In 10th TACAS, 2004. [36] Derek C. Oppen. Elementary bounds for presburger arithmetic. In Proceedings of the fifth annual ACM symposium on Theory of computing, pages 34–37. ACM Press, 1973. [55] Calogero G. Zarba. The Combination Problem in Automated Reasoning. PhD thesis, Stanford University, 2004. [37] M. Presburger. über die vollständigkeit eines gewissen systems der aritmethik ganzer zahlen, in welchem die addition als einzige operation hervortritt. In Comptes Rendus du premier Congrès des Mathématiciens des Pays slaves, Warsawa, pages 92–101, 1929. [56] Calogero G. Zarba. Combining sets with elements. In Nachum Dershowitz, editor, Verification: Theory and Practice, volume 2772 of Lecture Notes in Computer Science, pages 762–782. Springer, 2004. [38] William Pugh. Counting solutions to presburger formulas: how and why. In Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation, pages 121–134. ACM Press, 1994. [57] Calogero G. Zarba. A quantifier elimination algorithm for a fragment of set theory involving the cardinality operator. In 18th International Workshop on Unification, 2004. [39] William Pugh and David Wonnacott. Going beyond integer programming with the omega test to eliminate false data dependences. IEEE Trans. Parallel Distrib. Syst., 6(2):204– 211, 1995. 16 F ::= A ::= A | F1 ∧ F2 | F1 ∨ F2 | ¬F | ∃x.F | ∀x.F the terms P t1 , t2 , t is linear, so we can write it in the k form c0 + i=1 ci xi . Consequently, we may transform P the atomic formulas into forms 0 < c0 + ki=1 ci xi and Pk c dvd c0 + i=1 ci xi . Consider an elimination of an existential quantifier ∃x from a conjunction of such atomic formulas. Let c1 , . . . , cp be the coefficients next to x in the conjuncts and let M > 0 be the least common multiple of c1 , . . . , cp . Multiply each atomic formula of the form 0 < ci x + t by M/|ci |, and multiply each atomic formula of the form c dvd ci x + t by M/ci (yielding M c dvd M x + (M/ci )t). The result is an equivalent conjunction of formulas with the property that, in each conjunct, the coefficient next to x is M or −M . The conjunction is therefore of the form F0 (M x) for some formula F0 . The formula ∃x.F0 (M x) is equivalent to the formula ∃y.(F0 (y) ∧ M dvd y). By moving x to the left-hand side if its coefficient is −1 in the term t of each atomic formula 0 < t, replacing c dvd −y + t by c dvd y − t, and renaming y as x, it remains to eliminate an existential quantifier from ∃x.F (x) where T1 = T2 | T1 < T2 | C dvd T T ::= C | T1 + T2 | T1 − T2 | C · T C ::= . . . −2 | −1 | 0 | 1 | 2 . . . Figure 11: Formulas of Presburger Arithmetic PA 11 11.1 Appendix Quantifier Elimination for PA For completeness, this section reviews a procedure for quantifier elimination in Presburger arithmetic. For expository purposes we present a version of the quantifier elimination procedure that first transforms the formula into disjunctive normal form. The transformation to disjunctive normal form can be avoided, as observed in [11, 36, 40]. However, our results in Section 5 can be used with other variations of the quantifierelimination for Presburger arithmetic, and can be formulated in such a way that they not only do not depend on the technique for quantifier elimination for Presburger arithmetic, but do not depend on the technique for deciding Presburger arithmetic at all, allowing the use of automata-theoretic [23] and model checking techniques [19]. Figure 11 presents the syntax of Presburger arithmetic formulas. We interpret formulas over the structure of integers, with the standard interpretation of logical connectives, quantifiers, irreflexive total order on integers, addition, subtraction, and constants. We allow multiplication by a constant only (the case C · T in Figure 11), which is expressible using addition and subtraction. If c is a constant and t is a term, the notation c dvd t denotes that c divides t i.e., t mod c = 0. We assume that c > 0 in each formula c dvd t. We review a simple algorithm for deciding Presburger arithmetic inspired by [37], [51, Page 24], [11]. The algorithm we present eliminates an existential quantifier from a conjunction of literals in the language of Figure 11, which suffices by Section 4.1. Note first that we may eliminate all equalities t1 = t2 because F (x) ≡ i=1 p ^ bi < x ∧ i=1 r ^ ci dvd x + ti i=1 max(b1 , . . . , bp ) < u < min(a1 , . . . , aq ) Let b = max(b1 , . . . , bp ). Then ∃x.F (x) is equivalent to WN i=1 F (b + i). Namely, if a solution exists, it must be of the form b + i for some i > 0, and it suffices to check N consecutive numbers as argued above. Of course, we do not know the assignment to free variables of ∃x.F (x), so we do not know for which bi we have b = bi . However, we can check all possibilities for bi . We therefore have that ∃y.F (y) is equivalent to p N _ _ Next, we have ¬(t1 < t2 ) ⇐⇒ t2 < t1 + 1 and ¬(c dvd t) ⇐⇒ x < ai ∧ where x does not occur in any of ai , bi , ti . Let N be the least common multiple of V c1 , . . . , cr . Clearly, if x = u is a solution of F1 (x) ≡ ri=1 ci dvd x + ti , then so is x = u + N k for every integer k. IfVp = 0 and q = N 0 then ∃y.F (y) is equivalent to e.g. i=1 F (i), which eliminates the quantifier. Otherwise, suppose that p > 0 (the case q > 0 is analogous, and if p > 0 and q > 0 then both are applicable). Suppose for a moment that we are given an assignment to free variables of ∃x.F (x). Then the formula ∃x.F (x) is equivalent to W u F1 (u) where u ranges over the elements u such that t1 = t2 ⇐⇒ (t1 < t2 + 1) ∨ (t2 < t1 + 1) c−1 _ q ^ F (bj + i) j=1 i=1 c dvd t+i This completes the sketch of the quantifier elimination for Presburger arithmetic. We obtain the following result. i=1 which means that it suffices to consider the elimination of anVexistential quantifier from the formula of n the form i=1 A where each A is an atomic formula of the form t1 < t2 or of the form c dvd t. Each of Fact 4 For every first-order formula φ in the language of Presburger arithmetic of Figure 11 there exists a 17 quantifier-free formula ψ such that ψ is a disjunction of conjunctions of literals, the free variables of ψ are a subset of the free variables of φ, and ψ is equivalent to φ over the structure of integers. 11.2 11.3 Undecidability of MSOL of Integer Sets with Cardinalities We first note that there is a reduction from the Post Correspondence Problem that shows the undecidability of MSOL with equicardinality constraints. Namely, we can represent binary strings by finite sets of natural numbers. In this encoding, given a position, MSOL itself can easily express the local property that, at a given position, a string contains a given finite substring. The equicardinality gives the additional ability of finding an n-th element of an increasing sequence of elements. To encode a PCP instance, it suffices to write a formula checking the existence of a string (represented as set A) and the existence of two increasing sequences of equal length (represented by sets U and D), such that for each i, there exists a pair (aj , bj ) of PCP instance such that the position starting at Ui contains the constant string aj , and Ui+1 = Ui + |aj |, and similarly the position starting at Di contains bj and Di+1 = Di + |bj |. The undecidability of MSOL over strings extended with equicardinality can also be shown by encoding multiplication of natural numbers. Given A = {1, 2, ..., x} and B = {1, 2, ..., y}, we can define a set the set C = {x, 2x, ...y · x} as the set with the same number of elements as B, that contains x, and that is closed under unary operation z 7→ z + y. Therefore, if we represent a natural number n as the set {1, . . . , n}, we can define both multiplication and addition of integers. This means that we can write formulas whose satisfiability answers the existence of solutions of Diophantine equations, which is undecidable by [33]. A similar reduction to a logic that does not even have quantification over sets is presented in [57]. 18 O’Caml source code of algorithm α
2cs.AI
Under consideration for publication in Theory and Practice of Logic Programming 1 arXiv:cs/0406014v1 [cs.PL] 7 Jun 2004 PROGRAMMING PEARL O(1) reversible tree navigation without cycles RICHARD A. O’KEEFE The University of Otago, NZ (e-mail: [email protected]) Abstract Imperative programmers often use cyclically linked trees in order to achieve O(1) navigation time to neighbours. Some logic programmers believe that cyclic terms are necessary to achieve the same in logic-based languages. An old but little-known technique provides O(1) time and space navigation without cyclic links, in the form of reversible predicates. A small modification provides O(1) amortised time and space editing. 1 The problem When imperative programmers think of lists, they commonly choose doubly linked lists, instead of the singly linked lists that logic and functional programmers use. In the same way, it is extremely common for trees to be given parent links, whether they are really needed or not. A typical C example might be typedef int Datum; typedef struct TreeRec *TreePtr; struct TreeRec { TreePtr left, right, up, down; Datum datum; }; where ‘down’ points to the first child of a node, ‘up’ to its parents, and the children of a node form a doubly linked list with ‘left’ and ‘right’ pointers. Essentially this representation is required by the Document Object Model (W3C, 1998; W3C, 2000), for example. Cyclically linked trees in imperative languages such as Java provide constant time navigation in any of the four directions (up, down, left, right) and also constant time and constant space editing (insert, delete, replace). They do so at a price: each element is rigidly locked into place, so that any kind of space sharing (such as hash consing) is made impossible. Some logic programming languages have been designed to support cyclically linked terms. That does provide constant time navigation, but not editing. The locking into place that is a nuisance in imperative languages is a very serious difficulty 2 R. A. O’Keefe in logic programming languages. Additionally, reasoning about the termination of programs that traverse cyclic graphs is harder than reasoning about programs that traverse trees, whether in Prolog dialects or in lazy functional languages, so it is useful to get by with trees if we can. This article has two parts. In the first part, I present “fat pointers” that can be used to navigate around pure trees. The tree itself remains unmodified throughout. The main predicates I define have the form from to(From,To). If one of the arguments is ground and the other is uninstantiated, the time and space cost is O(1) per solution. In the second part, I present “edit pointers” that can be used to navigate around trees and edit them, in O(1) amortised time and space per step and edit. The type declarations are Mycroft/O’Keefe (Mycroft and O’Keefe, 1984) type declarations using the syntax of Mercury (Somogyi et al., 1995). The predicate declarations are also Mycroft/O’Keefe declarations giving argument types and modes. The code has been type-checked by the Mercury compiler. The clauses are Edinburgh Prolog. This paper provides evidence that using different definitions for different modes is useful, but that is difficult in Mercury, so the modes were not converted to Mercury syntax and the code does not pass Mercury mode-checking. 2 Acknowledgement This is a generalisation of a method for O(1) left and right navigation in a list shown to me by David H. D. Warren in 1983, in a text editor he wrote in Prolog. A companion paper (O’Keefe, 2000) presents this technique in a functional context. It was rejected on the grounds that the data structure had already been published by Huet as the Zipper in (Huet, 1997). However, the two data structures described in this paper and in (O’Keefe, 2000) are different from the Zipper, and the issues discussed here are different. 3 Fat Pointers The key idea is to distinguish between a tree and a pointer into a tree. The usual C/Java approach blurs this distinction, and that has misled some logic programmers into thinking that cyclically linked trees are necessary in order to obtain a certain effect in pointers. A tree just has to represent certain information; a pointer has to know how to move. A suitable data type for trees is :- type tree(Datum) ---> node(Datum, list(tree(Datum))). :- pred tree_datum(tree(D), D). tree_datum(node(Datum,_), Datum). :- pred tree_children(tree(D), list(tree(D))). tree_children(node(_,Children), Children). Programming pearl 3 Like a C pointer, a “fat pointer” points to a specific (sub)tree; unlike a C pointer, a “fat pointer” carries a context: the (sub)tree’s left siblings (ordered from nearest to furthest), its right siblings (ordered from nearest to furthest), and a parent fat pointer, if this is not the root. :- type pointer(D) ---> ptr(tree(D), list(tree(D)), list(tree(D)), pointer(D)) ; no_ptr. The predicates we define will never be true of a ‘no ptr’ argument. :- pred top_pointer(tree(D), pointer(D)). top_pointer(Tree, ptr(Tree,[],[],no_ptr)). :- pred pointer_tree(pointer(D), tree(D)). pointer_tree(ptr(Tree,_,_,_), Tree). :- pred pointer_datum(pointer(D), D). pointer_datum(ptr(Tree,_,_,_), Datum) :tree_datum(Tree, Datum). :- pred at_left(pointer(_)). at_left(ptr(_,[],_,_)). :- pred at_right(pointer(_)). at_right(ptr(_,_,[],_)). :- pred at_top(pointer(_)). at_top(ptr(_,_,_,no_ptr)). :- pred at_bottom(pointer(_)). at_bottom(ptr(Tree,_,_,_)) :tree_children(Tree, []). :- pred left_right(pointer(D), pointer(D)). left_right(ptr(T,L,[N|R],A), ptr(N,[T|L],R,A)). :- pred up_down_first(pointer(D), pointer(D)). up_down_first(P, ptr(T,[],R,P)) :% P = ptr(tree(_,[T|R]),_,_,_). P = ptr(Tree,_,_,_), tree_children(Tree, [T|R]). The ‘top pointer/2’ predicate may be used to make a fat pointer from a tree, or to extract a tree from a fat pointer positioned at top. The ‘at */1’ predicates recognise whether a fat pointer is positioned at a boundary. The query ‘left right(Left, Right)’ is true when Left and Right are pointers to adjacent siblings, Left on the left, and 4 R. A. O’Keefe Right on the right. The query ‘up down first(Up, Down)’ is true when Up is a pointer and Down is a pointer to Up’s first child; it is O(1) time and space in either direction provided that the list of children of a node is stored in that node and not recomputed. The query ‘up down(Up, Down)’ is to be true when Up is a pointer and Down is a pointer to any of Up’s children. It uses mode-dependent code. :- pred up_down(pointer(D), pointer(D)). up_down(P, ptr(T,L,R,A)) :( var(P) -> A = ptr(_,_,_,_), % not no_ptr, that is. P = A ; A = P, P = ptr(Tree,_,_,_), tree_children(Tree, Children), % split Children++[] into reverse(L)++[T]++R split_children(Children, [], L, T, R) ). :- pred split_children(list(T), list(T), list(T), T, list(T)). split_children([T|R], L, L, T, R). split_children([X|S], L0, L, T, R) :split_children(S, [X|L0], L, T, R). We could write this clearly enough as up_down_specification(P, ptr(T,L,R,P)) :P = ptr(tree(_,Children),_,_,_), split_children(Children, [], L, T, R). but then the cost of moving up would not be O(1). This is an interesting predicate, because getting efficient behaviour in multiple modes is not just a matter of subgoal ordering. In the (+,-) mode, it is acceptable to call ‘split children/5’, because that will be O(1) space and time per solution. In the (-,+) mode, we must bypass that call. If the code is encapsulated in a module and type checked, it is clear that the bypassed call must succeed, but that would not be obvious to a compiler. Queries in SGML and XML often ask for (not necessarily adjacent) preceding or following siblings of a node. Testing whether one node is a following sibling of another does not require mode-dependent code. However, in order to prevent unbounded backtracking in the reverse direction, the code below uses the technique of passing a variable (L2) twice: once for its value, and once so that its length can act as a depth bound. :- pred siblings_before_after(pointer(D), pointer(D)). siblings_before_after(ptr(T1,L1,R1,A), ptr(T2,L2,R2,A)) :right_move([T1|L1], R1, L2, [T2|R2], L2). Programming pearl 5 :- pred right_move(list(T), list(T), list(T), list(T), list(T)). right_move(L, R, L, R, _). right_move(L1, [X|R1], L2, R2, [_|B]) :right_move([X|L1], R1, L2, R2, B). Moving from left to right, this costs O(1) per following sibling. Moving from right to left, it costs O(n) per preceding sibling because the second clause builds up patterns of O(n) average length and the first clause unifies them against the known lists for each solution. The ‘left right star/2’ predicate below fixes this using mode-dependent code. I do not know whether O(1) cost per solution can be obtained with bidirectional code. Next we have transitive ( plus) and reflexive transitive ( star) closures of the basic predicates. Once again, we want to execute different code for the (+,-) and (-,+) modes of the ‘* plus/2’ predicates. :- pred left_right_star(pointer(D), pointer(D)). left_right_star(L, R) :( L = R ; left_right_plus(L, R) ). :- pred left_right_plus(pointer(D), pointer(D)). left_right_plus(L, R) :( var(L) -> left_right(X, R), left_right_star(L, X) ; left_right(L, X), left_right_star(X, R) ). :- pred up_down_star(pointer(D), pointer(D)). up_down_star(A, D) :( A = D ; up_down_plus(A, D) ). :- pred up_down_plus(pointer(D), pointer(D)). up_down_plus(A, D) :( var(A) -> up_down(X, D), up_down_star(A, X) ; up_down(A, X), up_down_star(X, D) ). 6 R. A. O’Keefe 4 Performance A simple benchmark is to build a large tree and traverse it. :- pred run. run :mk_tree(10, T), time((direct_datum(T, X), atom(X))), time((any_pointer_datum(T, X), atom(X))), time(labels(T,_)), time(collect(T,_)). :- pred mk_tree(integer, tree(integer)). mk_tree(D, node(D,C)) :( D > 0 -> D1 is D - 1, C = [T,T,T,T], mk_tree(D1, T) ; C = [] ). :- pred direct_datum(tree(D), D). direct_datum(node(D,_), D). direct_datum(node(_,C), D) :member(N, C), direct_datum(N, D). :- pred any_pointer_datum(tree(D), D). any_pointer_datum(T, D) :top_pointer(T, P), up_down_star(P, N), pointer_datum(N, D). :- pred labels(tree(D), list(D)). labels(Tree, Labels) :labels(Tree, Labels, []). :- pred labels(tree(D), list(D), list(D)). labels(node(Label,Children)) --> [Label], labels_list(Children). :- pred labels_list(list(tree(D)), list(D), list(D)). labels_list([]) --> []. labels_list([Tree|Trees]) --> labels(Tree), labels_list(Trees). Programming pearl 7 Table 1. Traversal times in seconds, by methods and languages search direct search pointer list direct list pointer 89.5s 13.2s 7.0s 235.0s 41.6s 16.9s 151.2s 10.5s 3.9s 197.0s 44.7s 22.5s N/A N/A N/A N/A 8.0s 2.5s 17.0s 5.6s system SWI Prolog 3.3.8 Quintus Prolog 3.4 SICStus Prolog 3.8.4 ghc 4.08.1 clm 1.3.1 :- pred collect(tree(D), list(D)). collect(Tree, Labels) :top_pointer(Tree, Ptr), collect(Ptr, Labels, []). :- pred collect(pointer(D), list(D), list(D)). collect(Ptr, [Datum|Labels1], Labels) :pointer_datum(Ptr, Datum), ( at_bottom(Ptr) -> Labels1 = Labels2 ; up_down_first(Ptr, Child), collect(Child, Labels1, Labels2) ), ( at_right(Ptr) -> Labels2 = Labels ; left_right(Ptr, Sibling), collect(Sibling, Labels2, Labels) ). this builds a tree with 1,398,101 nodes, and traverses it using a backtracking search (both directly and using “fat pointers”), and by building a list (both directly and using “fat pointers”). Table 1 shows the times for this benchmark, as measured on an 84 MHz SPARCstation 5. The last two rows of table 1 refer to lazy functional languages: Haskell (ghc), and Clean (clm). Both of those compilers use whole-program analysis, inlining, and strong type information, unlike the incremental, direct, and untyped Prolog compilers. 5 The findall/3 sharing problem The first draft of this article included measurements for findall/3. They were horrifying. This data structure is bad news for findall/3 and its relatives. To understand why, let’s consider three queries: q1(P, L) :- findall(Q, p1(P, Q), L). 8 R. A. O’Keefe q2(P, L) :- findall(T, p2(P, T), L). q3(P, L) :- findall(D, p3(P, D), L). p1(P, Q) :- up_down_star(P, Q). p2(P, T) :- p1(P, Q), Q = ptr(T, _). p3(P, D) :- p1(P, Q), pointer_datum(Q, D). For concreteness, suppose that P points to a complete binary tree with n nodes, and that the node data are one-word constants. Query q3 requires O(n) space to hold the result. Query q2 requires O(n log n) space to hold the result. This is because fragments of the tree are repeatedly copied. Query q1 requires at least O(n2 ) space to hold the result. Every pointer holds the entire tree to simplify movement upwards, so the entire tree and its fragments are repeatedly copied. If findall/3 copied terms using some kind of hash consing, the space cost could be reduced to O(n), but not the time cost, because it would still be necessary to test whether a newly generated solution could share structure with existing ones. One referee suggested that Mercury’s ‘solutions/2’ would be cleverer. A test in the 0.10 release showed that it is not yet clever enough. This is related to the problem of costly pointer unification: a fat pointer contains the entire original tree and many of its fragments as well as the fragment it directly refers to. But that is only a problem when you try to copy a fat pointer or unify it with something. The ‘siblings before after/2’ predicate is efficient if one of the arguments is ground and the other uninstantiated. With two ground arguments, it is expensive, because because testing whether two fat pointers are the same fat pointer is expensive in this representation. Two fat pointers are the same if and only if they unify, but that may involve comparing the source tree with itself (and its subtrees with themselves, perhaps repeatedly). After reading an earlier draft of this, Thomas Conway (Conway, 2000) suggested a variant in which unifying fat pointers would be O(n) instead of O(n2 ). I have not adopted his code, because it makes moving up take more time and turn over more memory. He stores just enough of a parent to reconstruct it, given the child, instead of the entire parent. Conway’s code is very nearly Huet’s Zipper (Huet, 1997). 6 Sets of Pointers Thomas Conway (Conway, 2000) has pointed out that it would be useful to form sets of (pointers to) nodes, and that fat pointers are not suitable for that because they are so costly to unify. Sets of nodes are required for the HyTime query language and by other query languages, including XPath (W3C, 1999). When one wants to form a set of subtrees, one might want a set of tree values, or a set of occurrences of tree values. Using a pointer forces you to work with occurrences rather than values, and that Programming pearl 9 is not always appropriate. The comparison of subtrees can be made more efficient by preprocessing the main tree so that every node contains a hash code calculated from its value. Preprocessing the main tree so that every node has a unique number would make pointer comparison fast too. The ‘pair’ type here is standard in Mercury, tracing back to ‘keysort/2’ in DEC-10 Prolog. :- type ntree(D) = tree(pair(integer,D)). :- type npointer(D) = pointer(pair(integer,D)). :- pred number_tree(tree(D), ntree(D)). number_tree(Tree, Numbered) :number_tree(Tree, Numbered, 0, _). :- pred number_tree(tree(D), ntree(D), integer, integer). number_tree(node(Datum,Children), node(N0-Datum,NumberedChildren), N0, N) :N1 is 1 + N0, number_children(Children, NumberedChildren, N1, N). :- pred number_children(list(tree(D)), list(ntree(D)), integer, integer). number_children([], [], N, N). number_children([C|Cs], [D|Ds], N0, N) :number_tree(C, D, N0, N1), number_children(Cs, Ds, N1, N). :- pred same_pointer(npointer(D), npointer(D)). same_pointer(P1, P2) :pointer_datum(P1, N-_), pointer_datum(P2, N-_). :- pred compare_pointers(order, npointer(D), npointer(D)). compare_pointers(O, P1, P2) :pointer_datum(P1, N1-_), pointer_datum(P2, N2-_), compare(O, N1, N2). Prolog, having no type classes, would require special purpose set operations for sets of fat pointers using this technique. Mercury, having type classes, would not require special code. 7 Hello Heraclitus, Goodbye Parmenides The data structure described in the previous section implements pointers that point at particular nodes in trees, may exist in large numbers, and may be stepped in 10 R. A. O’Keefe any direction at O(1) cost. It is useful for navigating around trees that are not to be changed. If you are writing an editor, it is a blunder to try to point at nodes. Instead, it is advisable to point between nodes, as Emacs does. We need a different data structure, and different operations. The real challenge, as Huet understood well in (Huet, 1997), is to show that declarative languages can handle editing effectively. The title of this article promised O(1) reversible navigation; it did not promise O(1) reversible editing. Reversible editing is attainable, and so is O(1) editing. My attempts to discover a data structure that supports O(1) reversible editing have so far failed. Because these operations are not reversible, I show input (+) and output (-) modes in the :- pred(Huet, 1997) declarations. The normal way in Prolog to “change” a node at depth d in a tree is to build a new tree sharing as much as possible with the old one; that takes O(d) time and space. The trick that permits O(1) cost edit operations is not to rebuild the new tree at once, but to interleave rebuilding with editing and navigation. An edit_ptr records the subtrees to either side of the current position, whether the sequence at this level has been edited, and what the parent position was. To “change” trees, we need a new operation that creates a new node with the same information as an old one, except for a new list of children. :- pred tree_rebuild(+list(tree(D)), +tree(D), -tree(D)). tree_rebuild(C, node(D,_), node(D,C)). The ‘extract/2’ predicate extracts the edited Tree from an edit_ptr. Since these predicates are not reversible, mode information is shown in the :-pred declarations. :- type ---> ; ; nlr(P) no_parent % this is the root left_parent(P) % came down on the left right_parent(P). % came down on the right. :- type changed ---> n ; y. :- type edit_ptr(D) ---> edit_ptr(list(tree(D)), list(tree(D)), changed, nlr(edit_ptr(D))). An edit pointer contains a list of the nodes preceding the current position (in near-to-far order), a list of the nodes following the current position (in near-to-far order), a ‘changed’ flag, and a parent pointer tagged so that we know whether we came down on the left or the right. One of the differences between this data structure and the Zipper (Huet, 1997) is Programming pearl 11 that the Zipper builds new retained structure as it moves, while this data structure uses a ‘changed’ flag to revert to the original structure if nothing has happened but movement. :- pred start(+tree(D), -edit_ptr(D)). start(T, edit_ptr([],[T],n,no_parent)). :- pred at_top(+edit_ptr(_)). at_top(edit_ptr(_,_,_,no_parent)). :- pred at_left(+edit_ptr(_)). at_left(edit_ptr([], _,_,_)). :- pred left_datum(+edit_ptr(D), ?D). left_datum(edit_ptr([T|_],_,_,_), D) :- tree_datum(T, D). :- pred left(+edit_ptr(D), -edit_ptr(D)). left(edit_ptr([T|L],R,C,P), edit_ptr(L,[T|R],C,P)). :- pred left_insert(+tree(D), +edit_ptr(D), -edit_ptr(D)). left_insert(T, edit_ptr(L,R,_,P), edit_ptr([T|L],R,y,P)). :- pred left_delete(-tree(D), +edit_ptr(D), -edit_ptr(D)). left_delete(T, edit_ptr([T|L],R,_,P), edit_ptr(L,R,y,P)). :- pred left_replace(+tree(D), +edit_ptr(D), -edit_ptr(D)). left_replace(T, edit_ptr([_|L],R,_,P), edit_ptr([T|L],R,y,P)). :- pred left_down(+edit_ptr(D), -edit_ptr(D)). left_down(P, edit_ptr([],K,n,left_parent(P))) :P = edit_ptr([T|_],_,_,_), tree_children(T, K). :- pred left_promote_children(+edit_ptr(D), -edit_ptr(D)). left_promote_children(edit_ptr([T|L],R,_,P), edit_ptr(L1,R,y,P)) :tree_children(T, K), reverse_append(K, L, L1). :- pred reverse_append(+list(T), +list(T), -list(T)). reverse_append([], R, R). reverse_append([X|S], R0, R) :reverse_append(S, [X|R0], R). :- pred at_right(+edit_ptr(_)). 12 R. A. O’Keefe at_right(edit_ptr(_,[],_,_)). :- pred right_datum(+edit_ptr(D), -D). right_datum(edit_ptr(_,[T|_],_,_), D) :- tree_datum(T, D). :- pred right(+edit_ptr(D), -edit_ptr(D)). right(edit_ptr(L,[T|R],C,P), edit_ptr([T|L],R,C,P)). :- pred right_insert(+tree(D), +edit_ptr(D), -edit_ptr(D)). right_insert(T, edit_ptr(L,R,_,P), edit_ptr(L,[T|R],y,P)). :- pred right_delete(-tree(D), +edit_ptr(D), -edit_ptr(D)). right_delete(T, edit_ptr(L,[T|R],_,P), edit_ptr(L,R,y,P)). :- pred right_replace(+tree(D), +edit_ptr(D), -edit_ptr(D)). right_replace(T, edit_ptr(L,[_|R],_,P), edit_ptr(L,[T|R],y,P)). :- pred right_down(+edit_ptr(D), -edit_ptr(D)). right_down(P, edit_ptr([],K,n,right_parent(P))) :P = edit_ptr(_,[T|_],_,_), tree_children(T, K). :- pred right_promote_children(+edit_ptr(D), -edit_ptr(D)). right_promote_children(edit_ptr(L,[T|R],_,P), edit_ptr(L,R1,y,P)) :tree_children(T, K), append(K, R, R1). :- pred up(+edit_ptr(D), -edit_ptr(D)). up(edit_ptr(_,_,n,left_parent(P)), P). up(edit_ptr(_,_,n,right_parent(P)), P). up(edit_ptr(X,Y,y,left_parent(edit_ptr([T|L],R,_,P))), edit_ptr([N|L],R,y,P)) :reverse_append(X, Y, K), tree_rebuild(K, T, N). up(edit_ptr(X,Y,y,right_parent(edit_ptr(L,[T|R],_,P))), edit_ptr(L,[N|R],y,P)) :reverse_append(X, Y, K), tree_rebuild(K, T, N). :- pred extract(+edit_ptr(D), -tree(D)). extract(edit_ptr(_,[T|_],_,no_parent), Tree) :- !, Tree = T. extract(P, Tree) :- up(P, P1), extract(P1, Tree). It is easy to see that each of these operations except ‘up’ and ‘extract’ requires Programming pearl 13 O(1) time and O(1) space, assuming that ‘tree children’ is O(1). Moving ‘up’ from a position with n nodes to its left takes O(n) time and space, but that position must have been reached by a minimum of n ‘right/2’ and/or ‘left insert/3’ operations, so in the single-threaded case all the basic operations are O(1) amortised time and space. 8 Why isn’t editing reversible? Essentially, because the editing operations destroy information. We can easily reverse the operations “move right” or “move down”, because the only thing that has changed is the position, and the name of the predicate tells us what the old position must have been. Suppose, however, we tried to make insertion and deletion the same operation: :- pred indel_right(D, edit_ptr(D), edit_ptr(D)). indel_right(T, edit_ptr(L,R,Fs,P), edit_ptr(L,[T|R],Fw,P)) :? We would not know how to define Fs and Fw. The edit pointer data structure may not have reversible operations, but it is a persistent1 data structure, so that an editor using it can easily support unbounded UNDO. 9 An example Imagine an application to HTML, where we might have :- type ---> ; :- type html_info element(atom,list(pair(atom,string))) pcdata(string). html_tree == tree(html_info). The <FONT> tag is almost always misused, and is not allowed in “strict” HTML4 or XHTML. So we might want to replace every <FONT> element by its contents. :- pred unfont(+html_tree, -html_tree). unfont(HTML0, HTML) :start(HTML0, Ptr0), unfont_loop(Ptr0, Ptr), extract(Ptr, HTML). :- pred unfont_loop(+edit_ptr(html_info), -edit_ptr(html_info)). unfont_loop(P0, P) :( at_right(P0) -> P = P0 1 “Persistence” has at least two meanings: out-living a program execution (as in PS-Algol) or surviving changes so that the original value can be resurrected (as here). 14 R. A. O’Keefe ; ; right_datum(P0, element(font,_)) -> right_promote_children(P0, P1), unfont_loop(P1, P) right_down(P0, P1), unfont_loop(P1, P2), up(P2, P3), right(P3, P4), unfont_loop(P4, P) ). 10 Conclusion We don’t need cyclic links or mutable objects in declarative languages to support efficient multiway traversal and editing of trees, including models of XML. References Conway, T., (2000). Private communication. Huet, G. (1997). Functional Pearl: “The Zipper”, J. Functional Programming 7 (5): pp. 549–554, September 1997. Mycroft, A. and O’Keefe, R. A. (1984) A Polymorphic type system for Prolog. Artificial Intelligence, vol.23, pp295–307. O’Keefe, R. (2000). “Lifting the Curse of DOM”, Submitted for publication. Somogyi, Z., Henderson, F., and Conway, T. (1995). “Mercury: an efficient purely declarative logic programming language”, in Proceedings of the Australian Computer Science Conference, Glenelg, Australia, February 1995, pp 499–512. http://www.cs.mu.oz.au/mercury/ has this and other Mercury papers. World Wide Web Consortium (1998). “Document Object Model Level 1 Recommendation”. URL: http://www.w3.org/TR/REC-DOM-Level-1/ World Wide Web Consortium (1999). “XML Path Language (XPath) Version 1.0”. URL: http://www.w3.org/TR/xpath/ World Wide Web Consortium (2000). “Document Object Model Level 2 Recommendation”, November 2000. URL: http://www.w3.org/TR/REC-DOM-Level-2/
2cs.AI
QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION arXiv:1701.03990v2 [quant-ph] 19 Jan 2018 JIANXIN CHEN‡ , ANDREW M. CHILDS∗,†,‡ , AND SHIH-HAN HUNG∗,‡ A BSTRACT. How many quantum queries are required to determine the coefficients of a degree-d polynomial in n variables? We present and analyze quantum algorithms for this multivariate polynomial interpolation problem over the fields F q , R, and C. We show that kC and 2kC queries suffice 1 n+d to achieve probability 1 for C and R, respectively, where kC = ⌈ n+ 1 ( d )⌉ except for d = 2 and four d n+d other special cases. For F q , we show that ⌈ n+d ( d )⌉ queries suffice to achieve probability approachd ing 1 for large field order q. The classical query complexity of this problem is (n+ d ), so our result n + 1 n + d provides a speedup by a factor of n + 1, 2 , and d for C, R, and F q , respectively. Thus we find a much larger gap between classical and quantum algorithms than the univariate case, where the speedup is by a factor of 2. For the case of F q , we conjecture that 2kC queries also suffice to achieve probability approaching 1 for large field order q, although we leave this as an open problem. 1. I NTRODUCTION Let f ( x1 , . . . , xn ) ∈ K [ x1 , . . . , xn ] be a polynomial of degree d. Suppose d is known and we are given a black box that computes f on any desired input. The polynomial interpolation problem is to determine all the coefficients of the polynomial by querying the black box. Classically, a multivariate polynomial can be interpolated by constructing a system of linear d equations. Invertibility of the Vandermonde matrix implies that (n+ d ) queries are necessary and sufficient to determine all the coefficients. (Note that one must choose the input values carefully to construct a full-rank Vandermonde matrix for n > 1 [GS00].) Recent work has established tight bounds on the quantum query complexity of interpolating univariate polynomials over a finite field F q . In particular, [CvDHS16] developed an optimal quantum algorithm that makes d+2 1 queries to succeed with bounded error and one more query to achieve success probability 1 − O(1/q). They also showed that the success probability of the algorithm is optimal among all algorithms making the same number of queries. Previous work [KK11, MP11] shows that no quantum algorithm can succeed with bounded error using fewer queries, so the optimal success probability exhibits a sharp transition as the number of queries is increased. For multivariate polynomials, [CvDHS16] conjectured that a straightforward analog of the uni1 n+d variate algorithm solves the interpolation problem with probability 1 − o(1) using ⌊ n+ 1 ( d )⌋ + 1 queries. However, while that conjecture is natural, the analysis of the algorithm appeared to require solving a difficult problem in algebraic geometry and was left open. (In addition, Montanaro considered the quantum query complexity of interpolating a multilinear polynomial [Mon12], but this is quite different from the general multivariate case.) To the best of our knowledge, all previous work on quantum algorithms for polynomial interpolation has focused on finite fields. Cryptographic applications of interpolation typically use finite fields, and the multivariate case could lead to new applications in that domain. However, polynomial interpolation over infinite fields is also a natural problem, especially considering the ubiquity of real- and complex-valued polynomials in numerical analysis. ∗ D EPARTMENT OF C OMPUTER S CIENCE , U NIVERSITY OF M ARYLAND I NSTITUTE FOR A DVANCED C OMPUTER S TUDIES , U NIVERSITY OF M ARYLAND ‡ J OINT C ENTER FOR Q UANTUM I NFORMATION AND C OMPUTER S CIENCE , U NIVERSITY OF M ARYLAND † 1 2 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG In this paper, we propose an approach to the quantum query complexity of polynomial interpolation in the continuum limit. To obtain a well-defined initial state, the algorithm prepares a superposition over a bounded working region. The bounded region limits the precision that can be achieved due to the uncertainty principle, but the algorithm can be made arbitrarily precise by taking an arbitrarily large region. Using this strategy, we present a quantum algorithm for multivariate polynomial interpolation over the real and complex numbers. To simplify the analysis, we allow the algorithm to work with arbitrarily precise inputs and outputs over R or C; in practice, sufficiently fine discretization of the space could achieve similar performance. We also consider multivariate polynomial interpolation over finite fields, where our algorithm can be viewed as a generalization of the univariate polynomial interpolation algorithm proposed in [CvDHS16]. To analyze the success probability of our approach, we relate it to the tensor rank problem. The rank of a given tensor, which is the smallest integer k such that the tensor can be decomposed as linear combination of k simple tensors (i.e., those that can be written as tensor products), was first introduced nearly a century ago. A half century later, with the advent of principal component analysis on multidimensional arrays, the study of tensor rank attracted further attention. However, it has recently been shown that most tensor problems, including tensor rank, are NP-hard [Hås90, HL13, Shi16], and restricting these problems to symmetric tensors does not seem to alleviate their NP-hardness [HL13, Shi16]. More specifically, tensor rank is NP-hard over any field extension of Q and NP-complete over a finite field F q . Fortunately, analyzing the success probability of multivariate polynomial interpolation does not require exactly computing the rank of a symmetric tensor. The number of queries needed to achieve success probability 1 can be translated to the smallest integer k such that almost every symmetric tensor can be decomposed as a linear combination of no more than k simple tensors. In turn, this quantity can be related to properties of certain secant varieties, which lets us take advantage of recent progress in algebraic geometry [BBO15, BT15]. The success probability of our algorithm behaves differently as a function of the number of queries for the three fields we consider. Specifically, by introducing   d = 2, n ≥ 2; n + 1 n+d 1 kC (n, d) := ⌈ n+1 ( d )⌉ + 1 (n, d) = (4, 3), (2, 4), (3, 4), (4, 4);   1 n+d otherwise, ⌈ n+1 ( d )⌉ (1) we have the following upper bounds on the query complexity: Theorem 1.1. For positive integers d and n, there exists a quantum algorithm for interpolating an n-variate polynomial of degree d over the field K using at most d n+d (1) n+ d ( d ) queries for K = F q , succeeding with probability 1 − O (1/q); (2) 2kC queries for K = R, succeeding with probability 1; (3) kC queries for K = C, succeeding with probability 1. Note that these upper bounds can be improved using known results [CvDHS16] for univariate polynomial interpolation (see the final remark in Section 3.3.3). The remainder of the paper is organized as follows. After introducing the notation and mathematical background in Section 2, we describe the query model in Section 3.1 and present our algorithms in Section 3.2. We then analyze the algorithm to establish our query complexity upper bounds in Section 3.3. In Section 4, we show that our proposed algorithm is optimal for finite fields. Finally, in Section 5 we conclude by mentioning some open questions. QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 2. P RELIMINARIES 3 AND NOTATIONS In Section 2.1, we introduce some notation that is used in the paper, especially when describing the algorithm in Section 3.2. Section 2.2 reviews basic definitions and concepts from algebraic geometry that arise in our performance analysis in Section 3.3. 2.1. Notation and definitions. Let f ∈ K [ x1 , . . . , xn ] be a polynomial of degree at most d over the j field K. We let x j := ∏ni=1 xii for j ∈ J, where J := { j ∈ N n : j1 + · · · + jn ≤ d} is the set of allowed d j exponents with size J := (n+ d ). Thus x is a monomial in x1 , . . . , xn of degree j1 + j2 + · · · + jn . With this notation, we write f ( x) = ∑ j∈J c j x j for some coefficients {c j ∈ K : j ∈ J }. Access to the function f is given by a black box that performs | x, yi 7→ | x, y + f ( x)i for all x ∈ K n and y ∈ K. We will compute the coefficients of f by performing phase queries, which are obtained by phase kickback over K, as detailed in Section 3.1. For k-dimensional vectors x, y ∈ K k , we consider the inner product · : K k × K k → K defined by x · y = ∑ki=1 xi yi , where x is the complex conjugate of x (where we let x = x for x ∈ F q ). We denote the indicator function for a set A ⊆ R n by I A (z), which is 1 if z ∈ A and 0 if z ∈ / A. We denote a ball of radius r ∈ R + centered at 0 by B(r). A lattice Λ is a discrete additive subgroup of R n for positive integer n generated by e1 , . . . , en ∈ R n . For every element x ∈ Λ, we have x = ∑ni=1 γi ei for some γi ∈ Z for i ∈ {1, . . . , n}. A fun damental domain T of Λ centered at zero is a subset of R n such that T = ∑ni=1 ai ei : ai ∈ − 21 , 12 . e is an additive subgroup of R n generated by f1 , . . . , f n ∈ R n The dual lattice of Λ, denoted by Λ, satsifying ei · f j = δij for i, j ∈ {1, . . . , n}. The standard basis over the real numbers is the set {| xi : x ∈ R n } for positive integer n. The amplitude of a state | ψi in the standard basis is denoted by ψ( x) or h x|ψi. The standard basis vectors over real numbers are orthonormal in the sense of the Dirac delta function, i.e., h x′ | xi = δ(n) ( x − x′ ) for x, x′ ∈ R n . 2.2. Algebraic geometry concepts. A subset V of K n is an algebraic set if it is the set of common zeros of a finite collection of polynomials g1 , g2 , . . . , gr with gi ∈ K [ x1 , x2 , . . . , xn ] for 1 ≤ i ≤ r. A finite union of algebraic sets is an algebraic set, and an arbitrary intersection of algebraic sets is again an algebraic set. Thus by taking the open subsets to be the complements of algebraic sets, we can define a topology, called the Zariski topology, on K n . A nonempty subset V of a topological space X is called irreducible if it cannot be expressed as the union of two proper (Zariski) closed subsets. The empty set is not considered to be irreducible. An affine algebraic variety is an irreducible closed subset of some K n . We define projective n-space, denoted by P n , to be the set of equivalence classes of (n + 1)tuples ( a0 , . . . , an ) of complex numbers, not all zero, under the equivalence relation given by ( a0 , . . . , an ) ∼ (λa0 , . . . , λan ) for all λ ∈ K, λ 6= 0. A notion of algebraic variety may also be introduced in projective spaces, giving the notion of a projective algebraic variety: a subset V ⊆ P n is an algebraic set if it is the set of common zeros of a finite collection of homogeneous polynomials g1 , g2 , . . . , gr with gi ∈ K [ x0 , x1 , . . . , xn ] for 1 ≤ i ≤ r. We call open subsets of irreducible projective varieties quasi-projective varieties. For any integers n and d, we define the Veronese map of degree d as Vd : [ x0 : x1 : · · · : xn ] 7→ [ x0d : x0d−1 x1 : · · · : xnd ] (2) where the notation with square brackets and colons denotes homogeneous coordinates and the expression in the output of Vd ranges over all monomials of degree d in x0 , x1 , . . . , xn . The image of Vd is an algebraic variety called a Veronese variety. Finally, for an irreducible algebraic variety V, its kth secant variety σk (V ) is the Zariski closure of the union of subspaces spanned by k distinct points chosen from V. 4 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG For more information about Veronese and secant varieties, refer to Example 2.4 and Example 11.30 in [Har92]. 3. Q UANTUM ALGORITHM FOR POLYNOMIAL INTERPOLATION 3.1. The query model. Using the standard concept of phase kickback, we encode the results of queries in the phase by performing standard queries in the Fourier basis. We briefly explain these queries for the three types of fields we consider. 3.1.1. Finite field F q . The order of a finite field can always be written as a prime power q := pr . Let e : F q → C be the exponential function e(z) := ei2πTr(z)/p where the trace function Tr : F q → r −1 2 F p is defined by Tr(z) := z + z p + z p + · · · + z p . The Fourier transform over F q is a unitary transformation acting as | xi 7→ √1q ∑y∈Fq e( xy) | yi for all x ∈ F q . The k-dimensional quantum 1 Fourier transform (QFT) is given by | xi 7→ qk/2 ∑y∈Fkq e( x · y) | yi for any x ∈ F kq . A phase query is simply the Fourier transform of a standard query. By performing an inverse QFT, a query, and then a QFT, we map | x, yi 7→ e(y f ( x)) | x, yi for any x, y ∈ F q . As in the univariate case, our algorithm is nonadaptive, making all queries in parallel for a carefully chosen superposition of inputs. With k parallel queries, we generate a phase ∑ki=1 yi f ( xi ) = j J k ∑ki=1 ∑ j∈J yi xi c j for the input ( x, y) ∈ F kq × F kq . For convenience, we define Z : F nk q × F q → F q by Z ( x, y) j = ∑ki=1 yi xi j for j ∈ J, so that ∑ki=1 yi f ( xi ) = Z ( x, y) · c. 3.1.2. Real numbers R. Let e : R → C be the exponential function e( x) := ei2πx . For any function ψ whose Fourier transform exists, the QFT over R acts as Z R dx ψ( x) | xi 7→ Z R dy Ψ(y) | yi , (3) R where Ψ(y) = R dx e(− xy)ψ( x). By Parseval’s theorem, the QFT is unitary. As in the finite field case, we construct a phase query by making a standard query in the Fourier basis, giving Z R2 dx dy ψ( x, y) | x, yi 7→ Z R2 dx dy e(y f ( x))ψ( x, y) | x, yi . (4) An algorithm making k parallel queries generates a phase Z ( x, y) · c, where we similarly define Z : R nk × R k → R J by Z ( x, y) j = ∑ki=1 yi xi j for j ∈ J. 3.1.3. Complex numbers C. The complex of the real √ numbers can be viewed as a field extension n numbers of degree 2, namely C = R [ −1]. For any positive integer n, let φn : C → R2n be an isomorphism φn ( x) := (Re( x1 ), Im( x1 ), Re( x2 ), Im( x2 ), . . . , Re( xn ), Im( xn )), which we also denote in boldface by x. A complex number x ∈ C can be stored in a quantum register as a tensor product of its real and imaginary parts, | xi = |Re( x)i |Im( x)i. A complex function ψ : C m → C n can be seen as a function with 2m variables. Let ψ( x) = ψ̃ (x). By abuse of notation, we will neglect the tilde and write ψ( x) = ψ(x). Let e : C → C be the exponential function e( x) := ei2πRe( x ) . For any function ψ : C → C whose Fourier transform exists, we define the transform Z R2 d2 x ψ ( x ) | x i 7 → Z R2 d2 y Ψ ( y ) | y i , (5) QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 5 R where Ψ(y) = R2 d2 x e(−yx)ψ(x). Note that in general Ψ(y) cannot be written in the form of Ψ(y) with a complex variable y ∈ C. To encode the output in the phase, the queries act as Z 2 R2 d x 7→ 7→ 7→ 7→ Z Z Z R2 Z R2 Z R2 R2 R2 d2 y ψ(x, y) | x, yi d2 x d2 x d2 x d2 x where we use the identity Z Z R2 Z R2 Z R d2 y d2 y R2 d2 y Z Z R2 d2 z ψ(x, y)e(−yz) | x, zi (6) R2 d2 z ψ(x, y)e(−yz) | x, z + f( x)i (7) R2 d2 z Z R2 d2 u ψ(x, y)e(−yz)e(u (z + f ( x))) | x, ui (8) d2 y ψ(x, y)e(y f ( x)) | x, yi , R2 R2 Z (9) d2 y e(y( x − x′ )) = δ(2) (x − x′ ) for x, x′ ∈ C. j An algorithm making k parallel queries generates a phase ∑ki=1 yi f ( xi ) = ∑ki=1 ∑ j∈J yi xi c j . We define Z : C nk × C k → C J satisfying Z ( x, y) j = ∑ki=1 yi xi j for j ∈ J, so that ∑ki=1 yi f ( xi ) = Z ( x, y) · c. 3.2. The algorithm. Our algorithm follows the same idea as in [CvDHS16]: we perform k phase queries in parallel for a carefully-chosen superposition of inputs, such that the output states corresponding to distinct polynomials are as distinguishable as possible. For a k-query quantum algorithm, we consider the mapping Z : K nk × K k → K J defined in Section 3.1 for K = F q , R, and C. Reference [CvDHS16] gave an optimal algorithm for n = 1 using a uniform superposition over a unique set of preimages of the range Rk := Z (K nk , K k ) of Z, so we apply the same strategy here. For each z ∈ Rk , we choose a unique ( x, y) ∈ K nk × K k such that Z ( x, y) = z. Let Tk be some set of unique representatives, so that Z : Tk → Rk is a bijection. 3.2.1. K = F q . The algorithm generates a uniform superposition over Tk , performs k phase queries, and computes Z in place, giving p 1 ∑ |Tk | ( x,y)∈ Tk | x, yi 7→ p 1 ∑ |Tk | ( x,y)∈ Tk e( Z ( x, y) · c) | x, yi 7→ p 1 ∑ | R k | z∈ Rk e( z · c) | zi . (10) We then measure in the basis of Fourier states | e ci := √1 J ∑z∈F J e(z · c) | zi. A simple calculation q q shows that the result of this measurement is the correct vector of coefficients with probability | Rk |/q J . 3.2.2. K = R. We consider a bounded subset S ⊆ R J and a set Tk′ of unique preimages of each element in Rk ∩ S such that Z ( Tk′ ) = Rk ∩ S and Z : Tk′ → Rk ∩ S is bijective. The algorithm on input | ψi with support supp(ψ) ⊆ Rk ∩ S gives |ψi = Z Rk ∩S d J z ψ( z) | zi 7→ 7→ 7→ Z Z Z Rk ∩S Rk ∩S Rk ∩S d J z ψ(z) | zi | Z −1 (z)i (11) d J z ψ(z)e(z · c) | zi | Z −1 (z)i (12) d J z ψ(z)e(z · c) | zi =: | ψc i . (13) The choice of S constrains the set of inputs that can be perfectly distinguished by this procedure, as captured by the following lemma. 6 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG R Lemma 3.1 (Orthogonality). For positive integer n, let m( A) := A dn z be the measure of the set A ⊆ R n R n . Let S be a bounded subset of R n with nonzero measure. Let | e ci = √ 1 S d z e( c · z) | zi and let U m(S) be the maximal subset of Rn c, c′ c′ , such that for any ∈ U with c 6= Z 1 dn z e((c − c′ ) · z) = 0. he c′ |e ci = m(S) S (14) Then there is a lattice Λ such that U ∈ R n /Λ. Proof. By definition, c − c′ must be a zero of the Fourier transform F (I S ) of the indicator function I S (z). We denote Λ := {c : F (I S )(c) = 0} ∪ {0} and let c0 ∈ U. Clearly U ⊆ c0 + Λ as Λ contains all zeros. Since hc^ + c0 |ce0 i = 0 for all c ∈ Λ\ {0}, we have c0 + Λ ⊆ U and U = ′ ^ c0 + Λ. If c ∈ Λ\ {0}, then hc^ 0 + c |ce0 i = h ce0 |c 0 − c i = 0 implies that − c ∈ Λ. If c, c ∈ Λ \ {0}, then hc^ + c0 |−^ c′ + c0 i = hc +^ c′ + c0 |ce0 i = 0 implies c + c′ ∈ Λ\ {0}. Therefore Λ is an additive n subgroup of R . Now we prove that Λ is a lattice. For ǫ > 0, δ ∈ B(ǫ), and c ∈ Λ, if S ⊆ B(r) for r < |hc] + δ |e c i|2 = 1 4ǫ . Z 2 S dn z e( δ · z) ≥ Z 2 S dn z cos(2πδ · z) >0 Thus B(ǫ) contains exactly one element in Λ and hence Λ is discrete. (15)  Roughly speaking, Lemma 3.1 is a consequence of the uncertainty principle: restricting the support to a finite window limits the precision with which we can determine the Fourier transform. In the proof, note that a larger window offers better resolution of the coefficients. We have shown that the set Λ of perfectly distinguishable coefficients forms a lattice. We also require the set {| e ci : c ∈ Λ} to be a complete basis. Since hz|e c i = √ 1 e(z · c), completeness m(S) implies that | zi is of the form ∑c∈Λ e(−z · c) | e c i up to a normalization constant. More formally, we have the following lemma. R Lemma 3.2 (Completeness). For positive integer n, let m( A) := A dn z be the measure of the set A ⊆ R n . Let Λ beR a discrete additive subgroup of R n . Let S be a bounded set with nonzero measure and n e ci = √ 1 |e S d z e( z · c ) | zi . Then {| c i : c ∈ Λ } forms a complete basis over support S if and only if S m(S) is a fundamental domain of the dual lattice of Λ. e be the dual lattice of Λ. We observe that (ignoring the normalization constant) Proof. Let Λ ∑ e(−z · c) |eci = c∈Λ = Z S J ′ dz ∑ e z0 ∈ Λ ∑ e((z c∈Λ ′ − z) · c) z ′ = Z S d J z′ ∑ e z0 ∈ Λ E e) ∩ S . I S ( z + z0 ) | z + z0 i = ( z + Λ δ ( z ′ − z − z0 ) z ′ (16) (17) In Equation (16), ∑c∈Λ e(z · c) = ∑z0 ∈Λe δ(z − z0 ) up to a constant factor [Hör83, Section 7.2]. The e ) ∩ S cannot be empty, so a fundamental domain of Λ e is a subset of S. For z, z′ ∈ R n , set (z + Λ ′ ′ e ) ∩ S|(z + Λ e ) ∩ Si = 0 if z ∈ e which implies that S is a subset of a fundamental h(z + Λ / z + Λ, e domain of Λ.  e Without Lemma 3.2 further restricts the bounded set S has to be a fundamental region of Λ. loss of generality, one may choose S to be a fundamental domain of a lattice centered at zero. In the last step, the algorithm applies the unitary operator Z 1 p (18) ∑ d J z e(−z · c′ ) c′ hz| m(S) c′ ∈Λ S QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 7 to the state | ψc i in Equation (13). The algorithm outputs c′ ∈ Λ with probability 1 m( Rk ∩ S)m(S) Z Rk ∩S d J z ψ(z)e(z · (c − c′ )) 2 ≤ m( Rk ∩ S) , m(S) (19) where the upper bound follows from the Cauchy-Schwarz inequality. The maximum is reached if I Rk ∩S (z) and c happens to be a lattice point. If c ∈ / Λ, the algorithm returns the ψ( z) = √ 1 m ( Rk ∩S) closest lattice point with high probability. To achieve arbitrarily high precision, one may want to take S → R J . In this limit, the basis of coefficients is normalized to the Dirac delta function, i.e., he c′ |ci = δ( J ) (c − c′ ). In this case, Λ → R J and the unitary operator in Equation (18) becomes the J-dimensional QFT over the real numbers. m( R ∩S) However, for the interpolation problem, the success probability m(kS) is not well-defined in the limit S → R J since different shapes for S can give different probabilities. Thus it is necessary to choose a bounded region, and we leave the optimal choice as an open question. Though the size of the fundamental domain S affects the resolution of the coefficients, it does not affect the maximal success probability m(mR(kS∩)S) . This can be seen by scale invariance: for every z ∈ Rk , there is a preimage ( x, y) such that Z ( x, y) = z. Then λz ∈ Rk since Z ( x, λy) = λz for any λ ∈ R. In terms of the bijection ℓ : z 7→ λz for λ ∈ R × , we have ℓ( Rk ) = Rk and ℓ( Rk ∩ S) = k ∩ℓ( S )) Rk ∩ ℓ(S). Then m( Rk ∩ ℓ(S)) = m(ℓ( Rk ∩ S)) = λ J m( Rk ∩ S) and hence m(mR(ℓ( = m(mR(kS∩)S) . S )) Thus we can make the precision arbitrarily high by taking S arbitrarily large, and we call the success probability of the algorithm. m ( Rk ∩S) m(S) 3.2.3. K = C. We consider a bounded set S ⊆ C J and a set Tk′ of unique preimages of each element in Rk ∩ S such that Z ( Tk′ ) = Rk and Z : Tk′ → Rk ∩ S is bijective. The algorithm on input | ψi with support supp(ψ) ⊆ Rk ∩ S gives |ψi = Z φ( Rk ∩S) d2J z ψ(z) | zi 7→ 7→ 7→ Z Z Z φ( Rk ∩S) φ( Rk ∩S) φ( Rk ∩S) d2J z ψ(z) | zi |φ( Z −1 (z))i (20) d2J z ψ(z)e(z · c) | zi |φ( Z −1 (z))i (21) d2J z ψ(z)e(z · c) | zi =: |ψc i . (22) By Lemma 3.1 and Lemma 3.2, the set S must be a fundamental domain in C J . Let {|e ci : c ∈ Λ} be the measurement basis. In the last step of the algorithm, we apply the unitary operator p 1 m(S) ∑ ′ Z c ∈φ(Λ) φ(S) d2J z e(−z · c′ ) c′ hz| (23) to the state | ψc i in Equation (22). The algorithm outputs c′ ∈ Λ with probability 1 m( Rk ∩ S)m(S) Z 2 φ( Rk ∩S) d2J z ψ(z)e(z · (c − c′ )) . (24) Again, since |ψi is normalized, Equation (24) cannot be arbitrarily large. By the Cauchy-Schwarz m( R ∩S) inequality, Equation (24) is upper bounded by m(kS) ; this maximal success probability is obI φ( Rk ∩S) (z) and c happens to be a lattice point. If c ∈ / Λ, the algorithm tained if ψ(z) = √ 1 m ( Rk ∩S) returns the closest lattice point with high probability. 8 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG By the same argument as in Section 3.2.2, we can show scale invariance holds for complex numk ∩ℓ( S )) bers: for ℓ : z 7→ λz where z ∈ C J and λ ∈ R × , m(mR(kS∩)S) = m(mR(ℓ( . Thus we can make the preS )) cision of the algorithm arbitrarily high by taking S arbitrarily large without affecting the maximal success probability. 3.3. Performance. We have shown in Section 3.2.1 that the optimal success probability is at most | Rk |/q J for K = Fq . For real and complex numbers, we consider a bounded support S in which the algorithm is performed. The success probability of the algorithm with this choice is at most m ( Rk ∩S) , as shown in Equation (19) and Equation (24). To establish the query complexity, first we m(S) show that if dim Rk = J, the algorithm outputs the coefficients with bounded error. R J d Lemma 3.3. For positive integers n, k, d, let J := (n+ and let m ( A ) : = d z be the volume of A ⊆ R J . ) d A j Let Z : K nk × K k , Z ( x, y) = ∑ki=1 yi xi for an infinite field K. Let Rk = Z (K nk , K k ) be the range of Z. If m( R ∩S) dim Rk = J, then m(kS) > 0 if S is a fundamental domain centered at 0. Proof. Rk is a constructible set for K = C and it is a semialgebraic set for K = R. By [BBO15] and [BT15], Rk has non-empty interior if dim( Rk ) = J for both cases. S is a fundamental domain centered at 0 with finite measure, so we only need to prove that m( Rk ∩ S) is of positive measure, or equivalently, that the interior of Rk and the interior of S have non-empty intersection. If this is not the case, then any interior point of S cannot be in the interior of Rk . By scale invariance of Rk , any point in K n except 0 cannot be in the interior of Rk , which contradicts the fact that Rk has non-empty interior given dim( Rk ) = J.  Lemma 3.3 shows that for infinite fields, although we perform the algorithm over a bounded support, the query complexity can be understood by considering the dimension of the entire set Rk . Moreover, by invoking recent work on typical ranks, we can establish the minimum number of queries to determine the coefficients almost surely. Now let vd ( x1 , x2 , . . . , xn ) be the (n+d d)-dimensional vector that contains all monomials with variables x1 , . . . , xn of degree no more than d as its entries. Let Xn,d := {vd ( x1 , x2 , . . . , xn ) : x1 , x2 , . . . , xn ∈ K } (25) where K is a given ground field. For example, we have X3,2 = {( x12 , x22 , x32 , x1 x2 , x1 x3 , x2 x3 , x1 , x2 , x3 , 1) T : x1 , x2 , x3 ∈ K }. (26) n +d Our question is to determine the smallest number k such that a generic vector in K ( d ) can be written as a linear combination of no more than k elements from Xn,d . More precisely, we have Rk = {∑ ki=1 ci vi : ci ∈ K, vi ∈ Xn,d }, and we ask what is the smallest number k such that Rk has n +d full measure in K ( d ) . Our approach requires basic knowledge of algebraic geometry—specifically, the concepts of Zariski topology, Veronese variety, and secant variety. Formal definitions can be found in Section 2.2. For the reader’s convenience, we also explain these concepts briefly when we first use them. Now we make two simple observations. d (1) In general, vd ( x1 , x2 , . . . , xn ) can be treated as an (n+ d )-dimensional vector that contains all monomials with variables x1 , . . . , xn , xn+1 of degree d as its entries, by simply taking the map ( x1 , x2 , . . . , xn ) 7→ ( xxn+1 1 , . . . , xxn+n 1 ) and multiplying by xnd +1 . For example, applying this mapping to X3,2 gives ′ X3,2 = {( x12 , x22 , x32 , x1 x2 , x1 x3 , x2 x3 , x1 x4 , x2 x4 , x3 x4 , x42 ) T : x1 , x2 , x3 , x4 ∈ K }. QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 9 ′ is slightly bigger than X The new set Xn,d n,d since it also contains those points corresponding to xn+1 = 0, but this will not affect our calculation since the difference is just a measure ′ . zero set in Xn,d ′ (2) The set Xn,d is the Veronese variety. One may also notice that this set is isomorphic to ⊗d ( x1 , x2 , . . . , x n + 1 ) T in the symmetric subspace. These observations imply that instead of studying Rk , we can study the new set ( ) R′k = k ′ ∑ ci v′i : ci ∈ K, v′i ∈ Xn,d . (27) i=1 In general, we have a sequence of inclusions: ′ Xn,d = R1′ ⊆ R2′ ⊆ · · · ⊆ R′k ⊆ · · · ⊆ K ( n +d d ) . (28) By taking the Zariski closure, we also have ′ = R′ ⊆ R′ ⊆ · · · ⊆ R′ ⊆ · · · ⊆ K ( Xn,d 2 1 k n +d d ) (29) ′ . where R′k is the kth secant variety of the Veronese variety Xn,d Palatini showed the following [Pal09, Adl87]: Lemma 3.4. If dim R′k+1 ≤ dim R′k + 1, then R′k+1 is linear. d ( ′ In particular, this shows that if dim R′k = (n+ d ), then R k = K n +d d ) . m ( Rk ∩S) For an infinite field K, define kK to be the smallest integer such that m(KS) = 1. Thus kK represents the minimal number of queries such that our algorithm succeeds with probability 1. For the finite field case K = F q , we only require that m ( RkF ∩S) q m(S) goes to 1 when q tends to infinity. 3.3.1. K = C. A theorem due to Alexander and Hirschowitz [AH95] implies an upper bound on the query complexity of polynomial interpolation over C. Theorem 3.5 (Alexander-Hirschowitz Theorem, [AH95]). The dimension of R′k satisfies  k ( k − 1)  d = 2, 2 ≤ k ≤ n;  k ( n + 1) − 2 n+d ′ dim Rk = ( d ) − 1 (d, n, k) = (3, 4, 7), (4, 2, 5), (4, 3, 9), (4, 4, 14);   n+d min{k(n + 1), ( d )} otherwise. (30) n +d Thus, the minimum k to make R′k = C ( d ) is   d = 2, n ≥ 2; n + 1 n+d 1 kC (n, d) := ⌈ n+1 ( d )⌉ + 1 (n, d) = (4, 3), (2, 4), (3, 4), (4, 4);   1 n+d otherwise. ⌈ n+1 ( d )⌉ (31) By parameter counting, we see that Rk is of full measure in R′k . It remains to show that R′k is of full measure in its Zariski closure R′k : Theorem 3.6. R′k is of full measure in R′k . Proof. R′k is just the image of the map ( Q1 , Q2 , . . . , Qk ) 7→ ( Q1 + Q2 + · · · + Qk ). By Exercise 3.19 in Chapter II of [Har77], R′k is a constructible set, so it contains an open subset of each connected component of R′k . Therefore its complement is of measure 0.  This immediately implies the following: 10 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG Corollary 3.7. Rk has measure 0 in C ( Thus, as the integer k increases, so does m ( Rk ∩S) . m(S) n +d d ) for k < kC (n, d) and measure 1 in C ( m ( R′k ∩S ) m(S) n +d d ) for k ≥ kC (n, d). suddenly jumps from 0 to 1 at the point kC (n, d), and This implies part (3) of Theorem 1.1. 3.3.2. K = R. Now consider the case K = R. For d = 2, (n + 1)-variate symmetric tensors are simply (n + 1) × (n + 1) symmetric matrices, so a random (n + 1)-variate symmetric tensor will be of rank n + 1 with probability 1. However, if the order of the symmetric tensors is larger than 2, the situation is much more complicated. For example, a random bivariate symmetric tensor of order 3 will be of two different ranks, 2 and 3, both with positive probabilities. n +d From the perspective of algebraic geometry, it still holds that R′k = R ( d ) for k ≥ kC (n, d), and n +d for k < kC (n, d), R′k is of measure zero in R ( d ) . It also holds that Rk is of full measure in R′k . However, the claim that R′k has full measure in R′k no longer holds over R. As we explained in the proof of Theorem 3.6, R′k is the image of the map ( Q1 , Q2 , . . . , Qk ) 7→ ( Q1 + Q2 + · · · + Qk ). For an algebraically closed field K, it is known that the image of any map is always a constructible set in its Zariski closure. Thus R′k is of full measure in R′k . Over R, it is easy to verify that the image may not be of full measure in its Zariski closure (a simple counterexample is x 7→ x2 ). Consequently, over C, R′k has non-empty interior for a unique value of k, and this value of k is called the generic rank. Over R, R′k is just a semialgebraic set and it has non-empty interior for several values of k, which are called the typical ranks. For the univariate case, we have the following theorem: Theorem 3.8 ([CO12, CR11]). For n = 1, all integers from kC = ⌈ d+2 1 ⌉ to kR = d are typical ranks. For the multivariate case n ≥ 2, it still holds that kC (n, d) defined in Section 3.3.1 is the smallest typical rank [BT15]. According to [BBO15], every rank between kC (n, d) and the top typical rank kR (n, d) is also typical. Thus we only need to study the top typical rank kR (n, d). Unfortunately, the top typical rank in general is not known. In the literature, considerable effort has been devoted to understanding the maximum possible rank kmax (n, d), which, by definition, is also an upper bound for kR (n, d). In particular, we have kmax (n, 2) ≤ n + 1 for n ≥ 2, kmax (2, 4) ≤ 11, 1 n+d kmax (3, 4) ≤ 19, kmax (4, 4) ≤ 29, kmax (4, 3) ≤ 15, and kmax (n, d) ≤ 2⌈ n+ 1 ( d )⌉ otherwise [BT15]. The above result implies kR (n, d) ≤ kmax (n, d) ≤ 2kC (n, d). We also mention a few other upper d bounds on kmax (n, d). Trivially we have kmax (n, d) ≤ (n+ d ). In [GS98, LT10], this was improved d n + d −1 to kmax (n, d) ≤ (n+ d ) − n. Later work showed that kmax ( n, d) ≤ ( n ) [BBS08]. Jelisiejew then d −5 proved that kmax (n, d) ≤ (n+nd−1) − (n+ n −2 ) [Jel13], and Ballico and De Paris then improved this to d −5 n + d −6 kmax (n, d) ≤ (n+nd−1) − (n+ n −2 ) − ( n −2 ) [BDP17]. For small cases, these bounds may be stronger than the bound kmax (n, d) ≤ 2kC (n, d) mentioned above. To summarize, we have the following, which implies part (2) of Theorem 1.1: Theorem 3.9. As the integer k increases from kC (n, d) − 1 to kR (n, d) ≤ 2kC (n, d), strictly increasing sequence from 0 to 1, and so does m ( R′k ∩S ) m(S) forms a m ( Rk ∩S) . m(S) 3.3.3. K = F q . We link the finite field case with the complex case using the Lang-Weil theorem: Theorem 3.10 (Lang-Weil Theorem, [LW54]). There exists a constant A(n, d, r) depending only on n, d, r such that for any variety V ⊆ P n with dimension r and degree d, if we define V over a finite field F q , the number of points in V must satisfy 1 | N − qr | ≤ (d − 1)(d − 2)qr − 2 + A(n, d, r)qr −1 . (32) QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 11 The Lang-Weil theorem shows that when q is large enough, the number of points in a variety over F q is very close to qdim V . So it actually tells us that m ( R′k ∩S ) m ( R′k ∩S ) m(S) = 0 if k < kC (n, d). It remains unclear whether m(S) > 0 for k = kC (n, d). Once again, for the finite field case, when we talk about the measure, we always assume q is sufficiently large. As in the real field case, the main challenge now is to study the measure of R′k in R′k . d For the upper bound, recall our notation that vd ( x1 , x2 , . . . , xn ) is the (n+ d )-dimensional vector that contains all monomials with degree no more than d as its entries. Here we make a slight change to the definition in which we require all those xi s in vd to be ′′ and R ′′ . We prove the following: nonzero. We can similarly define Xn,d k Lemma 3.11. Let rn,d be the minimum number such that | Rr′′n,d | = q( rn−1,d + rn,d−1 . n +d d ) − O(q( n +d d )−1 ). Then rn,d ≤ Proof. The proof is by induction on n + d. For n + d = 2, it is easy to verify r2,2 = 3 ≤ r1,2 + r2,1 = 2 + 1. Assume Lemma 3.11 holds for n + d ≤ m − 1 and consider the pair (n, d) with n + d = m. For the sake of readability, we first explain how the induction works for the specific example (n, d) = (3, 2), and then generalize our idea to any (n, d). The vector ′′ v2 ( x1 , x2 , x3 ) = ( x12 , x22 , x32 , x1 x2 , x1 x3 , x2 x3 , x1 , x2 , x3 , 1) T ∈ X3,2 (33) can be rearranged as ( x3 , x3 x1 , x3 x2 , x32 , x12 , x22 , x1 x2 , x1 , x2 , 1) T . The first 4 entries can be rewritten as x32 ( x13 , xx31 , xx23 , 1) T = x32 v1 ( x13 , xx31 , xx23 ), and the last 6 entries form v2 ( x1 , x2 ). When ( x1 , x2 , x3 ) ranges over all 3-tuples in F q \ {0}, ( x13 , xx31 , xx23 ) also ranges over all possible 3-tuples in F q \ {0}. By assumption, if we take linear combinations of r3,1 vectors chosen from 3 +1 (3 + 1 ) 3 +1 ′′ , the first 4 entries will range over no fewer than q( 1 ) − O ( q( 1 )−1 ) different vectors in F 1 . X3,2 q For any such linear combination, we can add r2,2 extra vectors from X3,2 with the restriction that x3 = 0, which will guarantee these extra vectors do not affect the first 4 entries. By assumption, 2 +2 2 +2 (2 + 2 ) the last 6 entries will range over no fewer than q( 2 ) − O(q( 2 )−1 ) different vectors in F q 2 .  2 +2  3 +1 3 +1 2 +2 ( 3 +2 ) Thus, in total, we have q( 1 ) − O(q( 1 )−1 ) q( 2 ) − O(q( 2 )−1 ) different vectors in F q 2 if we ′′ , which implies r take linear combinations of r3,1 + r2,2 vectors from X3,2 3,2 ≤ r3,1 + r2,2 . d For general (n, d), the analogous partition of vd ( x1 , x2 , . . . , xn ) is still valid. Those (n+ d )− (n−d1+d) = (n+d−d−1 1) entries involving xn will form xnd−1 vd−1 ( x1n , xxn1 , . . . , xxn−n 1 ) and the rest will form vd ( x1 , x2 , . . . , xn−1 ). All arguments follow straightforwardly, so we have rn,d ≤ rn−1,d + rn,d−1 for n + d = m and for any (n, d) by induction.  d −1 Corollary 3.12. rn,d ≤ (n+ d −1 ). Proof. We use induction on n + d. For n + d = 2, it is easy to verify. If it is true for n + d = m, then d −2 n + d −2 n + d −1 for n + d = m + 1, we have rn,d ≤ rn−1,d + rn,d−1 ≤ (n+  d −1 ) + ( d −2 ) = ( d −1 ). R′′k is obviously a subset of R′k , so kFq (n, d) ≤ rn,d . By combining Theorem 3.10 and Corollary 3.12, we have the following, which implies part (1) of Theorem 1.1: d −1 Corollary 3.13. kC (n, d) ≤ kFq (n, d) ≤ rn,d ≤ (n+ d −1 ) = d n+d n + d ( d ). Remark 3.14. By combining Corollary 3.12 with the fact rn,2 ≥ kC (n, 2), we have rn,2 = n + 1. 12 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG Remark 3.15. It was previously known that rn,1 = 1 [BV97, dBCW02] and r1,d = ⌈ d+2 1 ⌉ [CvDHS16]. We can further refine the upper bound using these boundary conditions:       d −2  d −2  d+n−3 n−2+i n−2+i d−i+3 d+n−3 + r1,d−i + rn,d ≤ ∑ ≤ ∑ 2 d−1 i i d−1 i=0 i=0       n+d+2 n+d−3 d+n−3 n−1 n+d−2 = − + . (34) 2 2 n−1 n d−1 4. O PTIMALITY In this section, we show that our algorithm is optimal for the case of finite fields. Specifically, we show that no k-query quantum algorithm can succeed with probability greater than | Rk |/q J . This follows by essentially the same argument as in the univariate case [CvDHS16]. First we show that the final state of a k-query algorithm is restricted to a subspace of dimension | Rk |. We prove the following: d Lemma 4.1 (cf. Lemma 3 of [CvDHS16, arXiv version]). Let J := (n+ d ), and let | ψc i be the state of any quantum algorithm after k queries, where the black box contains c ∈ F qJ . Then dim span{| ψc i : c ∈ F qJ } ≤ | Rk |. Proof. Following the same technique as in the proof of Lemma 3 in [CvDHS16, arXiv version], consider a general k-query quantum algorithm Uk Qc Uk−1 Qc . . . Qc U1 Qc U0 acting on a state space of the form | x, y, wi for an arbitrary-sized workspace register |wi. Here Qc : | x, yi 7→ e(y f ( x)) | x, yi for x ∈ F nq , y ∈ F q is the phase query. Starting from the initial state | x0 , y0 , w0 i = |0, 0, 0i, we can write the output state in the form |ψc i = ∑ z∈ Rk e( z · c) | ξ z i , (35) where with x = ( x1 , . . . , xk ) ∈ (F nq )k , y = (y1 , . . . , yk ) ∈ F kq , w = (w1 , . . . , wk+1 ) and I an appropriate index set, ! |ξ z i = ∑ ∑ ( x,y)∈ Z−1 ( z) xk +1 ∈F nq , y k +1 ∈ F q , w ∈ I k +1 k ∏ x j+1 , y j+1 , w j+1 U j x j , y j , w j j=0 Then dim span{| ψc i : c ∈ F qJ } ≤ dim span {| ξ z i : z ∈ Rk } ≤ | Rk |. | xk+1 , yk+1 , w k+1 i . (36)  We also use the following basic lemma about the distinguishability of a set of quantum states in a space of restricted dimension. Lemma 4.2 (Lemma 2 of [CvDHS16, arXiv version]). Suppose we are given a state | φc i with c ∈ C chosen uniformly at random. Then the probability of correctly determining c with some orthogonal measurement is at most dim span{φc : c ∈ C }/|C |. Combining these lemmas, the success probability of multivariate interpolation under the uniform distribution over c ∈ F qJ (and hence also in the worst case) is at most | Rk |/q J . Unfortunately it is unclear how to generalize this argument to the infinite-dimensional case, so we leave lower bounds on the query complexity of polynomial interpolation over R and C as a topic for future work. QUANTUM ALGORITHM FOR MULTIVARIATE POLYNOMIAL INTERPOLATION 5. C ONCLUSION 13 AND OPEN PROBLEMS In this paper, we studied the number of quantum queries required to determine the coefficients of a degree-d polynomial in n variables over a field K. We proposed a quantum algorithm that works for K = C, R, or F q , and we used it to give upper bounds on the quantum query complexity of multivariate polynomial interpolation in each case. Our results show a substantially larger gap between classical and quantum algorithms than the univariate case. There are still several open questions that remain. Recall that kK represents the minimal number of queries required for our algorithm to succeed with probability 1 over the field K (or with probability approaching 1 for large q if K = F q ). First, for the finite field case K = F q , can we bound kFq by CkC where C is a constant independent of the degree d? For the values of (n, d) for which explicit values of kC , kR and kFq are known, we always have kC ≤ kFq ≤ kR . For example, kC (1, d) = kFq (1, d) = ⌈ d+2 1 ⌉ ≤ d = kR (1, d) and kC (n, 2) = kFq (n, 2) = kR (n, 2) = n + 1. Thus it is plausible to conjecture that kFq (n, d) ≤ kR (n, d), which would imply kFq ≤ 2kC . Another question is whether we can always obtain positive success probability with only kC queries. We know that kC queries are sufficient to achieve positive success probability for K = C and R, but are they also sufficient for K = F q ? Indeed, if they are, then kFq ≤ 2kC follows immediately. To see this, if there is a point p with rank greater than 2kC , then consider a line through p and a point q with rank kC . This line has no other points with rank at most kC , since otherwise p would be of rank no more than 2kC , a contradiction. Therefore, the measure of the set of points with rank kC must be less than a fraction 1q of the whole space, which contradicts the assumption that kC queries suffice. Thus there is no point with rank greater than 2kC —or in other words, if kC queries are sufficient to achieve positive success probability, then 2kC queries are sufficient to achieve success probability 1. While we considered an algorithm with a bounded working region, it is unclear what is the highest success probability that can be achieved by a general k-query algorithm without this restriction (and in particular, whether fewer than kK queries could suffice to solve the problem with high probability). Indeed, even for the algorithm we proposed in Section 3.2, it remains open to understand what choice of the region S leads to the highest success probability. As mentioned in Section 4, it would be useful to establish lower bounds on the query complexity of polynomial interpolation over infinite fields. Also, as stated in [CvDHS16], for the univariate case over finite fields, the algorithm is time efficient since the function Z −1 (z), i.e., finding a preimage of elements in the range of Z, is efficiently computable. However, for multivariate cases, it remains open whether there is an analogous efficiency analysis. Finally, Zhandry has placed the quantum algorithm for polynomial interpolation in a broader framework that includes other problems such as polynomial evaluation and extrapolation [Zha15]. It could be interesting to consider these problems for multivariate polynomials and/or over infinite fields. A CKNOWLEDGMENTS We thank Charles Clark for encouraging us to consider quantum algorithms for polynomial interpolation over the real numbers. J.C. would also like to thank Jun Yu and Chi-Kwong Li for helpful comments in early discussions of the project. This work received support from the Canadian Institute for Advanced Research, the Department of Defense, and the National Science Foundation (grant 1526380). R EFERENCES [Adl87] Bjorn Adlandsvik, Joins and higher secant varieties., Mathematica Scandinavica 61 (1987), 213–222. [AH95] James Alexander and André Hirschowitz, Polynomial interpolation in several variables, Journal of Algebraic Geometry 4 (1995), no. 2, 201–222. 14 JIANXIN CHEN, ANDREW M. CHILDS, AND SHIH-HAN HUNG [BBO15] Alessandra Bernardi, Grigoriy Blekherman, and Giorgio Ottaviani, On real typical ranks, 2015, arXiv:1512.01853. [BBS08] Andrzej Białynicki-Birula and Andrzej Schinzel, Representations of multivariate polynomials by sums of univariate polynomials in linear forms, Colloquium Mathematicum 112 (2008), no. 2, 201–233. [BDP17] Edoardo Ballico and Alessandro De Paris, Generic power sum decompositions and bounds for the Waring rank, Discrete & Computational Geometry (2017), 1–19, available at arXiv:1312.3494. [BT15] Grigoriy Blekherman and Zach Teitler, On maximum, typical and generic ranks, Mathematische Annalen 362 (2015), no. 3-4, 1021–1031, available at arXiv:1402.2371. [BV97] Ethan Bernstein and Umesh Vazirani, Quantum complexity theory, SIAM Journal on Computing 26 (1997), no. 5, 1411–1473. [CO12] Pierre Comon and Giorgio Ottaviani, On the typical rank of real binary forms, Linear and multilinear algebra 60 (2012), no. 6, 657–667, available at arXiv:0909.4865. [CR11] Antonio Causa and Riccardo Re, On the maximum rank of a real binary form, Annali di Matematica Pura ed Applicata 190 (2011), no. 1, 55–59, available at arXiv:1006.5127. [CvDHS16] Andrew M. Childs, Wim van Dam, Shih-Han Hung, and Igor E. Shparlinski, Optimal quantum algorithm for polynomial interpolation, 43rd international colloquium on automata, languages, and programming (ICALP 2016), 2016, pp. 16:1–16:13, available at arXiv:1509.09271. [dBCW02] J. Niel de Beaudrap, Richard Cleve, and John Watrous, Sharp quantum vs. classical query complexity separations, Algorithmica 34 (2002), 449–461, available at arXiv:quant-ph/0011065. [GS98] Anthony V. Geramita and Henry K. Schenck, Fat points, inverse systems, and piecewise polynomial functions, Journal of Algebra 204 (1998), no. 1, 116–128. [GS00] Mariano Gasca and Thomas Sauer, Polynomial interpolation in several variables, Advances in Computational Mathematics 12 (2000), no. 4, 377–410. [Har77] Robin Hartshorne, Algebraic geometry, Graduate Texts in Mathematics, vol. 52, Springer, 1977. [Har92] Joe Harris, Algebraic geometry: A first course, Graduate Texts in Mathematics, vol. 133, Springer, 1992. [Hås90] Johan Håstad, Tensor rank is NP-complete, Journal of Algorithms 11 (1990), no. 4, 644–654. [HL13] Christopher J. Hillar and Lek-Heng Lim, Most tensor problems are NP-hard, Journal of the ACM 60 (2013), no. 6, 45:1–45:39, available at arXiv:0911.1393. [Hör83] Lars Hörmander, The analysis of linear partial differential operators: Distribution theory and fourier analysis, Springer, 1983. [Jel13] Joachim Jelisiejew, An upper bound for the Waring rank of a form, 2013, arXiv:1305.6957. [KK11] Daniel M. Kane and Samuel A. Kutin, Quantum interpolation of polynomials, Quantum Information & Computation 11 (2011), no. 1, 95–103, available at arXiv:0909.5683. [LT10] Joseph M. Landsberg and Zach Teitler, On the ranks and border ranks of symmetric tensors, Foundations of Computational Mathematics 10 (2010), no. 3, 339–366, available at arXiv:0901.0487. [LW54] Serge Lang and André Weil, Number of points of varieties in finite fields, American Journal of Mathematics 76 (1954), no. 4, 819–827. [Mon12] Ashley Montanaro, The quantum query complexity of learning multilinear polynomials, Information Processing Letters 112 (2012), no. 11, 438–442, available at arXiv:1105.3310. [MP11] David A. Meyer and James Pommersheim, On the uselessness of quantum queries, Theoretical Computer Science 412 (2011), no. 51, 7068–7074, available at arXiv:1004.1434. [Pal09] F. Palatini, Sulle varietà algebriche per le quali sono di dimensione minore dell’ordinario, senza riempire lo spazio ambiente, una o alcune delle variet‘a formate da spazi seganti, Atti. Accad. Torino 44 (1909), 362–374. [Shi16] Yaroslav Shitov, How hard is the tensor rank?, 2016, arXiv:1611.01559. [Zha15] Mark Zhandry, Quantum oracle classification: The case of group structure, 2015, arXiv:1510.08352.
8cs.DS
Object-oriented tools for advanced applications (an extended abstract) L.Yu. Ismailova, K.E. Zinchenko arXiv:cs/0106023v1 [cs.LO] 11 Jun 2001 Vorotnikovskiy per, 7, bld. 4 Institute for Contemporary Education “JurInfoR-MSU ” Moscow, 103006, Russia [email protected] Actual Objects Abstract Potential Objects This paper contains a brief discussion of the Application Development Environment (ADE) that is used to build database applications involving the graphical user interface (GUI). ADE computing separates the database access and the user interface. The variety of applications may be generated that communicate with different and distinct desktop databases. The advanced techniques allows to involve remote or stored procedures retrieval and call. ❡ ❡ h(i) ❡ ✯ ✟ ✟ ✟ h ❡ ✟✟ ❡ ❡ ✟✟ ✟✟ ❡ ✟✟ ❡✟ Events i Introduction Recent research activity generated not only the valuable advance in understanding the nature of object but stimulated the experimental efforts in development the object-oriented tools. Here is briefly discussed the Application Development Environment (ADE) that is used to build database applications involving the graphical user interface (GUI). ADE computing separates the database access and the user interface. The variety of applications may be generated that communicate with different and distinct desktop databases. The advanced techniques allows to involve remote or stored procedures retrieval and call. According to an object-oriented traditions [Gro91], ADE include some basic features of inheritance, encapsulation, and polymorphism. They are used to derive an actual object to cover the needed information resources. The potential object (PO) is composed with the menu (M), data access (DA), and modular counterparts (MC). The Ancestor Potential Objects (APO) contain the menus, events, event evolver, attributes and functions (that are encapsulated). The Descendant Potential Objects (DPO) are inherited from APO. The aim of the current contribution is to give a brief profile of the ADE project without any detailed mathematical or implementational consideration. Nevertheless, some mathematical background corresponds to the references [Gro91], [He95]. Other less traditional for the database area ideas are due to [Wol96a] to conform the object compu- ❡ Figure 1: Event Driven Objects. Here: possible object h is the mapping from the event (assignment) i into the actual object h(i). Note that a set of the possible objects {h|h : I → T } = HT (I) represents an idea of functor-as-object for I is a category of events, T is a (sub)category of the actual objects - type. tation strategies. The main ADE building blocks have the relative uniformity to resolve the modular linkages. ADE enables the host computational environment to extend the properties of the distinct MC. 1 Event driven objects The MC is a holder of all the controls to communicate with the user. The event is assigned by the user call (for instance, clicking) or selection. Thus, when the activity is initiated, the following main events may be triggered: respond to a request from the user application, database retrieval or updating. The possible order of the events is prescribed by evolver and is determined by the scripts. A fragment of the event driven procedure is shown in Fig. 1 1.1 Proceedings of the 3rd International Workshop on Advances in Databases and Information Systems (ADBIS’96). Moscow, September 10–13, 1996. Vol. 2: Extended abstracts. Moscow: MEPhI, 1996. c 1996–2001 L.Yu. Ismailova Menu Menu gives more flexibility to the attribute selection. Usually the lists of possible attributes are supported to give the developer or user more freedom. Menus are established to be encapsulated in APO and are inherited in DPO. 27 1.2 Particular application models and related formal systems (like combinatory logic) having been elucidated. Logician H.Curry and his school independently investigated the concepts of the ‘object’ and the ‘substitution’ in order to render theoretical computer science with the trustworthy representations from the early 1960’s (in fact, even earlier). The results obtained by H.CurryD.S.Scott became the mathematical foundations of modern computer science and inspired many subsequent works, e.g. D.Turner ([1979] applicative programming), T.Hughes ([1982] supercombinators in programming), P.-L. Curien et.al. ([1985] categorical combinatory logic in programming), P. Fradet et.al. ([1990-91] functional programming languages reducible to collections (systems) of combinators). All these investigations as well as adjoining contemporary works employ the idea of ‘object’ borrowed from the combinatory logic (in the sense of Curry-Scott). The analysis of problems arose and, in particular, representation of transition processes in information systems (dependency of program code on the basis of combinators, transition from some basis to another etc.) reflects the principle effect of varying the primary established objects. The attempts of partial solutions do not result in an adequate mathematical apparatus. Some advance was done within the applicative computational framework (see references in [Wol96a]). The particular application is derived from Potential Object Library (POL) giving rise to Actual Object Libraries (AOL). 2 Computational and relative backgrounds ADE concepts are based on a variant of computation theory for information systems. The object-oriented programming, data base and knowledge base engineering are included. Some vital concepts have clear mathematical representations: data object that represents the computer stored data; metadata object that represents the conceptual information; assignment that captures more dynamics and intrinsic states; expansible database that represent the individualized self contained object couples. The main feature of the general approach is in embedding the typed entities (also the variable concepts) into the typeless system that is based on the a theory of the variable concepts. The last one is fitted to capture the dynamics of different objects and switching the states in the information systems. The prescribed modes in the information systems as a rule are corresponded to the known classic cases: the relational database theory, frame theory and logical reasoning in knowledge systems, theory of programming. The implementation results in a nonCoddian notion of (relational) database management system. Coddian type of database is equipped with the first order relational logic but the current data objects’ base needs a higher order logic with the descriptions. To extract its possible advantages the unified architecture based on extensible data objects’ model is proposed. It supports the main object-oriented mechanisms of encapsulation, polymorphism and inheritance and contains five major components. They are Conceptual Shell (CS), Application Development Environment (ADE), Basic Relational Tool System (BRTS), and MetaRelational Tool System (MRTS). Some general counterparts neatly corresponding to ADE are reflected in Fig. 1. These subsystems are relatively self-contained, and incorporated into the ToolKit. BRTS supports relational interfaces (extensional level), MRTS adds the intentional level, and the pair <BRTS, MRTS> gives the enhanced relational features. ADE contains the extensible data objects’ model and manipulates the switching, or variable concepts (references may be found in [Wol96a]). Both BRTS and MRTS are embedded into ADE. CS adds an external interactive mode to maintain and generate applications. 3 4 Applied research The starting point for ADE project originates from the various object notions. Known results in the field of relational data bases (originated from works by E. Codd and his school [1972 and later]), in the field of conceptual modelling (M.Brodie [1984 and later]), in the field of knowledge based systems (including inference and transformation mechanisms) chiefly deal with established modes of information systems. Establishing the representation of a concept as invariant on variations, creating the tools of ‘evolving the concept’ as a mathematical process overtakes these essential difficulties and are put into fundamentals of analysis an information system dynamics (also the transition or switching processes). Developing the theory of variable concepts naturally arises from the very process of creating theoretical foundations of computer science. Information systems contain besides database (DB) also the metadata base (MDB) that does include different facts concerning database. In applications metadata bases are used as the components of knowledge system with knowledge bases. Both parts, DB and MDB communicate each other and the host computational environment of information system. The relative ideas were understood from 1987 in the nine known research projects of extensible database systems. De Witt ([1988] and later) gave a brief comparison and further directions of the possible research. The main ideas were concentrated on a model of data. Even the project without any pre-defined data model was proclaimed, but the desirable degree of flexibility was not achieved. The most prominent experiments with experimental (object-oriented) extensible system have used the molecular chaining of objects to avoid the known difficulties in designing and development. But the completed solution was not obtained neither in a theory nor in practice. The design of the systems which accumulate and process both information and metainformation does influence the effectiveness of information system, the efforts of its designing, maintenance, modifications and extensions. This results in the problem of designing the Application Development Environment (ADE) which communicates with the varying DB The relative approaches The ADE notion is based on the theory of variable concepts in the form of variable sets originate from F.Lawvere investigations carried out in 1970’s. These constructions were used in elementary category theory, in particular in representation of predicate logic. Until present time these results were of interest only for theoreticians. In computer science variable sets are used in the form of variable domains’ theories in denotational semantics of programming languages (pioneer investigations by C.Starchey & C.Wadsworth [1974]). Variable collections (sets) are more widely used in computer science in the from of approximation lattices (works by D.S. Scott commenced in 1969, [Sco71]) with employing infinite domain. An attempt to formalize an idea of ‘information system’ with infinite domain is known as continuity principle and called Scott-Belnap’s thesis). In the early 1980’s D.S.Scott resumed his analysis of the idea of variable domains because of the nature of lambda-calculus 28 and MDB. 5 The target prototype system Application Development Environment (ADE) is mainly based on the idea of variable, or switching concept and covers the vital mechanisms of encapsulation, inheritance and polymorphism. Variable concepts naturally generate families of similar types that are derived from the generic types. Concepts in ADE are equipped with the evolvents that manage the transitions, or switching between the types. In particular, the identity evolvent supports the constant concepts and types (statical concepts). To achieve the needed flexibility a general ADE layout consists of the uniform modular units, as shown in Fig. 2. In ADE Data Object Definition Language (DODL) contains the construction of data objects’ base scheme as a relation between concepts. Concepts are included into the type system with the interpretation over the variable domains. A coherent set of variable domains generates the data objects’ base. Basis to maintain the data objects in use and their bases is generated by computational models with applicative structures. The developer obtains the set of the means that establish, support and modify the linkages between the data objects’ base schemes, data objects’ base and computational models. DODL declares: type system as a set of metadata objects; em linkages between the types; system of domains; linkages between the domains; extensions of domains and types; computational tools of applicative pre-structures and structures. The third part of the implementation supports two level of interfaces. The first is the Intentional Management System (IMS) to support concepts (metadata objects) of different kinds, and the second is associated Extensional Management System (EMS) to support the appropriated extensions (data objects) generated by the intentions. EMS is embedded into the unified computational model. It is object-oriented extensible programming system Basic Relational Tool System (BRTS). BRTS has the fixed architecture with the one level comprehension, separate selfcontained components, interfaces and languages. It is the First Order Tool (FOT) and generates ‘fast prototypes’. D(M)ODL and D(M)OML of BRTS contain the SQL-based relational complete languages that cooperate with ADE. BRTS mainly supports relatively large number of low cardinality relations (extensions) and supports Data (Metadata) Object Model D(M)OM with retrieval, modifications and definitions of a storable information. IMS is also embedded into the computational model and supports a numerous matadata objects. Their amount is almost the same as for data objects. IMS is based on D(M)OM with a simple comprehension to manage metadata base and is supported by MetaRelational Tool System (MRTS). MRTS manipulates with the metaobjects (concepts) and metarelations (frames) and is embedded into ADE. Objectives of the proposed ADE conception ADE is both the research project and tool kit aimed at development of the mathematical apparatus, models and methods which being considered together comprise a variant of theory of computations for object-oriented programming technology, data base management systems and knowledge based systems. The research aims were establishing and experimental issues of some generic concepts in computer science: data object to represent the storable data; metadata object to represent the conceptual information; assignment to represent internal states and dynamics; extensible database to represent relatively self-contained couples of objects and some additional derived concepts. All of these notions are important to succeed in ADE development. At the present time in computer science there are proper means and methods to handle static application domains. And there is an appropriate mathematical apparatus as well. But the work with dynamic application domain is still a problem unsolved also in mathematical aspect. Other aspect of the proposed research is to verify the feasibility of previously aimed generic concepts. Thus the implementation of a prototype information system will assist in understanding the dynamics of data objects both within tool and applied (programming of information) system. 6 ADE contribution to the research activity ADE has under research the idea of a concept as the variable entity to possess the creation of the variable concepts and associated transition effects. In their turn the variable concepts lead to parameterized type system. The approach developed in ADE is based on the reasons stated. The usage of the method of embedding typed system (including the apparatus of variable concepts) into untyped system based on the apparatus of Applicative Computational Systems (ACS) is the distinctive feature of the approach being developed. Combining the ideas of variable concepts will make possible development of a wide range of applied information systems, particularly in the field of data base management systems, knowledge based systems and programming systems. 7 General features ADE is viewed to be a comprehensive research as follows: establishing the primitive frame to represent and analyze a ‘variable concept’; setting up the approach to integrate the far distant concepts, means and models from computer science branches; developing methods to adopt some intentional concepts of computer science that naturally result from the idea of ‘variable concepts’ and their potential applications; creating the tool kit to explicate and apply the advantages of variable concepts; augmenting the possibilities of host programming system; specifying the enhanced data models; fixing the possible ranges of design and development those systems that involve the idea of data/metadata object; creating the generalized tool kit on the basis of the mathematical concepts in the current contribution. 8 New supporting technologies A main result is the experimental verification of variable concepts approach. This would be applied to develop the variety of applied information systems. Computations with variable concepts and appropriated programming system allows to built a system especially to manipulate the objects. All of this results in an apparatus for analysis the branches of object-oriented approach: programming in terms of concepts. This generalizes the programming in terms of superobjects; 29 GUI ✒ ✠ Conceptual Interface-1 ❅ ❅ ■ ❅❅ ❘ ❅ ❅ ✲ Conceptual Interface-n ✛ Conceptual Shell CS: POL Interface ✻ Conceptual Relational Interface ❄ ✛ ✲ PO System DPO Interface ✻ ❄ DPO System Storage Interface ✁ ☛ ✁ ✁ ✁ PP P ✐P PP PP PP PP PP q PP ✲ PO Relations ✛ ✁ ✕ ✁ PO Language ✛ ✲ Search System ✶ ✏ ✏✏ PP q P AO Language Relational System ✻ ❄ ✲ R-level ✛ S-level Figure 2: Application Development Environment: ADE. Abbreviations: GUI - Graphical User Interface; POL - Potential Object Library; PO - Potential Object; AOL - Actual Object Library; AO - Actual Object; DPO - Descendent Potential Object; R-level - Representation level; S-level - Storage level 30 object oriented database (management) systems. The database extensibility, development of databases with varying data models, dynamical databases, analyzers of ‘data object’ dynamics, the ‘bases of invariants’ etc. would be achieved; knowledge base systems grounded on the concepts which are metadata objects. Maintenance of the systems of ‘variable concepts’ and their interrelations, management of switching the systems of concepts, management of database modification etc. 9 Some ready made original systems were tested and expanded to achieve the prototype system with the properties mentioned (by E.Codd, by N.Roussoupolos). Conclusions: interpretation of the results The resulting two level comprehension model and computational environment verify the feasibility of the approach. The adequate, neutral and semantical representation of data is the target in the sphere of extensible systems and their moderations and modifications. The relational solutions are the criteria in database technology. Therefore, the variable concepts generate the power and sound representation of data objects, have the boundary conditions as the known results in information systems (both in a theory and applications) and capture the additional effects of dynamics to simulate, in particular, the encapsulation, polymorphism and inheritance. The last gives the contribution in development of object-oriented systems. Usage of intentions and extensions ADE gives a smart framework for intentions and extensions and intentional tool/applied system. It enables the possibility to develop the conceptual support that encircles the adjunct ideas: establishing the logical apparatus (on the basis of higher order theory) to study the hierarchies of variable concepts; development of specialized ‘tool theories’ to estimate a selective power of newly designed programming systems, database systems and models for systems with databases and knowledge bases; support and development of specialized semantical theories and models for systems with databases and knowledge bases. Possible applications of this framework: ‘rapid prototypes’ of newly developed computer information systems, estimation of their ranges, adaptation to variations in problem domains, demands, programming systems, experts. The specific feature of architecture: two levelled design - intentional and extensional levels. 10 References M.L. Brodie. Interoperable Information Systems: Motivations, Challenges, Approaches, and Status. Russian Basic Research Foundation, Moscow, Russia, April, 6-7, 1995. [Gro91] Object Management Group. The common object request broker: Architecture and specification. Rev. 1.1, OMG Document Number 91.12.1, 1991. [He95] P.Van Hentenryck and V. Saraswat (eds.). Principles and Practice of Constraint Programming, project Hydra 2, pages 29–48. The MIT Press, Massachusetts, 1995. Improvements in design, engineering and management processes At present it is difficult to estimate real benefits of using the apparatus of variable concepts in particular applied information systems because of the newness and the originality of mathematical apparatus being developed and the approach on the whole. The possible gains and prospects that may be yielded by the ADE approach are set forth below: high degree of generalization; taking into account the intentional features (‘subjects’, dynamical scripts’, etc.); relative simplicity of interfaces; possibility to aggregate/disaggregate the representations; clarity, referential transparency and fully explicit constructions; possibilities to handle collections of objects or concepts; the modular implementation to cover the higher order logic. 11 [Bro95] [KW96] A. Kaplan and J.C. Wileden. PolySPIN: Support for polylingual persistence, interoperability and naming in object-oriented databases. Technical report UM-CS-1996-004, University of Massachusetts Amherst, January 1996. Experimental techniques, Software, and Tools The feature of current research is in primary creation of the needed tool system to be adequate to the newly generated mathematical apparatus. The experimental research and verification of the obtained model is based on prototypes CS, ADE, BRTS, BMRS. The difficulties to implement full scale prototype are resolved by the high level object-oriented programming language. Some candidate programming systems are tested to enable the needed computational properties. After that the main programming tool kit is selected. Preliminary candidate tools were C++ or Modula-2. An attention is paid to select an appropriate database management system. If needed the original DBMS is attached. At the preliminary tests the attention was paid to OLE-2 techniques. [Rou76] N. Roussopoulos. A semantic network model of databases. PhD dissertation, Toronto University, 1976. An early object-oriented approach via ‘frames’ was established. The frames are treated as intensions, and the associated relations as extensions. [Sco71] D.S. Scott. The lattice of flow diagrams. In Symposium on semantics of algorithmic languages, volume 188 of Lecture notes in mathematics, pages 311–378. Berlin, Heidelberg, New York, Springer Verlag, 1971. [Wol96a] V.E. Wolfengagen. Logical Applicative Modeling DAta Base (LAMBDA). The research project 93-012-943 granted by RFBR. The final report., Moscow Engineering Phycics Institute, January 1996. [Wol96b] V.E. Wolfengagen. Object-oriented solutions. In J. Eder and L.A. Kalinichenko, editors, Advances in DataBases and Information Systems, Workshop in computing, pages 407–431. Springer, 1996. 31
6cs.PL
arXiv:1612.03156v1 [cs.DS] 9 Dec 2016 Testing Bayesian Networks Clement L. Canonne∗ Columbia University [email protected] Ilias Diakonikolas† University of Southern California [email protected] Daniel M. Kane‡ University of California, San Diego [email protected] Alistair Stewart§ University of Southern California [email protected] December 12, 2016 Abstract This work initiates a systematic investigation of testing high-dimensional structured distributions by focusing on testing Bayesian networks – the prototypical family of directed graphical models. A Bayesian network is defined by a directed acyclic graph, where we associate a random variable with each node. The value at any particular node is conditionally independent of all the other non-descendant nodes once its parents are fixed. Specifically, we study the properties of identity testing and closeness testing of Bayesian networks. Our main contribution is the first non-trivial efficient testing algorithms for these problems and corresponding information-theoretic lower bounds. For a wide range of parameter settings, our testing algorithms have sample complexity sublinear in the dimension and are sampleoptimal, up to constant factors. 1 Introduction 1.1 Background Distribution testing has its roots in statistical hypothesis testing [NP33, LR05] and was initiated in [GR00, BFR+ 00]. The paradigmatic problem in this area is the following: given sample access to an arbitrary distribution P over a domain of size N , determine whether P has some global property or is “far” from any distribution having the property. A natural way to solve this problem would be to learn the distribution in question to good accuracy, and then check if the corresponding hypothesis is close to one with the desired property. However, this testing-via-learning approach requires Ω(N ) samples and is typically suboptimal. The main goal in this area is to obtain sample-optimal testers – ideally, testers that draw o(N ) samples from the underlying distribution. During the past two decades, a wide range of properties have been studied, and we now have sample-optimal testers for many of these properties [Pan08, CDVV14, VV14, DK16, DGPP16]. √ We remark that even for the simplest properties, e.g., identity testing, at least Ω( N ) many samples are required for arbitrary distributions over N atoms. While this √ is an improvement over the Ω(N ) samples required to learn the distribution, a sample upper bound of O( N ) is still impractical if N is very large. For example, suppose that the unknown distribution is supported on {0, 1}n . For this high-dimensional setting, a n/2 sample complexity bound √ of Θ(2 ) quickly becomes prohibitive, when the dimension increases. Notably, the aforementioned Ω( N ) sample lower bound characterizes worst-case instances, which in many cases ∗ Part of this work was performed while visiting the University of Southern California. Supported by a USC startup fund. ‡ Supported in part by NSF Award CCF-1553288 (CAREER). § Supported by a USC startup fund. † 1 are unlikely to arise in real-world data. This observation motivates the study of testing structured distribution families, where significantly improved testers may be possible. Hence, the following natural question arises: Can we exploit the structure of the data to perform the desired testing task more efficiently? A natural formalization of this question involves viewing the data as samples from a probabilistic model – a model that we believe represents the random process generating the samples. The usual assumption is that there exists a known family of probabilistic models – describing a set of probability distributions – and that the data are random samples drawn from an unknown distribution in the family. In this context, the distribution testing problem is the following: Let C be a family of probabilistic models. The testing algorithm has access to independent samples from an unknown P ∈ C, and its goal is to output “yes” if P def has some property P, and output “no” if the total variation distance, dTV (P, Q) = (1/2)kP − Qk1 , where k · k1 denotes the L1 -norm, is at least ǫ to every Q ∈ C that has property P. The sample complexity of this structured testing problem depends on the underlying family C, and we are interested in obtaining efficient algorithms that are sample optimal for C. More than a decade ago, Batu, Kumar, and Rubinfeld [BKR04] considered a specific instantiation of this broad question – testing the equivalence between two unknown discrete monotone distributions – and obtained a tester whose sample complexity is poly-logarithmic in the domain size. A recent sequence of works [DDS+ 13, DKN15b, DKN15a] developed a framework to obtain sample-optimal estimators for testing the identity of structured distributions over total orders (e.g., univariate multi-modal or log-concave distributions). The main lesson of these works is that, under reasonable structural assumptions, the sample complexity of testing may dramatically improve – becoming sub-logarithmic or even independent of the support size. Moreover, in all studied cases, one obtains testers with sub-learning sample complexity. 1.2 This Work: Testing High-Dimensional Structured Distributions This paper initiates a systematic investigation of testing properties of high-dimensional structured distributions. One of the most general formalisms to succinctly represent such distributions is provided by probabilistic graphical models [WJ08, KF09]. Graphical models compactly encode joint probability distributions in high dimensions. Formally, a graphical model is a graph where we associate a random variable with each node. The key property is that the edge-structure of the graph determines the dependence relation between the nodes. The general problem of inference in graphical models is of fundamental importance and arises in many applications across several scientific disciplines, see [WJ08] and references therein. In particular, the task of learning graphical models has been extensively studied [Nea03, DSA11]. A range of informationtheoretic and algorithmic results have been developed during the past five decades in various settings, see, e.g., [CL68, Das97, FY96, FGG97, FLN00, CGK+ 02, Chi02, Mar03, AKN06, WRL06, AHHK12, SW12, LW12, DKS16b] for a few references. In contrast, the general question of testing graphical models has received less attention. We propose the following broad set of questions: Question 1.1. Let C be a family of high-dimensional graphical models and P be a property of C. What is the sample complexity of testing whether an unknown P ∈ C has property P? Can we develop testers for P with sub-learning sample complexity? Can we design sample-optimal and computationally efficient testers? We believe that Question 1.1 points to a fundamental research direction that warrants study for its own sake. Moreover, as we explain in the following paragraphs, such estimation tasks arise directly in various practical applications across the data sciences, where sample efficiency is of critical importance. Hence, improved estimators for these tasks may have implications for the analysis of datasets in these areas. For concreteness, Question 1.1 refers to a single unknown distribution that we have sample access to. We are also naturally interested in the broader setting of testing properties for collections of distributions in C. Before we proceed to describe our contributions, a few comments are in order: As previously mentioned, for all global properties of interest (e.g., identity, independence, etc.), the sample complexity of testing the property is bounded from above by the sample complexity of learning an arbitrary distribution from 2 C. Hence, the overarching goal is to obtain testers that use fewer samples than are required to actually learn the model – or to prove that this is impossible. On a related note, in the well-studied setting of testing arbitrary discrete distributions, the main challenge has been to devise sample-optimal testers; the algorithmic aspects are typically straightforward. This is no longer the case in the high-dimensional setting, where the combinatorial structure of the underlying model may pose non-trivial algorithmic challenges. In this work, we start this line of inquiry by focusing on testing Bayesian networks [Pea88] (Bayes nets or BN for brevity), the prototypical family of directed graphical models. Bayesian networks are used for modeling beliefs in many fields including robotics, computer vision, computational biology, natural language processing, and medicine [JN07, KF09]. Formally, a Bayesian network is defined by a directed acyclic graph (DAG) S = (V, E), where we associate a random variable with each node. Moreover, the value at any particular node is conditionally independent of all the other non-descendant nodes once its parents are fixed. Hence, for a fixed topology, it suffices to specify the conditional distribution for each node for each configuration of values for its parents. The main problems that we study in this setting are the related tasks of testing identity and closeness: In identity testing, we are given samples from an unknown Bayes net P and we want to distinguish between the case that it is equal to versus significantly different from an explicitly given Bayes net Q. In closeness testing, we want to test whether two unknown Bayes nets P, Q are identical versus significantly different. We believe that our techniques can be naturally adapted to test other related properties (e.g., independence), but we have not pursued this direction in the current paper. A related testing problem that we consider is that of structure testing: given samples from an unknown Bayes net P , we want to test whether it can be represented with a given graph structure S or is far from any Bayes net with this structure. In the prior work on testing unstructured discrete distributions, the natural complexity measure was the domain size of the unknown distributions. For the case of Bayes nets, the natural complexity measures are the number of variables (nodes of the DAG) – denoted by n – the maximum in-degree of the DAG – denoted by d – and the alphabet size of the discrete distributions on the nodes. To avoid clutter in the expressions, we focus on the natural setting that the random variables associated with each node are Bernoulli’s, i.e., the domain of the underlying distributions is {0, 1}n . (As we will point out, our bounds straightforwardly extend to the case of general alphabets with a necessary polynomial dependence on the alphabet size.) We note that Bayes nets are a universal representation scheme: Any distribution over {0, 1}n can be presented as a BN, if the maximum in-degree d of the graph is unbounded. (Indeed, for d = n − 1, one can encode all distributions over {0, 1}n .) In fact, as we will see, the sample complexity of testing scales exponentially with d. Therefore, an upper bound on the maximum in-degree is necessary to obtain nontrivial upper bounds. Indeed, the most interesting regime is the settting where the number of nodes n is large and the degree d is small. In applications of interest, this assumption will be automatically satisfied. In fact, as we explain in the following subsection, in many relevant applications the maximum in-degree is either 1 (i.e., the graph is a tree) or bounded by a small constant. 1.3 Related Work We partition the related work intro three groups corresponding to research efforts by different communities. Computer Science. A large body of work in computer science has focused on designing statistically and computationally efficient algorithms for learning structured distributions in both low and high dimensions [Das99, FM99, AK01, VW02, CGG02, MR05, MV10, BS10, DDS12a, DDS12b, CDSS13, DDO+ 13, CDSS14a, CDSS14b, HP15, ADLS15, DDS15, DDKT16, DKS15, DKS16a]. On the other hand, the vast majority of the literature in distribution property testing during the past two decades focused on arbitrary discrete distributions, where the main complexity measure was the domain size. See [BFR+ 00, BFF+01, Bat01, BDKR02, BKR04, Pan08, VV11, DDS+ 13, ADJ+ 11, LRR11, ILR12, CDVV14, VV14, ADK15, CDGR16, DK16] for a sample of works, or [Rub12, Can15] for surveys. 3 A line of work [BKR04, DDS+ 13, DKN15b, DKN15a] studied properties of one-dimensional structured distribution families under various “shape restrictions” on the underlying density. In the high-dimensional setting, Rubinfeld and Servedio [RS05] studied the identity testing problem for monotone distributions over {0, 1}n . It was shown in [RS05] that poly(n) samples suffice for the case of uniformity testing, but the more general problems of identity testing and independence testing require 2Ω(n) samples. Subsequently, Adamaszek, Cjumaj, and Sohler [ACS10] generalized these results to continuous monotone distributions over [0, 1]n . A related, yet distinct, line of work studied the problem of testing whether a probability distribution has a certain structure [BKR04, BFRV11, ADK15, CDGR16]. The sample complexity bounds in these works scale exponentially with the dimension. Statistics. The area of hypothesis testing for high-dimensional models has a long history in statistics and is currently an active topic of study. A sequence of early and recent works, starting with [Wei60, Bic69, LS93], has studied the problem of testing the equivalence between two nonparametric high-dimensional distributions in the asymptotic regime. In the parametric setting, Hotelling’s T-squared statistic [Hot31] is the classical test for the equivalence of two high-dimensional Gaussians (with known and identical covariance). However, Hotelling’s test has the serious defect that it fails when the sample size is smaller than the dimension of the data [BS96]. Recent work has obtained testers that, under a high-dimensional Gaussian model (with known covariance), succeed in the sub-linear regime for testing identity [SD08] and closeness [CQ10]. A number of more recent works study properties of covariance matrices [CM13], regression [JM14], and linear independence testing [RISW16]. Applications. The problems of testing identity and closeness of Bayesian networks arise in a number of applications where sample efficiency is critical [FLN00, GWJ03, SK03, Alm10, NLR11, RESG14, SM15, YGM+ 15]. In bioinformatics applications (e.g., gene set analysis), each sample corresponds to an experiment that may be costly or ethically questionable [YGM+ 15]. Specifically, [YGM+ 15] emphasizes the need of making accurate inferences on tree structured Bayesian networks, using an extremely small sample size – significantly smaller than the number of variables (nodes). [Alm10] studies the problem of testing closeness between two unknown Bayesian network models in the context of a biology application, where Bayes nets are used to model gene expression data. The motivation in [Alm10] comes from the need to compare network models for a common set of genes under varying phenotypes, which can be formulated as the problem of testing closeness between two unknown Bayes nets. As argued in [Alm10], due to the small sample size available, it is not feasible to directly learn each BN separately. Basic Notation and Definitions. Consider a directed acyclic graph (DAG), S, with n vertices that are def topologically sorted, i.e., labelled from the set [n] = {1, 2, . . . , n} so that all directed edges of S point from vertices with smaller label to vertices with larger label. A probability distribution P over {0, 1}n is defined to be a Bayesian network (or Bayes net) with dependency graph S if for each i ∈ [n], we have that PrX∼P [Xi = 1 | X1 , . . . , Xi−1 ] depends only on the values Xj , where j is a parent of i in S. Such a distribution P can be specified by its conditional probability table, i.e., the vector of conditional probabilities of Xi = 1 conditioned on every possible combination of values to the coordinates of X at the parents of i. To formalize the above description, we use the following terminology. We will denote by Parents(i) the set of parents of node i in S. For a vector X = (X1 , . . . , Xn ) and a subset A ⊆ [n], we use XA to denote the vector (Xi )i∈A . We can now give the following definition: Definition 1.1. Let S be the set {(i, a) : i ∈ [n], a ∈ {0, 1}|Parents(i)| } and m = |S|. For (i, a) ∈ S, the parental configuration Πi,a is defined to be the event that XParents(i) = a. Once S is fixed, we may associate to a Bayesian network P the conditional probability table p ∈ [0, 1]S given by pi,a = PrX∼P [Xi = 1 | Πi,a ], for (i, a) ∈ S. We note that the distribution P is determined by p. We will frequently index p as a vector. That is, we will use the notation pk , for 1 ≤ k ≤ m, and the associated events Πk , where each k stands for an (i, a) ∈ S lexicographically ordered. 4 2 Our Results and Techniques The structure of this section is as follows: In Section 2.1, we provide the statements of our main results in tandem with a brief explanation of their context and the relations between them. In Section 2.2, we give a detailed outline of our algorithmic and lower bound techniques. 2.1 Main Results The focus of this paper is on the properties of identity testing and closeness testing of Bayes nets. We give the first non-trivial efficient testing algorithms and matching information-theoretic lower bounds for these problems. For a wide range of parameter settings, our algorithms achieve sublearning sample complexity and are sample-optimal (up to constant factors). For concreteness, we consider Bayes nets over Bernoulli random variables. We note that our upper bounds straightforwardly extend to general alphabets with a polynomial dependence on the alphabet size (see Remark 5.11). Let BN n,d denote the family of Bernoulli Bayes nets on n variables such that the corresponding DAG has maximum in-degree at most d. For most of our results, we will think of the dimension n as being large and the maximum degree d as being comparably small (say, bounded from above by a constant or at most logarithmic in n). For the inference problems of learning and testing Bayes nets, there are two versions of the problem: The first version corresponds to the setting where the structure of the graph is fixed (and known a priori to the algorithm). In the second version, both the graph and the parameters are unknown to the algorithm. We note that both versions of the problem are interesting, based on the application. The unknown structure setting is clearly at least as hard, and typically includes an algorithm for the fixed structure case plus additional algorithmic ingredients. Before we give the statements of our main testing results, we record a nearly tight bound on the sample complexity of learning BN n,d . This bound will be used as a baseline to compare against our efficient testers: Fact 2.1. The sample complexity of learning BN n,d , within total variation distance ǫ, with confidence e d · n/ǫ2 ), for all d ≤ n/2, in the fixed structure setting, and (ii) Θ(2 e d · n/ǫ2 ) in probability 9/10, is: (i) Θ(2 the unknown structure setting. We give a proof of this fact in Appendix A. Fact 2.1 characterizes the sample complexity of learning Bayes nets (up to logarithmic factors). We remark that our information-theoretic upper bound for the fixed structure case also yields a simple computationally efficient algorithm. The unknown structure regime is much more challenging computationally. For this setting, we provide a nearly tight information-theoretic upper bound that is non-constructive. (The corresponding algorithm runs in exponential time.) In fact, we note that no sample-optimal computationally efficient algorithm is known for unknown structure Bayes nets. Our first main result concerns the fixed structure regime. For technical reasons, we focus on Bayes nets that satisfy a natural balancedness condition. Roughly speaking, our balancedness condition ensures that the conditional probabilities are bounded away from 0 and 1, and that each parental configuration happens with some minimum probability. Formally, we have: Definition 2.2. A Bayes net P over {0, 1}n with structure S is called (c, C)-balanced if, for all k, we have that (i) pk ∈ [c, 1 − c], and (ii) PrP [ Πk ] ≥ C. Under a mild condition on the balancedness, we give sample-optimal and computationally efficient algorithms for testing identity and closeness of Bayes nets. Specifically, for the problem of identity testing against an explicit distribution, we require that the explicit distribution be balanced (no assumption is needed for the unknown Bayes net). For the problem of closeness testing, we require that one of the two unknown distributions be balanced. We are now ready to state our first main theorem: 5 Theorem 2.3 (Testing Identity and Closeness of Fixed–Structure Bayes Nets). For testing identity and closeness of fixed structure Bayes  nets P, Q with n nodes and maximum in-degree d, there is an efficient algorithm √ √ that uses O 2d/2 n/ǫ2 samples and, assuming that one of P, Q is (c, C)-balanced with c = Ω̃ (1/ n) √  and C = Ω̃ dǫ2 / n , correctly distinguishes between the cases that P = Q versus kP − Qk1 > ǫ, with probability at least 2/3. Moreover, this sample size is information-theoretically optimal, up to constant factors, for all d < n/2, even for the case of uniformity testing. The conceptual message of Theorem 2.3 is that, for the case of fixed structure, testing is informationtheoretically easier than learning. Specifically, our result establishes a quadratic gap between learning and identity testing, reminiscent of the analogous gap in the setting of unstructured discrete distributions. We remark here that the information-theoretic lower bounds of Fact 2.1 (i) hold even for Bayes nets with constant balancedness. We now turn our attention to the case of unknown structure. Motivated by Theorem 2.3, it would be tempting to conjecture that one can obtain testers with sub-learning sample complexity in this setting as well. Our first main result for unknown structure testing is an information-theoretic lower bound, showing that this is not the case. Specifically, even for the most basic case of tree-structured Bays Nets (d = 1) with unknown structure, uniformity testing requires Ω(n/ǫ2 ) samples. It should be noted that our lower bound applies even for Bayes nets with constant balancedness. Formally, we have: Theorem 2.4 (Sample Lower Bound for Uniformity Testing of Unknown Tree-Structured Bayes Nets). Any algorithm that, given sample access to a balanced tree-structured Bayes net P over {0, 1}n , distinguishes between the cases P = U and kP − U k1 > ǫ (where U denotes the uniform distribution over {0, 1}n ), with probability 2/3, requires Ω(n/ǫ2 ) samples from P . At the conceptual level, our above lower bound implies that in the unknown topology case – even for the simplest non-trivial case of degree-1 Bayes nets – identity testing is information-theoretically essentially as hard as learning. That is, in some cases, no tester with sub-learning sample complexity exists. We view this fact as an interesting phenomenon that is absent from the previously studied setting of testing unstructured discrete distributions. Theorem 2.4 shows that testing Bayes nets can be as hard as learning. However, it is still possible that testing is easier than learning in most natural situations. For the sake of intuition, let us examine our aforementioned lower bound more carefully. We note that the difficulty of the problem originates from the fact that the explicit distribution is the uniform distribution, which can be thought of as having any of a large number of possible structures. We claim that this impediment can be circumvented if the explicit distribution satisfies some non-degeneracy conditions. Intuitively, we want these conditions to ensure robust identifiability of the structure: that is, that any (unknown) Bayes net sufficiently close to a non-degenerate Bayes net Q must also share the same structure. For tree structures, there is a very simple non-degeneracy condition. Namely, that for each node, the two conditional probabilities for that node (depending on the value of its parent) are non-trivially far from each other. For Bayes nets of degree more than one, our non-degeneracy condition is somewhat more complicated to state, but the intuition is still simple: By definition, non-equivalent Bayesian network structures satisfy different conditional independence constraints. Our non-degeneracy condition rules out some of these possible new conditional independence constraints, as far from being satisfied by the non-degenerate Bayesian network. Let γ > 0 be a parameter quantifying non-degeneracy. Under our non-degeneracy condition, we can design a structure tester with the following performance guarantee: Theorem 2.5 (Structure Testing for Non-Degenerate Bayes Nets). Let S be a structure of degree at most d and P be a degree at most d Bayes net over {0, 1}n with structure S ′ whose underlying undirected graph  d 2 has no more edges than S. There is an algorithm that uses O (2 + d log n)/γ samples from P , runs 6  in time O nd+3 /γ 2 , and distinguishes between the following two cases with probability at least 2/3: (i) P can be expressed as a degree-d Bayes net with structure S that is γ-non-degenerate; or (ii) P cannot be expressed as a Bayes net with structure S. By invoking the structure test of the above theorem, we can reduce the identity testing with unknown structure to the case of known structure, obtaining the following: Theorem 2.6 (Testing Identity of Non-Degenerate Unknown Structure Bayes Nets). There exists an algorithm with the following guarantees. Given the description of a degree-d Bayes net Q over {0, 1}n , which √  √ 2 is (c, C) balanced and γ-non-degenerate for c = Ω̃ (1/ n) and C = Ω̃ dǫ / n , ǫ > 0, and sample access to a distribution P , promised to be a degree-d Bayes net with no more edges than Q, the algo √ rithm takes O 2d/2 n/ǫ2 + (2d + d log n)/γ 2 samples from P , runs in time O (n)d+3 (1/γ 2 + 1/ǫ2 ), and distinguishes with probability at least 2/3 between (i) P = Q and (ii) kP − Qk1 > ǫ. We remark that we can obtain an analogous result for the problem of testing closeness. See Section 7. We have shown that, without any assumptions, testing is almost as hard as learning for the case of trees. An interesting question is whether this holds for high degrees as well. We show that for the case of high degree sub-learning sample complexity is possible. We give an identity testing algorithm for degree-d Bayes nets with unknown structure, without balancedness or degeneracy assumptions. While the dependence on the number of nodes n of this tester is suboptimal, it does essentially achieve the “right” dependence on the degree d, that is 2d/2 : Theorem 2.7 (Sample Complexity Upper Bound of Identity Testing). Given the description of a degree-d Bayes net Q over {0, 1}n , ǫ > 0, and sample access to a degree-d Bayes net P , we can distinguish between the cases that P = Q and kP − Qk1 > ǫ, with probability at least 2/3, using 2d/2 poly(n, 1/ǫ) samples from P . The message of this result is that when the degree d increases, specifically for d = Ω(log n), the sample complexity of testing becomes lower than the sample complexity of learning. We also show an analogue of Theorem 2.7 for closeness testing of two unknown Bayes nets, under the additional assumption that we know the topological ordering of the unknown DAGs. 2.2 Overview of Algorithmic and Lower Bound Techniques In this section, we provide a high-level outline of the main ideas that come into our testing algorithms and our information-theoretic lower bounds. Finding the Right Parameter Distance. In order to design sample-efficient testing algorithms, we need to devise a statistic that can accurately detect when our high-dimensional distributions are non-trivially separated in total variation distance. The first obstacle to this attempt is that of actually understanding the behavior of the variational distance between our distributions. We remark that this difficulty does not appear in the one-dimensional unstructured case, and is a consequence of the structured high-dimensional setting. Unfortunately, it seems difficult to find an exact closed-form expression for the variational distance between two Bayes nets in terms of their parameters, even if the underlying graph structures are the same and explicitly known. To make things manageable, we handle this issue by finding an appropriate proxy for the total variation distance. A natural candidate is the Kullback–Leibler (KL) Divergence for the following reasons: (1) it can be used to bound from above the variation distance, and (2) it is relatively easy to compute for a pair of Bayesian networks with the same underlying structure. However, the KL-Divergence has the disadvantage that it depends on logarithms of the relevant conditional probabilities, which are hard to take advantage of. To deal with this, we bound from above the KL-Divergence by a “chi-squared-like quantity”. For the sake of intuition, let us first consider the basic setting that the underlying Bayes nets P, Q have no edges, i.e., they correspond to product distributions over {0, 1}n . It turns out that this case captures some 7 of the core difficulties of the high-dimensional setting, and it is instructive to understand as a first step. For product distributions, P and Q with mean vectors p, q, we bound from P above the variational distance in terms of the chi-squared distance between the mean vectors, namely i (pi − qi )2 /(qi (1 − qi )) (Lemma 3.4 and Corollary 3.5). For the case of general Bayes nets, we use an appropriate generalization of this bound (Lemma 3.8) involving instead the conditional probabilities, where additionally, each term is weighted by the probability of seeing that particular parental configuration. Relation to Unstructured Discrete Setting and Tolerant Testing. In this paragraph, we take a moment to point out a very useful analogy between (i) a special case of testing Bayes nets, and (ii) testing discrete unstructured distributions. In particular, we again consider the special case of testing (identity or closeness) of product distributions on {0, 1}n . It turns out that this setting is quite similar to testing unstructured distributions on [n]. Specifically, in both cases, the underlying distribution is parameterized by a set of parameters pi in [0, 1], and in both cases the variational distance between two such distributions can be bounded by an identical-looking chi-squared quantity. Moreover, in both cases, taking samples allows us to come up with independent estimates of the pi ’s (for discrete distributions we need to employ Poissonization, while for products the samples from different coordinates are automatically independent). This analogy becomes even stronger when one considers product distributions where the sum of the pi ’s is approximately 1. In this setting, there is a formal correspondence between the two problems. Specifically, to each discrete distribution we can associate the product distribution obtained by taking Poi(λ) samples from P and noting the bins that received at least one sample. This observation turns out to give a reduction of testing discrete distributions to testing “light” product distributions that nearly preserves variational distance. This reduction can be formalized, which allows us to port some lower bounds from one setting to the other, specifically for the question of tolerant testing. Warm-up: Testing Identity and Closeness of Product Distributions. Our first set of results (see Section 4) involves sample-optimal testers and matching information-theoretic lower bounds for testing identity and closeness of product distributions over {0, 1}n . Our results for this setting can be viewed as discrete analogues of testing identity and closeness of high-dimensional spherical Gaussians, that have been studied in the statistics literature [Hot31, BS96, SD08, CQ10]. We note that the Gaussian setting is simpler since the total variation distance can be bounded by the Euclidean distance between the mean vectors, instead of the chi-squared distance. We start with the problem of testing the identity of an unknown product P with mean vector p against an explicit product distribution Q with mean vector q. Our tester relies on a statistic providing an unbiased P estimator of i (pi − qi )2 /(qi (1 − qi )). Essentially, every draw from P gives us an independent sample from each of the coordinate random variables. In order to relate our tester more easily to the analogous testers for unstructured distributions over finite domains, we consider Poi(m) samples from each of these coordinate distributions. From there, we construct a random variable Z that provides an unbiased estimator √ of our chi-squared statistic, and a careful analysis of the variance of Z shows that with O( n/ǫ2 ) samples we can distinguish between P = Q and P being ǫ-far from Q. Testing closeness between two unknown product distributions is somewhat more complicated. As is the case when comparing unknown discrete distributions on [n], we have the difficulty that we do not know how to scale our approximations to the (pi − qi )2 terms. We are forced to end up rescaling using the total number of samples drawn with xi = 1 as a proxy for 1/(qi ). This leaves us with a statistic reminiscent of that used in [CDVV14], which can be shown to work with a similar analysis. Unfortunately, in our setting, it is no longer the case that the sum of the qi ’s is O(1), and this ends up affecting the analysis making our sample complexity depend on n3/4 , instead of n2/3 as in the unstructured case. 8 Perhaps surprisingly, we show that this added complexity is in fact necessary: we show that both our identity tester and our closeness tester are sample-optimal up to constant factors. To prove our lower bounds, we use the information-theoretic technique from [DK16]: Given a candidate hard instance, we proceed by bounding from above the mutual information between appropriate random variables. More specifically, we construct an appropriate family of hard instances (distributions) and show that a set of k samples taken from a distribution from the chosen family has small shared information with whether or not the distributions are the same. Recall that the hard family of instances for distinguishing discrete distributions over [n] had (a) many “light” bins (domain elements) of probability mass approximately 1/n, where either pi = qi on each bin or pi = qi (1 ± ǫ) in each bin, and (b) a number of “heavy” bins where pi = qi ≈ 1/k (where k was the number of samples taken). The goal of the heavy bins was to “add noise” and hide the signal from the light bins. In the case of discrete distributions over [n], we could only have k such heavy bins. In the case of product distributions, there is no such restriction, and we can have n/2 of them in our hard instance. The added noise leads to an increased sample complexity of testing closeness in the high-dimensional setting. An interesting difference with the unstructured discrete distribution setting is that our identity tester is in fact tolerant for a wide range of settings – in particular when Q uniform or more generally balanced, i.e., has mean vector q with coordinates bounded away from 0 and 1 (see Remark 4.7). Tolerant testing is the (harder) problem of distinguishing between kP − Qk1 > ǫ and kP − Qk1 < ǫ/2. Unlike the case of unstructured discrete distributions over [n], for product distributions there exists a tolerant uniformity tester with strongly sublinear sample complexity. This is essentially due to the fact that the variational distance from the uniform distribution is proportional to the ℓ2 distance between the mean vectors, which can be √ accurately approximated with O( n/ǫ2 ) samples. The same holds when the explicit product distribution is balanced or when we want to test closeness of two unknown balanced products. On the other hand, when the distributions are unbalanced, tolerant testing requires Ω(n/ log n) samples, via the foregoing reduction from the case of discrete distributions on [n] (Theorem 4.28). In the following paragraphs, we describe how to generalize our previous results for product distributions to testing general Bayes nets. The case of known structure turns out to be manageable, and at a technical level a generalization of our testers for product distributions. The case of unknown structure poses various complications and requires a number of non-trivial new ideas. Testing Identity and Closeness of Fixed Structure Bayes Nets. Our testers and matching lower bounds for the fixed structure regime are given in Sections 5 and 7.1. For concreteness, let us consider the case of testing identity of a tree-structured (d = 1) Bayes net P against an explicit tree-structured Bayes net Q with the same structure. Recall that we are using as a proxy for the distance kP − Qk1 an appropriate chi-squared-like quantity. A major difficulty in generalizing our identity tester for products is that the chi-squared statistic depends not on the probabilities of the various coordinates, but on the conditional probabilities of these coordinates based on all possible parental configurations. This fact produces a major wrinkle in our analysis for the following reason: while in the product distribution case each sample provides information about each coordinate probability, in the Bayes net case a sample only provides information about conditional probabilities for parental configurations that actually occurred in that sample. This issue can be especially problematic to handle if there are uncommon parental configurations about which we will have difficulty gathering much information (with a small sized sample). Fortunately, the probabilities conditioned on such parental configurations will have a correspondingly smaller effect on the final distribution and thus, we will not need to know them to quite the same accuracy. So while this issue can be essentially avoided, we will require some technical assumptions about balancedness to let us know that none of the parental configurations are too rare. Using these ideas, we develop an identity tester for tree9 √ structured Bayes nets that uses an optimal Θ( n/ǫ2 ) samples. For known structure Bayes nets of degree d > 1, the sample complexity will also depend exponentially on the degree d. Specifically, each coordinate will have as many as 2d parental configurations. Thus, instead of having only n coordinate probabilities to worry about, we will need to keep track of 2d n conditional probabilities. This will require that our sample complexity also scale like 2d/2 . The final complexity of our identity and closeness testers will thus be √ O(2d/2 n/ǫ2 ). We now briefly comment on our matching lower bounds. Our sample complexity lower bound of √ Ω( n/ǫ2 ) for the product case can be generalized in a black-box manner to yield a tight lower bound √ Ω(2d/2 n/ǫ2 ) for testing uniformity of degree-d Bayes nets. The basic idea is to consider degree-d Bayes nets with the following structure: The first d nodes are all independent (with marginal probability 1/2 each), and will form in some sense a “pointer” to one of 2d arbitrary product distributions. The remaining n − d nodes will each depend on all of the first d. The resulting distribution is now an (evenly weighted) disjoint mixture of 2d product distributions on the (n − d)-dimensional hypercube. In other words, there are 2d product distributions p1 , . . . , p2d , and our distribution returns a random i (encoded in binary) followed by a random sample form pi . By using the fact that the pi ’s can be arbitrary product distributions, we obtain our desired sample complexity lower bound. Testing Identity and Closeness of Unknown Structure Bayes Nets. As we show in Sections 6 and 7.2, this situation changes substantially when we do not know the underlying structure of the nets involved. In particular, we show that even for Bayes nets of degree-1 uniformity testing requires Ω(n/ǫ2 ) samples. The lower bound construction for this case is actually quite simple: The adversarial distribution P will be developed by taking a random matching of the vertices and making each matched pair of vertices √ randomly 1 ± ǫ/ n correlated. If the matching were known by the algorithm, the testing procedure could proceed by approximating these  n/2 correlations. However, not knowing the structure, our algorithm would be forced to consider all n2 pairwise correlations, substantially increasing the amount of noise involved. To actually prove this lower bound, we consider the distribution X obtained by taking k samples from a randomly chosen P and Y from taking k samples from the uniform distribution. Roughly speaking, we wish to show that χ2 (X, Y ) is approximately 1. This amounts to showing that for a randomly chosen pair of distributions P and P ′ from this family, we have that E[P k (x)P ′k (x)] is approximately 1. Intuitively, we show that this expectation is only large if P and P ′ share many edges in common. In fact, this expectation can be computed exactly in terms of the lengths of the cycles formed by the graph obtained taking the union of the edges from P and P ′ . Noting that P and P ′ typically share only about 1 edge, this allows us to prove our desired lower bound. However, the hardness of the situation described above is not generic and can be avoided if the explicit distribution Q satisfies some non-degeneracy assumptions. Morally, a Bayes nets Q is non-degenerate if it is not close in variational distance to any other Bayes net of no greater complexity and non-equivalent underlying structure. For tree structures, our condition is that for each node the two conditional probabilities for that node (depending on the value of its parent) are far from each other. If this is the case, even knowing approximately what the pairwise distributions of coordinates are will suffice to determine the structure. One way to see this is the following: the analysis of the Chow-Liu algorithm [CL68] shows that the tree-structure for P is the maximum spanning tree of the graph whose edge weights are given by the shared information of the nodes involved. This tree will have the property that each edge, e, has higher weight than any other edge connecting the two halves of the tree. We show that our non-degeneracy assumption implies that this edge has higher weight by a noticeable margin, and thus that it is possible to verify that we have the correct tree with only rough approximations to the pairwise shared information of variables. For Bayes nets of higher degree, the analysis is somewhat more difficult. We need a slightly more 10 complicated notion of non-degeneracy, essentially boiling down to a sizeable number of not-approximatelyconditionally-independent assumptions. For example, a pair of nodes can be positively identified as having an edge between them in the underlying graph if they are not conditionally independent upon any set of d other nodes. By requiring that for each edge the relevant coordinate variables are not close to being conditionally independent, we can verify the identity of the edges of S with relatively few samples. Unfortunately, this is not quite enough, as with higher degree Bayesian networks, simply knowing the underlying undirected graph is not sufficient to determine its structure. We must also be able to correctly identify the so-called ∨-structures. To do this, we will need to impose more not-close-to-conditionally-independent assumptions that allow us to robustly determine these as well. Assuming that Q satisfies such a non-degeneracy condition, testing identity to it is actually quite easy. First one verifies that the distribution P has all of its pairwise (or (d + 2)-wise) probabilities close to the corresponding probabilities for Q. By non-degeneracy, this will imply that P must have the same (or at least an equivalent) structure as Q. Once this has been established, the testing algorithms for the known structure can be employed. Sample Complexity of Testing High-Degree Bayes Nets. One further direction of research is that of understanding the dependence on degree of the sample complexity of testing identity and closeness for degree-d Bayes nets without additional assumptions. For d = 1, we showed that these problems can be as hard as learning the distribution. For the general case, we give an algorithm with sample complexity 2d/2 poly(n, 1/ǫ) for identity testing (and 22d/3 poly(n, 1/ǫ) for closeness testing). The conceptual message of this result is that, when the degree increases, testing becomes easier than learning informationtheoretically. It is a plausible conjecture that the correct answer for identity testing is Θ(2d/2 n/ǫ2 ) and for closeness testing is Θ(22d/3 n/ǫ2 ). We suspect that our lower bound techniques can be generalized to match these quantities, but the constructions will likely be substantially more intricate. The basic idea of our 2d/2 poly(n, 1/ǫ) sample upper bound for identity testing is this: We enumerate over all possible structures for P , running a different tester for each of them by comparing the relevant conditional probabilities. Unfortunately, in this domain, our simple formula for the KL-Divergence between the two distributions will no longer hold. However, we can show that using the old formula will be sufficient by showing that if there are large discrepancies when computing the KL-divergence, then there must be large gap between the entropies H(P ) and H(Q) in a particular direction. As the gap cannot exist both ways, this suffices for our purposes. 2.3 Organization This paper is organized as follows: In Section 3, we give the necessary definitions and tools we will require. Section 4 gives our matching upper and lower bounds for identity and closeness testing of product distributions. In Section 5 we study the identity testing for Bayes nets with known structure: We give an identity tester that works under a mild balancedness condition on the explicit Bayes net distribution, and also show that the sample complexity of our algorithm is optimal, up to constant factors. In Section 6, we study the identity testing for unknown structure Bayes nets: We start by proving a sample complexity lower bound showing that, for the unknown structure regime, uniformity testing is information-theoretically as hard as learning – even for the case of trees. We then show that this lower bound can be circumvented under a natural non-degeneracy condition on the explicit Bayes net distribution. Specifically, we give an identity tester with sub-learning sample complexity for all low-degree non-degenerate Bayes nets. Our identity tester for unknown structure non-degenerate Bayes nets relies on a novel structure tester that may be of interest in its own right. Section 7 studies the corresponding closeness testing problems for both known and unknown structure Bayes nets. Finally, in Section 8 we consider the case of high-degree Bayes nets and obtain testers for identity and closeness of unknown-structure Bayes nets. Our testers in this section have optimal (and sub-learning) sample complexity as a function of the maximum in-degree d and polynomial dependence in the dimension n. 11 3 Preliminaries In this section, we record the basic definitions and technical tools that will be used throughout this paper. Basic Notation and Definitions. The L1 -distance between two discrete probability distributions P, Q P supported on a set A is defined as kP − Qk1 = x∈A |P (x)−Q(x)|. Our arguments will make essential use P P (x) of related distance measures, specifically the KL-divergence, defined as D(P kQ) = x∈A P (x) log Q(x) , q p p √ P and the Hellinger distance, defined as dH (P, Q) = (1/ 2) · Q(x))2 . x∈A ( P (x) − We write log and ln for the binary and natural logarithms, respectively, and by H(X) the (Shannon) entropy of a discrete random variable X (as well as, by extension, H(P ) for the entropy of a discrete distribution P ). We denote by I (X; Y ) the mutual information between two random variables X and Y , P Pr[ (X,Y )=(x,y) ] defined as I (X; Y ) = x,y Pr[ (X, Y ) = (x, y) ] log Pr[ X=x ] Pr[ Y =y ] . For a probability distribution P , we write X ∼ P to indicate that X is distributed according to P . For probability distributions P, Q, we will use P ⊗ Q to denote the product distribution with marginals P and Q. Identity and Closeness Testing. We now formally define the testing problems that we study. Definition 3.1 (Identity testing). An identity testing algorithm of distributions belonging to a class C is a randomized algorithm which satisfies the following. Given a parameter 0 < ǫ < 1 and the explicit description of a reference distribution Q ∈ C, as well as access to independent samples from an unknown distribution P ∈ C, the algorithm outputs either accept or reject such that the following holds: • (Completeness) if P = Q, then the algorithm outputs accept with probability at least 2/3; • (Soundness) if kP − Qk1 ≥ ǫ, then the algorithm outputs reject with probability at least 2/3. Note that by the above definition the algorithm is allowed to answer arbitrarily if neither the completeness nor the soundness cases hold. The closeness testing problem is similar, except that now both P, Q are unknown and are only available through independent samples. Definition 3.2 (Closeness testing). A closeness testing algorithm of distributions belonging to a class C is a randomized algorithm which satisfies the following. Given a parameter 0 < ǫ < 1 and access to independent samples from two unknown distributions P, Q ∈ C, the algorithm outputs either accept or reject such that the following holds: • (Completeness) if P = Q, then the algorithm outputs accept with probability at least 2/3; • (Soundness) if kP − Qk1 ≥ ǫ, then the algorithm outputs reject with probability at least 2/3. Finally, we also consider a third related question, that of structure testing: Definition 3.3 (Structure testing). Let C be a family of Bayes nets. A structure testing algorithm of Bayes nets belonging to C is a randomized algorithm which satisfies the following. Given a parameter 0 < ǫ < 1 and the explicit description of a DAG S, as well as access to independent samples from an unknown P ∈ C, the algorithm outputs either accept or reject such that the following holds: • (Completeness) if P can be expressed as a Bayes net with structure S, then the algorithm outputs accept with probability at least 2/3; • (Soundness) if kP − Qk1 > ǫ for every Q ∈ C with structure S, then the algorithm outputs reject with probability at least 2/3. 12 In all cases the two relevant complexity measures are the sample complexity, i.e., the number of samples drawn by the algorithm, and the time complexity of the algorithm. The golden standard is to achieve sample complexity that is information-theoretically optimal and time-complexity linear in the sample complexity. In this work, the family C will correspond to the family of Bayes nets over {0, 1}n , where we will impose an upper bound d on the maximum in-degree of each node. For d = 0, i.e., when the underlying graph has no edges, we obtain the family of product distributions over {0, 1}n . Relations between Distances. We will require a number of inequalities relating the L1 -distance, the KLdivergence, and the Hellinger distance between distributions. We state a number of inequalities relating these quantities that we will use extensively in our arguments. The simple proofs are deferred to Appendix B. A binary product distribution is a distribution over {0, 1}n whose coordinates are independent. Note that such a distribution is determined by its mean vector. We have the following: Lemma 3.4. Let P, Q be binary product distributions with mean vectors p, q ∈ (0, 1)n . We have that 2 n X i=1 (pi − qi )2 ≤ D(P kQ) ≤ n X (pi − qi )2 . (1) 1 kp − qk22 . α(1 − α) (2) i=1 qi (1 − qi ) In particular, if there exists α > 0 such that q ∈ [α, 1 − α]n , we obtain 2kp − qk22 ≤ D(P kQ) ≤ Recall that for any pair of distributions P, Q, Pinsker’s inequality states that kP − Qk21 ≤ 2 D(P kQ). This directly implies the following: Corollary 3.5. Let P, Q be binary product distributions with mean vectors p, q ∈ (0, 1)n . We have that kP − Qk21 ≤ 2 n X (pi − qi )2 i=1 qi (1 − qi ) . The following lemma states an incomparable and symmetric upper bound on the L1 -distance, as well as a lower bound. Lemma 3.6. Let P, Q be binary product distributions with mean vectors p, q ∈ (0, 1)n . Then it holds that n   X min c, kp − qk42 ≤ kP − Qk21 ≤ 8 i=1 (pi − qi )2 . (pi + qi )(2 − pi − qi ) for some absolute constant c ∈ (0, 1). (Moreover, one can take c = 4(1 − e−3/2 ) ≃ 3.11.) While the above is specific to product distributions, we will require analogous inequalities for Bayes nets. We start with the following simple lemma: Lemma 3.7. Let P and Q be Bayes nets with the same dependency graph. In terms of the conditional probability tables p and q of P and Q, we have: 2 m X k=1 Pr [ Πk ] (pk − qk )2 ≤ D(P kQ) ≤ P 13 m X k=1 Pr [ Πk ] P (pk − qk )2 . qk (1 − qk ) Finally, we state an alternative bound, expressed with respect to the Hellinger distance between two Bayes nets: Lemma 3.8 ([DKS16b, Lemma 4]). Let P and Q be Bayes nets with the same dependency graph. In terms of the conditional probability tables p and q of P and Q, we have: dH (P, Q)2 ≤ 2 m r X k=1 Pr [ Πk ] Pr [ Πk ] P Q (pk − qk )2 . (pk + qk )(2 − pk − qk ) 4 Testing Identity and Closeness of Product Distributions The structure of this section is as follows: In Section 4.1, we give an identity testing algorithm for n√ dimensional binary product distributions with sample complexity O( n/ǫ2 ). In Section 4.2, we show that this sample bound is information-theoretically optimal. Sections 4.3 and 4.4 contain matching upper and lower bounds respectively for the task of closeness testing between product distributions. 4.1 Identity Testing Algorithm In this section, we prove the following theorem: Theorem 4.1. There exists a computationally efficient algorithm which, given an explicit product distribution Q (via its mean vector), and sample access to an unknown product distribution P over {0, 1}n , has the √ following guarantees: For any ǫ > 0, the algorithm takes O n/ǫ2 samples from P , and distinguishes with probability 2/3 between the cases that P = Q versus kP − Qk1 > ǫ. Let Q = Q1 ⊗ · · · ⊗ Qn be a known product distribution over {0, 1}n with mean vector q, and P = P1 ⊗ · · · ⊗ Pn be an unknown product distribution on {0, 1}n with unknown mean vector p. The goal is to distinguish, given independent samples from P , between P = Q, and kP − Qk1 > ǫ. Let 0 < γ < 1/2. We say that a product distribution P over {0, 1}n is γ-balanced if its mean vector p satisfies pi ∈ [γ, 1 − γ] for all i ∈ [n]. To prove Theorem 4.1, we can assume without loss of generality def ǫ . Indeed, given sample access to a product distribution P , we can that P, Q are γ0 -balanced for γ0 = 16n simulate access to the γ0 -balanced product distribution P ′ by re-randomizing independently each coordinate with probability 2γ0 , choosing it then to be uniform in {0, 1}. The resulting product distribution P ′ is γ0 balanced, and satisfies kP − P ′ k1 ≤ n · γ0 ≤ 4ǫ . Therefore, to test the identity of a product distribution P against a product distribution Q with parameter ǫ, it is sufficient to test the identity of the γ0 -balanced product distributions P ′ , Q′ (with parameter 2ǫ ). Preprocessing. We also note that by flipping the coordinates i such that qi > 1/2, we can assume that qi ∈ [γ0 , 1/2] for all i ∈ [n]. This can be done without loss of generality, as q is explicitly given. For any i such that qi > 21 , we replace qi by 1 − qi and work with the corresponding distribution Q′ instead. By flipping the i-th bit of all samples we receive from P , it only remains to test identity of the resulting distribution P ′ to Q′ , as all distances are preserved. √ Proof of Correctness. Let m ≥ 2716 ǫ2n , and let M1 , . . . , Mn be i.i.d. Poi(m) random variables. We set M = maxi∈[n] Mi and note that M ≤ 2m with probability 1 − e−Ω(m) (by a union bound). We condition hereafter on M ≤ 2m (our tester will reject otherwise) and take M samples X (1) , . . . , X (M ) drawn from P . We define the following statistic: W = n X (Wi − mqi )2 − Wi i=1 qi (1 − qi ) 14 , ǫ Input Error tolerance ǫ, dimension n, balancedness parameter γ ≥ 16n , mean vector q = n (q1 , . . . , qn ) ∈ [γ, 1/2] of an explicit product distribution Q over {0, 1}n , and sampling access to a product distribution P over {0, 1}n . l √ m n . - Set τ ← 14 ǫ2 , m ← 2716 ǫ2 - Draw M1 , . . . , Mn ∼ Poi(m) independently, and let M ← maxi∈[n] Mi . If M > 2m set W = τ m2 Else Take M samples X (1) , . . . , X (M ) from P , and define W = n X (Wi − mqi )2 − Wi qi (1 − qi ) i=1 where Wi ← PM i (j) j=1 Xi for i ∈ [n]. If W ≥ τ m2 return reject. Otherwise return accept. Figure 1: Identity testing of an unknown product distribution P against a given product distribution Q. def PMi (j) where we write Wi = j=1 Xi for all i ∈ [n]. We note that the Wi ’s are independent, as P is a product distribution and the Mi ’s are independent. The pseudocode for our algorithm is given in Figure 1. Our identity tester is reminiscent of the “chi-squared type” testers that have been designed for the unstructured univariate discrete setting [CDVV14, DKN15b, ADK15]. We start with a simple formula for the expected value of our statistic: P 2 i −qi ) Lemma 4.2. E[W ] = m2 ni=1 (p qi (1−qi ) . Proof. Since Wi ∼ Poi(mpi ) for all i, we can write     E (Wi − mqi )2 = E Wi2 − 2mqi E[Wi ] + m2 qi2 = mpi + m2 (pi − qi )2 , and therefore E[W ] = Pn E[(Wi −mqi )2 ]−E[Wi ] i=1 qi (1−qi ) = m2 As a corollary we obtain: Pn (pi −qi )2 i=1 qi (1−qi ) . Claim 4.3. If P = Q then E[W ] = 0. Moreover, whenever kP − Qk1 > ǫ we have E[W ] > 21 m2 ǫ2 . Proof. The first part is immediate from the expression of E[W ]. The second follows from Corollary 3.5, as P 2 i −qi ) m2 kP − Qk21 ≤ 2m2 ni=1 (p qi (1−qi ) = 2E[W ]. We now proceed to bound from above the variance of our statistic. The completeness case is quite simple: Claim 4.4. If P = Q, then Var[W ] ≤ 8m2 n. 15 P 2 i ) −Wi ] Proof. Suppose that P = Q, i.e., p = q. From independence, we have that Var[W ] = ni=1 Var[(Wq2i −mq . 2 (1−q ) i i     2 2 2 2 Using the fact that E (Wi − mqi ) − Wi = 0, we get Var[(Wi −mqi ) −Wi ] = E ((Wi − mqi ) − Wi ) = 2m2 qi2 , where the last equality follows from standard computations involving the moments of a Poisson random variable. From there, recalling that qi ∈ (0, 1/2] for all i ∈ [n], we obtain Var[W ] = P 1 2 2m2 ni=1 (1−q 2 ≤ 8m n. i) For the soundness case, the following lemma bounds the variance of our statistic from above. We note that the upper bound depends on the balancedness parameter γ.   √ Lemma 4.5. We have that Var[W ] ≤ 16nm2 + 32 2nm E[W ] + √32γ E[W ]3/2 . + 16 γ Proof. For general p, q, we have that   Var[(Wi − mqi )2 − Wi ] = E ((Wi − mqi )2 − Wi )2 − m4 (pi − qi )4 = 2m2 p2i + 4m3 pi (pi − qi )2 , where as before the last equality follows from standard computations involving the moments of a Poisson random variable. This leads to Var[W ] = 2m 2 n X i=1 n n n X pi (pi − qi )2 X p2 X pi (pi − qi )2 p2i 3 2 3 i + 4m ≤ 8m + 16m . qi2 (1 − qi )2 q 2 (1 − qi )2 q2 qi2 i=1 i i=1 i i=1 We handle the two terms separately, in a fashion similar to [ADK15, Lemma 2]. For the first term, we can write: n X p2 i 2 q i=1 i = n X (pi − qi )2 qi2 i=1 + n X 2pi qi − q 2 i i=1 2 ) qi2 = i=1 qi2 + n X 2qi (pi − qi ) + q 2 i i=1 qi2 n 2(pi − qi ) (pi − qi )2 X 2(pi − qi ) + =n+ qi qi qi2 i=1 i=1 i=1 i=1   n n n X X (pi − qi )2 X (pi − qi )2 (pi − qi )2 ≤ n+ 1 + + = 2n + 2 qi2 qi2 qi2 (AM-GM) i=1 i=1 i=1 =n+ n X ≤ 2n + (pi − qi qi2 + n X n X (pi − qi )2 n X n 2 X (pi − qi )2 4 ≤ 2n + 2 E[W ] . γ qi m γ i=1 We bound the second term from above as follows: n X pi (pi − qi )2 i=1 qi2 n X pi pi (pi − qi )2 · qi qi i=1 v v u n 2u n uX pi uX (pi − qi )4 t ≤t 2 q qi2 i i=1 i=1  X n √ 2 p (pi − qi )2 2n + √ E[W ] ≤ m γ qi i=1   1 √ 2 p = 2 2n + √ E[W ] · E[W ] . m m γ ≤ 16 (by the Cauchy–Schwarz inequality) (from the monotonicity of ℓp -norms) Overall, we obtain   √ 2 p 32 2n + √ E[W ] · E[W ] Var[W ] ≤ 16nm + E[W ] + 16m γ m γ   √ 32 32 2 + 16 2nm E[W ] + √ E[W ]3/2 . = 16nm + γ γ 2 We are now ready to prove correctness. def ǫ2 4. Lemma 4.6. Set τ = Then we have the following:   • If kP − Qk1 = 0, then Pr W ≥ τ m2 ≤ 13 .   • If kP − Qk1 > ǫ, then Pr W < τ m2 ≤ 31 . Proof. We start with the soundness case, i.e., √ assuming kP − Qk1 > ǫ. In this case, Claim 4.3 implies ǫ and for m ≥ 16 2n, Lemma 4.5 implies that E[W ] > 2τ m2 . Since γ ≥ 16n ǫ r √ n E[W ]3/2 . Var[W ] ≤ 16nm + 32 2nmE[W ] + 32 · 4 ǫ 2 By Chebyshev’s inequality, we have that     4 Var[W ] 1 2 Pr W < τ m ≤ Pr E[W ] − W > E[W ] ≤ 2 E[W ]2 p √ 64nm2 128 2nm 4 · 128 n/ǫ ≤ + + E[W ]2 E[W ] E[W ]1/2 √ √ √ 4 · 64n 2 · 128 2n 4 2 · 128 n ≤ ≤ 128 + + m2 ǫ4 mǫ2 mǫ3/2 (3) √ ! 2 5 2 , + C2 C (4) √ which is at most 1/3 as long as C ≥ 2716, that is m ≥ 2716 ǫ2n . Turning to the completeness, we suppose kP − Qk1 = 0. Then, by Chebyshev’s inequality, and Claim 4.4 we have that     Var[W ] 128n Pr W ≥ τ m2 = Pr W ≥ E[W ] + τ m2 ≤ 2 4 ≤ 4 2 , τ m ǫ m √ √ which is no more than 1/3 as long as m ≥ 8 6 ǫ2n . Remark 4.7. We observe that the aforementioned analysis – specifically Claim 4.3 and Lemma 4.6) – can be adapted to provide some tolerance guarantees in the completeness case, that is it implies a tester that distinguishes between kP − Qk1 ≤ ǫ′ and kP − Qk1 > ǫ, where ǫ′ = O(ǫ2 ). This extension, however, requires the assumption that Q be balanced: indeed, the exact dependence between ǫ′ and ǫ2 will depend on this balancedness parameter, leading to a tradeoff between tolerance and balancedness. Further, as shown in Section 4.5, this tradeoff is in fact necessary, as tolerant testing of arbitrary product distributions requires Ω(n/ log n) samples. 17 4.2 Sample Complexity Lower Bound for Identity Testing In this section, we prove our matching information-theoretic lower bound for identity testing. In Theorem 4.8, we give a lower bound for uniformity testing of a product distribution, while Theorem 4.13 shows a quantitatively similar lower bound for identity testing against the product distribution with mean vector q = (1/n, . . . , 1/n). Theorem 4.8. There exists an absolute constant ǫ0 > 0 such that, for any 0 < ǫ ≤ ǫ0 , the following holds: Any algorithm that has sample access to an unknown product distribution P over {0, 1}n and distinguishes √ between the cases that P = U and kP − U k1 > ǫ with probability 2/3 requires Ω( n/ǫ2 ) samples. Proof. We follow the information-theoretic framework of [DK16] for proving distribution testing lower bounds, first defining two distributions over product distributions Y, N : • Y is the distribution that puts probability mass 1 on the uniform distribution, U = Bern(1/2)⊗n ; • N is the uniform distribution over the set     n O  1 ǫ Bern + (−1)bj √ : (b1 , . . . , bn ) ∈ {0, 1}n .   2 n j=1 Lemma 4.9. N is supported on distributions that are Ω(ǫ)-far from U .  def Nn 1 Proof. By symmetry, it is sufficient to consider the distribution P = Bern j=1 2 + bound from below the expression of kP − U k1 :    X 1 ǫ |x| 1 ǫ n−|x| 1 kP − U k1 = +√ −√ − n 2 n 2 n 2 n √ǫ n  . We explicitly x∈{0,1}    n    2ǫ n−k 2ǫ k 1 X n −1 1− √ 1+ √ = n 2 n n k k=0 1 ≥ n 2 √ n +2 n 2 X √ k= n + n 2 √ n +2 n 2 C ≥√ n X       n 2ǫ k 2ǫ n−k 1+ √ −1 1− √ k n n √ k= n + n 2  2ǫ 1+ √ n k  2ǫ 1− √ n n−k −1 , where C > 0 is an absolute constant. We bound from below each summand separately: fixing k, and writing √ √ ℓ = k − n2 ∈ [ n, 2 n],     n/2 1 + √2ǫ !ℓ  4ǫ2 2ǫ n−k 2ǫ k n = 1− 1− √ 1+ √ n n n 1 − √2ǫn √  n/2 1 + √2ǫ ! n 2 2 4ǫ n −−−→ e4ǫ−2ǫ , ≥ 1− 2ǫ n→∞ √ n 1− n 2 so that each summand is bounded by a quantity that converges (when n → ∞) to e4ǫ−2ǫ −1 > 4ǫ−2ǫ2 > 2ǫ, implying that each is Ω(ǫ). Combining the above gives C kP − U k1 ≥ √ n √ n +2 n 2 X √ + n k= n 2 18 Ω(ǫ) = Ω(ǫ) as claimed. We will make a further simplification, namely that instead of drawing k samples from P = P1 ⊗ · · · ⊗ Pn , the algorithm is given ki samples from each Pi , where k1 , . . . , kn are independent Poi(k) random def variables. This does not affect the lower bound, as this implies a lower bound on algorithms taking k∗ = max(k1 , . . . , kn ) samples from P (where the ki ’s are as above), and k∗ ≥ k2 with probability 1 − 2−Ω(n) . We now consider the following process: letting X ∼ Bern(1/2) be a uniformly random bit, we choose a distribution P over {0, 1}n by • Drawing P ∼ Y if X = 0, and; • Drawing P ∼ N if X = 1; • Drawing k1 , . . . , kn ∼ Poi(k), and returning k1 samples from P1 , . . . , kn samples from Pn . For i ∈ [n], we let Ni denote the number of 1’s among the ki samples drawn from Pi , and write N = (N1 , . . . , Nn ) ∈ Nn . We will rely on the standard fact, as stated in [DK16]: Fact 4.10. Let X be a uniform random bit and Y a random variable taking value in some set S. If there exists a function f : S → {0, 1} such that Pr[ f (Y ) = X ] ≥ 0.51, then I (X; Y ) = Ω(1). Proof. By Fano’s inequality, letting q = Pr[ f (Y ) 6= X ], we have h(q) = h(q) + q log(|{0, 1}| − 1) ≥ H (X | Y ). This implies I (X; Y ) = H (X) − H (X | Y ) = 1 − H (X | Y ) ≥ 1 − h(q) ≥ 1 − h(0.49) ≥ 2 · 10−4 . The next step is then to bound from above I (X; N ), in order to conclude that it will be o(1) unless k is taken big enough and invoke Fact 4.10. By the foregoing discussion and the relaxation on the ki ’s, we have that the conditioned on X the Ni are independent (with Ni ∼ Poi(kpi )). Recall now that if X, Y1 , Y2 are random variables such that Y1 and Y2 are independent conditioned on X, by the chain rule we have that H ((Y1 , Y2 ) | X) = H (Y1 | X) + H (Y2 | X, Y1 ) = H (Y1 | X) + H (Y2 | X) , where the second equality follows from conditional independence, and therefore I (X; (Y1 , Y2 )) = H ((Y1 , Y2 )) − H ((Y1 , Y2 ) | X) = H (Y1 ) + H (Y1 | Y2 ) − (H (Y1 | X) + H (Y2 | X)) ≤ H (Y1 ) + H (Y1 ) − (H (Y1 | X) + H (Y2 | X)) = (H (Y1 ) − H (Y1 | X)) + (H (Y2 ) − H (Y2 | X)) = I (X; Y1 ) + I (X; Y2 ) . This implies that I (X; N ) ≤ n X I (X; Ni ) , (5) i=1 so that it suffices to bound each I (X; Ni ) separately. Lemma 4.11. Fix any i ∈ [n], and let X, Ni be as above. Then I (X; Ni ) = O(k2 ǫ4 /n2 ). Proof. By symmetry it suffices to consider only the case of i = 1, so that we let A = N1 . The first step is to bound from above I (X; A) by a more manageable quantity: Fact 4.12. We have that I (X; A) ≤ ∞ X a=0  Pr[ A = a | X = 1 ] Pr[ A = a ] 1 − Pr[ A = a | X = 0 ] 19 2 . (6) The proof of this fact is given in Appendix C. Since A ∼ Poi(kp1 ) with p1 = 1/2 if X = 0 and uniformly yields that Pr[ A = ℓ | X = 0 ] = e−k/2 Pr[ A = ℓ | X = 1 ] = Writing out ϕ(ǫ, ℓ) =  (k/2)ℓ ℓ! e−k/2 Pr[ A=ℓ | X=1 ] Pr[ A=ℓ | X=0 ]  (k/2)ℓ ℓ!   √ n (1 e−kǫ/ 1 2 ± √ǫ n if X = 1, a simple computation √ n (1 + 2 √ǫn )ℓ + ekǫ/ 2 − 2 √ǫn )ℓ  . √ as a function of ǫ/ n, we see that it is even. Thus, expanding it as a √ def Taylor series in α = ǫ/ n, the odd degree terms will cancel. Moreover, we can write ∞ X ℓ=0 i h Pr[ A = ℓ ] (1 − ϕ(ǫ, A))2 = EA (1 − ϕ(ǫ, A))2 i h 1 EA∼Poi(k/2) (1 − ϕ(ǫ, A))2 2 i h 1 + EA∼Poi(k(1/2+α)) (1 − ϕ(ǫ, A))2 4 i h 1 + EA∼Poi(k(1/2−α)) (1 − ϕ(ǫ, A))2 . 4 = Now, we can rewrite 2  e−kα (1 + 2α)ℓ + ekα (1 − 2α)ℓ (1 − ϕ(ǫ, A)) = 1 − 2   e−2kα (1 + 2α)2ℓ + 2(1 − 4α2 )ℓ + e2kα (1 − 2α)2ℓ . = 1 − e−kα (1 + 2α)ℓ + ekα (1 − 2α)ℓ + 4 2 For b ∈ {−1, 0, 1}, we have EA∼Poi(k(1/2+bα)) [1] = 1 (!), and (from the MGF of a Poisson distribution) as well as   2 e−kα EA∼Poi(k(1/2+bα)) (1 + 2α)A = e−kα ek(1/2+bα)·2α = eb·2α k   2 ekα EA∼Poi(k(1/2+bα)) (1 − 2α)A = ekα ek(1/2+bα)·−2α = e−b·2α k ,   2 2 e−2kα EA∼Poi(k(1/2+bα)) (1 + 2α)2A = e−2kα ek(1/2+bα)·(4α+4α ) = e2kα (1+2b+2bα)   2 2 e2kα EA∼Poi(k(1/2+bα)) (1 − 2α)2A = e2kα ek(1/2+bα)·(−4α+4α ) = e2kα (1−2b+2bα)   2 2 3 2EA∼Poi(k(1/2+bα)) (1 − 4α2 )A = 2ek(1/2+bα)·−4α = 2e−2kα −4kbα . 20 Gathering the terms, we get h EA (1 − ϕ(ǫ, A))2 i e2kα + e−2kα 1 2 1−2+ = 4 2 + + 2kα2 1 − (e −2kα2 +e −2kα2 1 − (e 2kα2 +e ! 2 2 )+ 2 (3+2α) 2 (−1+2α) e2kα + e2kα 4 2 (1+2α) )+ 2 −4kα3 + 2e−2kα e−2kα 2 (3−2α) + e2kα 2 +4kα3 + 2e−2kα ! ! 4  1 2 2 2 3 2 2 = − 4(e2kα + e−2kα ) + e2kα (3+2α) + e2kα (−1+2α) + 2e−2kα −4kα 16  2 (1+2α) + e−2kα 2 (3−2α) + e2kα  2 +4kα3 + 2e−2kα = O(k2 α4 ) , (Taylor series expansion in α) giving that indeed ∞ X ℓ=0 2 Pr[ A = ℓ ] (1 − ϕ(ǫ, A)) = O  ǫ4 k 2 n2  . This completes the proof. This lemma, along with Eq. (5), gives the desired result, that is  4 2  4 2 n X ǫ k ǫ k =O , O I (X; N ) ≤ 2 n n (7) i=1 √ which is o(1) unless k = Ω( n/ǫ2 ). Theorem 4.13. There exists an absolute constant ǫ0 > 0 such that, for any ǫ ∈ (0, ǫ0 ), distinguishing √ def P = P ∗ and kP − P ∗ k1 > ǫ with probability 2/3 requires Ω( n/ǫ2 ) samples, where P ∗ = Bern(1/n)⊗n . Proof. The proof will follow the same outline as that of Theorem 4.8 first defining two distributions over product distributions Y, N : • Y is the distribution that puts probability mass 1 on P ∗ ; • N is the uniform distribution over the set     n  O  1 Bern 1 + (−1)bj ǫ : (b1 , . . . , bn ) ∈ {0, 1}n .   n j=1 Lemma 4.14. With probability 1 − 2−Ω(n) , N is supported on distributions that are Ω(ǫ)-far from P ∗ . Proof. Using Hellinger distance as a proxy will only result in an Ω(ǫ2 ) lower bound on the distance, so we (j) compute it explicitly instead: in what follows, e(j) ∈ {0, 1}n denotes the basis vector with ei = 1{i=j} . 21 Fix any vector b = (b1 , . . . , bn ) ∈ {0, 1}n such that |b| ∈ [n/3, 2n/3], and let P be the corresponding distribution from the support of N . ∗ kP − P k1 ≥ n X j=1 1 = n (j) |P (e  1 1− n ∗ (j) ) − P (e n−1 X n     n X 1 + (−1)bj ǫ Y 1 + (−1)bi ǫ 1 1 n−1 )| = 1− − 1− n n n n j=1 i6=j bj (1 + (−1) ǫ) j=1 Y i6=j (−1)bi ǫ 1− n−1  −1 . Each summand can be bounded from above as follows: 2n/3 Y    2n/3  ǫ (−1)bi ǫ ǫ ≤ , ≤ 1+ 1− 1− n−1 n−1 n−1 i6=j where the last inequality follows from our assumption on |b|. In turn, this gives that • If bj = 0, bj (1 + (−1) ǫ) Y i6=j (−1)bi ǫ 1− n−1   ǫ − 1 ≥ (1 + ǫ) 1 − n−1 2n/3 − 1 = Ω (ǫ) . • If bj = 1, bj 1 − (1 + (−1) ǫ) Y i6=j (−1)bi ǫ 1− n−1   ǫ ≥ 1 − (1 − ǫ) 1 + n−1 2n/3 = Ω (ǫ) . n−1 −1 = e +o(1) , we get kP − P ∗ k1 = Ω(ǫ). The lemma now follows from observing that Since n1 1 − n1 n a uniformly random b ∈ {0, 1}n satisfies |b| ∈ [n/3, 2n/3] with probability 1 − 2−Ω(n) . The only ingredient missing to conclude the proof is the analogue of Lemma 4.11: Lemma 4.15. Suppose kǫ2 n ≤ 1. Fix any i ∈ [n], and let X, Ni be as above. Then I (X; Ni ) = O(k2 ǫ4 /n2 ). Proof. The proof is similar as that of [DK16, Lemma 3.3], replacing (their) mn by (our) n. For completeness, we provide an alternative proof in Appendix C. 4.3 Closeness Testing Algorithm In this section, we prove the following theorem: Theorem 4.16. There exists an efficient algorithm which, given sample access to two unknown product distributions P, Q over {0, 1}n , has the following guarantees. For any ǫ ∈ (0, 1), the algorithm  √ takes O max n/ǫ2 , n3/4 /ǫ samples from P and Q, and distinguishes with probability 2/3 between (i) kP − Qk1 = 0 and (ii) kP − Qk1 > ǫ. The rest of this section is devoted to the proof of the above theorem. Let P, Q be two product distributions on {0, 1}n with mean vectors p, q ∈ [0, 1]n . For S ⊆ [n], we denote by PS and QS the product distributions on {0, 1}|S| obtained by restricting P and Q to the coordinates in S. Similarly, we write pS , qS ∈ [0, 1]|S| for the vectors obtained by restricting p, q to the coordinates in S, so that PS has mean vector pS . 22 High-level Idea. The basic idea of the algorithm is to divide the coordinates in two bins U, V : one containing the indices where both distributions have marginals very close to 0 (specifically, at most 1/m, where m is our eventual sample complexity), and one containing the remaining indices, on which at least one of the two distributions is roughly balanced. Since P and Q can only be far from each other if at least one of kPU − QU k1 , kPV − QV k1 is big, we will test separately each case. Specifically, we will apply two √ different testers: one “χ2 -based tester” (with sample complexity O n/ǫ2 ) to the “heavy bin” U – which relies on the fact that the marginals of P, Q on U are balanced by construction – and one “ℓ2 -tester” (with  sample complexity O n3/4 /ǫ ) to the “light bin” V – relying on the fact that kpV k2 , kqV k2 are small. The pseudocode of our algorithm is given in Figure 2. Sample Complexity. Hereafter, we let def m = C max √ n n3/4 , ǫ2 ǫ ! , for some absolute constant C > 0 to be determined in the course of the analysis. We let M1 , . . . , Mn be i.i.d. Poi(m) random variables. We set M = maxi∈[n] Mi and note that M ≤ 2m with probability 1 − e−Ω(m) (by a union bound). We will condition hereafter on the event that M, M ′ ≤ 2m and our tester will reject otherwise. ǫ Without loss of generality, as in the previous sections, we will assume that 16n ≤ pi , qi ≤ 34 for every i ∈ [n]. Indeed, this can be ensured by the simple preprocessing step below. Preprocessing. Using O(log n) samples from P and Q, we can ensure without loss of generality that all pi , qi are at most 3/4 (with probability 9/10). Namely, we estimate every pi , qi to an additive 1/64, and proceed as follows: 1 of that of pi , we output reject and stop; • If the estimate of qi is not within an additive ± 32 • If the estimate of pi is more than 43/64, mark i as “swapped” and replace Xi by 1 − Xi (for P ) and Yi by 1 − Yi (for Q) in all future samples. Assuming correctness of the estimates (which holds with probability at least 9/10), if we pass this step then 1 |pi −qi | < 16 for all i. Moreover, if i was not swapped, then it means that we had pi ≤ 43/64+1/64 < 3/4, and therefore qi < 43/64 + 1/64 + 1/16 = 3/4. Now, if we had qi > 3/4, then pi > 3/4 − 1/16 and the estimate of pi would be more than 3/4 − 1/16 − 1/64 = 43/64. Our closeness tester is described in the following pseudocode. 23 Input Error tolerance ǫ ∈ (0, 1), dimension n, and sampling access to two product distributions P, Q over {0, 1}n . - Preprocess P, Q so that qi ≤ 43 for all i ∈ [n], return reject if a discrepancy appears. √  3/4 def - Set m = C max ǫ2n , n ǫ . - Define M, M ′ as follows: Draw M1 , . . . , Mn , M1′ , . . . , Mn′ i.i.d. Poi(m) random variables, and set M = maxi∈[n] Mi , M ′ = maxi∈[n] Mi′ . - Take m samples from both P and Q, and let U ′ , V ′ ⊆ [n] be respectively the set of coordinates i such that Xi = 1 for at least one sample, and its complement. If max(M, M ′ ) > 2m, return reject. ′ - Take M (resp. M ′ ) samples X (1) , . . . , X (M ) from PU ′ (resp. Y (1) , . . . , Y (M ) from QU ′ ), and define X (Wi − Vi )2 − (Wi + Vi ) , W i + Vi ′ Wheavy = i∈U for Vi , Wi defined as Wi = If Wheavy ≥ mǫ2 12000 return reject. PM i (j) j=1 Xi ′ and Vi = PMi′ (j) j=1 Yi for all i ∈ U ′ . ′ ′ - Take M (resp. M ′ ) samples X (1) , . . . , X (M ) from PV ′ (resp. Y (1) , . . . , Y define X  Wlight = (Wi′ − Vi′ )2 − (Wi′ + Vi′ ) , ′ (M ′ ) from QV ′ ), and i∈V ′ for Vi′ , Wi′ defined as Wi′ = If Wlight ≥ ǫ2 600n return reject. PM i ′ (j) j=1 Xi , Vi′ = PMi′ ′ (j) j=1 Yi for all i ∈ V ′ . return accept. Figure 2: Closeness testing between two unknown product distributions P, Q over {0, 1}n . Proof of Correctness. def def For m as above, define U, V ⊆ [n] by V = U = [n] \ V . We start with the following simple claim:  i ∈ [n] : max(pi , qi ) < 1 m Claim 4.17. Assume kP − Qk1 > ǫ. Then, at least one of the following must hold: (i) kpV − qV k22 > P 2 ǫ2 i) or (ii) i∈U (ppii−q +qi > 64 . and ǫ2 16n , Proof. Since ǫ < kP − Qk1 ≤ kPU − QU k1 + kPV − QV k1 , at least one of the two terms in the RHS P 2 i −qi ) must exceed 2ǫ . We now recall that, by Lemma 3.6, it holds that kPU − QU k21 ≤ 8 i∈U (pi +q(pi )(2−p i −qi ) P (pi −qi )2 2 3 and from the further assumption that pi , qi ≤ 4 that kPU − QU k1 ≤ 16 i∈U pi +qi . 24 Using subadditivity and the Cauchy–Schwartz inequality, we also have X X p √ kPV − QV k1 ≤ kPi − Qi k1 = 2 |pi −qi | = 2kpV − qV k1 ≤ 2 |V |kpV − qV k2 ≤ 2 nkpV − qV k2 , i∈V i∈V from where we derive that kpV − qV k22 ≥ 1 4n kPV − QV k21 . This completes the proof. We now define U ′ , V ′ ⊆ [n] (our “proxies” for U, V ) as follows: Taking m samples from both P and Q, we let V ′ be the set of indices which were never seen set to one in any sample, and U ′ be its complement. We have the following: i h Claim 4.18. Assume kP − Qk1 > ǫ. Then, at least one of the following must hold: (i) E kpV ′ − qV ′ k22 > hP i (pi −qi )2 ǫ2 ǫ2 , or (ii) E . > 128 ′ i∈U ∩U pi +qi 150n Proof. By definition, any fixed i belongs to V ′ with probability (1 − pi )m (1 − qi )m , and so h E kpV ′ − qV ′ k22 i = n X i=1 ≥  (pi − qi )2 · (1 − pi )m (1 − qi )m ≥ X (pi − qi )2 · (1 − pi )m (1 − qi )m i∈V    1 2m X 1 2m 1 2 1− (pi − qi ) = 1 − kpV − qV k22 ≥ kpV − qV k22 , m m 9 i∈V for m ≥ 10. Similarly, # " X (pi − qi )2 X (pi − qi )2 · (1 − (1 − pi )m (1 − qi )m ) ≥ = E p + q p + q i i i i ′ i∈U i∈U ∩U ≥ 1 X (pi − qi )2 2 i∈U pi + q i  1 1− 1− m 2m ! X i∈U (pi − qi )2 pi + q i , and in both cases the proof follows by Claim 4.17. We will require the following implication: Claim 4.19. Assume kP − Qk1 > ǫ. Then, at least one of the following must hold with probability at least P 2 ǫ2 ǫ2 i) , or (ii) i∈U ′ ∩U (ppii−q 4/5 (over the choice of U ′ , V ′ ): (i) kpV ′ − qV ′ k22 > 300n +qi > 2000 . 2 ǫ ′′ , and variable V ′ ∩ V . By (the Proof. First, assume that kpV −hqV k22 > 16n i let V denote the random ǫ2 . Writing m2 kpV ′′ − qV ′′ k22 = proof of) Claim 4.18, we have E kpV ′′ − qV ′′ k22 ≥ 19 kpV − qV k22 > 150n Pn 2 2 i=1 m (pi − qi ) 1i∈V ′′ (note that each summand is in [0, 1]), we then get by a Chernoff bound that   C 1 1 m2 ǫ2 1 ǫ2 2 Pr kpV ′′ − qV ′′ k2 < < e− 8 150n < e− 1200 ǫ2 < , 300n 5 using our setting of m (for an appropriate choice of the constant C > 0). P 2 ǫ2 i) Suppose now that i∈U (ppii−q +qi > 64 . We divide the proof in two cases. hP 2 ǫ2 i) > . Then Pr • Case 1: there exists i∗ ∈ U such that (ppii−q i∈U ′ ∩U +qi 2000  2m 1 Pr[ i∗ ∈ U ′ ] ≥ 1 − 1 − m > 45 . 25 (pi −qi )2 pi +qi > ǫ2 2000 i ≥ 2 2 def 2 ǫ 2000 (pi −qi ) i) ′ • Case 2: (ppii−q +qi ≤P2000 for all i ∈ U . Then, writing Xi = pi +qi 1i∈U ∩U ∈ [0, 1] for all ǫ2 n 2000 i ∈ [n], we have E[ i=1 Xi ] ≥ 128 by Claim 4.18, and a multiplicative Chernoff bound ensures that # # " n " X X (pi − qi )2 2000 ǫ2 1 Xi < 1 ≤ e− 8·128 < , ≤ Pr < Pr p + q 2000 5 i i ′ i=1 i∈U ∩U concluding the proof. Finally, we will need to bound the expected ℓ2 -norm of pV ′ and qV ′ . i i h h Claim 4.20. For U ′ , V ′ defined as above, we have E kpV ′ k22 , E kqV ′ k22 ≤ n . m2 i h Proof. By symmetry, it is sufficient to bound E kpV ′ k22 . We have n n X   X p2i · (1 − pi )m . p2i · (1 − pi )m (1 − qi )m ≤ E kp2V ′ k2 = i=1 i=1 Studying the auxiliary function f : x ∈ [0, 1] 7→ x2 (1 − x)m , we see that it achieves a maximum at We can then bound    2  2 4n E kpV ′ k2 ≤ n · f ∼m→∞ 2 2 , m+2 e m   and so E kp2V ′ k2 ≤ mn2 for m large enough (and this actually holds for any m ≥ 1). Case 1: discrepancy in U ′ . show the following: 2 m+2 . We assume that Algorithm 2 reached the line where Wheavy is computed, and Lemma 4.21. If P = Q, then with probability at least 9/10 we have Wheavy ≤ P (pi −qi )2 ǫ2 mǫ2 i∈U ∩U ′ pi +qi > 2000 , then Wheavy ≥ 12000 with probability at least 9/10. mǫ2 12000 . Conversely, if Proof. Recall that the Wi ’s are independent, as P is a product distribution and the Mi ’s are independent. Similarly for the Vi ’s. We have: P 2 ǫ2 i) Claim 4.22. If P = Q, then E[Wheavy ] = 0. Moreover, if i∈U ∩U ′ (ppii−q +qi > 2000 , then E[Wheavy ] > mǫ2 6000 . Proof. Note that Wi ∼ Poi(mpi ) and Vi ∼ Poi(mqi ) for all i ∈ U ′ . From there, we can compute (as in [CDVV14]) !   (pi − qi )2 1 − e−m(pi +qi ) (Wi − Vi )2 − (Wi + Vi ) , =m 1− E Wi + Vi pi + q i m(pi + qi ) by first conditioning on Wi + Vi . This immediately gives the first part of the claim. As for the second, −x 1 observing that 1 − 1−ex ≥ 31 min(1, x) for x ≥ 0, and that pi + qi ≥ m for all i ∈ U , by definition we get ! X (pi − qi )2 X (pi − qi )2 mǫ2 1 − e−m(pi +qi ) 1 E[Wheavy ] = m ≥ . 1− ≥ m pi + q i m(pi + qi ) 3 pi + q i 6000 ′ ′ i∈U i∈U ∩U 26 We can now bound the variance of our estimator: 2 P 3 i) Claim 4.23. Var[Wheavy ] ≤ 2n + 5m i∈U ′ (ppii−q +qi ≤ 7n + 5 E[Wheavy ]. In particular, if P = Q then Var[Wheavy ] ≤ 2n. Proof. The proof of the first inequality is similar to that in [CDVV14, Lemma 5], with a difference in the final bound due to the fact that the pi ’s and qi ’s no longer sum to one. For completeness, we give the proof below. h i P 2 i ) −(Wi +Vi ) First, note that by independence of the Vi ’s and Wi ’s, we have Var[Wheavy ] = i∈U ′ Var (Wi −VW , i +Vi so it is sufficient to bound each summand individually. In order to do so, we split the variance calculation into two parts: the variance conditioned on Wi + Vi = j, and the component of the variance due to the variation in j. Writing for convenience def f (Wi , Vi ) = (Wi − Vi )2 − Wi − Vi , W i + Vi we have that Var[f (X, Y )] ≤ max (Var[f (X, Y ) | X + Y = j]) + Var[E[f (X, Y ) | X + Y = j]] . j We now bound the first term. Since (Wi − Vi )2 = (j − 2Vi )2 , and Vi is distributed as Bin(j, α) (where def i ), we can compute the variance of (j − 2Vi )2 from standard expressions for for conciseness we let α = piq+q i  the moments of the Binomial distribution as Var[(j −2Vi )2 ] = 16j(j −1)α(1−α) (j − 23 )(1 − 2α)2 + 21 . Since α(1 − α) ≤ 14 and j − 23 < j − 1 < j, this in turn is at most j 2 (2 + 4j(1 − 2α)2 ). Because the denominator is Wi + Vi which equals j, we must divide this by j 2 , make it 0 when j = 0, and take its expectation as j is distributed as Poi(m(pi + qi )). This leads to Var[f (Wi , Vi ) | Wi + Vi = j] ≤ 2(1 − e−m(pi +qi ) ) + 4m (pi − qi )2 . pi + q i We now consider the second component of the variance–the contribution to the variance due to the variation in the sum Wi + Vi . Since for fixed j, as noted above, we have Vi distributed as Bin(j, α), we have E[(Wi − Vi )2 ] = E[j 2 − 4jVi + 4Vi2 ] = j 2 − 4j 2 α + 4(jα − jα2 + j 2 α2 ) = j 2 (1 − 2α)2 + 4jα(1 − α) . We finally subtract Wi + Vi = j and divide by j to yield (j − 1)(1 − 2α)2 , except with a value of 0 when j = 0 by definition. However, note that replacing the value at j = 0 with 0 can only lower the variance. Since the sum j = Wi + Vi is drawn from a Poisson distribution with parameter m(pi + qi ), we thus have: Var [E[f (Wi , Vi )|Wi + Vi = j]] ≤ m(pi + qi )(1 − 2α)4 ≤ m(pi + qi )(1 − 2α)2 = m (pi − qi )2 . pi + q i Summing the final expressions of the previous two paragraphs yields a bound on the variance of f (Wi Vi ) of 2(1 − e−m(pi +qi ) ) + 5m (pi − qi )2 (pi − qi )2 ≤ 2 + 5m , pi + q i pi + q i as 1 − e−x ≤ 1 for all x. This shows that X (pi − qi )2 X (pi − qi )2 X (pi − qi )2 = 2n + 5m + 5m Var[Wheavy ] ≤ 2n + 5m pi + q i pi + q i pi + q i ′ ′ ′ i∈U ∩U i∈U X (pi − qi )2 3 ≤ 2n + E[Wheavy ] + 5m , 5 pi + q i ′ i∈U ∩V 27 i∈U ∩V so it only remains to bound the last term. But by definition, i ∈ V implies 0 ≤ pi , qi < 5m 1 m, from which X |pi − qi | X (pi − qi )2 ≤5 ≤ 5|U ′ ∩ V | ≤ 5n . p + q p + q i i i i ′ ′ i∈U ∩V i∈U ∩V This completes the proof. With these two claims in hand, we are ready to conclude the proof of Lemma 4.21. We start with the 2 P ǫ2 i) soundness case, i.e. assuming i∈U ∩U ′ (ppii−q +qi > 2000 . Then, by Chebyshev’s inequality and Claim 4.22 we have that     4 Var[Wheavy ] 1 mǫ2 ≤ Pr E[Wheavy ] − Wheavy > E[Wheavy ] ≤ Pr Wheavy < 12000 2 E[Wheavy ]2 12 28n (by Claim 4.23) ≤ 2 + 5E[W E[Wheavy ] heavy ]   n 1 9 · 20002 · 28n 36 · 2000 + =O + . (8) ≤ m2 ǫ4 5ǫ2 m m2 ǫ4 ǫ2 m √ We want to bound this quantity by 1/10, for which it suffices to have m > C ǫ2n for an appropriate choice of the absolute constant C > 0 in our setting of m. Turning to the completeness, assume that kP − Qk1 = 0. Then, by Chebyshev’s inequality, and invoking Claim 4.23 we have:      n  mǫ2 36 · 20002 Var[W ] mǫ2 = O , = Pr W ≥ E[W ] + ≤ Pr W ≥ 12000 12000 ǫ4 m2 ǫ4 m2 which is no more than 1/10 for the same choice of m. Case 2: discrepancy in V ′ . and show the following: We now assume that Algorithm 2 reached the line where Wlight is computed, Lemma 4.24. If P = Q, then with probability at least 9/10 we have Wlight ≤ ǫ2 ǫ2 kpV ′ − qV ′ k22 > 300n , then Wlight ≥ 600n with probability at least 9/10. ǫ2 600n . Conversely, if , which by Claim 4.20, a union bound, and Markov’s inequalProof. We condition on kp′V k22 , kqV′ k22 ≤ 20n m2 ity happens with probability at least 19/20. The analysis is similar to [CDVV14, Section 3], observing that the (Vi′ )i∈V ′ , (Wi′ )i∈V ′ ’s are mutually independent Poisson random variables, Vi′ (resp. Wi′ ) having mean mpi (resp. mqi ). Namely, following their analysis, the statistic Wlight is an unbiased estimator for m2 kpV ′ − qV ′ k22 with variance √ Var[Wlight ] ≤ 8m3 bkpV ′ − qV ′ k22 + 8m2 b , def def where b = 20n is our upper bound on kp′V k22 , kqV′ k22 . From there, setting ǫ′ = √ǫn and applying Chebym2 shev’s inequality, we get that there exists an absolute constant C ′ > 0 such the completeness and soundness √ b ′ guarantees from the lemma holds with probability at least 19/20, provided that m > C ǫ′ 2 , i.e., √ 3/2 20n √ ′n ′n = . m>C 2 · 20C ǫ m2 mǫ2 3/4 Solving for m shows that choosing m ≥ C n ǫ for some absolute constant C > 0 is enough. A union bound then allows us to conclude the proof of the lemma, guaranteeing correctness with probability at least 1 9 1 − 20 = 10 . 1 − 20 28 4.4 Sample Complexity Lower Bound for Closeness Testing In this section, we prove a matching information-theoretic lower bound for testing closeness of two unknown arbitrary product distributions. Theorem 4.25. There exists an absolute constant ǫ0 > 0 such that, for any 0 < ǫ ≤ ǫ0 , the following holds: Any algorithm that has sample access to two unknown product distribution P, Q over {0, 1}n and √ distinguishes between the cases that P = Q and kP − Qk1 > ǫ requires Ω(max( n/ǫ2 , n3/4 /ǫ)) samples. √ Proof. The first part of the lower bound, Ω( n/ǫ2 ), follows from Theorem 4.8; we focus here on the second √ term, Ω(n3/4 /ǫ), and consequently assume hereafter that n/ǫ2 < n3/4 /ǫ. Let k ≥ 1 be fixed, and suppose we have a tester that takes k = o(n3/4 /ǫ) samples: we will show that it can only be correct with vanishing probability. We will again follow the information-theoretic framework of [DK16] for proving distribution testing lower bounds, first defining two distributions over pairs of product distributions Y, N : • Y: for every i ∈ [n], independently choose (pi , qi ) to be either pi = qi = k1 with probability 1/2, and def Nn def Nn pi = qi = n1 otherwise; and set P = j=1 Bern(pi ), Q = j=1 Bern(qi ). 1 k def • N : for every i ∈ [n], independently choose (pi , qi ) to be either pi = qi = 1−ǫ 1/2, and ( 1+ǫ n , n ) or def Nn Q = j=1 Bern(qi ). 1+ǫ ( 1−ǫ n , n ) with probability Nn uniformly at random otherwise; and set P = j=1 Bern(pi ), Note that in both Y and N , with overwhelming probability the pairs (P, Q) have roughly n/2 marginals with (equal) parameter 1/k, and roughly n/2 marginals with parameter Θ (1)/n. Lemma 4.26. With probability 1−2−Ω(n) , a uniformly chosen pair (P, Q) ∼ N satisfies kP − Qk1 = Ω(ǫ). Proof. Similar to that of Lemma 4.14. We will as before make a further simplification, namely that instead of drawing k samples from P = P1 ⊗ · · · ⊗ Pn and Q = Q1 ⊗ · · · ⊗ Qn , the algorithm is given ki samples from each Pi (resp. ki′ from Qi ), where k1 , . . . , kn , k1′ , . . . , kn′ are independent Poi(k) random variables. We now consider the following process: letting X ∼ Bern(1/2) be a uniformly random bit, we choose a pair of distributions (P, Q) (both P and Q being probability distributions over {0, 1}n ) by • Drawing (P, Q) ∼ Y if X = 0, and; • Drawing (P, Q) ∼ N if X = 1; • Drawing k1 , k1′ , . . . , kn , kn′ ∼ Poi(k), and returning ki samples from each Pi and ki′ samples from each Qi For i ∈ [n], we let Ni and Mi denote respectively the number of 1’s among the ki samples drawn from Pi and ki′ samples drawn from Qi , and write N = (N1 , . . . , Nn ) ∈ Nn (and M ∈ Nn for Q). The next step is then to upperbound I (X; (N, M )), in order to conclude that it will be o(1) unless k is taken big enough and invoke Fact 4.10. By the foregoing discussion and the relaxation on the ki ’s, we have that the conditioned on X the Ni ’s (and Mi ’s) are independent (with Ni ∼ Poi(kpi ) and Mi ∼ Poi(kqi )). This implies that n X I (X; (Ni , Mi )) (9) I (X; (N, M )) ≤ i=1 so that it suffices to bound each I (X; (Ni , Mi )) separately. 29 Lemma 4.27. Fix any i ∈ [n], and let X, Ni , Mi be as above. Then I (X; (Ni , Mi )) = O(k4 ǫ4 /n4 ). Proof. By symmetry it is enough to consider only the case of i = 1, so that we let (A, B) = (N1 , M1 ). Since A ∼ Poi(kp1 ) and B ∼ Poi(kq1 ) with (p1 , q1 ) = (1/k, 1/k) or (p1 , q1 ) = (1/n, 1/n) uniformly if X = 0, and  1 1  w.p. 12 ( k , k ) 1−ǫ (p1 , q1 ) = ( 1+ǫ w.p. 14 n , n )   1−ǫ 1+ǫ ( n , n ) w.p. 14 if X = 1, a computation similar as that of [DK16, Proposition 3.8] yields that, for any i, j ∈ N  i+j  i+j !  i+j ! 1 1 −2k/k k −2 −2k/n k −2k/n k e e +e +e = Pr[ (A, B) = (i, j) | X = 0 ] = 2i!j! k n 2i!j! n  i+j !  i+j  1 (1 + ǫ)i (1 − ǫ)j + (1 − ǫ)i (1 + ǫ)j −2k/k k −2k/n k Pr[ (A, B) = (i, j) | X = 1 ] = e +e 2i!j! k n 2  i+j  ! i (1 − ǫ)j + (1 − ǫ)i (1 + ǫ)j 1 k (1 + ǫ) = e−2 + e−2k/n . 2i!j! n 2 Note in particular that for 0 ≤ i+j ≤ 1, this implies that Pr[ (A, B) = (i, j) | X = 0 ] = Pr[ (A, B) = (i, j) | X = 1 ]. From the above, we obtain I (X; (A, B)) = O(1) · X (Pr[ (A, B) = (i, j) | X = 0 ] − Pr[ (A, B) = (i, j) | X = 1 ])2 Pr[ (A, B) = (i, j) | X = 0 ] + Pr[ (A, B) = (i, j) | X = 1 ] i,j≥0 X (Pr[ (A, B) = (i, j) | X = 0 ] − Pr[ (A, B) = (i, j) | X = 1 ])2 = O(1) · Pr[ (A, B) = (i, j) | X = 0 ] + Pr[ (A, B) = (i, j) | X = 1 ] i+j≥2  k 2(i+j) X (1 − 12 ((1 + ǫ)i (1 − ǫ)j + (1 − ǫ)i (1 + ǫ)j ))2 4k = O(1) · e− n n 2i!j! 2e−2 + o(1) i+j≥2   = O (kǫ/n)4 where the second-to-last inequality holds for k = o(n). (Which is the case, as n3/4 /ǫ < n, and we assumed k = o(n3/4 /ǫ).) √ This lemma, along with Eq. (9), immediately implies the result:  4 !  4 4 n X kǫ k ǫ O I (X; (N, M )) ≤ =O n n3 n/ǫ2 < n3/4 /ǫ implies that (10) i=1 which is o(1) unless k = Ω(n3/4 /ǫ). 4.5 Ruling Out Tolerant Testing Without Balancedness In this section, we show that any tolerant identity testing algorithm for product distributions must have sample complexity near-linear in n if the explicitly given distribution is very biased. 30 Theorem 4.28. There exists an absolute constant ǫ0 < 1 such that the following holds. Any algorithm that, given a parameter ǫ ∈ (0, ǫ0 ] and sample access to product distributions P, Q over {0, 1}n , distinguishes between kP − Qk1 < ǫ/2 and kP − Qk1 > ǫ with probability at least 2/3 requires Ω (n/ log n) samples. Moreover, the lower bound still holds in the case where Q is known, and provided as an explicit parameter. Proof. The basic idea will be to reduce to the case of tolerant testing of two arbitrary distributions p and q over [n]. In order to do this, we define the following function from distributions of one type to distributions of the other: If p is a distribution over [n], define Fδ (p) to be the distribution over {0, 1}n obtained by taking Poi(δ) samples from p and returning the vector x where xi = 1 if and only if i was one of these samples drawn. Note that, because of the Poissonization, Fδ (p) is a product distribution. We have the following simple claim: Claim 4.29. For any δ ∈ (0, 1] and distributions p, q on [n], dTV (Fδ (p), Fδ (q)) = (δ + O(δ2 ))dTV (p, q). Proof. In one direction, we can take correlated samples from Fδ (p) and Fδ (q) by sampling a from Poi(δ) and then taking a samples from each of p and q, using these to generate our samples from Fδ (p), Fδ (q). For fixed a, the variation distance between Fδ (p) and Fδ (q) conditioned on that value of a is clearly at most adTV (p, q). Therefore, dTV (Fδ (p), Fδ (q)) ≤ E[a]dTV (p, q) = δdTV (p, q). In the other direction, note that Fδ (p) and Fδ (q) each have probability δ + O(δ2 ) of returning a vector of weight 1. This is because Poi(δ) = 1 with probability δe−δ = δ + O(δ2 ) and since Poi(δ) > 1 with probability O(δ2 ). Let G(p) and G(q) denote the distributions Fδ (p) and Fδ (q) conditioned on returning a vector of weight 1. By the above, we have that dTV (Fδ (p), Fδ (q)) ≥ (δ + O(δ2 ))dTV (G(p), G(q)). Letting pi (resp. qi ) be the probability that p (resp. q) assigns to i ∈ [n], we get that for any fixed i ∈ [n] the probability that Fδ (p) returns ei is −δpi (1 − e ) Y −δpj e δpi = (e j6=i − 1) n Y e−δpj . j=1 Therefore G(p) puts on ei probability proportional to (eδpi − 1) = (δ + O(δ2 ))pi . Similarly, the probability that G(q) puts on ei is proportional to (δ + O(δ2 ))qi (where in both cases, the constant of proportionality is (δ + O(δ2 ))−1 ). Therefore, dTV (G(p), G(q)) = δ−1 (1 + O(δ)) = δ−1 (1 + O(δ)) n X i=1 n X i=1 =δ −1 |(δ + O(δ2 ))pi − (δ + O(δ2 ))qi | (δ|pi − qi | + O(δ2 )(pi + qi )) (1 + O(δ))(δdTV (p, q) + O(δ2 )) = dTV (p, q) + O(δ) . Thus, dTV (Fδ (p), Fδ (q)) ≥ (δ + O(δ2 ))dTV (p, q). This completes the proof. The above claim guarantees the existence of some constant δ0 ∈ (0, 1] such that dTV (Fδ0 (p), Fδ0 (q)) ∈ [0.9δ0 dTV (p, q), 1.1dTV (p, q)]. However, it is known [VV11] that for any sufficiently small ǫ > 0 there exist distributions p and q over [n] such that one must take at least c logn n samples (where c > 0 is an absolute constant) to distinguish between dTV (p, q) ≤ ǫ/(2 · 0.9δ0 ) and dTV (p, q) ≥ ǫ/(1.1δ0 ). Given q samples from p and q we can with high probability simulate c′ q samples from P = Fδ0 (p) and Q = Fδ0 (q) (where c′ = c′ (δ0 ) > 0 is another absolute constant). Therefore, we cannot distinguish between the cases 31 dTV (P, Q) ≤ ǫ/2 and dTV (P, Q) ≥ ǫ in fewer than c′ · c logn n , as doing so would enable us to distinguish between p and q with less than c logn n samples – yielding a contradiction. Moreover, the above still holds when q is explicitly known, specifically even when q is taken to be the uniform distribution on [n]. 5 Testing Identity of Fixed Structure Bayes Nets In this section, we prove our matching upper and lower bounds for testing the identity of Bayesnets with √ known graph structure. In Section 5.1, we describe an identity algorithm that uses O 2d/2 n/ǫ2 samples, where d is the maximum in-degree and n the number of nodes (dimension). In Section 5.2, we show that this sample upper bound is tight, up to constant factors, even for uniformity testing. 5.1 Identity Testing Algorithm In this section, we establish the upper bound part of Theorem 2.3 for identity, namely testing identity to a fixed Bayes net given sample access to an unknown Bayes net with the same underlying structure. In order to state our results, we recall the definition of balancedness of a Bayes net: Definition 5.1. A Bayes net P over {0, 1}n with structure S is said to be (c, C)-balanced if, for all k, it is the case that (i) pk ∈ [c, 1 − c] and (ii) PrP [ Πk ] ≥ C. Roughly speaking, the above conditions ensure that the conditional probabilities of the Bayes net are bounded away from 0 and 1, and that each parental configuration occurs with some minimum probability. With this definition in hand, we are ready to state and prove the main theorem of this section: Theorem 5.2. There exists a computationally efficient algorithm with the following guarantees. Given as input (i) a DAG S with n nodes and maximum in-degree d and a known (c, C)-balanced Bayes net Q with √ √ structure S, where c = Ω̃ (1/ n) and C = Ω̃ dǫ2 / n ; (ii) a parameter ǫ > 0, and (iii) sample access  √ to an unknown Bayes net P with structure S, the algorithm takes O 2d/2 n/ǫ2 samples from P , and distinguishes with probability at least 2/3 between the cases P = Q and kP − Qk1 > ǫ. d/2 √ We choose m ≥ α 2 ǫ2 n , where α > 0 is an absolute constant to be determined in the course of the √ n ≥ β log n and C ≥ β d+log n , for analysis. Let S and Q be as in the statement of the theorem, for c ≥ β log m m n an appropriate absolute constant β > 0. Recall that S denotes the set {(i, a) : i ∈ [n], a ∈ {0, 1}|Parents(i)| }. By assumption, we have that |Parents(i)| ≤ d for all i ∈ [n]. For each (i, a) ∈ S, corresponding to the parental configuration √ def Πi,a = {XParents(i) = a}, we define the value Ni,a = m PrQ [ Πi,a ] / 2. Intuitively, Ni,a is equal to a small constant factor times the number of samples satisfying Πi,a one would expect to see among m independent samples, if the unknown distribution P were equal to Q. We will also use the notation     def def pi,a = Pr Xi = 1 XParents(i)=a , where X ∼ P , and qi,a = Pr Xi = 1 XParents(i)=a , where X ∼ Q. Given m independent samples X (1) , . . . , X (m) from a Bayes net P with structure S, we define the estimators Zi,a , Yi,a for every i ∈ [n], a ∈ {0, 1}|Parents(i)| as follows. For every (i, a) such that the number of samples X (j) satisfying the configuration Πi,a is between Ni,a and 2Ni,a (that is, neither too few nor too (j ) many), we look only at the first Ni,a such samples X (j1 ) , . . . , X Ni,a , and let Ni,a def Zi,a = X 1n Xi X 1n Xi j=1 (jℓ ) =1 o Ni,a def Yi,a = j=1 32 (jℓ ) =0 o . We note that Zi,a + Yi,a = Ni,a by construction. We then define the quantity def Wi,a = 2 (Z ((1 − qi,a)Zi,a − qi,a Yi,a )2 + (2qi,a − 1)Zi,a − qi,a i,a + Yi,a ) 1Ni,a >1 + (pi,a − qi,a )2 1Ni,a ≤1 . Ni,a (Ni,a − 1) On the other hand, for every (i, a) such that the number of samples X (j) satisfying the configuration Πi,a is less than Ni,a or more than 2Ni,a , we continue as a thought experiment and keep on getting samples until we see Ni,a samples with the right configuration, and act as above (although the actual algorithm will stop and output reject whenever this happens). From there, we finally consider the statistic W : def W = n X X i=1 a∈{0,1}|Parents(i)| PrQ [ Πi,a ] Wi,a qi,a (1 − qi,a ) (11) Observe that the algorithm will output reject as soon as at least one parental configuration Πi,a was not seen enough times, or seen too many times, among the m samples. The pseudocode of our algorithm is given in the following figure. Input Error tolerance ǫ ∈ (0, 1), dimension n, description S of a DAG with maximum in-degree d and d+log n n of a (c, C)-balanced Bayes net Q with structure S (where c ≥ β log m and C ≥ β m ), and sampling access to a distribution P over {0, 1}n with structure S. - Preprocess Q so that qi,a ≤ samples taken from P ) for all (i, a) ∈ [n] × {0, 1}d (and apply the same transformation to all √ n ǫ2 ⌉, and take m samples X (1) , . . . , X (m) from P . √ ← m PrQ [ Πi,a ]/ 2 for all (i, a) ∈ [n] × {0, 1}d . - Set m ← ⌈α - Let Ni,a 1 2 def - Define Zi,a , Yi,a , Wi,a as above, and W = Pn i=1 P W a∈{0,1}|Parents(i)| i,a . PrQ [ Πi,a ] qi,a (1−q i,a ) (At this point, if any configuration Πi,a was satisfied by less than Ni,a or more than 2Ni,a of the m samples, then the algorithm has rejected already.) If W ≥ ǫ2 32 return reject. Otherwise return accept. Figure 3: Testing identity against a known-structure balanced Bayes net. Preprocessing. We will henceforth assume that qi,a ≤ 12 for all (i, a) ∈ [n] × {0, 1}d . This can be done without loss of generality, as Q is explicitly known. For any i such that qi,a > 21 , we replace qi,a by 1 − qi,a and work with the corresponding distribution Q′ instead. By flipping the corresponding bit of all samples we receive from P , it only remains to test identity of the resulting distribution P ′ to Q′ , as all distances are preserved. First Observation. If P = Q, then we want to argue that with probability at least 9/10 none of the Wi,a ’s will be such that too few samples satisfied Πi,a (as this will immediately cause rejection). To see why this 33 is the case, observe that as long as m PrQ [ Πi,a ] ≥ β(d + log n) (for an appropriate choice of absolute constant β > 0), the number mi,a of samples satisfying Πi,a among the m we draw will, by a Chernoff 1 bound, such that mi,a ≥ m PrQ [ Πi,a ] ≥ Ni,a with probability at least 1− 2d1n · 10 . A union bound over the d at most 2 n possible parental configurations will yield the desired conclusion. But the fact that P = Q is n (c, C)-balanced indeed implies that PrQ [ Πi,a ] ≥ C ≥ β d+log m , the last inequality by our choice of C. Therefore, it will be sufficient to continue our analysis, assuming that none of the Wi,a ’s caused rejection because of an insufficient number of samples satisfying Πi,a . As we argued above, this came at the cost of only 1/10 of probability of success in the completeness case, and can only increase the probability of rejection, i.e., success, in the soundness case. Moreover, in the analysis of the expectation and variance of W , we assume that for every (i, a) ∈ S, we have PrP [ Πi,a ] ≤ 4 PrQ [ Πi,a ]. This is justified by the following two lemmas, which ensure respectively that if it is not the case, then we will have rejected with high probability (this time because too many samples satisfied Πi,a ); and that we still have not rejected (with high probability) if P = Q. Lemma 5.3. Let P be as in the statement of Theorem 5.2, and suppose there exists a parental configuration (i∗ , a∗ ) ∈ S such that PrP [ Πi∗ ,a∗ ] > 4 PrQ [ Πi∗ ,a∗ ]. Then, with probability at least 9/10, the number of samples mi∗ ,a∗ satisfying Πi∗ ,a∗ among the m samples taken will be more than 2Ni∗ ,a∗ . Proof. This follows easily from a Chernoff bound, as       1 1 Pr mi,a < 2m Pr [ Πi∗ ,a∗ ] < Pr mi,a < m Pr [ Πi∗ ,a∗ ] = Pr mi,a < E[mi,a ] , Q 2 P 2 and E[mi,a ] > β(d + log n). Lemma 5.4. Suppose P = Q. Then, with probability at least 9/10, for every parental configuration (i, a) ∈ S the number of samples mi,a satisfying Πi,a among the m samples taken will be at most 2Ni,a . Proof. This again follows from a Chernoff bound and a union bound over all 2d n configurations, as we have Pr[ mi,a > 2m PrQ [ Πi,a ] ] = Pr[ mi,a > 2E[mi,a ] ], and E[mi,a ] > β(d + log n). Expectation and Variance Analysis. We start with a simple closed form formula for the expectation of our statistic: P (pi,a −qi,a )2 Lemma 5.5. We have that E[W ] = i,a PrQ [ Πi,a ] qi,a (1−qi,a ) . (In particular, if P = Q then E[W ] = 0.) Proof. Fix any (i, a) ∈ S. Since Zi,a follows a Bin(Ni,a , pi,a ) distribution, we get   2 E[Wi,a ] = E (Zi,a − qi,a Ni,a )2 + (2qi,a − 1)Zi,a − qi,a Ni,a   1Ni,a >1 + E (pi,a − qi,a )2 1Ni,a ≤1 Ni,a (Ni,a − 1) = (pi,a − qi,a )2 1Ni,a >1 + (pi,a − qi,a )2 1Ni,a ≤1 = (pi,a − qi,a )2 , giving the result by linearity of expectation. The last part follows from the fact that pi,a = qi,a for all (i, a) if P = Q. As a simple corollary, we obtain: Claim 5.6. If kP − Qk1 ≥ ǫ, then E[W ] ≥ ǫ2 16 . 34 Proof. The claim follows from Pinsker’s inequality and Lemma 3.7, along with our assumption that PrP [ Πi,a ] ≤ 4 · PrQ [ Πi,a ] for every (i, a): kP − Qk21 ≤ 2 D(P kQ) ≤ 2 X (i,a) Pr [ Πi,a ] P X (pi,a − qi,a )2 (pi,a − qi,a )2 ≤8 Pr [ Πi,a ] . Q qi,a (1 − qi,a ) qi,a (1 − qi,a ) (i,a) We now turn to bounding from above the variance of our statistic. This will be done by controlling the covariances and variances of the summands individually, and specifically showing that the former are zero. We have the following: Claim 5.7. If (i, a) 6= (j, b), then Cov(Wi,a , Wi,b ) = 0; and the variance satisfies Var   p2i,a PrQ [ Πi,a ] 4 4 pi,a (1 − pi,a ) 2 (p − q ) + Wi,a ≤ Pr [ Πi,a ] 2 i,a i,a 2 (1 − q )2 1Ni,a >1 . qi,a (1 − qi,a ) m Q m2 qi,a qi,a(1 − qi,a )2 i,a (Moreover, if P = Q then Var h PrQ [ Πi,a ] qi,a (1−qi,a ) Wi,a i ≤ 4 .) m2 Proof. The key point is to observe that, because of the way we defined the Zi,a ’s and Yi,a ’s (only considering the Ni,a first samples satisfying the desired parental configuration), we have that Wi,a and Wj,b are independent whenever (i, a) 6= (j, b). This directly implies the first part of the claim, i.e., Cov(Wi,a , Wi,b ) = E[(Wi,a − E[Wi,a ]) (Wj,b − E[Wj,b ])] = 0 , when (i, a) 6= (j, b). i h Pr [ Π ] . Note that W We then consider Var qi,aQ(1−qi,a i,a i,a )  2    2 E Wi,a = E ((Zi,a − qi,a Ni,a )2 + (2qi,a − 1)Zi,a − qi,a Ni,a )2 1Ni,a >1 2 Ni,a (Ni,a − 1)2 + (pi,a − qi,a )4 1Ni,a ≤1 , so that, writing p, q, N, Z for pi,a , qi,a , Ni,a , Zi,a respectively (for readability):      PrQ [ Πi,a ] PrQ [ Πi,a ] 2   2  Var Wi,a = E Wi,a − E[Wi,a ]2 q(1 − q) q(1 − q)    PrQ [ Πi,a ] 2  2  E Wi,a − (p − q)4 = q(1 − q)   = E ((Z − qN )2 + (2q − 1)Z − q 2 N )2 − N 2 (N − 1)2 (p − q)4 PrQ [ Πi,a ]2 1N >1 N 2 (N − 1)2 q 2 (1 − q)2  1N >1 1  = 2 E ((Z − qN )2 + (2q − 1)Z − q 2 N )2 − N 2 (N − 1)2 (p − q)4 m (N − 1)2 q 2 (1 − q)2  1 2N p(1 − p) 2 2 = 2 1 (2N − 3)p + 2(N − 1)q − 4(N − 1)pq + p . N >1 m N − 1 q 2 (1 − q)2 i h PrQ [ Πi,a ] 4 Wi,a = m12 N2N If p = q, then this becomes Var q(1−q) −1 1Ni,a >1 ≤ m2 , providing the second part of the 35 claim. In the general case, we can bound the variance as follows:    PrQ [ Πi,a ] 1 2N p(1 − p) Var Wi,a = 2 1N >1 2(N − 1)(p2 + q 2 − 2pq) − p2 + p 2 2 q(1 − q) m N − 1 q (1 − q)  1 2N p(1 − p) 2 2(N − 1)(p − q) + p(1 − p) 1 = 2 N >1 m N − 1 q 2 (1 − q)2 4N p(1 − p) 1 2N p2 (1 − p)2 2 = 2 2 (p − q) 1 + 1N >1 N >1 m q (1 − q)2 m2 N − 1 q 2 (1 − q)2 4N p(1 − p) 4 p2 (1 − p)2 2 ≤ 2 2 (p − q) + 1N >1 m q (1 − q)2 m2 q 2 (1 − q)2 pi,a (1 − pi,a ) 4 p2i,a (1 − pi,a )2 4 2 Pr [ Πi,a ] 2 (p − q ) + = i,a i,a 2 (1 − q )2 1Ni,a >1 m Q m2 qi,a qi,a (1 − qi,a )2 i,a ≤ p2i,a 4 pi,a (1 − pi,a ) 4 2 (p − q ) + Pr [ Πi,a ] 2 i,a i,a 2 (1 − q )2 1Ni,a >1 . m Q m2 qi,a qi,a (1 − qi,a )2 i,a This completes the proof. Using this claim, we now state the upper bound it allows us to obtain: d d ] 2 n Lemma 5.8. We have that Var[W ] ≤ 24 2m2n + 26 E[W cm . (Moreover, if P = Q we have Var[W ] ≤ 4 m2 .) Proof. This will follow from Claim 5.7, which guarantees that if P = Q, Var[W ] ≤ 2d n · Moreover, in the general case, Var[W ] ≤ 4 m2 p2i,a pi,a (1 − pi,a ) 4 X 4 X 2 Pr [ Πi,a ] 2 (p − q ) + i,a i,a 2 (1 − q )2 1Ni,a >1 . Q m m2 qi,a (1 − qi,a )2 qi,a i,a (i,a) (i,a) We deal with the two terms separately, as follows: • For the second term, we will show that p2i,a 2d n 24E[W ] 4 X 1 ≤ 24 . + N >1 i,a 2 (1 − q )2 m2 m2 cm qi,a i,a (i,a) 36 d = 4 2mn2 . This follows from the following sequence of (in-)equalities: X (i,a) p2i,a 2 (1 − q )2 1Ni,a >1 = qi,a i,a 2 X (pi,a − qi,a )2 X 2pi,a qi,a − qi,a 1 + 2 (1 − q )2 Ni,a >1 2 (1 − q )2 1Ni,a >1 qi,a qi,a i,a i,a (i,a) (i,a) 2 X 2qi,a (pi,a − qi,a ) + qi,a X (pi,a − qi,a )2 1 + 1Ni,a >1 = N >1 i,a 2 (1 − q )2 2 (1 − q )2 qi,a qi,a i,a i,a (i,a) (i,a) ≤ 4 · 2d n + X (pi,a − qi,a X 2(pi,a − qi,a ) 1N >1 1Ni,a >1 1Ni,a >1 + 2 2 qi,a (1 − qi,a )2 i,a qi,a (1 − qi,a ) )2 (i,a) (i,a) X (pi,a − qi,a )2 X pi,a − qi,a ≤ 4 · 2d n + 1N >1 1 + 4 N >1 i,a 2 (1 − q )2 qi,a (1 − qi,a ) i,a qi,a i,a (i,a) (i,a) X X (pi,a − qi,a )2 (pi,a − qi,a )2 1 + 2 1 + ≤ 4 · 2d n + N >1 i,a 2 (1 − q )2 2 (1 − q )2 qi,a qi,a (AM-GM) i,a i,a (i,a) (i,a) ≤ 6 · 2d n + 3 ≤ 6 · 2d n + ≤ 6 · 2d n + = 6 · 2d n + using our assumption that qi,a ≤ 1 2 (i,a) 6 X (pi,a − qi,a )2 1N >1 c qi,a (1 − qi,a ) i,a (i,a) 6m X Ni,a (pi,a − qi,a )2 1N >1 c m qi,a (1 − qi,a ) i,a (i,a) (pi,a − qi,a )2 6m 6m X Pr [ Πi,a ] 1Ni,a >1 ≤ 6 · 2d n + E[W ] , Q c qi,a (1 − qi,a) c (i,a) for all (i, a). pi,a (1 − pi,a ) 4 X 2 Pr [ Πi,a ] 2 E[W ] . (pi,a − qi,a )2 ≤ 2 Q m cm qi,a(1 − qi,a ) (i,a) This is shown as follows: (i,a) Pr [ Πi,a ] Q 1Ni,a >1 X (pi,a − qi,a )2 2 (1 − q )2 1Ni,a >1 qi,a i,a • For the first term, we will show that X ! pi,a (1 − pi,a )(pi,a − qi,a )2 (pi,a − qi,a )2 1X 1 ≤ · Pr [ Π ] i,a 2 (1 − q )2 4 qi,a(1 − qi,a ) Q qi,a (1 − qi,a ) qi,a i,a (i,a) ≤ (pi,a − qi,a )2 1 X Pr [ Πi,a ] Q 2c qi,a (1 − qi,a ) (i,a) 1 = E[W ] . 2c d ] Combining the above, we conclude that Var[W ] ≤ 24 2mn2 + 26 E[W cm . We now have all the tools we require to establish the completeness and soundness of the tester. Lemma 5.9 (Completeness). If P = Q, then the algorithm outputs accept with probability at least 2/3. 37 Proof. We first note that, as per the foregoing discussion and Lemma 5.4, with probability at least 8/10 we have between Ni,a and 2Ni,a samples for every parental configuration (i, a) ∈ S, and therefore have not outputted reject. By Chebyshev’s inequality and Lemma 5.8,   ǫ2 4 2d n Pr W ≥ ≤ 4096 2 4 ≤ 32 m ǫ 30 for a suitable choice of α > 0. Therefore, by a union bound the algorithm will output reject with probability 2 4 + 10 = 13 . at most 30 Lemma 5.10 (Soundness). If kP − Qk1 ≥ ǫ, then the algorithm outputs reject with probability at least 2/3. Proof. As noted before, it is sufficient to show that, conditioned on having between Ni,a and 2Ni,a samples for every parental configuration and PrP [ Πi∗ ,a∗ ] ≤ 4 PrQ [ Πi∗ ,a∗ ] for all (i, a), the algorithm rejects with probability at least 2/3 + 1/10 = 23/30. Indeed, whenever too few or too many samples from a given parental configuration are seen the algorithm rejects automatically, and by Lemma 5.3 this happens with probability at least 9/10 if some parental configuration is such that PrP [ Πi∗ ,a∗ ] > 4 PrQ [ Πi∗ ,a∗ ]. Conditioning on this case, by Chebyshev’s inequality,     4 Var[W ] 1 2d n 1 ǫ2 ≤ Pr |W − E[W ]| ≥ E[W ] ≤ ≤ 96 Pr W ≤ 2 2 + 104 cmE[W ] , 2 32 2 E[W ] m E[W ] h i  d  ǫ2 ǫ2 1 from Lemma 5.8. Since E[W ] ≥ 16 by Claim 5.6, we then get Pr W ≤ 32 = O m2 2nǫ4 + cmǫ ≤ 17 2 30 , √ n ). again for a suitable choice of α > 0 and β > 0 (recalling that c ≥ β log n Remark 5.11. We note that we can reduce the problem of testing degree-d Bayes nets over alphabet Σ, to testing degree (d + 1)⌈log 2 (|Σ|)⌉ − 1 and alphabet of size 2. First consider the case where |Σ| = 2b . Then it suffices to have nb bits in n clusters of size b. Each cluster of b will represent a single variable in the initial model with each of the 2b possibilities denoting a single letter. Then each bit will need to potentially be dependent on each other bit in its cluster and on each bit in each cluster that its cluster is dependent on. Therefore, we need degree (d + 1)b − 1. Note that this operation preserves balancedness. Now if |Σ| is not a power of 2, we need to pad the alphabet. The obvious way to do this is to create a set of unused letters until the alphabet size is a power of 2. Unfortunately, this creates an unbalanced model. To create a balanced one, we proceed as follows: we split a number of the letters in Σ in two. So, instead of having alphabet a, b, c, . . ., we have a1 , a2 , b1 , b2 , c, . . .. We make it so that when a word would have an a in a certain position, we map this to a new word that has either a1 or a2 in that position, each with equal probability. We note that this operation preserves L1 distance, and maintains the balancedness properties. 5.2 Sample Complexity Lower Bound Here we prove a matching information-theoretic lower bound: Theorem 5.12. There exists an absolute constant ǫ0 > 0 such that, for any 0 < ǫ ≤ ǫ0 , the following holds: Any algorithm that has sample access to an unknown Bayes net P over {0, 1}n with known structure S of maximum in-degree at most d < n/2, and distinguishes between the cases that P = U and kP − U k1 > ǫ requires Ω(2d/2 n1/2 /ǫ2 ) samples. Proof. Our lower bound will be derived from families of Bayes nets with the following structure: The first d nodes are all independent (and will in fact have marginal probability 1/2 each), and will form in some sense a “pointer” to one of 2d arbitrary product distributions. The remaining n−d nodes will each depend on all of the first d. The resulting distribution is now an (evenly weighted) disjoint mixture of 2d product distributions 38 on the (n − d)-dimensional hypercube. In other words, there are 2d product distributions p1 , . . . , p2d , and our distribution returns a random i (encoded in binary) followed by a random sample form pi . Note that the pi can be arbitrary product distributions. The unknown distribution P to test is obtained as follows: let X be a Bernoulli random variable with parameter 1/2. If X = 0, P is the uniform distribution on {0, 1}n , i.e., each of the 2d distributions pi is uniform on {0, 1}n−d . Otherwise, if X = 1, then every pi is a product distribution on {0, 1}n−d with, for each coordinate, a parameter chosen uniformly and independently to be either 12 + √ǫn or 12 − √ǫn . We will show that the shared information between a sample of size o(2d/2 n1/2 /ǫ2 ) and X is small. In view of this, let σi (for 1 ≤ i ≤ n−d) be the set of indices of the samples that were drawn from pi . Note that since X is uncorrelated with the σi ’s, and as the σi are a function of the samples, I (X; S) = I (X; S | σi ). This is because I (X; S)) = H(X) − H(X | S) = H(X | σi ) − H(X | S, σi ) = I (X; S | σi ). Now, for fixed σi , the samples we draw from pi are mutually independent of X. Let Si denote the tuple P of these |σi | samples. Thus, we have that I (X; S | σi ) ≤ i I (X; Si | σi ). By the same analysis as in the  4 proof of Theorem 4.8, this latter term is O( |σ2i | ǫn ). Therefore, " #    2 4 X |σi | ǫ4 m ǫ I (X; S | σi ) ≤ E O , =O 2 n n2d i  where we used the fact that |σi | is Bin m, 1/2d distributed. Note that the above RHS is o(1) unless m = Ω(2d/2 n1/2 /ǫ2 ), which completes the proof. 6 Testing Identity of Unknown Structure Bayes Nets In this section, we give our algorithms and lower bounds for testing the identity of low-degree Bayes nets with unknown structure. In Section 6.1, we start by showing that – even for the case of trees – uniformity testing of n-node Bayes nets requires Ω(n/ǫ2 ) samples. In Sections 6.2, we design efficient identity testers with sample complexity sublinear in the dimension n, under some non-degeneracy assumptions on the explicit Bayes net. 6.1 Sample Complexity Lower Bound In this section, we establish a tight lower bound on identity testing of Bayes nets in the unknown structure case. Our lower bound holds even for balanced Bayes nets with a tree structure. In order to state our theorem, we first give a specialized definition of balancedness for the case of trees. We say that a Bayes net with tree structure is c-balanced if it satisfies pk ∈ [c, 1 − c] for all k (note that this immediately implies it is (c, C)-balanced). Theorem 6.1. There exists absolute constants c > 0 and ǫ0 > 0 such that, for any ǫ ∈ (0, ǫ0 ) and given samples from an unknown c-balanced Bayes net P over {0, 1}n with unknown tree structure, distinguishing between the cases P = U and kP − U k1 > ǫ (where U is the uniform distribution over {0, 1}n ) with probability 2/3 requires Ω(n/ǫ2 ) samples. (Moreover, one can take c = 1/3.) Hence, without any assumptions about the explicit distribution, identity testing is information-theoretically as hard as learning. This section is devoted to the proof of Theorem 6.1. Fix any integer m ≥ 1. We will define a family of no-instances consisting of distributions {Pλ }λ over {0, 1}n such that: 1. every Pλ is ǫ-far from the uniform distribution U on {0, 1}n : kPλ − U k1 = Ω (ǫ); 2. every Pλ is a Bayes net with a tree structure; 39  3. unless m = Ω ǫn2 , no algorithm taking m samples can distinguish with probability 2/3 between a uniformly chosen distribution from {Pλ }λ and u; or, equivalently, no algorithm taking one sample can distinguish with probability 2/3 between Pλ⊗m and U ⊗m , when Pλ is chosen uniformly at random from {Pλ }λ . def The family is defined as follows. We let δ = √ǫ , n and let a matching-orientation parameter λ consist n 2 λ(1) of (i) a matching of [n] (partition of [n] in disjoint pairs (i, j) with i < j) and (ii) a vector λ(2) of n2 bits. The distribution Pλ is then defined as the distribution over {0, 1}n with uniform marginals, and (1) tree structure with edges corresponding to the pairs λ(1) ; and such that for every λk (2) λk cov(Xi , Xj ) = (−1) δ. = (i, j) ∈ λ(1) , Notations. For λ = (λ(1) , λ(2) ) as above and x ∈ {0, 1}n , we define the agreement count of x for λ, c(λ, x), as the number of pairs (i, j) in λ(1) such that (xi , xj ) “agrees” with the correlation suggested by λ(2) . Specifically: n o (2) def (1) c(λ, x) = | (i, j) ∈ [n]2 : ∃ℓ ∈ [n/2], λℓ = (i, j) and (−1)xi +xj = (−1)λℓ |. Moreover, for λ, µ two matching-orientation parameters, we define the sets A = Aλ,µ , B = Bλ,µ , C = Cλ,µ as o n def (2) (1) (2) (common pairs with same orientations) , λ = µ = µ A = (s, t) ∈ [n/2]2 : λ(1) s s t t o n def (2) (1) (common pairs with different orientations) λ(2) B = (s, t) ∈ [n/2]2 : λ(1) s 6= µt s = µt , def C = (λ(1) ∪ µ(1) ) \ (A ∪ B) (pairs unique to λ or µ) so that 2(|A| + |B|) + |C| = n. Proof of Item 1. Fix any matching-orientation parameter λ. We have X X n kPλ − U k1 = |Pλ (x) − U (x)| = |U (x)(1 + 2δ)c(λ,x) (1 − 2δ) 2 −c(λ,x) − U (x)| x∈{0,1}n 1 = n 2 X x∈{0,1}n x∈{0,1}n n |(1 + 2δ)c(λ,x) (1 − 2δ) n −c(λ,x) 2 2 1 X − 1| = n 2 X k=0 x : c(λ,x)=k n 2 n 2 n |(1 + 2δ)k (1 − 2δ) 2 −k − 1| n   X  n   1 + 2δ k  1 − 2δ  2 −k n 1 1 X n n2 −k k 2 22 − n| |(1 + 2δ) (1 − 2δ) 2 − 1| = | = n 2 2 2 k k 22 k=0 k=0      n 1 n 1 , , +δ = Ω (ǫ) , , Bin = 2dTV Bin 2 2 2 2 where the last equality follows from Lemma 4.9. Proof of Item 3. Let the distribution Q over ({0, 1}n )m be the uniform mixture def Q = Eλ [Pλ⊗m ] , 40 where Pλ is the distribution on {0, 1}n corresponding to the matching-orientation parameter λ. In particular, for any x ∈ {0, 1}n we have n Pλ (x) = U (x)(1 + 2δ)c(λ,x) (1 − 2δ) 2 −c(λ,x) with U being the uniform distribution on {0, 1}n and c(λ, x), the agreement count of x for λ, defined as before. Now, this leads to dPλ (x) = 1 + G(λ, x) , du c(λ,x)  n def 1+2δ − 1. For two matching-orientation parameters λ, µ, we can define where G(λ, x) = (1 − 2δ) 2 1−2δ def the covariance τ (λ, µ) = Ex∼U [G(λ, x)G(µ, x)]. By the minimax approach (as in [Pol03, Chapter 3]), it is sufficient to bound the L1 -distance between Q and U ⊗m by a small constant. Moreover, we have kQ − U ⊗m k1 ≤ Eλ,µ [(1 + τ (λ, µ))m ] − 1 (12) and to show the lower bound it is sufficient to prove that the RHS is less than Setting z def 1+2δ = 1−2δ , 1 10 unless m = Ω we can derive, by expanding the definition n ǫ2  . n τ (λ, µ) = 1 + (1 − δ)n Ex∼U [z c(λ,x)+c(µ,x) ] − 2(1 − 2δ) 2 Ex∼U [z c(λ,x) ].  Since, when x is uniformly drawn in {0, 1}n , c(λ, x) follows a Bin n2 , 21 distribution, we can compute the last term as n  n n n 1 1+z 2 c(λ,x) 2 2 = 2(1 − 2δ) 2 ] = 2(1 − 2δ) 2(1 − 2δ) Ex∼U [z n = 2 , 2 (1 − 2δ) 2 where we used the expression of the probability-generating function of a Binomial. This leads to 1 + τ (λ, µ) = (1 − 2δ)n Ex∼U [z c(λ,x)+c(µ,x) ] = (1 − 2δ)n z |B| Eα∼Bin(|A|, 1 ) [z 2α ] 2 Y Eα∼Bλ,µ (σ) [z α ] , σ cycle : |σ|≥4 where “cycle” and the probability distribution Bλ,µ (σ) are defined as follows. Recall that λ and µ define a weighted multigraph over n vertices, where each vertex has degree exactly 2, the edges are from the pairs (2) (2) (1) (1) λi ’s and µi ’s, and the weights are in {0, 1} according to the λi ’s and µi ’s. That multigraph Gλ,µ is better seen as the disjoint union of cycles (and indeed, A ∪ B corresponds to the cycles of length 2, while C corresponds to cycles of length at least 4). For such a cycle σ in Gλ,µ , we let Bλ,µ (σ) be the distribution below. If the number of negative covari(2) (2) ances – the number of edges with label λℓ = 1 or µℓ = 1 – along σ is even (resp. odd), then Bλ,µ (σ) is  1 a Bin |σ|, 2 conditioned on being even (resp. odd). Instead of the above, we first consider the related quantity with the conditioning removed (indeed, as we 41 will see in Claim 6.2, this new quantity is within an 1 + O(ǫ2 ) factor of the actual one): Y Eα∼Bin(|σ|, 1 ) [z α ] 1 + τ̃ (λ, µ) = (1 − 2δ)n z |B| Eα∼Bin(|A|, 1 ) [z 2α ] 2 2 n |B| = (1 − 2δ) z 2α σ cycle : |σ|≥4 Eα∼Bin(|A|, 1 ) [z ]Eα∼Bin(P 1 σ : |σ|≥4 |σ|, 2 2 α ) [z ] = (1 − 2δ)n z |B| Eα∼Bin(|A|, 1 ) [z 2α ]Eα∼Bin(|C|, 1 ) [z α ] 2 2     |A| |C| 1+z 1 + z2 = (1 − 2δ)n z |B| 2 2     2 |A|  1 + z |C| 2 |B| 21 +z = (1 − 2δ) z (1 − 2δ) (1 − 2δ) 2 2 {z } | = 1 − 4δ  2 |B| 1 + 4δ Thus, we need to compute  2 |A| (2|A| + 2|B| + |C| = n) =1 . h m|A| m|B| i 1 + 4δ2 1 − 4δ2 h i m m def def = Eλ,µ a|A| b|B| (where a = 1 + 4δ2 , b = 1 − 4δ2 )     h h ii a |A| |A| |B| |A|+|B| = Eλ,µ E a b |A| + |B| = Eλ,µ b E |A| + |B| b " #  a |A|+|B|  |A|+|B| 1 + b = Eλ,µ b (|A| ∼ Bin |A| + |B|, 21 ) 2  # " m !|A|+|B|  m  1 + 4δ2 + 1 − 4δ2 a + b |A|+|B| . = Eλ,µ  = Eλ,µ 2 2 Eλ,µ [(1 + τ̃ (λ, µ))m ] = Eλ,µ s In particular, consider the following upper bound on f (k), the probability that |A| + |B| ≥ k: setting def n = 2, for 0 ≤ k ≤ s,    2(s−k) s 2 s!2s 2k s−k s (2s − 2k)! 2k k! k f (k) = Pr[ |A| + |B| ≥ k ] ≤ · = 2s  = k! 2s k (s − k)!2s−k (2s)! (2k)! 2k s Qk−1 Qk−1 2 k 2 1 1 j=0 (s − j) j=0 (s − j) = = Qk−1 ≤ . Q2k−1 k! j=0 (2s − j) k! j=0 (2s − 2j − 1) k! Therefore, for any z > 1, we have  Z ∞  i i Z ∞ h h ln t |A|+|B| |A|+|B| Pr |A| + |B| ≥ Pr z ≥ t dt = = Eλ,µ z dt ln z 0 0    Z ∞  Z ∞  ln t ln t Pr |A| + |B| ≥ =1+ Pr |A| + |B| ≥ dt ≤ 1 + dt ln z ln z 1 1 Z ∞ Z ∞ dt dt  ln t  ≤ 1 +  ≤1+ (from our upper bound on f (k)) ln t Γ ln 1 1 ln z ! z Z ∞ u e du . =1+ Γ lnuz 1 42 Assuming now that 1 < z ≤ 1 + γ for some γ ∈ (0, 1), from ln z < γ and monotonicity of the Gamma function we obtain Z ∞ u Z ∞ γv Z ∞ v i h e du e dv e dv |A|+|B|   =1+γ =1+ Eλ,µ z ≤1+γ ≤ 1 + 42γ. Γ(v) 1 1/γ Γ(v) 0 Γ uγ Suppose now m ≤ c ǫn2 = def z = 1 + 4δ2 for c < 3 1000 . m + 1 − 4δ2 2 4c δ2 , m for some constant c > 0 to be determined later. Then, by monotonicity ≤ 1 + 4δ2  4c2 δ + 1 − 4δ2 2  4c2 δ ≤ e16c + e−16c 1 def = 1+γ <1+ 2 42 · 20 Therefore, i h 1 Eλ,µ [(1 + τ̃ (λ, µ))m ] − 1 = Eλ,µ z |A|+|B| − 1 < , 20 as desired. To conclude, we bound Eλ,µ [(1 + τ (λ, µ))m ] combining the above with the following claim: def 1+2δ 1−2δ Claim 6.2. Let z = as above. Then for any two matching-orientation parameters λ, µ, we have Y σ : |σ|≥4 Eα∼Bλ,µ (σ) [z α ] ≤ e 8ǫ4 n · Eα∼Bin(P 1 σ : |σ|≥4 |σ|, 2 α ) [z ] . Proof. Fix λ, µ as in the statement, and any cycle σ in the resulting graph. Suppose first this is an “even” cycle:  |σ|/2  1 X |σ| 2k (1 + z)|σ| + (1 − z)|σ| Eα∼Bλ,µ (σ) [z ] = Eα∼Bin(|σ|, 1 ) [z | α even] = . z = 2 1/2 2k 2|σ| α α k=0 Similarly, if σ is an “odd” cycle, Eα∼Bλ,µ (σ) [z α ] =   |σ| , from which | Eα∼Bin(|σ|, 1 ) [z α ] 1 + | 1−z 1+z (1+z)|σ| −(1−z)|σ| . 2|σ| We then obtain Eα∼Bλ,µ (σ) [z α ] ≤ 2 Y σ α Eα∼Bλ,µ (σ) [z ] ≤ Y σ  1 − z |σ| Eα∼Bin(|σ|, 1 ) [z ] 1 + | | 2 1+z α   Y 1 − z |σ| 1+| | = Eα∼Bin( |σ|, 1 ) [z ]· . σ 2 1+z σ α P 1−z We now bound the last factor: since | 1+z | = 2δ = √2ǫn we have at most n2 cycles, we get   Y  Y  n ǫ4 1 − z |σ| | = 1 + (2δ)|σ| ≤ 1 + 16δ4 2 ≤ e8 n , 1+| 1+z σ : |σ|≥4 σ : |σ|≥4 as claimed. With this result in hand, we can get the conclusion we want: for any λ, µ, Y Eα∼Bλ,µ (σ) [z α ] 1 + τ (λ, µ) = (1 − 2δ)n z |B| Eα∼Bin(|A|, 1 ) [z 2α ] 2 ≤e =e 8ǫ4 n σ cycle : |σ|≥4 (1 − 2δ)n z |B| Eα∼Bin(|A|, 1 ) [z 2α ]Eα∼Bin(P 2 8ǫ4 n (1 + τ̃ (λ, µ)) , 43 1 σ : |σ|≥4 |σ|, 2 α ) [z ] (by Claim 6.2) from which m Eλ,µ [(1 + τ (λ, µ)) ] ≤ e 8ǫ4 m n ≤ e8cǫ 2 m Eλ,µ [(1 + τ̃ (λ, µ)) ] ≤ e 1 21 <1+ , 20 10 concluding the proof: by Eq. (12), kQ − U ⊗m k1 ≤ 1 10 8ǫ4 m n  1 1+ 20  (as c < (for m ≤ 3 1000 cn ) ǫ2 and ǫ ≤ 1) , for any m < c ǫn2 . 6.2 Identity Testing Algorithm against Non-Degenerate Bayes Nets We start with the case of trees and then generalize to bounded degree. 6.2.1 The Case of Trees In this section, we prove our result on testing identity of a tree structured Bayes net with unknown topology. Recall from Section 6.1 that a Bayes net with tree structure is said to be cbalanced if it satisfies pk ∈ [c, 1 − c] for all k. We will require the following definition of non-degeneracy of a tree, which will be a simpler case of the definition we shall have for general Bayes nets (Definition 6.10): Definition 6.3. For any γ ∈ (0, 1], we say a tree Bayes net P over {0, 1}n is γ-non-degenerate if for all i ∈ [n],     |Pr Xi = 1 XParents(i) = 1 − Pr Xi = 1 XParents(i) = 0 | ≥ γ where X ∼ P . Roughly speaking, this definition states that the choice of the value of its parent has a significant influence on the probability of any node. With these definitions, we are ready to state and prove our result: Theorem 6.4. There exists an efficient algorithm with the following guarantees. Given as input (i) a tree S over n nodes and an explicit c-balanced, γ-non-degenerate Bayes net Q with structure S, where c, γ = Ω (1/na ) for some absolute constant a > 0; (ii) parameter ǫ > 0, and (iii) sample access to a Bayes net √ P with unknown tree structure, the algorithm takes O n/ǫ2 samples from P , and distinguishes with probability at least 2/3 between P = Q and kP − Qk1 > ǫ. The algorithm follows a natural idea: (1) check that the unknown distribution P indeed has, as it should, the same tree structure as the (known) distribution Q; (2) if so, invoke the algorithm of the previous section, which works under the assumption that P and Q have the same structure. Therefore, to establish the theorem it is sufficient to show that (1) can be performed efficiently. Specifically, we will prove the following: Theorem 6.5. There exists an algorithm with the following guarantees. For γ ∈ (0, 1), c ∈ (0, 1/2), it takes as input an explicit c-balanced, γ-nondegenerate tree Bayes net Q over {0, 1}n with structure S(Q), and ! log2 1c log n O c6 γ 4 samples from an arbitrary tree Bayes net P over {0, 1}n with unknown structure S(P ). • If P = Q, the algorithm returns accept with probability at least 4/5; • If S(P ) 6= S(Q), the algorithm returns reject with probability at least 4/5.  √  log2 1 Note that the above theorem implies the desired result as long as c6 γ 4c = O ǫ2 logn n . Proof of Theorem 6.5. We start by stating and proving lemmas that will be crucial in stating and analyzing the algorithm: 44 n Fact 6.6. Given τ > 0 and sample access to a tree Bayes net P over {0, 1}n , one can obtain with O( log τ2 ) samples estimates (µ̂i )i∈[n] , (ρ̂i,j )i,j∈[n] such that, with probability at least 9/10,  max max|µ̂i − E[Xi ] |, max|ρ̂i,j i∈[n] i,∈[n]  − E[Xi Xj ]| ≤ τ. Proof. The fact follows immediately by an application of Chernoff bounds. Lemma 6.7. Let c ∈ (0, 1/2]. There exists a constant λ and a function f such that I (Xi ; Xj ) = f (E[Xi ] , E[Xj ] , E[Xi Xj ]) , for any c-balanced tree Bayes net P over {0, 1}n and X ∼ P , where f is λ-Lipschitz with respect to the k·k∞ norm on the domain Ωc ⊆ [0, 1] × [0, 1] × [0, 1] → [0, 1] in which (E[Xi ] , E[Xj ] , E[Xi Xj ])i,j then take values. Moreover, one can take λ = 16 log 1c . Proof Sketch: Expanding the definition of mutual influence I (X; Y ) of two random variables, it is not hard to write it as a function of E[X] , E[Y ], and E[XY ] only. This function would not be Lipschitz on its entire domain, however. The core of the proof leverages the balancedness assumption to restrict its domain to a convenient subset Ωc ⊆ [0, 1] × [0, 1] × [0, 1], on which it becomes possible to bound the partial derivatives of f . We defer the details of the proof to Appendix C. We now show the following crucial lemma establishing the following result: For any balanced Bayes net, the shared information between any pair of non-adjacent vertices i, j is noticeably smaller than the minimum shared information between any pair of neighbors along the path that connects i, j. Lemma 6.8. Let c ∈ (0, 1/2], and fix any c-balanced tree Bayes net P over {0, 1}n with structure S(Q). Then, for any distinct i, j ∈ [n] such that i 6= Parents(j) and j 6= Parents(i), we have  I (Xi ; Xj ) ≤ (1 − 2c2 ) min I Xk ; XParents(k) , {k,Parents(k)}∈path(i,j) where X ∼ P . (and path(i, j) is a path between i to j, of the form i − · · · − k − · · · − j, where each edge is of the form (k, Parents(k) or (Parents(k), k)). Proof. By induction and the data processing inequality, it is sufficient to prove the statement for a path of length 3, namely Xi − Xk − Xj . The result will follow from a version of the strong data processing inequality (see e.g., [PW15], from which we borrow the notations ηKL , ηTV ): since Xi → Xk → Xj forms a chain with the Markov property, we get I (Xi ; Xj ) ≤ ηKL (PXj |Xk )I (Xi ; Xk ) from [PW15, Equation 17]. Now, by [PW15, Theorem 1], we have ηKL (PXj |Xk ) ≤ ηTV (PXj |Xk ) = dTV (PXj |Xk =0 , PXj |Xk =1 ). If k = Parents(j) (in our Bayes net), then dTV (PXj |Xk =0 , PXj |Xk =1 ) = |pj,0 − pj,1 | ≤ 1 − 2c from the c-balancedness assumption. On the other hand, if j = Parents(k), then by Bayes’  rule it is easy to check that (again, from the c-balancedness assumption) Pr XParents(k) = 1 Xk = a ∈ [c2 , 1 − c2 ], and dTV (PXj |Xk =0 , PXj |Xk =1 ) = |Pr[ Xj = 1 | Xk = 0 ] − Pr[ Xj = 1 | Xk = 1 ]| ≤ 1 − 2c2 . Therefore, we get I (Xi ; Xj ) ≤ (1 − 2c2 )I (Xi ; Xk ) as wanted; by symmetry, I (Xi ; Xj ) ≤ (1 − 2c2 )I (Xj ; Xk ) holds as well. 45 Lemma 6.9. Let c ∈ (0, 1/2], γ ∈ (0, 1), and fix any c-balanced, γ-nondegenerate tree Bayes net P over {0, 1}n , with structure S(P ). Then, there exists an absolute constant κ such that for any i ∈ [n] one has  I Xi ; XParents(i) ≥ κ , where X ∼ P . (Moreover, one can take κ = cγ 2 2 ln 2 .) def Proof. Fix any such i, and write X = Xi , Y = XParents(i) for convenience; and set u = Pr[ X = 1 ], def def def v = Pr[ Y = 1 ], a = Pr[ X = 1 | Y = 1 ], and b = Pr[ X = 1 | Y = 0 ]. We then have I (X; Y ) = X Pr[ X = x, Y = y ] log (x,y)∈{0,1}2 = X (x,y)∈{0,1}2 Pr[ X = x, Y = y ] Pr[ X = x ] Pr[ Y = y ] Pr[ X = x | Y = y ] Pr[ Y = y ] log Pr[ X = x | Y = y ] Pr[ X = x ] 1−b b 1−a a + (1 − u)b log + u(1 − a) log + ua log 1−v v 1−v v = uϕ(a, v) + (1 − u)ϕ(b, v) , = (1 − u)(1 − b) log def where ϕ(x, y) = x log xy +(1−x) log 1−x 1−y ≥ 0 for x, y ∈ [0, 1] is the KL-divergence between two Bernoulli distributions with parameters x, y. From our assumptions of c-balanced and γ-nondegeneracy, we know that u, v, a, b satisfy c ≤ a, b, u, v ≤ 1 − c γ ≤ |a − b| , which leads to, noticing that |a − b| ≥ γ implies that at least one of |a − v| ≥ γ2 , |b − v| ≥ γ2 holds and that ϕ(·, v) is convex with a minimum at v:   γ   γ  1 ≥ cγ 2 , I (X; Y ) ≥ c (ϕ(a, v) + ϕ(b, v)) ≥ c min ϕ v − , v , ϕ v + , v 2 2 2 ln 2 using the standard lower bound of ϕ(x, y) ≥ 2 ln 2 (x − y)2 on the KL-divergence. The Algorithm. With these in hand, we are ready to describe and analyze the algorithm underlying Theorem 6.5: Let γ ∈ (0, 1), c ∈ (0, 1/2) be fixed constants, and Q be a known c-balanced, γ-nondegenerate tree Bayes net over {0, 1}n , with structure S(Q). Furthermore, let P be an unknown tree Bayes net over {0, 1}n with unknown structure S(P ), to which we have sample access. 2 def c 2, Let κ = κ(c, γ) = 2cγln 2 as in Lemma 6.9, c′ = of applying Lemma 6.8 later to P , set def τ = and λ = λ(c′ ) = 16 log 2 c as in Lemma 6.7. In view 1 c3 γ 2 κ − (1 − 2c′ 2 )κ = . 4λ 64 ln 2 log 2c The algorithm then proceeds as follows. (Below, X denotes a random variable distributed according to P .) 1. Take m = O  log n τ2  samples from P , and use them to 46 • Estimate all n2 marginals Pr[ Xi = 1 | Xj = a ], and verify that they are all in [c′ , 1 − c′ ] (ensuring that P is c′ -balanced), with probability at least 9/10. Else, return reject;  • Estimate all n2 + n values of E[Xi ] and E[Xi Xj ] to an additive τ , with probability at least 9/10, as in Fact 6.6. (Call these estimates µ̂i , ρ̂i,j .) At the end of this step, we are guaranteed that P is c′ -balanced (or else we have rejected with probability at least 9/10). 2. Check that all µ̂i , ρ̂i,j ’s are all within an additive τ of what they should be under Q. If so, return accept, else return reject.  21  log Clearly, the algorithm only uses O c6 γ 4c log n samples from P . We now establish its correctness: first, with probability at least 4/5 by a union bound, all estimates performed in the first step are correct; we condition on that. Completeness. If P = Q, then P is c-balanced, and thus a fortiori c′ -balanced: the algorithm does not reject in the first step. Moreover, clearly all (µ̂i )i , (ρ̂i,j )i,j are then within an additive τ of the corresponding values of P = Q, so the algorithm returns accept. Soundness. By contrapositive. If the algorithm returns accept, then P is c′ -balanced by the first step. Given our setting of τ , by Lemma 6.7 our estimates (µ̂i )i , (ρ̂i,j )i,j are such that all corresponding quantities def Iˆi,j = f (µ̂i , µ̂j , ρ̂i,j ) ′2 )κ of the mutual informations I (Xi ; Xj ) for P . But then, by Lemma 6.8 are within τ λ = κ−(1−2c 4  this implies that the relative order of all Iˆi,j , Iˆi′ ,j ′ is the same as that of I (Xi ; Xj ) , I Xi′ ; Xj ′ . This itself implies that running the Chow–Liu algorithm on input these Iˆi,j ’s would yield the same, uniquely determined tree structure S(P ) as if running it on the actual I (Xi ; Xj )’s. To see this, we note that the Chow-Liu algorithm works by computing a maximum-weight spanning tree (MST) with respect to the weights given by the pairwise mutual information. The claim follows from the fact that the MST only depends on the relative ordering of the edge-weights. But since the (µ̂i )i , (ρ̂i,j )i,j are also within an additive τ of the corresponding quantities for Q (per our check in the second step), the same argument shows that running the Chow–Liu algorithm would result in the same, uniquely determined tree structure S(Q) as if running it on the actual mutual informations from Q. Therefore, S(P ) = S(Q), concluding the proof. 6.2.2 The Case of Bounded Degree In this section, we show how to test identity of unknown structure Bayesian networks with maximum in-degree d under some non-degeneracy conditions. Intuitively, we want these conditions to ensure identifiability of the structure: that is, that any (unknown) Bayes net close to a non-degenerate Bayes net Q must also share the same structure. To capture this notion, observe that, by definition, non-equivalent Bayes net structures satisfy different conditional independence constraints: our non-degeneracy condition is then to rule out some of these possible new conditional independence constraints, as far from being satisfied by the non-degenerate Bayes net. Formally, we have the following definition: Definition 6.10 (Non-degeneracy). For nodes Xi , Xj , set of nodes S, and a distribution P over {0, 1}n , we say that Xi and Xj are γ-far from independent conditioned on XS if for all distributions Q over {0, 1}n such that dTV (P, Q) < γ, it holds that Xi and Xj are not independent conditioned on XS . 47 A Bayes net P is then called γ-non-degenerate with respect to structure S and degree d if for any nodes Xi , Xj and set of nodes S of size |S| ≤ d not containing i or j satisfying one of the following: (i) Xi is a parent of Xj , (ii) S contains a node Xk that is a child of both Xj and Xj , (iii) Xi is a grandparent of Xj and there is a child of Xi and parent of Xj , Xk , that is not in S, (iv) Xi and Xj have a common parent Xk that is not in S we have that Xi and Xj are γ-far from independent conditioned on XS (where all relations are under structure S). Xj Xj Xi Xk Xi Xk Xk Xj Xi Xi Xj Figure 4: The four possible conditions of Definition 6.10, from left (i) to right (iv). The black nodes are the ones in S, the red ones (besides Xi , Xj ) are not in S. We shall also require some terminology: namely, the definition of the skeleton of a Bayesian network as the underlying undirected graph of its structure. We can now state the main result of this section: Theorem 6.11. There exists an algorithm with the following guarantees. Given the full description of a √ Bayes net Qof degree at most d which is (c, C) balanced and γ-non-degenerate for c = Ω̃ (1/ n) and C = √ Ω̃ dǫ2 / n , parameter ǫ ∈ (0, 1], and sample access to a distribution P , promised to be a Bayes net of de √ gree at most d whose skeleton has no more edges than Q’s, the algorithm takes O 2d/2 n/ǫ2 + (2d + d log n)/γ 2 samples from P , runs in time O (n)d+3 (1/γ 2 +1/ǫ2 ), and distinguishes with probability at least 2/3 between (i) P = Q and (ii) kP − Qk1 > ǫ. In Lemma 6.15, we show that these non-degeneracy conditions are enough to ensure identifiability of the structure, up to equivalence. In Proposition 6.17, we give a test for conditional independence specialized to Bernoulli random variables. In the last part, we provide a test for showing whether a non-degenerate Bayes net has a given structure using this conditional independence test, establishing Theorem 6.12. We then can combine this structure test with our test for Bayes nets with known structure to obtain Theorem 6.11. This structure tester, which may be of independent interest, has the following guarantees, Theorem 6.12. Let S be a structure of degree at most d and P be a Bayesian network with structure S ′ that also has degree at most d and whose skeleton has no more edges than S. Suppose that P either (i) can be expressed as a Bayesian network with structure S that is γ-non-degenerate with degree d; or (ii) cannot be expressed as a Bayesian network with structure S. Then there is an algorithm which can decide which case holds  with probability 99/100, given S, γ,and sample access to P . The algorithm takes O (2d + d log n)/γ 2 samples and runs in time O nd+3 /γ 2 . Using the above theorem, we can prove the main result of this section: 48 Proof of Theorem 6.11. We first invoke the structure test given in Fig. 6. If it accepts, we run the known structure test given in Theorem 5.2. We accept only if both accept. The correctness and sample complexity now both follow from Theorem 6.12 and Theorem 5.2. Specifically, if the structure test accepts, then with high probability, we have that Q can be expressed as a Bayes net with the same structure as P , and thus we have the pre-conditions for the known structure test. If either test rejects, then P 6= Q. Non-degeneracy and Equivalent Structures. The motivation behind the γ-non-degeneracy condition is the following: if Q is γ-non-degenerate, then for any Bayesian network P with degree at most d that has dTV (P, Q) < γ we will argue that P can be described using the same structure S as we are given for Q. Indeed, the structure S ′ of P will have the property that S and S ′ both can be used to describe the same Bayesian networks, a property known as I-equivalence. It will then remain to make this algorithmic, that is to describe how to decide whether P can be described with the same structure as Q or whether dTV (P, Q) ≥ γ. Assuming we have this decision procedure, then if the former case happens to hold we can invoke our existing known-structure tester (or reject if the latter case holds). We will require for our proofs the following definition: Definition 6.13 (∨-structure). For a structure S, a triple (i, j, k) is a ∨-structure (also known as an immorality) if i and j are parents of k but neither i nor j is a parent of the other. The following result, due to Verma and Pearl [VP91], will play a key role: Lemma 6.14. Two structures S and S ′ are I-equivalent if and only if they have the same skeleton and the same ∨-structures. Note that, for general structures S, S ′ , it may be possible to represent all Bayesian networks with structure S as ones with structure S ′ , but not vice versa. Indeed, this can easily be achieved by adding edges to S to any node (if any) with less than d parents. This is the rationale for the assumption in Theorem 6.12 that S ′ has no more edges than S: as this assumption is then required for S and S ′ to be I-equivalent unless dTV (P, Q) ≥ γ. We now prove that any Bayesian network Q satisfiying the conditions of Theorem 6.12 and being nondegenerate with respect to a structure can in fact be expressed as having that structure. Lemma 6.15. Fix γ > 0. If Q is a Bayesian network with structure S ′ of degree at most d that is γ-nondegenerate with respect to a structure S with degree at most d and S ′ has no more edges than S, then S and S ′ are I-equivalent. Note that Q being γ-non-degenerate for some γ > 0 is equivalent to a set of conditional independence conditions all being false, since if Xi and Xj are not conditionally independent with respect to XS , then there is a configuration a such that PrQ [XS = a] > 0 and I(Xi ; Xj | XS = a) ≥ 0. Proof. We first show that S and S ′ have the same skeleton and then that they have the same ∨-structures. We need the following: Claim 6.16. Let S be the set of parents of Xi in a Bayesian network Q with structure S. Let Xj be a node that is neither in S nor a descendant of Xi . Then Xi and Xj are independent conditioned on XS . Proof. Firstly, we note that there is a numbering of the nodes which is consistent with the DAG of S such that any j ∈ S has j < i. Explicitly, we can move Xi and all its descendants to the end of the list of nodes to obtain this numbering. 49 def Letting D = {1, . . . , i − 1}, we have that, from the definition of Bayesian networks, PrQ [Xi = 1 | XD = b] = PrQ [Xi = 1 | XS = bS ] for all configurations b of D. Then for any configuration a of def S ′ = S ∪ {j}, we have Pr[Xj = 1 | XS ′ = a] = P X b:bS =a Pr[Xj = 1 | XD = b] Pr[XD = b | XS ′ = a] P P = Pr[Xj = 1 | XS = aS ] P = Pr[Xj = 1 | XS = aS ] X b:bS =a Pr[XD = b | XS ′ = a] P P concluding the proof. Suppose for a contradiction that (i, j) is an edge in the skeleton of S but not in S ′ . Without loss of generality, we may assume that Xj is not a descendant of Xi in S ′ (since otherwise we can swap the roles of i and j in the argument). Then as Xi is not in S, the set of parents of Xj in S ′ , either, by Claim 6.16 Xi and Xj are independent conditioned on XS . However since one of Xi and Xj is a parent of the other in S, condition (i) of γ-non-degeneracy gives that Xi and Xj are γ-far from independent conditioned on XS . This is a contradiction, so all edges in the skeleton of S must be edges of S ′ . But by assumption S ′ has no more edges than S, and so they have the same skeleton. Next we show that i and j have the same ∨-structures. Assume by contradiction that (i, j, k) is a ∨structure in S but not S ′ . Since S and S ′ have the same skeleton, this cannot be because Xi is the parent of Xj or vice versa. Therefore, must be that at least one of Xi or Xj is the child of Xk rather than its parent in S ′ . As before, without loss of generality we may assume that Xj is not a descendant of Xi in S ′ . This implies that Xk cannot be a child of Xi , since then Xj must be a child of Xk and so a descendant of Xi . Thus S, the set of parents of Xi in S ′ , contains Xk but not Xj ; and Claim 6.16 then implies that Xi and Xj are independent conditioned on XS . However, in S Xk is the child of both Xi and Xj and so by condition (ii) of γ-non-degeneracy, we have that Xi and Xj are γ-far from independent conditioned on XS . This contradiction shows that all ∨-structures in S are ∨-structures in S ′ as well. Finally, we assume for the sake of contradiction that (i, j, k) is a ∨-structure in S ′ but not S. Again without loss of generality, we assume that Xj is not a descendant of Xi in S ′ ; and let S be the parents of Xi in S ′ . Note that neither Xk nor Xj is in S since this is a ∨-structure. Now by Claim 6.16, Xi and Xj are independent conditioned on XS . In S, however, (i, j, k) is not a ∨-structure yet (i, k), (j, k) (but not (i, j)) are in the skeleton of S. Thus at least one of Xi , Xj is a child of Xk . If only one is a child, then the other must be Xk ’s parent. In the case of two children, we apply condition (iv) and in the case of a parent and a child, we apply condition (iii) of γ-non-degeneracy. Either way, we obtain that, since Xk is not in S, Xi and Xj are γ-far from independent conditioned on XS . This contradiction shows that all ∨-structures in S ′ are also ∨-structures in S. We thus have all the conditions for Lemma 6.14 to apply and conclude that S and S ′ are I-equivalent. Conditional Independence Tester. We now turn to establishing the following proposition: Proposition 6.17. There exists an algorithm that, given parameters γ, τ > 0, set of coordinates S ⊆ [n] and coordinates i, j ∈ [n] \ S, as well as sample access to a distribution P over {0, 1}n , satisfies the following. With probability at least 1 − τ , the algorithm accepts when Xi and Xj are independent conditioned on XS and rejects when no distribution Q with dTV (P, Q) < γ has this property (and may do either if neither cases holds). Further, the algorithm takes O((2d + log(1/τ ))/γ 2 ) samples from P and runs in time O((2d + log(1/τ ))/γ 2 ). 50 Input γ, τ > 0, i, j ∈ {0, 1}n , S ⊆ {0, 1}n with i, j ∈ / S, and sample access to a distribution P on {0, 1}n . - Take O((2d + log(1/τ ))/γ 2 ) samples from P . Let P̃ be the resulting empirical distribution. For each configuration a ∈ {0, 1}|S| of S, - Compute the empirical conditional means µi,a = EX∼P̃ [Xi | XS = a] and µj,a = EX∼P̃ [Xj | XS = a]. - Compute the conditional covariance CovP̃ [Xi , Xj | XS = a] = EX∼P̃ [(Xi −µi,a )(Xj −µj,a) | XS = a]. Compute the expected absolute value of the conditional covariance β = EY ∼P̃ [|CovP̃ [Xi , Xj | XS = YS ]|]. If β ≤ γ/3, return accept Else return reject. Figure 5: Testing whether Xi and Xj are independent conditioned on S or are γ-far from being so. Proof. The algorithm is given in Fig. 5. Its sample complexity is immediate, and that the algorithm takes linear time in the number of samples is not hard to see. It remains to prove correctness. def To do so, define D = S ∪ {i, j}. Let PD , P̃D be the distributions of XS for X distributed as P, P̃ respectively. Since PD is a discrete distribution with support size 2d+2 , by standard results the empirical P̃D obtained from our O((2d+2 + log 1/τ )/γ 2 ) samples is such that dTV (PD , P̃ ) ≤ γ/10 with probability at least 1 − τ . We hereafter assume that this holds. Note that the distribution PD determines whether P is such that Xi and Xj are independent conditioned on S or is δ-far from being so for any δ. Thus if these two nodes are γ-far from being conditionally independent in P , then they are γ-far in PD and therefore are 9γ/10-far in P̃D . We now need to show that the expected absolute value of the conditional covariance is a good approximation of the distance from conditional independence, which is our next claim: Claim 6.18. For a distribution Q on {0, 1}n , let γ be the minimum γ > 0 such that Xi and Xj are γ-far from independent conditioned on XS in Q. Let β = EY ∼Q [|CovQ [Xi , Xj | XS = YS ]|]. Then we have β/3 ≤ γ ≤ 2β. Proof. For simplicity, we assume that |D| = n and that we have only coordinates i, j and S. Firstly, we show that β ≤ γ. By assumption, there is a distribution R with dTV (Q, R) = γ which has that Xi and Xj are independent conditioned on XS . Thus R has |CovR [Xi , Xj | XS = a]| = 0 for all configurations a. Since 0 ≤ |CovQ [Xi , Xj | XS = a]| ≤ 1, it follows that |β − EY ∼R [|CovQ [Xi , Xj | XS = YS ]|]| ≤ 3dTV (Q, R) as CovQ [Xi , Xj | XS = YS ] = E[Xi Xj | XS = YS ] − E[Xi | XS = YS ]E[Xj | XS = YS ] and so β ≤ 3γ. Next we need to show that β ≤ 2γ. To show this, we construct a distribution S on {0, 1}n with dTV (Q, S) = 2β in which Xi and Xj are independent conditioned on XS . Explicitly, for a configuration a 51 of S and b, c ∈ {0, 1}, we set def Pr[XS = a, Xi = b, Xj = c] = Pr[XS = a, Xi = b, Xj = c]+(−1)b+c CovQ [Xi , Xj | XS = a] Pr[XS = a] . S Q Q For each configuration a, this increases two probabilities by |CovQ [Xi , Xj | XS = a]| PrQ [XS = a] and decrease two probabilities by the same amount. Thus, providedP that all probabilities are still non-negative (which we show below), S is a distribution with dTV (Q, S) = a 2|Cov Q [Xi , Xj | XS = a]| PrQ [XS = a] = 2β. def Now consider the conditional joint distribution of Xi , Xj for a given a. Let pb,c = PrQ [Xi = b, Xj = c | XS = a]. Then the conditional covariance CovQ [Xi , Xj | XS = a], which we denote by α for simplicity here, is α = E[Xi Xj | XS = a] − E[Xi | XS = a]E[Xj | XS = a] = p1,1 − (p1,0 + p1,1 )(p0,1 + p1,1 ) = p1,1 (1 − p1,0 − p0,1 − p1,1 ) − p1,0 p0,1 = p1,1 p0,0 − p1,0 p0,1 . In S, these probabilities change by α. p1,1 and p0,0 are increased by α and p0,1 and p1,0 are decreased by it. Note that if α > 0, p1,1 and p0,0 are at least p1,1 p0,0 ≥ α and when α < 0, p0,1 and p1,0 are at least p1,0 p0,1 ≥ −α. Thus all probabilities in S are in [0, 1], as claimed. A similar expression for the conditional covaraince in S to that for α above yields CovS [Xi , Xj | XS = a] = (p1,1 − α)(p0,0 − α) − (p1,0 + α)(p0,1 + α) = 0α2 − (p0,0 + p1,1 + p0,1 + p1,0 )α + p1,1 p0,0 − p1,0 p0,1 = p1,1 p0,0 − p1,0 p0,1 − α = 0 . Since Xi and Xj are Bernoulli random variables, the conditional covariance being zero implies that they are conditionally independent. Completeness. Suppose by contrapositive that the algorithm rejects. Claim 6.18 implies that in P̃ , Xi and Xj are γ/9-far from independent conditioned on XS . Thus they are γ/9 far in P̃D and, since dTV (PD , P̃D ) ≤ γ/10, this implies that they are not conditionally independent in PD . Thus, in P , Xi and Xj are not independent conditioned on XS . Soundness. Now suppose that Xi and Xj are γ-far from independent conditioned on XS in P . Per the foregoing discussion, this implies that they are (9γ/10)-far from being so in P̃D . Now Claim 6.18 guarantees that EY ∼P̃ [|Cov P̃ [Xi , Xj |XS = YS ]|] ≤ 9γ/20 > γ/3, and therefore the algorithm rejects in this case. This completes the proof of correctness. Structure Tester. Finally, we turn to the proof of Theorem 6.12, analyzing the structure testing algorithm described in Fig. 6. Proof of Theorem 6.12. We first show correctness. There are at most nd+2 possible choices of Xi , Xj and |S| and thus we run the conditional independence tester at most nd+2 times. With O((2d + d log n)/γ 2 ) samples, each test gives an incorrect answer with probability no more than τ = n−Ω(d) . With appropriate choice of constants we therefore have that all conditional independence tests are correct with probability 99/100. We henceforth condition on this, i.e., that all such tests are correct. 52 Input γ > 0, a structure S and a Bayesian network P - Draw O((2d + d log n)/γ 2 ) samples from P . Call this set of samples S. For each nodes Xi , Xj and set S of nodes with |S| ≤ d and i, j 6= S If one of the following conditions holds in structure S (i) Xi is the parent of Xj , (ii) S contains a node Xk that is a child of both Xj and Xj , (iii) Xi is a grandparent of Xj and there is a child of Xi and parent of Xj , Xk that is not in S, (iv) Xi and Xj have a common parent Xk that is not in S Then run the conditional independence tester of Proposition 6.17 (Fig. 5) using the set of samples S to test whether Xi and Xj are independent conditioned on XS . If the conditional indpendence tester accepts, return reject. Otherwise return accept. Figure 6: Testing whether P has structure as S Completeness. If P is γ-non-degenerate with respect to structure S and degree d, then by the definition of non-degeneracy, for any Xi , Xj and S that satisfy one of conditions (i)–(iv) we have that Xi and Xj are γ-far from independent conditioned on XS . Thus every conditional independence test rejects and the algorithm accepts. Soundness. Now suppose by contrapositive that the algorithm accepts. For any Xi , Xj , and S that satisfy one of conditions (i)–(iv), the conditional independence test must have rejected, that is any such Xi and Xj are not independent conditioned on such an XS . Let γ ′ be the mimuimum over all Xi , Xj , and S that satisfy one of conditions (i)–(iv) and distributions Q over {0, 1} such that Xi and Xj are independent conditioned on XS in Q, of the total variation distance between P and Q. Since there are only finitely many such combinations of Xi , Xj , and S, this γ ′ is positive. Thus P is γ ′ -nondegenerate with respect to S and d. Since we assumed that P has a structure S ′ with degree at most d and whose skeleton has no more edges than that of S, we can apply Lemma 6.15, which yields that S and S ′ are I-equivalent. Thus P can indeed be expressed as a Bayesian network with structure S. This completes the proof of correctness. To conclude, observe that we run the loop at most nd+2 times, each using time at most O((2d + d log n)/γ 2 ). The total running time is thus O(nd+3 /γ 2 ). 7 Testing Closeness of Bayes Nets 7.1 Fixed Structure Bayes Nets We now establish the upper bound part of Theorem 2.3 for closeness, namely testing closeness between two unknown Bayes nets with the same (known) underlying structure. Theorem 7.1. There exists a computationally efficient algorithm with the following guarantees. Given as input (i) a DAG S with n nodes and maximum in-degree d, (ii) a parameter ǫ > 0, and (iii) sample √ access to two unknown (c, C)-balanced Bayes nets P, Q with structure S, where c = Ω̃ (1/ n) and C = 53  √ √  Ω̃ dǫ2 / n ; the algorithm takes O 2d/2 n/ǫ2 samples from P and Q, and distinguishes with probability at least 2/3 between the cases P = Q and kP − Qk1 > ǫ. d/2 √ Proof. We choose m ≥ α 2 ǫ2 n , where α > 0 is an absolute constant to be determined in the course of the √ n ≥ β log n and C ≥ β d+log n , analysis. Let S and P, Q be as in the statement of the theorem, for c ≥ β log m m n for some other absolute constant β > 0. The algorithm proceeds as follows: first, taking m samples from both P and Q, it computes for each parental configuration (i, a) ∈ [n] × {0, 1}d the number of times N̂i,a and M̂i,a this configuration was observed among the samples, for respectively P and Q. If for any (i, a) it is the case that N̂i,a and M̂i,a are not within a factor 4 of each other, the algorithm returns reject. (Using the same number of samples, it also estimates pi,a and qi,a within an additive 1/3, and applies the same standard transformation as before so that we can hereafterh assume i pi,a , qi,a ≤ 2/3 for allh(i, a).) i Note that E N̂i,a = m PrP [ Πi,a ] and E M̂i,a = m PrQ [ Πi,a ]; given the C-balancedness assump- tion and by Chernoff and union bounds, with probability at least 9/10 we have that N̂i,a and M̂i,a are within a factor 2 of their expectation simultaneously for all n2d parental configurations. We hereafter condition on this (and observe that this implies that if P = Q, then the algorithm rejects in the step above with probability at most 1/10).   The algorithm now draws independently n2d values (Mi,a )(i,a) , where Mi,a ∼ Poi N̂i,a ; and takes fresh samples from P, Q until it obtains Mi,a samples for each parental configuration Πi,a (for each of the two distributions). If at any point the algorithm takes more than 10m samples, it stops and returns reject. (Again, note that by concentration (this time of Poisson random variables)1 , our assumption that N̂i,a ≥ m PrP [ Πi,a ] /2 ≥ mC/2 = β(d + log n) and a union bound, the algorithm will reject at this stage with probability at most 1/10.) Conditioning on not having rejected, we define for each parental configuration Πi,a the quantity Ui,a (resp. Vi,a ) as the number of samples from P (resp. Q) among the first Πi,a for which    Mi,a satisfying  Xi = 1. In particular, this implies that Ui,a ∼ Poi pi,a N̂i,a , Vi,a ∼ Poi qi,a N̂i,a (and are independent), and that the random variables Wi,a defined below: def Wi,a = (Ui,a − Vi,a )2 − (Ui,a + Vi,a ) Ui,a + Vi,a are independent. We then consider the statistic W : def W = n X X Wi,a . i=1 a∈{0,1}d Claim 7.2. If P = Q, then E[W ] = 0. Moreover, if kP − Qk1 > ǫ then E[W ] > mǫ2 144 . Proof. We start by analyzing the expectation of Wi,a , for any fixed (i, a) ∈ [n]×{0, 1}d . The same argument as Claim 7.2 leads to conclude that E[Wi,a ] = 0 if P = Q (proving the first part of the claim), and that otherwise we have E[Wi,a ] ≥ 1 min(1, mc) (pi,a − qi,a )2 1 (pi,a − qi,a )2 2 (pi,a − qi,a )2 N̂i,a = N̂i,a ≥ N̂i,a 3 pi,a + qi,a 3 pi,a + qi,a 9 (pi,a + qi,a )(2 − pi,a − qi,a ) (13) Specifically, if X ∼ Poi(λ) then we have Pr[ |X − λ| > λ/2 ] = e−Ω(λ) . 54 (since mc ≥ β log n ≫ 1 and 0 < pi,a , qi,a ≤ 2/3). Summing over all (i, a)’s and recalling that N̂i,a ≥ m PrP [ Πi,a ] /2, N̂i,a ≥ m PrQ [ Πi,a ] /2 yields the bound: mX E[W ] ≥ 9 (i,a) r (pi,a − qi,a )2 m m ≥ dH (P, Q)2 ≥ Pr [ Πi,a ] Pr [ Πi,a ] P Q (pi,a + qi,a )(2 − pi,a − qi,a ) 18 18 1− r 1 1 − kP − Qk21 4 (where we relied on Lemma 3.8 for the second-to-last inequality). This gives the last part of the claim, as 2 2 2 the RHS is at least mǫ 144 whenever kP − Qk1 > ǫ . We now bound the variance of our estimator: P (p −qi,a )2 = O(n2d + E[W ]). In particular, if P = Q then Claim 7.3. Var[W ] ≤ n2d+1 + 5 (i,a) N̂i,a pi,a i,a +qi,a Var[W ] ≤ n2d+1 . Proof. We follow the proof of Claim 4.23 to analyze the variance of Wi,a , obtaining a bound of Var[Wi,a ] ≤ (p −q )2 i,a . Invoking Eq. (13) and summing over all (i, a) ∈ [n] × {0, 1}d then lead to the desired 2 + 5N̂i,a pi,a i,a +qi,a conclusion. The correctness of our algorithm will then follow for the two claims above: def ǫ2 288 . Lemma 7.4. Set τ = Then we have the following: • If kP − Qk1 = 0, then Pr[ W ≥ τ am ] ≤ • If kP − Qk1 > ǫ, then Pr[ W < τ m ] ≤ 1 10 . 1 10 . Proof. We start with the soundness case,i.e. assuming kP − Qk1 > ǫ, which by Claim 7.2 implies E[W ] > 2τ . Then, by Chebyshev’s inequality,   1 4 Var[W ] Pr[ W < τ m ] ≤ Pr E[W ] − W > E[W ] ≤ 2 E[W ]2 8n2d 12 2 + 5E[W ] E[W ]   n2d 1 =O 4 2 + . ǫ m mǫ2 ≤ (Claim 7.3) d 1 We want to bound this quantity by 1/10, for which it is enough to have ǫn2 4 m2 ≪ 1 and mǫ2 ≪ 1, which both hold for an appropriate choice of the absolute constant α > 0 in our setting of m. Turning to the completeness, we suppose kP − Qk1 = 0. Then, by Chebyshev’s inequality, and invoking Claim 7.3,   n2d Var[W ] Pr[ W ≥ τ m ] = Pr[ W ≥ E[W ] + τ m ] ≤ 2 2 = O 4 2 τ m ǫ m which is no more than 1/10 for the same choice of m. Combining all the elements above concludes the proof, as by a union bound the algorithm is correct 1 1 1 + 10 + 10 ) > 23 . with probability at least 1 − ( 10 55 ! 7.2 Unknown Structure Bayes Nets As for the case identity testing, we give a closeness tester for balanced non-degenerate Bayes Nets. An additional assumption that we require is that the ordering of the nodes in the corresponding DAGs is known to the algorithm. Formally, we show: Theorem 7.5. There exists a computationally efficient algorithm with the following guarantees. Given as input (i) a parameter ǫ > 0, (ii) an ordering of nodes π, and (ii) sample access to unknown γ-nondegenerate, (c, C)-balanced Bayes nets P, Q such the structures of P and Q give the same ordering π to √ √ √  nodes, where c = Ω̃ (1/ n) and C = Ω̃ dǫ2 / n ; the algorithm takes N = O(2d/2 n/ǫ2 + 2d /γ 2 + d log(n)/γ 2 ) samples from P and Q, runs in time nd poly(N ), and distinguishes with probability at least 2/3 between the cases P = Q and kP − Qk1 > ǫ. Proof. The argument’s idea is the following: we first test that P and Q have the same skeleton. Since they have the same ordering, that suffices to show that they have the same structure. If this is the case, then we use our known-structure tester. In more detail, given the γ-non-degeneracy assumption, for each pair of coordinates i, j and set of coordinates S with |S| ≤ d, we can, using the conditional independence tester from Proposition 6.17 to test whether each of P and Q has Xi and Xj conditionally independent on XS or γ-far from it with n−d−2 /100 probability of error in O((2d + d log(n))/γ 2 ) samples. Running tests on the same samples for all nd+2 combinations of i, j, S, we can with probability at least 99/100 correctly classify which of the two cases holds, for all i, j, S that are either conditionally independent or γ-far. We note that by non-degeneracy, there is an edge between i and j in the structure defining P only if Xi and Xj are γ-far from independent conditioned on XS for all S (i.e., if there is no edge then there must exist a S such that Xi and Xj are conditionally independent on XS ). Therefore, assuming our conditional independence testers all answered as they should, we can use this to successfully identify the set of edges in the structure of P (and thus, since we know the ordering, the entire structure). Having determined the underlying structures of P and Q, our tester rejects if these structures differ (as using Lemma 6.15, γ-non-degeneracy implies that neither can equal a Bayes net with non-equivalent structure and fewer edges). Otherwise, we run the tester from Theorem 7.1 (since we satisfy its assumptions) and return the result. 8 Identity and Closeness Testing for High-Degree Bayes Nets Finally, in this section we give testing algorithms for identity and closeness of degree-d Bayes nets with unknown structure, without balancedness assumptions. Compared to the testing algorithm of Theorem 2.6 and Theorem 7.5 (which work under such assumptions) the dependence on the number of nodes n the testers in this section are suboptimal, they achieve the “right” dependence on the degree d (specifically, 2d/2 for identity and 22d/3 for closeness). Hence, these testers achieve sub-learning sample complexity for the case that d = Ω(log n). Theorem 8.1. There exists two algorithms with the following guarantees: • (Identity) Given the full description of a Bayes net Q of degree at most d, parameter ǫ ∈ (0, 1], and sample access to a distribution P promised to be a Bayes net (i) of degree at most d and (ii) such that the structures of P and Q give the same ordering to nodes, the first takes N = 2d/2 poly(n/ǫ) samples from P , runs in time nd poly(N ), and distinguishes with probability at least 2/3 between (i) P = Q and (ii) kP − Qk1 > ǫ. • (Closeness) Given parameter ǫ ∈ (0, 1], and sample access to two distributions P, Q promised to be Bayes nets (i) of degree at most d and (ii) such that the structures of P and Q give the same ordering to nodes, the second takes N = 22d/3 poly(n/ǫ) samples from P and Q, runs in time nd poly(N ), and distinguishes with probability at least 2/3 between (i) P = Q and (ii) kP − Qk1 > ǫ. 56 Proof. We first establish the first part of the theorem, namely the existence of an identity testing algorithm with optimal dependence on the degree d. The algorithm is quite simple: it goes over each set S ⊆ [n] of at most d + 1 coordinates, and checks that for each of them it holds that the conditional distributions P, S, QS are equal (versus kPS − QS k1 > poly( nǫ )). Since PS and QS are supported on sets of size O(2d ), and as there are only O(nd+1 ) such sets to consider, the claimed sample complexity suffices to run all tests correctly with probability 9/10 overall (by a union bound). The more difficult part is to argue correctness, that is to show that if the test accepts then one must have kP − Qk1 < ǫ. To do so, assume (without loss of generality) that H(P ) ≤ H(Q): we will show that D(P kQ) is small, which implies that the L1 distance is as well.. P Let the ordering of P be coordinates 1, 2, 3, . . . . We note that D(P kQ) = i D(Pi kQi | P1 , . . . , Pi−1 ) (i.e. the expectation over P1 , . . . , Pi−1 of the KL-divergence of the conditional distributions of Pi and Qi , conditioned on these (i − 1) coordinates). It thus suffices to show that each of these terms is small. Let Si be the set of parents of node i under P . We have that: D(Pi kQi | P1 , . . . , Pi−1 ) = D(Pi kQi | PSi ) + EP1 ,...,Pi−1 [D(Qi | PSi kQi | P1 , . . . , Pi−1 )] . Further, note that the fact that the tester accepted implies that D(Pi kQi | PSi ) is small. Now, we have that X X H(P ) = H(Pi | P1 , . . . , Pi−1 ) = H(Pi | PSi ) , i H(Q) = X i i H(Qi | Q1 , . . . , Qi−1 ) = X i H(Qi | QSi ) − I (Qi ; Q1 , . . . , Qi−1 | QSi ) . But since the (d+1)-wise probabilities are close, we have that H(Pi | PSi ) is close to H(Qi | QSi ) (up to an additive poly(ǫ/n)). Therefore, for each i, we have that I (Qi ; Q1 , . . . , Qi−1 | QSi ) = poly(ǫ/n). In order to conclude, let us compare I (Qi ; Q1 , . . . , Qi−1 | QSi ) and EP1 ,...,Pi−1 [D(Qi | PSi kQi | P1 , . . . , Pi−1 )]. The former is the sum, over assignments y ∈ {0, 1}i−1 consistent with an assignment x ∈ {0, 1}Si , of Pr[ QSi = x ] H(Qi | QSi = x) + Pr[ Q1,...,i−1 = y ] H(Qi | Q1,...,i−1 = y). The latter is the sum over the same y’s of Pr[ PSi = x ] H(Qi | QSi = x) + Pr[ P1,...,i−1 = y ] H(Qi | Q1,...,i−1 = y) . But because of the d-way probability similarities, the terms Pr[ PSi = x ] and Pr[ QSi = x ] terms are very close, within an additive poly(ǫ/n). (Here we use the extra assumption that P and Q use the same ordering.) Denote by Ti the parents of i under the topology of Q. Then H(Qi | Q1,...,i−1 = y) depends only on the values of the coordinates in Ti . Thus the last part of the sum is a sum over z of Pr[ QTi = z ] H(Qi | QTi = z) and Pr[ PTi = z ] H(Qi | QTi = z), which are also close by a similar argument. Thus, EP1,...,Pi−1 [D(Qi | PSi kQi | P1 , . . . , Pi−1 )] = I (Qi ; Q1 , . . . , Qi−1 | QSi ) + poly(ǫ/n) = poly(ǫ/n) . This implies that P, Q are close in KL divergence, and therefore in L1 . The second part of the theorem, asserting the existence of a closeness testing algorithm with optimal dependence on d, will be very similar. Indeed, by the proof above it suffices to check that the restrictions of P and Q to any set of (d + 3)-coordinates are poly(ǫ/n)-close. Using known results [CDVV14], this can be done for any specific collection of d + 3 coordinates with N samples in poly(N ) time, and high probability of success, implying the second part of the theorem. 57 References [ACS10] M. Adamaszek, A. Czumaj, and C. Sohler. Testing monotone continuous distributions on highdimensional real cubes. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, pages 56–65, 2010. [ADJ+ 11] J. Acharya, H. Das, A. Jafarpour, A. Orlitsky, and S. Pan. Competitive closeness testing. Journal of Machine Learning Research - Proceedings Track, 19:47–68, 2011. [ADK15] J. Acharya, C. Daskalakis, and G. Kamath. Optimal testing for properties of distributions. CoRR, abs/1507.05952, 2015. [ADLS15] J. Acharya, I. Diakonikolas, J. Li, and L. Schmidt. Sample-optimal density estimation in nearlylinear time. CoRR, abs/1506.00671, 2015. [AHHK12] A. Anandkumar, D. J. Hsu, F. Huang, and S. Kakade. Learning mixtures of tree graphical models. In NIPS, pages 1061–1069, 2012. [AK01] S. Arora and R. Kannan. Learning mixtures of arbitrary Gaussians. In Proceedings of the 33rd Symposium on Theory of Computing, pages 247–257, 2001. [AKN06] P. Abbeel, D. Koller, and A. Y. Ng. Learning factor graphs in polynomial time and sample complexity. J. Mach. Learn. Res., 7:1743–1788, 2006. [Alm10] A. Almudevar. A hypothesis test for equality of bayesian network models. EURASIP J. Bioinformatics and Systems Biology, 2010, 2010. [Bat01] T. Batu. Testing Properties of Distributions. PhD thesis, Cornell University, 2001. [BDKR02] T. Batu, S. Dasgupta, R. Kumar, and R. Rubinfeld. The complexity of approximating entropy. In ACM Symposium on Theory of Computing, pages 678–687, 2002. [BFF+ 01] T. Batu, E. Fischer, L. Fortnow, R. Kumar, R. Rubinfeld, and P. White. Testing random variables for independence and identity. In Proc. 42nd IEEE Symposium on Foundations of Computer Science, pages 442–451, 2001. [BFR+ 00] T. Batu, L. Fortnow, R. Rubinfeld, W. D. Smith, and P. White. Testing that distributions are close. In IEEE Symposium on Foundations of Computer Science, pages 259–269, 2000. [BFRV11] A. Bhattacharyya, E. Fischer, R. Rubinfeld, and P. Valiant. Testing monotonicity of distributions over general partial orders. In ICS, pages 239–252, 2011. [Bic69] P. J. Bickel. A distribution free version of the smirnov two sample test in the p-variate case. Ann. Math. Statist., 40(1):1–23, 02 1969. [BKR04] T. Batu, R. Kumar, and R. Rubinfeld. Sublinear algorithms for testing monotone and unimodal distributions. In ACM Symposium on Theory of Computing, pages 381–390, 2004. [BS96] Z. Bai and H. Saranadasa. Effect of high dimension: by an example of a two sample problem. Statist. Sinica,, 6:311–329, 1996. [BS10] M. Belkin and K. Sinha. Polynomial learning of distribution families. In FOCS, pages 103– 112, 2010. 58 [Can15] C. L. Canonne. A survey on distribution testing: Your data is big. but is it blue? Electronic Colloquium on Computational Complexity (ECCC), 22:63, 2015. [CDGR16] C. Canonne, I. Diakonikolas, T. Gouleakis, and R. Rubinfeld. Testing shape restrictions of discrete distributions. In 33rd Symposium on Theoretical Aspects of Computer Science, STACS 2016, pages 25:1–25:14, 2016. [CDSS13] S. Chan, I. Diakonikolas, R. Servedio, and X. Sun. Learning mixtures of structured distributions over discrete domains. In SODA, pages 1380–1394, 2013. [CDSS14a] S. Chan, I. Diakonikolas, R. Servedio, and X. Sun. Efficient density estimation via piecewise polynomial approximation. In STOC, pages 604–613, 2014. [CDSS14b] S. Chan, I. Diakonikolas, R. Servedio, and X. Sun. Near-optimal density estimation in nearlinear time using variable-width histograms. In NIPS, pages 1844–1852, 2014. [CDVV14] S. Chan, I. Diakonikolas, P. Valiant, and G. Valiant. Optimal algorithms for testing closeness of discrete distributions. In SODA, pages 1193–1203, 2014. [CGG02] M. Cryan, L. Goldberg, and P. Goldberg. Evolutionary trees can be learned in polynomial time in the two state general Markov model. SIAM Journal on Computing, 31(2):375–397, 2002. [CGK+ 02] J. Cheng, R. Greiner, J. Kelly, D. Bell, and W. Liu. Learning bayesian networks from data: An information-theory based approach. Artificial Intelligence, 137(1):43 – 90, 2002. [Chi02] D. M. Chickering. Learning equivalence classes of bayesian-network structures. J. Mach. Learn. Res., 2:445–498, 2002. [CL68] C. Chow and C. Liu. Approximating discrete probability distributions with dependence trees. IEEE Trans. Inf. Theor., 14(3):462–467, 1968. [CM13] T. T. Cai and Z. Ma. Optimal hypothesis testing for high dimensional covariance matrices. Bernoulli, 19(5B):2359–2388, 2013. [CQ10] S. X. Chen and Y. L. Qin. A two-sample test for high-dimensional data with applications to gene-set testing. Ann. Statist., 38(2):808–835, 04 2010. [Das97] S. Dasgupta. The sample complexity of learning fixed-structure bayesian networks. Machine Learning, 29(2-3):165–180, 1997. [Das99] S. Dasgupta. Learning mixtures of Gaussians. In Proceedings of the 40th Annual Symposium on Foundations of Computer Science, pages 634–644, 1999. [DDKT16] C. Daskalakis, A. De, G. Kamath, and C. Tzamos. A size-free CLT for poisson multinomials and its applications. In Proceedings of STOC’16, 2016. [DDO+ 13] C. Daskalakis, I. Diakonikolas, R. O’Donnell, R.A. Servedio, and L. Tan. Learning Sums of Independent Integer Random Variables. In FOCS, pages 217–226, 2013. [DDS12a] C. Daskalakis, I. Diakonikolas, and R.A. Servedio. Learning k-modal distributions via testing. In SODA, pages 1371–1385, 2012. [DDS12b] C. Daskalakis, I. Diakonikolas, and R.A. Servedio. Learning Poisson Binomial Distributions. In STOC, pages 709–728, 2012. 59 [DDS+ 13] C. Daskalakis, I. Diakonikolas, R. Servedio, G. Valiant, and P. Valiant. Testing k-modal distributions: Optimal algorithms via reductions. In SODA, pages 1833–1852, 2013. [DDS15] A. De, I. Diakonikolas, and R. Servedio. Learning from satisfying assignments. In Proceedings of the 26th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, pages 478– 497, 2015. [DGPP16] I. Diakonikolas, T. Gouleakis, J. Peebles, and E. Price. Collision-based testers are optimal for uniformity and closeness. Electronic Colloquium on Computational Complexity (ECCC), 23:178, 2016. [DK16] I. Diakonikolas and D. M. Kane. A new approach for testing properties of discrete distributions. In FOCS, 2016. Full version available at abs/1601.05557. [DKN15a] I. Diakonikolas, D. M. Kane, and V. Nikishkin. Optimal algorithms and lower bounds for testing closeness of structured distributions. In 56th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2015, 2015. [DKN15b] I. Diakonikolas, D. M. Kane, and V. Nikishkin. Testing Identity of Structured Distributions. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, 2015. [DKS15] I. Diakonikolas, D. M. Kane, and A. Stewart. Nearly optimal learning and sparse covers for sums of independent integer random variables. CoRR, abs/1505.00662, 2015. [DKS16a] I. Diakonikolas, D. M. Kane, and A. Stewart. The fourier transform of poisson multinomial distributions and its algorithmic applications. In Proceedings of STOC’16, 2016. Available at https://arxiv.org/abs/1511.03592. [DKS16b] I. Diakonikolas, D. M. Kane, and A. Stewart. Robust learning of fixed-structure bayesian networks. CoRR, abs/1606.07384, 2016. [DSA11] R. Daly, Q. Shen, and S. Aitken. Learning bayesian networks: approaches and issues. The Knowledge Engineering Review, 26:99–157, 2011. [FGG97] N. Friedman, D. Geiger, and M. Goldszmidt. Bayesian network classifiers. Machine Learning, 29(2):131–163, 1997. [FLN00] N. Friedman, M. Linial, and I. Nachman. Using bayesian networks to analyze expression data. Journal of Computational Biology, 7:601–620, 2000. [FM99] Y. Freund and Y. Mansour. Estimating a mixture of two product distributions. In Proceedings of the 12th Annual COLT, pages 183–192, 1999. [FY96] N. Friedman and Z. Yakhini. On the sample complexity of learning bayesian networks. In Proceedings of the Twelfth International Conference on Uncertainty in Artificial Intelligence, UAI’96, pages 274–282, 1996. [GR00] O. Goldreich and D. Ron. On testing expansion in bounded-degree graphs. Technical Report TR00-020, Electronic Colloquium in Computational Complexity, 2000. [GWJ03] M. Gonen, P. H. Westfall, and W. O. Johnson. Bayesian multiple testing for two-sample multivariate endpoints. Biometrics, 59(1):76–82, 2003. 60 [Hot31] H. Hotelling. The generalization of student’s ratio. Ann. Math. Statist., 2(3):360–378, 08 1931. [HP15] M. Hardt and E. Price. Tight bounds for learning a mixture of two gaussians. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, pages 753–760, 2015. [ILR12] P. Indyk, R. Levi, and R. Rubinfeld. Approximating and Testing k-Histogram Distributions in Sub-linear Time. In PODS, pages 15–22, 2012. [JM14] A. Javanmard and A. Montanari. Confidence intervals and hypothesis testing for highdimensional regression. J. Mach. Learn. Res., 15(1):2869–2909, 2014. [JN07] F. V. Jensen and T. D. Nielsen. Bayesian Networks and Decision Graphs. Springer Publishing Company, Incorporated, 2nd edition, 2007. [KF09] D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques Adaptive Computation and Machine Learning. The MIT Press, 2009. [LR05] E. L. Lehmann and J. P. Romano. Testing statistical hypotheses. Springer Texts in Statistics. Springer, 2005. [LRR11] R. Levi, D. Ron, and R. Rubinfeld. Testing properties of collections of distributions. In ICS, pages 179–194, 2011. [LS93] R. Y. Liu and K. Singh. A quality index based on data depth and multivariate rank tests. Journal of the American Statistical Association, 88(421):252–260, 1993. [LW12] P. L. Loh and M. J. Wainwright. Structure estimation for discrete graphical models: Generalized covariance matrices and their inverses. In NIPS, pages 2096–2104, 2012. [Mar03] D. Margaritis. Learning Bayesian Network Model Structure From Data. PhD thesis, CMU, 2003. [MR05] E. Mossel and S. Roch. Learning nonsingular phylogenies and Hidden Markov Models. In To appear in Proceedings of the 37th Annual Symposium on Theory of Computing (STOC), 2005. [MV10] A. Moitra and G. Valiant. Settling the polynomial learnability of mixtures of Gaussians. In FOCS, pages 93–102, 2010. [Nea03] R. E. Neapolitan. Learning Bayesian Networks. Prentice-Hall, Inc., 2003. [NLR11] H.-T. Nguyen, P. Leray, and G. Ramstein. Multiple Hypothesis Testing and Quasi Essential Graph for Comparing Two Sets of Bayesian Networks, pages 176–185. Springer Berlin Heidelberg, Berlin, Heidelberg, 2011. [NP33] J. Neyman and E. S. Pearson. On the problem of the most efficient tests of statistical hypotheses. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 231(694-706):289–337, 1933. [Pan08] L. Paninski. A coincidence-based test for uniformity given very sparsely-sampled discrete data. IEEE Transactions on Information Theory, 54:4750–4755, 2008. [Pea88] J. Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1988. 61 [Pol03] D. Pollard. Asymptopia. http://www.stat.yale.edu/˜pollard/Books/Asymptopia, 2003. Manuscript. [PW15] Y. Polyanskiy and Y. Wu. Strong data-processing inequalities for channels and Bayesian networks. ArXiv e-prints, August 2015. [RESG14] Y. Rahmatallah, F. Emmert-Streib, and G. Glazko. Gene Sets Net Correlations Analysis (GSNCA): a multivariate differential coexpression test for gene sets. Bioinformatics, 30(3):360–368, 2014. [RISW16] A. Ramdas, D. Isenberg, A. Singh, and L. A. Wasserman. Minimax lower bounds for linear independence testing. In IEEE International Symposium on Information Theory, ISIT 2016, pages 965–969, 2016. [RS05] R. Rubinfeld and R. Servedio. Testing monotone high-dimensional distributions. In Proc. 37th Annual ACM Symposium on Theory of Computing (STOC), pages 147–156, 2005. [Rub12] R. Rubinfeld. Taming big probability distributions. XRDS, 19(1):24–28, 2012. [SD08] M. S. Srivastava and M. Du. A test for the mean vector with fewer observations than the dimension. Journal of Multivariate Analysis, 99(3):386 – 402, 2008. [SK03] D. M. Sobel and T. Kushnir. Interventions do not solely benefit causal learning: Being told what to do results in worse learning than doing it yourself. In Proceedings of the twenty-fifth annual meeting of the Cognitive Science Society, pages 1100–1105, 2003. [SM15] N. Städler and S. Mukherjee. Multivariate gene-set testing based on graphical models. Biostatistics, 16(1):47–59, 2015. [SW12] N. P. Santhanam and M. J. Wainwright. Information-theoretic limits of selecting binary graphical models in high dimensions. IEEE Trans. Information Theory, 58(7):4117–4134, 2012. [VP91] T. Verma and J. Pearl. Equivalence and synthesis of causal models. In Proceedings of the Sixth Annual Conference on Uncertainty in Artificial Intelligence, UAI ’90, pages 255–270, 1991. [VV11] G. Valiant and P. Valiant. Estimating the unseen: an n/ log(n)-sample estimator for entropy and support size, shown optimal via new CLTs. In STOC, pages 685–694, 2011. [VV14] G. Valiant and P. Valiant. An automatic inequality prover and instance optimal identity testing. In FOCS, 2014. [VW02] S. Vempala and G. Wang. A spectral algorithm for learning mixtures of distributions. In Proceedings of the 43rd Annual Symposium on Foundations of Computer Science, pages 113– 122, 2002. [Wei60] L. Weiss. Two-sample tests for multivariate distributions. Ann. Math. Statist., 31(1):159–164, 03 1960. [WJ08] M. J. Wainwright and M. I. Jordan. Graphical models, exponential families, and variational inference. Found. Trends Mach. Learn., 1(1-2):1–305, 2008. [WRL06] M. J. Wainwright, P. Ravikumar, and J. D. Lafferty. High-dimensional graphical model selection using ℓ1 -regularized logistic regression. In NIPS, pages 1465–1472, 2006. 62 [YGM+ 15] W. Yin, S. Garimalla, A. Moreno, M. R. Galinski, and M. P. Styczynski. A tree-like bayesian structure learning algorithm for small-sample datasets from complex biological model systems. BMC Systems Biology, 9(1):1–18, 2015. APPENDIX A Sample Complexity of Learning Bayesian Networks In this section, we derive tight bounds on the sample complexity of learning Bayes nets. Recall that n will denote the number of nodes and d the maximum in-degree; before stating the results and providing their proofs, we outline the high-level idea of the argument. If the structure is known, there is a very simple learning algorithm involving finding the empirical values for the relevant conditional probabilities and constructing the Bayes net using those terms. By computing the expected KL-Divergence between this hypothesis and the truth, we can show that it is possible to learn an  ǫ-aproximation in Õ 2d n/ǫ2 samples. Learning a Bayes net with unknown structure seems substantially more challenging, but at least the sample complexity is no greater. In particular, we can simply go over all possible topologies and come up with one hypothesis for each, and use a standard tournament to pick out the correct one. Appendix A.1 contains the details of both. We also prove in Appendix A.2 a matching lower bound (up to logarithmic factors). For this we can even consider Bayesian networks of fixed topology. In particular, we consider the topology where each of the last (n − d)-coordinates depend on all of the first d (which we can assume to be uniform and independent). The distribution we end up with is what we call a disjoint mixture of 2d product distributions. In particular for each of the 2d possible combinations of the first d coordinates, we have a (potentially different) product distribution over the remaining coordinates. In order to learn our final distribution we must learn at least half of these product distributions to O(ǫ) error. This requires that we obtain at least Ω((n − d)/ǫ2 ) samples from Ω(2d ) of the parts of our mixture. Thus, learning will require Ω(2d (n − d)/ǫ2 )) total samples. A.1 Sample Complexity Upper Bound Known Structure. The algorithm will return a Bayes net Q with the same (known) structure as the unknown P . Define pi,a as the probability (under P ) that the i-th coordinate is 1, conditioned on the parental configuration for i being equal to a (denoted Πi,a ); and qi,a the corresponding parameter for our hypothesis Q. Given this, the algorithm is simple. First, by a standard argument we can assume that all pi,a are in [0, 2/3] (as one can detect whether it is the case by taking O(log n) samples, and swap the corresponding coordinate of each sample if it is not the case). d We set m = O( 2ǫ2n log(2d n)), and consider separately two sets of configurations (i, a): • the light ones, for which pi,a PrP [ Πi,a ] ≤ ǫ ; 2n2d • the heavy ones, for which pi,a PrP [ Πi,a ] > ǫ . 2n2d We take m samples from P , and let qi,a be the empirical conditional probabilities. For any (i, a) for def which we see less than τ = O((log n)/ǫ) samples, we set qi,a = 0. Note that with high probability, for the right choice of constant in the definition of τ , for all heavy configurations simultaneously the estimate qi,a will (i) not be set to zero; and (ii) be within a factor 2 of the real value pi,a . Conversely, each light configuration will either have qi,a be zero, or within a factor 2 of pi,a . Conditioned on this happening, we can analyze the error. Note first that by our definition of light configuration and the triangle inequality, the sum of L1 error over all light configurations will be at most 63 ǫ/2. We now bound the contribution to the error of the heavy configurations. (In what follows, we implicitly restrict ourselves to these.) P (pi,a −qi,a )2 By Pinsker’s inequality, kP − Qk21 ≤ 2 D(P kQ) ≤ (i,a) PrP [ Πi,a ] qi,a (1−qi,a ) . It only remains to bound the expected KL divergence via the above bound. For each pair (i, a), on expectation we see m PrP [ Πi,a ] samples satisfying the parental configuration. The expected squared error (pi,a − qi,a )2 bep tween pi,a and our estimate qi,a is then O( m PrPi,a [ Πi,a ] ) by a standard variance argument. This implies that the expected KL-divergence is bounded as    pi,a (1 − pi,a ) 1 X O E E[D(P kQ)] = m qi,a (1 − qi,a ) (i,a) p (1−p ) i,a i,a and it will be sufficient to argue that qi,a (1−qi,a ) = O(1) with high probability (as then the RHS will be  d  bounded as O 2mn , and thus taking m = O(2d n/ǫ2 ) will be sufficient). Since pi,a ∈ [0, 2/3], it is enough to show that, with high probability, qi,a ≥ pi,a /2 simultaneously for all (i, a); but this is exactly the guarantee we had due to the “heaviness” of the  configuration.  2  Therefore, the contribution to the squared L1 2d n ǫ 2 error from the heavy configuration is O m = O d+log n ≪ ǫ . Gathering the two sources of error, we get an L1 -error at most ǫ with high probability, as claimed. Unknown Structure. For this upper bound, we reduce to the previous case of known structure. Indeed, there are only N = nO(dn) possible max-degree-d candidate structures: one can therefore run the above algorithm (with probability of failure 9/10) for each candidate structure on a common sample from P of size O(2d n/ǫ2 ), before running a tournament (cf. [DDS12b, DDS15]) to select a hypothesis with error O(ǫ) (which is guaranteed to exist as, with probability at least 9/10, the “right” candidate structure will generate a good hypothesis with error at most ǫ). The total sample complexity will then be   d   d 2 n dn log n 2 n log N + + = O , O ǫ2 ǫ2 ǫ2 ǫ2  which is O 2d n/ǫ2 for d = Ω(log n). A.2 Sample Complexity Lower Bound Our lower bound will be derived from families of Bayes nets with the following structure: The first d nodes are all independent (and will in fact have marginal probability 1/2 each), and will form in some sense a “pointer” to one of 2d arbitrary product distributions. The remaining n − d nodes will each depend on all of the first d. The resulting distribution is now an (evenly weighted) disjoint mixture of 2d product distributions on the (n − d)-dimensional hypercube. In other words, there are 2d product distributions p1 , . . . , p2d , and our distribution returns a random i (encoded in binary) followed by a random sample form pi . Note that the pi can be arbitrary product distributions. We show a lower bound of Ω(2d n/ǫ2 ) lower bound for learning, whenever d < (1 − Ω(1))n. Let Cǫ be a family of product distributions over {0, 1}n−d which is hard to learn, i.e., such that any algorithm learning Cǫ to accuracy 4ǫ which succeeds with probability greater than 1/2 must have sample complexity Ω(n/ǫ2 ). We will choose each pi independently and uniformly at random from Cǫ . Assume for the sake of contradiction that there exists an algorithm A to learn the resulting disjoint mixture of pi ’s to error ǫ with o(2d (n − d)/ǫ2 ) samples. Without loss of generality, this algorithm can be thought of returning as hypothesis disjoint union of some other distributions q1 , . . . , q2d , in which case the Pan−d kpi − qi k1 . error incurred is kp − qk1 = 21d i=1 By assumption on its sample complexity, for at least half of the indices 1 ≤ i ≤ n − d the algorithm obtains o(n/ǫ2 ) samples from pi . This implies that in expectation, by the fact that Cǫ was chosen hard to 64 learn, for at least half of these indices it will be the case that kpi − qi k1 > 16ǫ (as each of these i’s is such that kpi − qi k1 > 16ǫ with probability at least 1/2). This in turn shows that in expectation, kp − qk1 = 1 Pn−d 4ǫ i=1 kpi − qi k1 > 4 = ǫ, leading to a contradiction. 2d B Omitted Proofs from Section 3 We provide in this section the proofs of the inequalities stated in the preliminaries (Section 3). Proof of Lemma 3.4. Using properties of the KL-divergence: D(P kQ) = D(P1 ⊗ · · · ⊗ Pn kQ1 ⊗ · · · ⊗ Qn ) = so it suffices to show that 2(pi − qi )2 ≤ D(Pi kQi ) ≤ Qi = Bern(qi ), we can write D(Pi kQi ) = pi ln (pi −qi )2 qi (1−qi ) n X i=1 D(Pi kQi ) for all i ∈ [n]. Since Pi = Bern(pi ) and pi 1 − pi + (1 − pi ) ln qi 1 − qi def 2 Defining f : (0, 1)2 → R as f (x, y) = x ln xy + (1 − x) ln 1−x 1−y , we thus have to show that 2(x − y) ≤ f (x, y) ≤ (x−y)2 y(1−y) for all x, y ∈ (0, 1). def We begin by the upper bound: fixing any x, y ∈ (0, 1) and setting δ = x − y, we have     1−x δ2 δ x δ δ= + (1 − x) ln 1 − ≤ δ− f (x, y) = x ln 1 + y 1−y y 1−y y(1 − y) from ln(1 + u) ≤ u for all u ∈ (−1, ∞). Turning to the lower bound, we fix any y ∈ (0, 1) and consider the auxiliary function hy : (0, 1) → R 2 ′ defined by hy (x) = f (x, y) − 2(x − y)2 . From h′′y (x) = (1−2x) x(1−x) ≥ 0, we get that hy is convex, i.e. hy ′ is non-decreasing. Since h′y (x) = ln x(1−y) (1−x)y − 4(x − y), we have hy (y) = 0, and in turn we get that hy is non-increasing on (0, y] and non-decreasing on [y, 1). Since hy (y) = 0, this leads to hy (x) ≥ 0 for all x ∈ (0, 1), i.e. f (x, y) ≥ 2(x − y)2 . Proof of Lemma 3.6. Recall that for any pair of distributions, we have that dH (P, Q)2 ≤ 12 kP − Qk1 ≤ √ 2 dH (P, Q), where dH (P, Q) denotes the Hellinger distance between P, Q. Therefore, it is enough to show that ! n n X X (pi − qi )2 2 ′ 1 ≤ dH (P, Q)2 ≤ (pi − qi ) (14) min c , 4 qi (1 − qi ) i=1 i=1 c′ for some absolute constant > 0. (We will show Since P, Q are product measures, c′ =1− e−3/2 ≃ 0.78.) n n Y Y p √ 2 ( pi qi + (1 − pi )(1 − qi )) . (1 − dH (Pi , Qi ) ) = 1 − dH (P, Q) = 1 − 2 i=1 i=1 We start with the lower bound. Noting that for any x, y ∈ (0, 1) it holds that √ xy + p 1 (1 − x)(1 − y) ≤ 1 − (x − y)2 2 65 p √ (e.g., by observing that the function x ∈ (0, 1) 7→ 1 − 21 (x − y)2 − ( xy + (1 − x)(1 − y)) is minimized at y, where it takes value 0), we get 2 dH (P, Q) ≥ 1− n  Y i=1 where we relied on the inequality 1 − 1− n Y i=1  ≥ min(1− e−3/2 , Qn − xi ) ≥ 1 1 − (pi − qi )2 2 n i=1 (1 Pn (1 − xi ) = 1 − e i=1 ln(1−xi ) 1 2 1 1X (pi − qi )2 ) = min(1− e−3/2 , kp − qk22 ) 4 4 i=1 Pn for (x1 , . . . , xn ) ∈ [0, 1]: ! n P X 1 − n x i=1 i ≥ 1 − ≥1−e 1− xi . 2 i=1 xi i=1 P (the last inequality being true for ni=1 xi ≤ 23 , i.e. kp − qk22 ≤ 3). √ √ √ Turning to the upper bound, the elementary inequality 2 xy = x + y − ( x − y)2 , x, y > 0, gives that p √ (pi − qi )2 = 1 − zi . pi qi + (1 − pi )(1 − qi ) ≥ 1 − (pi + qi )(2 − pi − qi ) Therefore, dH (P, Q)2 ≤ (1 − n n n X X Y zi = (1 − zi )) ≤ i=1 i=1 i=1 n X (pi − qi )2 (pi − qi )2 ≤ , (pi + qi )(2 − pi − qi ) qi (1 − qi ) (15) i=1 where the third-to-last inequality follows from the union bound, and the last from the simple fact that (pi + qi )(2 − pi − qi ) ≥ qi (1 − qi ). Proof of Lemma 3.7. Let A and B be two distributions on {0, 1}d . Then we have: X D(AkB) = x∈{0,1}d Pr[x] ln A PrA [x] ;. PrB [x] (16) For a fixed i ∈ [d], the events Πi,a form a partition of {0, 1}d . Dividing the sum above into this partition, we obtain D(AkB) = X X a x∈Πi,a = X a = X a Pr[x] ln A Pr[Πi,a ] A X PrA|Πi,a [x] PrA [Πi,a ] Pr [x] ln + ln PrB [Πi,a ] PrB|Πi,a [x] A|Πi,a d x∈{0,1} Pr[Πi,a ](ln A PrA [x] PrB [x] ! PrA [Πi,a ] + D(A | Πi,a kB | Πi,a ) . PrB [Πi,a ] Let P≤i be the distribution over the first i coordinates of P and define Q≤i similarly for Q. Let Pi and Qi be the distribution of the i-th coordinate of P and Q respectively. We will apply the above to P≤i−1 and P≤i . First note that the i-th coordinate of P≤i | Πi,a and Q≤i | Πi,a is independent of the others, thus we 66 have (which likely follows from standard results): D(P≤i | Πi,a kQ≤i | Πi,a ) = X Pr [x] ln x∈{0,1}i X = Pr x∈{0,1}i = X P≤i |Πi,a P≤i−1 |Πi,a PrQ≤i |Πi,a [x] [x≤i−1 ] Pr [xi ] ln Pi |Πi,a Pr x∈{0,1}i−1 PrP≤i |Πi,a [x] P≤i−1 |Πi,a [x] ln PrP≤i−1 |Πi,a [x≤i−1 ] PrQ≤i−1 |Πi,a [x≤i−1 ] PrP≤i−1 |Πi,a [x] PrQ≤i−1 |Πi,a [x] + X y∈{0,1} + ln Pr [y] ln Pi |Πi,a PrPi |Πi,a [xi ] PrQ≤i |Πi,a [xi ] PrPi |Πi,a [y] PrQ≤i |Πi,a [y] = D(P≤i−1 | Πi,a kQ≤i−1 | Πi,a ) + D(Pi | Πi,a kQi | Πi,a ) Thus, we have: D(P≤i kQ≤i ) = X a Pr [Πi,a ](ln P≤i PrP≤i [Πi,a ] + D(P≤i | Πi,a kQ≤i | Πi,a ) PrQ≤i [Πi,a ] ! PrP≤i [Πi,a ] = Pr [Πi,a ] ln + D(P≤i−1 | Πi,a kQ≤i−1 | Πi,a ) + D(Pi | Πi,a kQi | Πi,a ) P≤i PrQ≤i [Πi,a ] a X = D(P≤i−1 kQ≤i−1 ) + Pr[Πi,a ] D(Pi | Πi,a kQi | Πi,a ) X a P By induction on i, we get D(P kQ) = X (i,a)∈S Pr[Πi,a ] D(Pi | Πi,a kQi | Πi,a ). P Now the distributions Pi | Πi,a and Qi | Πi,a are Bernoulli random variables with means pi,a and qi,a . For p, q ∈ [0, 1], we have: D(Bern(p) k Bern(q)) = p ln 1−p (p − q)2 p + (1 − p) ln ≤ q 1−q q(1 − q) as in the proof of Claim 4.3. On the other hand, studying for instance the function fq : (0, 1) → R defined by fq (p) = p ln pq +(1−p) ln (p−q)2 1−p 1−q (extended by continuity at q), we get fq (p) ≥ fq (1 − q) ≥ 2 for all p, q ∈ (0, 1)2 . This shows the lower bound. C Omitted Proofs from Sections 4.2 and 6.2 Fact (Fact 4.12). I (X; A) ≤   Pr[ A = a | X = 1 ] 2 . Pr[ A = a ] 1 − Pr[ A = a | X = 0 ] a=0 ∞ X (17) Proof. For a ∈ N, we write pa = Pr[ X = 0 | A = a ] and qa = Pr[ X = 1 | A = a ], so that pa + qa = 1. 67 ! By definition, I (X; A) = ∞ X Pr[ A = a ] = ∞ X Pr[ A = a ] (pa log (2pa ) + qa log (2qa )) X Pr[ X = x | A = a ] Pr[ X = x ] a=0 x∈{0,1}   ∞ X pa qa Pr[ A = a ] pa log = + qa log Pr[ X = 1 ] Pr[ X = 0 ] a=0 Pr[ X = x | A = a ] log a=0 = ∞ X a=0 ≤ ∞ X a=0 Pr[ A = a ] ((1 − qa ) log (1 − qa ) + qa log (qa ) + 1)  Pr[ A = a ] 1 − qa 1 − qa 2 = ∞ X a=0   qa 2 Pr[ A = a ] 1 − pa  where for the last inequality we rely on the fact that the binary entropy satisfies h(x) ≥ 1 − 1 − all x ∈ [0, 1). x 1−x 2 for Alternative proof of Lemma 4.15. We proceed as in the proof of Lemma 4.11, first writing "    # ∞ X Pr[ A = a | X = 1 ] 2 Pr[ A = a | X = 1 ] 2 I (X; A) = Pr[ A = a ] 1 − = EA 1− Pr[ A = a | X = 0 ] Pr[ A = a | X = 0 ] ℓ=0 def Pr[ A=a | X=1 ] Pr[ A=a | X=0 ] and noticing that za = e−kǫ/n (1+ǫ)a +ekǫ/n (1−ǫ)a . 2 = This leads to  k    k k k 4(1 − za )2 = 4 − 4 e− n ǫ (1 + ǫ)a + e n ǫ (1 − ǫ)a + e−2 n ǫ (1 + ǫ)2a + e2 n ǫ (1 − ǫ)2a + 2(1 − ǫ2 )a (18) We also have, by definition of A, that for any z ∈ R 1 1 1 EA [z A ] = EA∼Poi( k ) [z A ] + EA∼Poi( k (1+ǫ)) [z A ] + EA∼Poi( k (1−ǫ)) [z A ] n n n 2 4 4 1 k (z−1) 1 k (1+ǫ)(z−1) 1 k (1−ǫ)(z−1) + en + en = en 2 4 4 (19) from the expression of the probability generating function of a Poisson random variable. For any β ∈ {−1, 1}, we therefore have k k k k k k k k k 2 4e− n βǫ EA [(1 + βǫ)A ] = 2e n βǫ e− n βǫ + e n (1+ǫ)βǫ e− n βǫ + e n (1−ǫ)βǫ e− n βǫ = 2 + e n βǫ + e− n βǫ k k 2 k 2 k k k 2 k k 2 k 4e−2 n βǫ EA [(1 + βǫ)2A ] = 2e n (2βǫ+ǫ ) e−2 n βǫ + e n (1+ǫ)(2βǫ+ǫ ) e−2 n βǫ + e n (1−ǫ)(2βǫ+ǫ ) e−2 n βǫ = 2e n ǫ + e n ((1+2β)ǫ k 2 k 2 +ǫ3 ) k + e n ((1−2β)ǫ k 2 2 2 −ǫ3 ) k 2 k 4 · 2EA [(1 − ǫ2 )A ] = 4e n ǫ + 2e n (1+ǫ)ǫ + 2e n (1−ǫ)ǫ = 4e n ǫ + 2e n (ǫ 68 2 +ǫ3 ) k + 2e n (ǫ 2 −ǫ3 ) 2 Combining Eq. (18) and the above, we obtain i  h  k k 16EA (1 − zA )2 = 16 − 4 4e− n ǫ EA [(1 + ǫ)A ] + 4e n ǫ EA [(1 − ǫ)A ]   k k + 4e−2 n ǫ EA [(1 + ǫ)2A ] + 4e2 n ǫ EA [(1 − ǫ)2A ] + 8EA [(1 − ǫ2 )A ]   k 2  k k k k k 2 k 2 2 3 2 3 2 3 2 3 = 16 − 8 2 + e n ǫ + e− n ǫ + 4e n ǫ + e n (3ǫ +ǫ ) + e n (−ǫ −ǫ ) + e n (−ǫ +ǫ ) + e n (3ǫ −ǫ )  k 2 k 2 k 2 3 3 + 4e n ǫ + 2e n (ǫ +ǫ ) + 2e n (ǫ −ǫ )  k 2   k 2  k 3  k 2 k 2 k 2 k 3 = 8 − 8 e n ǫ + e− n ǫ + e n 3ǫ + e− n ǫ + 2e n ǫ e n ǫ + e− n ǫ . A Taylor expansion of this expression (in kǫ2 n for the first two parentheses, and  2 4 i h k ǫ 2 EA (1 − zA ) = O n2 kǫ3 n for the last) shows that as claimed. P X=x,Y =y ] Proof of Lemma 6.7. From the definition of I (X; Y ) = (x,y)∈{0,1} Pr[ X = x, Y = y ] log Pr[Pr[ X=x ] Pr[ Y =y ] , it is straightforward to check that for X, Y taking values in {0, 1} E[XY ] E[X] E[Y ] E[X] − E[XY ] + (E[X] − E[XY ]) log E[X] (1 − E[Y ]) E[Y ] − E[XY ] + (E[Y ] − E[XY ]) log (1 − E[X])E[Y ] 1 − E[X] − E[Y ] + E[XY ] + (1 − E[X] − E[Y ] + E[XY ]) log (1 − E[X])(1 − E[Y ]) = f (E[X] , E[Y ] , E[XY ]) I (X; Y ) = E[XY ] log def y−z 1−x−y+z x−z z +(x−z) log x(1−y) for f defined by f (x, y, z) = z log xy +(y−z) log (1−x)y +(1−x−y+z) log (1−x)(1−y) . 3 The domain of definition of f is the subset Ω ⊆ [0, 1] defined by (recalling that x, y, z correspond to E[X] , E[Y ] , E[XY ] for X, Y ∈ {0, 1}) 0 ≤ x, y ≤ 1 0 ≤ z ≤ min(x, y) √ 0 ≤ z ≤ xy (Cauchy–Schwarz) 0≤1+z−x−y Given the c-balancedness assumption on P , Ωc ⊆ Ω satisfies the further following constraints: c ≤ x, y ≤ 1 − c z z c2 ≤ , ≤ 1 − c2 x y 1 +z−x−y 1+z−x−y , ≤ 1 − c2 c2 ≤ 1−x 1−y 69 by Baye’s rule and recalling that 1+z−x−y corresponds to Pr[ X = 0, Y = 0 ] = Pr[ X = 0 | Y = 0 ] Pr[ Y = 0 ] = Pr[ Y = 0 | X = 0 ] Pr[ X = 0 ] while 1 − x, 1 − y correspond to Pr[ X = 0 ] , Pr[ Y = 0 ] respectively. One can then check that ∂f (1 − x)(x − z) (x, y, z) = log , ∂x x(1 + z − x − y) ∂f (1 − y)(y − z) (x, y, z) = log , ∂y y(1 + z − x − y) ∂f z(1 + z − x − y) (x, y, z) = log ∂z (x − z)(y − z) and therefore, on Ωc , that k x−z ∂f 1+z−x−y 1 1 ∂f k = k k ≤ sup |log | + |log | ≤ 2 log 2 = 4 log . ∂x ∞ ∂y ∞ (x,y,z)∈Ωc x 1−x c c Similarly, k 1 (x − z)(y − z) (1 − c2 )y ∂f k ≤ sup |log | + |log(1 + z − x − y)| ≤ sup |log | + |log 2 | 4 xy ∂z ∞ (x,y,z)∈Ωc z c c x (x,y,z)∈Ωc ≤ log 1 1 1 + log 3 = 8 log . 5 c c c ∂f ∂f So overall, f is λ-Lipschitz (with regard to the k·k∞ norm) on Ωc , for λ = k ∂f ∂x k∞ + k ∂y k∞ + k ∂z k∞ ≤ 16 log 1c . 70
8cs.DS
arXiv:1712.10099v1 [stat.ME] 29 Dec 2017 Finite-Sample Bounds for the Multivariate Behrens–Fisher Distribution with Proportional Covariances Yixuan Qiu and Lingsong Zhang Department of Statistics, Purdue University, West Lafayette, Indiana 47907, U.S.A. Abstract The Behrens–Fisher problem is a well-known hypothesis testing problem in statistics concerning two-sample mean comparison. In this article, we confirm one conjecture in Eaton & Olshen (1972), which provides stochastic bounds for the multivariate Behrens– Fisher test statistic under the null hypothesis. We also extend their results on the stochastic ordering of random quotients to the arbitrary finite dimensional case. This work can also be seen as a generalization of Hsu (1938) that provided the bounds for the univariate Behrens–Fisher problem. The results obtained in this article can be used to derive a testing procedure for the multivariate Behrens–Fisher problem that strongly controls the Type I error. Keywords: Behrens–Fisher problem; Hypothesis testing; Mean comparison; Stochastic bound; Type I error. 1 1 Introduction The Behrens–Fisher problem is one of the most well-known hypothesis testing problems that has been extensively studied by many statisticians, partly due to its simple form and numerous real applications. The univariate Behrens–Fisher problem can be phrased as follows: Let X = (X1 , . . . , Xm ) and Y = (Y1 , . . . , Yn ) be two independent random samples with iid iid Xi ∼ N(µ1 , σ12 ) and Yi ∼ N(µ2 , σ22 ), where all the four parameters are unknown, and the target is to test H0 : µ1 = µ2 versus Ha : µ1 6= µ2 . There was enormous research on designing a procedure to test this hypothesis, for example Fisher’s fiducial inference (Fisher, 1935), Scheffé’s t-distribution method (Scheffé, 1943), the generalized p-value method (Tsui & Weerahandi, 1989), the marginal inferential models (Martin & Liu, 2015), and many others that were summarized in review articles such as Scheffé (1970) and Kim & Cohen (1998). Among all these approaches, the most broadlyadopted test statistic is the Behrens–Fisher statistic. Using conventional notations, X and Y are the two sample means, S12 and S22 are the two unbiased sample variances, and then the Behrens–Fisher statistic is defined by T = (S12 /m + S22 /n) −1/2 (X − Y ). It is well known that the sampling distribution of T under H0 depends on the unknown variance ratio σ12 /σ22 , and various methods were proposed to approximate this null distribution, for example the most widely-used Welch-Satterthwaite approximate degrees of freedom (Satterthwaite, 1946; Welch, 1947). Despite their extreme popularity in applications, one critical issue of the approximation methods is that they do not guarantee the control of Type I error. Therefore, conservative test procedures that can strongly control the Type I error are also of interest. The remarkable works Hsu (1938) and Mickey & Brown (1966) showed that the distribution function of T is bounded below by tmin{m−1,n−1} , the t-distribution with min{m−1, n−1} degrees of freedom, and bounded above by tm+n−2 . With this result, one can use critical values or p-values based on tmin{m−1,n−1} to test the hypothesis, which ensures the limit of Type I error. This approach also motivated works such as Hayter (2013) and Martin & Liu (2015). 2 The Behrens–Fisher problem was also generalized to the multivariate case in various research articles. In this setting, each observation follows a multivariate normal distribution, and the target is to test the equality of the two mean vectors. In the multivariate case, most of the approaches are based on the approximate degrees of freedom framework, for example Yao (1965), Johansen (1980), Nel & Van der Merwe (1986), and Krishnamoorthy & Yu (2004). Also see Christensen & Rencher (1997) for a comparison of other solutions. Alternatively, along the direction of Hsu (1938) and Mickey & Brown (1966), Eaton & Olshen (1972) attempted to develop stochastic bounds for the test statistic in the multivariate case, and they provided the result for the two-dimensional case with proportional covariances assumption. However, the theorem that they developed to prove the result had the restriction that it only applied to the two-dimensional case, so they left the general finite dimensional case as a conjecture. In this article, we study the same problem as in Eaton & Olshen (1972) using a related but different approach, and we are able to confirm this conjecture and generalize their result to the arbitrary finite dimensional case. As a result, we provide sharp bounds for the multivariate Behrens–Fisher distribution with proportional covariances, as a direct generalization of Hsu’s result in the univariate case. The remaining part of this article is organized as follows. In Section 2 we briefly introduce the multivariate Behrens–Fisher problem and review some existing results on it. Section 3 is the main part of this article, where two major theorems that describe the stochastic bounds for the test statistic are provided. In Section 4 we use numerical simulations to illustrate the performance of the proposed test compared with other approximation methods. And finally in Section 5, some discussions and the conclusion of this article are provided. The proofs of two important lemmas are in the appendix. 3 2 Multivariate Behrens–Fisher Problem In this section we briefly describe the multivariate Behrens–Fisher problem and review some relevant results on it. Similar to the univariate case, let X = (X1 , . . . , Xm )T and Y = (Y1 , . . . , Yn )T be two independent random samples, with each observation following a iid iid p-dimensional multivariate normal distribution: Xi ∼ N(µ1 , Σ1 ), and Yi ∼ N(µ2 , Σ2 ). The problem of interest is to test H0 : µ1 = µ2 versus Ha : µ1 6= µ2 , with all the distributional parameters unknown. Following the same assumption in Eaton & Olshen (1972), we assume that X and Y have proportional covariances, i.e., Σ1 = Σ, (1) Σ2 = kΣ for some unknown p × p positive definite matrix Σ and an unknown constant k (k > 0). In the remaining part of this article we assume that p < min{m, n}. P Pn −1 Let X = m−1 m i=1 Xi and Y = n i=1 Yi be the sample means, and S1 = (m − Pn P T −1 T 1)−1 m i=1 (Yi − Y )(Yi − Y ) be the sample i=1 (Xi − X)(Xi − X) and S2 = (n − 1) covariance matrices. It is well known that X ∼ N(µ1 , m−1 Σ1 ), Y ∼ N(µ2 , n−1 Σ2 ), (m − 1)S1 ∼ W (Σ1 , m − 1), and (n − 1)S2 ∼ W (Σ2 , n − 1), where W (Σ, n) stands for a Wishart distribution with parameter Σ and n degrees of freedom. All these four random vectors and matrices are independent of each other. Furthermore, the multivariate Behrens–Fisher test statistic is defined as T 2 = (X − Y )T m−1 S1 + n−1 S2 −1 (X − Y ), (2) and the sampling distribution of T 2 under H0 is typically called the multivariate Behrens– Fisher distribution. In this article, our primary goal is to derive stochastic bounds for T 2 that are free of the unknown parameters. A major progress on this direction was made by Eaton & Olshen (1972). They first 4 showed that under H0 ,  d T 2 = Z T λ(m − 1)−1 W1 + (1 − λ)(n − 1)−1 W2 −1 (3) Z, d where X = Y means X and Y have the same distribution, Z ∼ N(0, Ip ), W1 ∼ W (Ip , m − 1), W2 ∼ W (Ip , n − 1), λ = m−1 (m−1 + kn−1 )−1 , Ip is the p × p identity matrix, and Z, W1, and W2 are independent. Then they proved that for p = 2,  Z T (m + n − 2)−1 W(m+n−2) −1  Z st T 2 st Z T ν −1 W(ν) −1 Z, (4) where st stands for the stochastic ordering, ν is any integer satisfying p ≤ ν ≤ min{m − 1, n − 1}, and W(n) stands for a W (Ip , n) random matrix that is independent of Z. However, in Eaton & Olshen (1972), (4) was only proved for the case of p = 2, since the underlying theory did not generalize to higher dimensions. To overcome this difficulty, in this article we use a different set of techniques to prove that (4) also holds for p > 2. The main results are presented in Section 3. 3 Main Results We first present two lemmas that are the keys to our main theorems, whose proofs are given in the appendix. Lemma 1 studies the property of a linear combination of Zi2 random variables, iid where Zi ∼ N(0, 1). Lemma 1. Assume that Z1 , . . . , Zp are p independent N(0, 1) random variables. Let F (t; θ) = P F (t; θ1 , . . . , θp ) denote the distribution function of the random variable Tθ = pi=1 Zi2 /θi , θi > 0, and define its partial derivatives as fi (t; θ) = ∂F (t; θ)/∂θi and gi (t; θ) = ∂ 2 F (t; θ)/∂θi2 . Then for i, j = 1, . . . , p, we have a) fi (t; θ) > 0, 5 b) gi (t; θ) < 0, and c) If θi < θj then fi (t; θ) > fj (t; θ). Lemma 1 itself gives some general properties of the distribution family represented by Tθ , and in this article the lemma is mainly used to show the conclusion below, which is the central technical tool to prove our main theorems. Lemma 2. Assume that Z is a N(0, Ip ) random vector. Fix t > 0 and let M1 and M2 be two   p×p positive definite matrices. Define h(λ; t, M1 , M2 ) = pr Z T {λM1 + (1 − λ)M2 }−1 Z ≤ t , and then ∂ 2 h(λ; t, M1 , M2 )/∂λ2 < 0. To present the main theorems of this article, we first introduce two useful concepts: the majorization of vectors (Olkin & Marshall, 2016), and the exchangeability of a sequence of random vectors. Definition 1. Let x = (x1 , . . . , xn ) and y = (y1 , . . . , yn ) be two vectors in Rn , and let x[1] ≥ · · · ≥ x[n] and y[1] ≥ · · · ≥ y[n] be the decreasing rearrangement of x and y respectively. x is said to be majorized by y, denoted by x ≺m y, if n X i=1 x[i] = n X i=1 y[i] and k X x[i] ≤ i=1 k X y[i] , k = 1, 2, . . . , n − 1. i=1 Intuitively, x ≺m y indicates that x and y have the same total quantity, but y is more “spread out”, or less “equally allocated” than x. Definition 2. A sequence of random vectors W = (W1 , . . . , Wr ) is said to be exchangeable, d if for any permutation π of (1, 2, . . . , r), (Wπ(1) , . . . , Wπ(r) ) = (W1 , . . . , Wr ). With these notations, the first main result of this article is summarized in Theorem 1. Theorem 1. Let W = (W1 , . . . , Wr ) be an exchangeable sequence of positive definite random matrices of size p × p, and let Z be a N(0, Ip ) random vector that is independent of W . If 6 ψ = (ψ1 , . . . , ψr ) and η = (η1 , . . . , ηr ) are two sequences of nonnegative constants such that ψ ≺m η, then ZT r X i=1 ψi Wi !−1 Z st Z T r X i=1 ηi Wi !−1 Z. Proof. Let Pp denote the space of all p×p positive definite matrices. Fix t > 0, and define the o n P −1 function φ : (Pp )r 7→ R, φ(w1 , . . . , wr ) = 1 − pr Z T ( ri=1 wi ) Z ≤ t with each wi ∈ Pp . We are going to show that φ is convex, i.e., given u1 , . . . , ur ∈ Pp , v1 , . . . , vr ∈ Pp , and any constant 0 ≤ λ ≤ 1, φ satisfies φ(λu1 + (1 − λ)v1 , . . . , λur + (1 − λ)vr ) ≤ λφ(u1 , . . . , ur ) + (1 − λ)φ(v1 , . . . , vr ). (5) P P To verify this, let ũ = ri=1 ui ∈ Pp and ṽ = ri=1 vi ∈ Pp , so φ(λu1 + (1 − λ)v1 , . . . , λur +   (1 − λ)vr ) = 1 − pr Z T {λũ + (1 − λ)ṽ}−1 Z ≤ t = 1 − h(λ; t, ũ, ṽ), where h(·) is defined in Lemma 2. It follows from Lemma 2 that h(·) is concave, implying h(λ) ≥ λh(1) + (1 −λ)h(0). Since h(1) = 1 − φ(u1, . . . , ur ) and h(0) = 1 − φ(v1 , . . . , vr ), (5) holds immediately. Moreover, φ is continuous and exchangeable on its arguments, so it satisfies the condition of Theorem 2.4 of Eaton & Olshen (1972). As a consequence of the theorem, it follows that EW {φ(ψ1 W1 , . . . , ψr Wr )} ≤ EW {φ(η1 W1 , . . . , ηr Wr )} , where the expectation is taken on the joint distribution of W = (W1 , . . . , Wr ). It is easy o n P −1 to see that EW {φ(ψ1 W1 , . . . , ψr Wr )} = 1 − pr Z T ( ri=1 ψi Wi ) Z ≤ t , so we obtain o o n n P P −1 −1 pr Z T ( ri=1 ψi Wi ) Z ≤ t ≥ pr Z T ( ri=1 ηi Wi ) Z ≤ t for any t > 0, which concludes the proof. Theorem 1 does not put any specific distributional assumptions on W , so it is more general than the Behrens–Fisher problem setting where Wi ’s follow Wishart distributions. Applying Theorem 1 to the multivariate Behrens–Fisher test statistic in (2), we obtain the following result: 7 Theorem 2. For the multivariate Behrens–Fisher test statistic (2), under H0 and the proportional covariances assumption (1), Fp,min{m,n}−p     min{m, n} − p m+n−p−1 2 t ≤ P (T ≤ t) ≤ Fp,m+n−p−1 t , p(min{m, n} − 1) p(m + n − 2) (6) where Fa,b (·) is the distribution function of an F -distribution with a and b degrees of freedom. Proof. We first show that equation (3) holds. Under H0 , X − Y ∼ N(0, (m−1 + kn−1 )Σ). Let c = m−1 + kn−1 , ∆ = cΣ, and ∆1/2 is the symmetric square root of ∆, then T 2 = (X − Y )T ∆−1/2 (m−1 ∆−1/2 S1 ∆−1/2 +n−1 ∆−1/2 S2 ∆−1/2 )−1 ∆−1/2 (X −Y ). It follows that ∆−1/2 (X − Y ) ∼ N(0, Ip ), ∆−1/2 S1 ∆−1/2 ∼ W ((m − 1)−1 c−1 Ip , m − 1), and ∆−1/2 S2 ∆−1/2 ∼ W (k(n − 1)−1 c−1 Ip , n − 1). If we let λ = m−1 (m−1 + kn−1 )−1 , then (3) can be obtained immediately. Now let ν = m − 1, θ = n − 1, ψ = ((ν + θ)−1 , . . . , (ν + θ)−1 ) ∈ Rν+θ , η be a vector that contains ν elements of λ/ν and θ elements of (1 − λ)/θ, and ξ ∈ Rν+θ be a vector that contains min{ν, θ} elements of min{ν, θ}−1 and other elements equal to zero, then it is easy to verify that ψ ≺m η ≺m ξ. According to Theorem 1, we have ZT r X i=1 ψi Wi !−1 Z st Z T r X ηi Wi i=1 !−1 Z st Z T r X ξi Wi i=1 !−1 Z. Pr P −1 −1 2 d It is obvious that = Z T ( ri=1 ηi Wi ) Z, and i=1 ψi Wi ∼ W ((ν + θ) Ip , ν + θ), T Pr d −1 T −1 Z = i=1 ξi Wi ∼ W (min{ν, θ} Ip , min{ν, θ}). Combining with the fact that nZ W np(n − p + 1)−1 F (Rao, 1973), where W ∼ W (Ip , n) and F ∼ Fp,n−p+1, (6) is confirmed. Using the inequality in Theorem 2, a p-value of the test can be computed as 2 pval(T ) = 1 − Fp,min{m,n}−p   min{m, n} − p 2 T , p(min{m, n} − 1) and it is guaranteed that under H0 , pr{pval(T 2 ) ≤ α} ≤ α. 8 (7) 4 Simulation Study In this section we conduct simulation experiments to compare the testing procedure using (7) with other existing methods, including Yao (1965), Johansen (1980), Nel & Van der Merwe (1986), and Krishnamoorthy & Yu (2004), in terms of their Type I errors. The experiment setting is as follows. We fix the number of variables p = 5, and assume that m ≤ n without loss of generality. Two groups of sample sizes are considered: the “small sample” group, with m = 10 and n = 10, 20, 50; and the “large sample” group, with m = 100 and n = 100, 200, 500. The true Σ is a realization of the W (I5 , 10) distribution, and its value is fixed during the experiment. Five different values of k are considered, k = 0.01, 0.1, 1, 10, 100, for each combination of m and n. Then for each parameter setting of (m, n, k), the data (X, Y ) are randomly sampled 100,000 times to compute the empirical Type I error for each method. Figure 1 illustrates the results for significance level α = 0.05. The first four methods correspond to the the existing solutions, and the “F-Bound” method is the one based on (7). As can be seen from the last three columns of the plot matrix, which correspond to the “large sample” case, all five solutions perform reasonably well. However, when the sample sizes are small, as in the first three columns of the plot matrix, the existing methods tend to exaggerate the Type I error a lot, and even double the pre-specified significance level in some situations. On the contrary, even if the F-Bound method is conservative in worst cases, it always guarantees the control of Type I error. This phenomenon is even more clear under the α = 0.01 situation, as is shown in Figure 2. Under some circumstances the existing methods inflate the Type I error more than four times, which may cause unreliable conclusions in real applications. Same as the previous case, the F-Bound method is always valid despite its conservativeness. To summarize, the simulation study indicates that the theoretical result obtained in this article is useful to derive a testing procedure for the multivariate Behrens–Fisher problem that guarantees the Type I error control, which is crucial for many scientific studies. 9 Figure 1: Type I errors of five testing methods for the multivariate Behrens–Fisher problem under different parameter settings, with each setting displayed in one sub-plot. The significance level is set to α = 0.05, indicated by the horizontal lines in each sub-plot, and the height of the bars stands for the Type I error. The first four methods are existing solutions to the problem, and the one labeled with “F-Bound” is the approach based on (7). Figure 2: The same plot as Figure 1 but with significance level α = 0.01. 10 5 Discussion and Conclusion In this article we have revisited the multivariate Behrens–Fisher problem with the proportional covariances assumption, and have derived finite-sample lower and upper bounds for the null distribution of the test statistic. This result extends the previous work by Hsu (1938) for the univariate case and Eaton & Olshen (1972) for the two-dimensional case, and can be used to create a testing procedure that strongly controls the Type I error for the multivariate Behrens–Fisher problem. It is true that the proportional covariances assumption (1) is a moderately strong restriction, and one may hope to verify the result for the most general forms of Σ1 and Σ2 . In this article, this assumption is made based on the following two considerations. First, the original motivation of this article was to generalize Theorem 3.1 of Eaton & Olshen (1972), about the stochastic ordering of a series of random quotients, from two-dimension to any finite dimension. However, the test statistic for the most general Behrens–Fisher problem does not belong to this type of random quotient. Second, the technical difficulty of the general case is expected to be formidable. As can be seen from Lemma 2, there exists some concavity property for the proportional covariances case, which greatly helps proving the bounds. However, many examples can be given to show that such properties are totally destroyed in the general case, so some more advanced techniques need to be developed in order to fully solve the general situation. We leave this possibility for future research. A A.1 Appendix Proof of Lemma 1 Proof. Since θ1 , . . . , θp are exchangeable in F (t; θ), we will prove the case for i = 1, j = 2 without loss of generality. Define the random variable T12 = Z12 /θ1 + Z22 /θ2 with the distribution function F12 (t; θ1 , θ2 ), and let φ(x) and Φ(x) denote the density function and 11 distribution function of N(0, 1), respectively, then F12 (t; θ1 , θ2 ) = Z (θ2 t)1/2 −(θ2 =2 Z t)1/2 pr(Z12 /θ1 + s2 /θ2 ≤ t)φ(s)ds (θ2 t)1/2 0 =4 Z (θ2 t)1/2 ∂F12 (t; θ1 , θ2 ) =2 ∂θ1 2Φ Φ 0 Z n (θ2 t)1/2 0  θ1 (t − s2 /θ2 )  θ1 (t − s2 /θ2 ) −1/2 (t − s2 /θ2 )1/2 θ1 1/2 φ 1/2    o − 1 φ(s)ds φ(s)ds − 2Φ((θ2 t)1/2 ) + 1, θ1 (t − s2 /θ2 ) 1/2  φ(s)ds > 0. (8) Moreover, using the fact that φ′ (x) = −xφ(x), we have ∂ 2 F12 (t; θ1 , θ2 ) ∂θ12 Z (θ2 t)1/2 n o   1 2 −1 3/2 −1/2 2 −1 2 −3/2 =− φ θ1 (t − s2 θ2−1 ) θ1 t − s θ2 θ1 + t − s θ2 0 1/2  φ(s)ds < 0. P Let f˜(t; θ3 , . . . , θp ) be the density function of T̃ = pi=3 Zi2 /θi , and then Tθ = T12 + T̃ has Rt the distribution function F (t; θ) = 0 F12 (s; θ1 , θ2 )f˜(t − s; θ3 , . . . , θp )ds. Taking the partial Rt derivatives with respect to θ1 on both sides, we have f1 (t; θ) = 0 (∂F12 (s; θ1 , θ2 )/∂θ1 ) f˜(t − Rt s; θ3 , . . . , θp )ds > 0 and g1 (t; θ) = 0 (∂ 2 F12 (s; θ1 , θ2 )/∂θ12 ) f˜(t − s; θ3 , . . . , θp )ds < 0, which prove the statements a) and b). Now let h(θ1 , θ2 ) = ∂F12 (t; θ1 , θ2 )/∂θ1 as in (8), and fix 0 < a < b with r = b/a > 1. With change of variables u = s(bt)−1/2 followed by ρ = arcsin(u), we obtain 1/2 Z 1 (1 − u2 )1/2 φ((at)1/2 (1 − u2 )1/2 )φ((bt)1/2 u)du 0 Z 1  1/2 −1 = r tπ (1 − u2 )1/2 exp −at(1 − u2 )/2 − btu2 /2 du 0 Z π/2 = r 1/2 tπ −1 cos2 ρ exp(−at cos2 ρ/2 − bt sin2 ρ/2)dρ ≡ r 1/2 tπ −1 Iab . h(a, b) = 2r t 0 Similarly, by switching the order of a and b and with another change of variable η = π/2 − ρ, 12 it follows that h(b, a) = r −1/2 tπ −1 Z π/2 sin2 ρ exp(−at cos2 η/2 − bt sin2 η/2)dη ≡ r −1/2 tπ −1 Iba . 0 Therefore, h(a, b) − h(b, a) −1 ≥ tπ (Iab − Iba ) = tπ −1 Z π/2 cos(2ρ) exp(−at cos2 ρ/2 − bt sin2 ρ/2)dρ 0 = tπ −1 exp{−(a + b)t/4} Z π/2 cos(2ρ) exp{(b − a)t cos(2ρ)/4}dρ Z π/2 2 −1 = (b − a)t (8π) exp{−(a + b)t/4} sin2 (2ρ) exp{(b − a)t cos(2ρ)/4}dρ > 0. 0 (9) 0 Now for f2 (t; θ), let θab = (a, b, θ3 , . . . , θp ) and θba = (b, a, θ3 , . . . , θp ), and then by symmetry we have f2 (t; θab ) = f1 (t; θba ). Hence as a consequence of (9), we finally get f1 (t; θab ) − f2 (t; θab ) = f1 (t; θab ) − f1 (t; θba ) Z t = {h(a, b) − h(b, a)}f˜(t − s; θ3 , . . . , θp )ds > 0, 0 whenever 0 < a < b, which concludes the proof of c). A.2 Proof of Lemma 2 Proof. For simplicity we omit the parameters t, M1 , and M2 in h(·) when no confusion is caused. Let M(λ) = λM1 +(1−λ)M2 be a matrix-valued function dependent on λ, and assume its eigen decomposition is M(λ) = Γ(λ)D(λ)Γ(λ)T , where D(λ) = diag {d1 (λ), . . . , dp (λ)} contains the sorted eigenvalues d1 (λ) ≥ · · · ≥ dp (λ) > 0, and Γ(λ) = (γ1 (λ), . . . , γp (λ)) are the associated eigenvectors. Again we will omit the λ arguments in the relevant quantities above whenever appropriate. Since M −1 = ΓD −1 ΓT , we have h(λ) = pr(Z T ΓD −1 ΓT Z ≤ t) = pr(Z T D −1 Z ≤ t). The 13 d second identity holds since ΓT Z ∼ N(0, ΓT Γ), ΓT Γ = Ip and thus Z = ΓT Z. Therefore, P using the notations in Lemma 1, we have h(λ) = pr( pi=1 Zi2 /di ≤ t) = F (t; δ) where δ = (d1 , . . . , dp ). As a result, h′′ (λ) = p X i=1 "  ∂di gi (t; δ) ∂λ 2 + fi (t; δ)  ∂ 2 di ∂λ2 # (10) , where fi (t; δ) and gi (t; δ) are also defined in Lemma 1. Theorem 9 and Theorem 10 of Lancaster (1964) provide explicit expressions for ∂ 2 di /∂λ2 , where the former assumes di ’s are distinct while the latter considers multiplicity of eigenvalues. For now we shall assume that di ’s are all distinct for brevity of the proof. The same technique applies to the more general case. Let M (k) be the kth derivative of M with respect to λ, then clearly M (1) = M1 − M2 and M (2) = O where O is the zero matrix. Also define pij = γiT M (1) γj = pji , then according to Theorem 9 of Lancaster (1964), p p X X ∂ 2 di p2ik pik pki = 2 . = 2 ∂λ2 di − dk di − dk k=1 k=1 k6=i k6=i Now consider the cumulative sum of eigenvalues from the bottom, defined as ci = whose second derivative is given by p p p X X p2jk ∂ 2 ci X ∂ 2 d j = = 2 ∂λ2 ∂λ2 d − dk j=i j=i k=1 j k6=j p =2 i−1 XX j=i k=1  i−1 X X =2  p j=i X p2jk p2jk + . dj − dk j,k≥i dj − dk k=1 p Pp j=i dj ,  X p2jk  p2jk +  dj − dk k=i dj − dk k6=j (11) j6=k For j 6= k, p2jk (dj − dk )−1 + p2kj (dk − dj )−1 = 0, so the second term in (11) is zero. For the first term, since k < j and hence dj < dk , we conclude that ∂ 2 ci /∂λ2 < 0. 14 With this result, h′′ (λ) in (10) can be written as 2 X  2  p ∂ di ∂di fi (t; δ) + gi (t; δ) h (λ) = ∂λ ∂λ2 i=1 i=1  2  X  2  p p X ∂ di ∂ ci ˜ fi (t; δ) < = fi (t; δ) , 2 ∂λ ∂λ2 i=1 i=1 ′′ p X  (12) where f˜1 = f1 and f˜i = fi − fi−1 for i ≥ 2. The inequality in (12) holds since gi (t; δ) < 0 by part b) of Lemma 1. Moreover, since d1 ≥ · · · ≥ dp , we have f1 ≤ · · · ≤ fp and thus f˜i ≥ 0 by part a) and c) of Lemma 1. This implies that h′′ (λ) < 0 and hence concludes the proof. References Christensen, W. F. & Rencher, A. C. (1997). A comparison of type i error rates and power levels for seven solutions to the multivariate behrens-fisher problem. Communications in Statistics-Simulation and Computation 26, 1251–1273. Eaton, M. L. & Olshen, R. A. (1972). Random quotients and the behrens-fisher problem. The Annals of Mathematical Statistics 43, 1852–1860. Fisher, R. A. (1935). The fiducial argument in statistical inference. Annals of Human Genetics 6, 391–398. Hayter, A. (2013). A new procedure for the behrens–fisher problem that guarantees confidence levels. Journal of Statistical Theory and Practice 7, 515–536. Hsu, P. (1938). Contribution to the theory of "student’s" t-test as applied to the problem of two samples. Statistical Research Memoirs 2, 1–24. Johansen, S. (1980). The welch-james approximation to the distribution of the residual sum of squares in a weighted linear regression. Biometrika 67, 85–92. 15 Kim, S.-H. & Cohen, A. S. (1998). On the behrens-fisher problem: a review. Journal of Educational and Behavioral Statistics 23, 356–377. Krishnamoorthy, K. & Yu, J. (2004). Modified nel and van der merwe test for the multivariate behrens–fisher problem. Statistics & probability letters 66, 161–169. Lancaster, P. (1964). On eigenvalues of matrices dependent on a parameter. Numerische Mathematik 6, 377–387. Magnus, J. R. (1985). On differentiating eigenvalues and eigenvectors. Econometric Theory 1, 179–191. Martin, R. & Liu, C. (2015). Marginal inferential models: Prior-free probabilistic inference on interest parameters. Journal of the American Statistical Association 110, 1621–1631. Mickey, M. R. & Brown, M. B. (1966). Bounds on the distribution functions of the behrens-fisher statistic. The Annals of Mathematical Statistics 37, 639–642. Nel, D. & Van der Merwe, C. (1986). A solution to the multivariate behrens-fisher problem. Communications in Statistics-Theory and Methods 15, 3719–3735. Nel, D. d., van der Merwe, C. A. & Moser, B. (1990). The exact distributions of the univariate and multivariate behrens-fisher statistics with a comparison of several solutions in the univariate case. Communications in Statistics-Theory and Methods 19, 279–298. Olkin, I. & Marshall, A. W. (2016). Inequalities: Theory of majorization and its applications, vol. 143. Academic press. Pan, X., Xu, M., Hu, T. et al. (2013). Some inequalities of linear combinations of independent random variables: Ii. Bernoulli 19, 1776–1789. Rao, C. R. (1973). Linear statistical inference and its applications, vol. 2. Wiley New York. 16 Ruben, H. (2002). A simple conservative and robust solution of the behrens-fisher problem. Sankhyā: The Indian Journal of Statistics, Series A 64, 139–155. Satterthwaite, F. E. (1946). An approximate distribution of estimates of variance components. Biometrics bulletin 2, 110–114. Scheffé, H. (1943). On solutions of the behrens-fisher problem, based on the t-distribution. The Annals of Mathematical Statistics 14, 35–44. Scheffé, H. (1970). Practical solutions of the behrens-fisher problem. Journal of the American Statistical Association 65, 1501–1508. Tsui, K.-W. & Weerahandi, S. (1989). Generalized p-values in significance testing of hypotheses in the presence of nuisance parameters. Journal of the American Statistical Association 84, 602–607. Welch, B. L. (1947). The generalization ofstudent’s’ problem when several different population variances are involved. Biometrika 34, 28–35. Yao, Y. (1965). An approximate degrees of freedom solution to the multivariate behrens fisher problem. Biometrika 52, 139–147. 17
10math.ST
Review: Metaheuristic Search-Based Fuzzy Clustering Algorithms 1 Waleed Alomoush, 2Ayat Alrosan Imam Abdulrahman Bin Faisal University Abstract Fuzzy clustering is a famous unsupervised learning method used to collecting similar data elements within cluster according to some similarity measurement. But, clustering algorithms suffer from some drawbacks. Among the main weakness including, selecting the initial cluster centres and the appropriate clusters number is normally unknown. These weaknesses are considered the most challenging tasks in clustering algorithms. This paper introduces a comprehensive review of metahueristic search to solve fuzzy clustering algorithms problems. Keywords Fuzzy clustering, Metaheuristic search, Local Search. 1. Introduction Fuzzy clustering is a partitional clustering technique that is based on the objects of a fuzzy soft set theory. The fuzzy soft set theory holds the notion that for a given universe of discourse, every object in the universe belongs to a varying degree to all sets defined in the universe [59, 70, 71]. In fuzzy clustering, the universe of discourse is all the objects in the given dataset and the sets defined on the universe are the clusters. Objects are not classified as belonging to one and only one cluster, but instead, they all possess a degree of membership with each of the clusters. Clustering is a unsupervised learning approach that is capable of partitioning identical data objects (patterns) based on some level of similarity, which increases the similarity of objects within a group and decreases the similarity among objects between various groups[13, 15, 37, 38]. Fuzzy clustering has several advantages that make it a preferable clustering algorithm. These advantages are fuzzy natural of FCM provides the algorithm with more information on the given dataset, simple and straightforward programming implementation, suitable for very large datasets since its time complexity is O(n), produces very good results in some conditions (i.e., hyper spherically shaped wellseparated clusters) and robust and is proved to converge to local optimal solution. However, fuzzy clustering has some weaknesses such as the number of clusters in the given dataset should be known a priori, the sensitivity to the cluster centres initialization phase and sensitive to noise and outliers. This paper is organized as follows: section two provides an review of cluster centres Initialization Sensitivity problem; section three provides an review of determining the number of clusters problem and the final section consist of discussion part 2. Cluster Centres Initialization Sensitivity - Local Optima Problem The selecting initial cluster centre value is considered one of the most challenging tasks in partitional clustering algorithms. Since incorrect selection of initial cluster centres values will make the searching process towards an optimal solution that stays in local optima, and therefore produce undesirable clustering result [14, 33]. The main cause of this problem lies in the way that the clustering algorithm works as its run in a manner similar to the hill climbing algorithm [40]. The hill climbing algorithm is a local search-based algorithm that moves in one direction without performing a wider scan of the search space to minimize (or maximize) the objective function. This behaviour prevents the algorithm to explore other regions in the search space which might have a better, or even the desired solution. Figure .1 is a graphical demonstration of the local optimal problem. A common and simple approach to alleviate this problem is to re-run the algorithm several times with several cluster initializations. However, this method is inapplicable in many cases such as a large dataset, or complex dataset (i.e., dataset with multiple optima) [35]. Hence, the use of optimization algorithms in solving clustering problem is preferable. Figure 1. Local optima problem. In the spirit of the main cause of this problem, the local search behaviour, several global based or improved local-based search algorithms were proposed in the last many decades to address this problem [12, 32, 40, 51, 58, 62]. Indeed, these algorithms include local search-based metaheuristic algorithms such as SA, TS or population-based metaheuristic algorithms such as EAs (including Genetic Programming, Evolutionary Programming (EP), Evolutionary Strategies (ES), GAs and DE), HS or swarm intelligence algorithms such as PSO, Bees algorithm, Artificial Bee Colony (ABC) and ACO. More details on metaheuristic approaches are given in Appendix A. The main goals of population-based search algorithms are their capabilities to deal with local optima and explore huge solution spaces effectively by maintaining, recombining and comparing many candidate solutions at the same time. While the local search-based nature inspired algorithms have some advantages over classical local search algorithms in coping with the local optima problem, their results are somehow weak compared with population-based metaheuristic algorithms [20]. The following is an overview of these algorithms proposed to solve clustering problem where the clusters number in known or set up a priori. 2.1 Local Search-based Metaheuristic Clustering Algorithms The local search-based metaheuristic algorithms were used to solve such clustering problem as in the following: In [62], the authors discussed the deal of the clustering problem always solved by the K-means technique . The weakness is obtained local minimum solutions, which are always what the K-means technique performs. The SA method for address optimization problems is proposed for solving the clustering weakness. The factors of the technique are discussed in full detail and it is shown that the technique converges to solution of the clustering weakness. Al-Sultan [1] proposed a clustering technique with a TS heuristic and showed that the proposed technique excel both the K-means technique and the SA-based clustering technique [1]. The author also proposed the same algorithm but for the fuzzy clustering problem [2]. An improved TSbased clustering algorithm was proposed by Sung and Jin [65]. Their proposed technique is a combination of the TS heuristic with two complementary functional procedures, called packing and releasing procedures. The technique was numerically tested for its electiveness in comparison with reference works including the TS algorithm, the K-means technique and the SA technique. These local search metaheuristics, TS and SA, just refine one candidate solution and are weak in coping with local optima. These technique are particularly factors sensitive and tuning is highly problem-dependent [57]. 2.2 Population-based Metaheuristic Clustering Algorithms for Fuzzy Clustering The population-based metaheuristic algorithms have been intensively used to solve such problem for fuzzy clustering. In the following sections, a description of such algorithms based on fuzzy clustering , is presented. Actually, the EAs for fuzzy clustering are somehow normally built upon adaptations of current methods developed for hard clustering. These algorithms can be broadly categorized into two approaches [35]. The first approach which is the most representative one is composed of two steps: first finding the appropriate cluster centres via EA, and secondly, the FCM algorithm performs clustering with initial cluster centre values obtained from the first step. The second approach of evolutionary fuzzy clustering techniques is composed of using the EA as a clustering algorithm by itself. Some of these algorithms use FCM or its variants as a local search engine to support the performance of their algorithm by speeding up their convergence and fine-tuning the evolved solutions that were explored by the evolutionary search. This categorization is also applicable to metaheuristic-based hard clustering algorithms. Some of these algorithms are discussed below: GA-based Fuzzy Clustering: Hall, Bezdek [29], Hall and Ozyurt [31] and Hall, Ozyurt [32]showed that their proposed geneticguided clustering algorithm can be a good clustering tool. GA was used to find the near optimal cluster center values where, FCM/HCM is used to perform the clustering. A real encoding scheme is used to encode cluster centres in GA’s population. A reformulated version of standard c-means’ objective function that exclude partitioning matrix U is used as a fitness function to control the GA’s evolving process. Their proposed method showed a promising result compared with random initialization of FCM/HCM. They also demonstrated that their GA method does not appear to have the capability to produce focused small improvement to the cluster centres to support a final clustering as in FCM/HCM. However, the GA guided clustering technique is very sensitive to the initial random solution that is used to generate an initial population. Furthermore, not enough experiments were conducted that can show the ability of the proposed algorithm to avoid a premature convergence problem. Liu and Xie [45] showed that their proposed genetics-based fuzzy clustering approach have much higher probabilities for reaching the global optimal solutions than the traditional technique. GA is used as a fuzzy clustering algorithm in this study and named as GFCM, while the evolving process was based on using FCM’s objective (i.e., J m (U ,V ) ) function as fitness function. All standard GA’s operators were used with a binary encoding scheme for cluster centres representation in each chromosome. In their experiments, the authors showed that GFCM has better results than FCM; however there is a limitation encountered regarding the local optima problem especially in the small populations. In some cases, GFCM gets stuck in local optimal solution. Van Le [67] proposed two approaches for the fuzzy clustering problem. These approaches are based on GAs and EP respectively. He concluded that these methods succeed in many cases where the FCM algorithm failed, and that the EP method appears to produce the best results. Klawonn and Keller [43] investigated an EA for clustering different types of cluster shapes such as shell and solid clusters (rectangle and cubes). They reported that such algorithm cannot produce promising results for shell shape but can be helpful for the other shapes. No details of the evolutionary clustering algorithm were given however. Egan, Krishnamoorthy [24] proposed a GA-based fuzzy clustering algorithm for noisy data. Their proposed algorithm is different from other GA-based clustering algorithms since it is directed to cluster different levels of noise data. An extra cluster that represents noise data, called noise cluster, is added to each chromosome. The authors reported that the binary representation outperformed a real-valued representation in this domain, while Hall, Ozyurt [32] reported that this conclusion is not documented. Their algorithm showed a good result in case of less noise data compared with the so called robust FCM [22] while in case of noise data, the algorithm performed poorly [32]. Maulik and Saha [51] proposed a modified DEbased fuzzy clustering technique which they named (MoDEFC) [51]. The mutation process of standard DE was modified in this algorithm through the use of the concepts of local and global best vector of PSO algorithm. These concepts were introduced during the mutation process to push the trial vector quickly towards the global optima. Here, the global best (GBest) vector among all DE generations and local best (LBest) vector among current generation are introduced to replace the random selection of these two vectors in the mutation process. Their proposed algorithm was used as an image segmentation algorithm. In addition, several synthetic and real life datasets as well as some benchmark functions were used to show wide applicability of the authors’ proposed algorithm. ACO-based Fuzzy Clustering: The ACO-based clustering algorithm has been proposed by [39] and [40]. Their proposed algorithm uses the concepts of ACO to find near optimal partitions of the data. The proposed method is similar to what has been done in [32]; it compress two phase: first, the algorithm, ants optimization mechanism, is used to find near optimal cluster centrees values, while in the second phase, the algorithm uses these values as the initial canters of cluster for the FCM algorithm to perform the clustering process. As in [32], they used the reformulated FCM’s objective function as a fitness function to control the optimization process of ACO. A set of benchmark data was used in their experiments such as iris, glass, cancer, etc. Promising results were shown compared with FCM algorithm. However, Supratid and Kim [66] showed some limitations of this algorithm regarding Pheromone, t value that is updated without any feedback from the procedure itself. Furthermore, the disconnection between ACS and FCM after ACS find the near optimal cluster centrees may lead to some weaknesses. Supratid and Kim [66] proposed a modified ACO-based fuzzy clustering algorithm which they named (MFAC). Their approach combines ACO, FCM and GA all together. The main idea of the combined this algorithms hinges on the frequently improvement of cluster outcomes. The authors reported that using a GA to optimize the initial clusters for FCM is still unsatisfactory. Since a GA increases just the current better solution, it will thus easily get trapped in local minima. The MFAC algorithm starts by using ACS for the cluster centrees refinement process during which the algorithm calls another procedure named GFCM. This algorithm is a combination between GA and FCM similar to what was proposed in [32]. Therefore, the main difference among the integration implemented in this work and the one done in [40] is that in this algorithm the integration of ACS with FCM occurs many times (through calling GFCM) during the clustering process whilst the integration of ACS with FCM optimizes the FCM initial clusters only once. Depending on the fact that the performance measurement relates to the percentages of accuracy of image retrieval, the researchers’ experimental results showed that their proposed method yields the best outcomes between others in creating fuzzy histogram in image retrieval application. Bee-based Fuzzy Clustering: Pham, Otri [58] proposed a Bees-based fuzzy clustering technique. Their proposed clustering approach exploits the search ability of the Bees Algorithm to control the local optimum weakness of the FCM technique. particularly, the mission is to search for appropriate cluster centres, which are represented as a real number in each bee, such that the FCM’s objective function is minimized. They compared the performance of their proposed algorithm with FCM and GA-based clustering algorithm on some numerical benchmark data. They showed that Bees-based clustering algorithm outperforms the others. Karaboga and Ozturk [42]proposed an ABC algorithm as a fuzzy clustering algorithm. They compared the performance of their proposed algorithm with FCM algorithm on some numerical benchmark data. Their results proved that ABC-based clustering algorithm outperforms FCM algorithm. [7] proposed artificial bee colony based fuzzy clustering algorithms for MRI image segmentation PSO-based Fuzzy Clustering In 2003, Xiao et al. used a new method based on the PSO and the Self Organizing Map (SOM) for clustering the gene expression data [69]. In their proposed method, the rate of convergence is improved by adding a conscience factor to the SOM algorithm. The proposed hybrid SOM/PSO approach uses PSO to develop the weights for SOM. The weights are trained by SOM in the first phase. In the second phase they are improved by PSO. The authors could achieve promising outcomes by applying the hybrid SOM-PSO approach over the gene expression data of Yeast and Rat Hepatocytes. Cui, Potok [19] and Cui and Potok [18] proposed a PSO based hybrid algorithm for classifying the text documents. The hybridization step is basically a two-step clustering approach where in the first step the PSO performs clustering until the maximum number of iterations is exceeded. Then in the second step the k-means algorithm is initialized with cluster centers obtained from the first step and then performs the final clustering procedure. This combination of the two steps is meant to improve the PSO performance and speed up its convergence especially in the case of large datasets. The authors applied the K-means, PSO and a hybrid PSO clustering technique on four different text document datasets and their outcomes clarify that the hybrid PSO technique can generate high compact clustering outcomes over a short span of time than the K-means algorithm. HS-based Fuzzy Clustering: Recently, the HS algorithm has been used for clustering problems as reported by Ingram and Zhang [36]. many researchers combined FCM algorithms with HS (FCM/HCM) in one framework such as Ayvaz [8] who combined HS with FCM to estimate the region structure and region transmissivities for a heterogeneous aquifer, Forsati, Mahdavi [26] and Mahdavi, Chehreghani [47] both developed the performance of HS for web documents clustering using the integration of k-means technique as a local search formed. This is done use calling k-means technique a few times then k-means obtained the clustering and the returned vector is added to HM if it has a best objective value than those in HM. In the same year; Fuzzy classification of the Fisher Iris dataset was fulfillment by Wang, Gao [68]. Initial classification was obtained by the (FCM) algorithm then the optimization of the fuzzy membership functions was calculated by a new hybrid HS-Clonal Selection Algorithm (CSA) approach. In 2008 also; Malaki, Pourbaghery [49] improved two hybrid IHSFCM clustering approach, which have been tested on a 58,000 elements NASA radiator dataset. In their proposed approach, the authors used the improved version of HS that was proposed by Mahdavi, Fesanghary [48] (IHS), in addition; they integrated it with FCM algorithm to develop its accomplishment. FCM in fact is integrated in two methods: first, it is integrated into IHS as a local search formed to maximize the convergence speed similar to what was employed by Mahdavi, Chehreghani [47]. This way is named (FHSClust). In the second method, FCM is used as a further final clustering phase to improve the partitioning outcomes, where it is created by the best solution vector improvised in FHS Clust. Alia, Mandava [4] proposed a new approach to tackle the well-known fuzzy c-means (FCM) initialization problem. This approach uses a metaheuristic search method called Harmony Search (HS) algorithm to produce near-optimal initial cluster centers for the FCM algorithm. To demonstrate the effective this approach by a MRI segmentation problem. The experiments indicate encouraging results in producing stable clustering for the given problem as compared to using an FCM with randomly initialized cluster centers. FA-based Fuzzy Clustering: Senthilnath, Omkar [63] employed FA for the purpose of clustering data objects into groups as per the values of their attributes. The performance of FA for clustering was then compared with those of other nature-inspired algorithms such as artificial bees colony (ABC) and particle swarm intelligence (PSO). The comparison also looked into the performance of nine other algorithms and approaches as utilized in the established literature on the 13 test data sets specified in [42]. The main performance criteria exploited for the purpose of comparison was the classification error percentage (CEP). CEP can be defined as the ratio of the number of misclassified samples in the test data set to the total number of samples in the same set. After extensive testing the researchers surmised that FA was the most effective method for clustering. [5, 6] proposed the fuzzy clustering algorithm using hybrid the firefly algorithm FA with fuzzy c-means algorithm FCM which is called FFCM to produce a new segmentation method for real and simulated MRI brain images 3 Determining the Number of Clusters Partitional clustering techniques suppose that the clusters number in unlabelled data is known and specified a priori by the user. Generally, this number is unknown, especially for high d-dimensional data, where visual investigation is inapplicable [3, 12, 22]. Indeed, selecting the convenient clusters number is a non- easy task and can lead to undesirable outcomes if inaccurate executed. Thus, several research were proposed to solve this matter GA-based Dynamic Clustering: Maulik and Bandyopadhyay proposed an algorithm named FVGA for automatic determination of an appropriate number of clusters with the corresponding fuzzy clustering results [50]. In their proposed algorithm FVGA, they used GA associated by XB cluster validity index as a fitness function to determine which chromosome will be evolved. This algorithm uses a real scheme to encode each candidate partition such that each genotype (chromosome) contains candidate cluster centres. To enable FVGA to determine the appropriate number of cluster centres, the authors used a variable length concept for each chromosome where each chromosome in the population can encode a different number of cluster centres. Thus, each chromosome has a number of cluster centres ranged over predefined values [min, max]. Furthermore, the single point crossover operator is used and modified in this study to guarantee that the offspring has at least two cluster centres (the minimum value of the range). The other GA operator, mutation operator, is subjected to each gene (cluster centre) in the chromosome when it is within the mutation probability mm. Finally, FVGA is hybridized with one step recalculating of clustering centres using the FCM’s cluster centre Eq. 5.10 as a mechanism to fine-tune each candidate partition. The hard version of FVGA can be found in [9, 12] under genetic clustering for unknown K (GCUK-clustering). The GCUK algorithm is the same as FVGA except that it used the DB index [23] as an objective function. In the same context, Pakhira, Bandyopadhyay [55] slightly modified the same algorithm by fixing the length of each chromosome through making its length equal to a predefined expected maximum number of clusters in the given dataset, while at the same time maintaining the idea of variable length. This is presented by incorporating the concept of empty gene in the chromosome that is represented by using the expression of ‘don’t care’. The other GA operators are the same as original FVGA except that the selection process changed to tournament of size 2. The main objective of this research is to evaluate FVGA with a variety of cluster validity indices (PC, PE, XB and PBMF). In addition, another comparison between FVGA [50], FCM and GGAFCM [32] was conducted based on measuring the performance of these algorithms in terms of validity indices. They demonstrated that the PBMF cluster validity index is better able to indicate the appropriate clusters number in a dataset irrespective of the source clustering algorithms used. Furthermore, they found that the efficiency of FVGA approach is to be comparable to, always better than the classical FCM technique and GGAFCM approach. However, FVGA in both researches[56] and[50] has some limitations as follows: The standard GA operators such as single point crossover and mutation may lead to an invalid solution in terms of region density representation (e.g., representing a region with low data density or the same number of cluster centre but with repeated centre values) that may affect the speed of convergence or the quality of the solution. This problem is highlighted by [35]and named “context- insensitivity”. This term “context-insensitivity” means as in [25] that “the schemata defined on the genes of the simple chromosome do not convey useful information that could be exploited by the implicit sampling process carried out by a clustering genetic algorithm”. In general, standard GA operators are usually not clustering oriented and should be modified to be more suitable for these types of problems [25, 35]. Saha and Bandyopadhyay proposed a new fuzzy dynamic clustering algorithm known as FuzzyVGAPS [60, 61]. This new algorithm is, in fact, based on the same basis of FVGA algorithm [50, 55] except for some modifications made to the objective function used in calculating the quality of the evolved chromosomes as well as some modifications to the GA operators. For the objective function, they used a new point symmetry-based index called fuzzy Symindex which is the fuzzy version of Sym-index proposed by the same authors in [11, 60]. This index is actually a modified version of the original PSindex proposed by [16, 17]. Furthermore, the membership grade for each data point to a particular cluster centre is calculated based on a conditional parameter called Q to use either a point symmetry distance or Euclidean distance. The probabilities of mutation and crossover operators are selected adaptively as in [64]. The hard version of this algorithm (Fuzzy-VGAPS) can be found in [11] under (VGAPS) name. VGAPS is similar to FuzzyVGAPS except that VGAPS used the hard version of the objective function named Sym-index. The outcomes of the Fuzzy-VGAPS are compared with those performed by other technique consist of both crisp and fuzzy techniques on four real-life datasets and four artificial consist of magnetic resonance image (MRI) brain with multiple sclerosis lesions. Despite the promising results compared with other algorithms, Fuzzy-VGAPS still has some limitations listed as follows: • Fuzzy-VGAPS will probably fail if the clusters do not have (symmetry) property since the similarity measure used in this algorithm is based on this feature [10]. • The fixed near value (which is the unique nearest neighbour of symmetric point used in this algorithm) may lead to many drawbacks. • Fuzzy-VGAPS is still very time consuming [41]. • Fuzzy-VGAPS has the same limitations of GA operators as mentioned for FVGA algorithm. DE-based Dynamic Clustering: Das and Konar [21] proposed a new algorithm for fuzzy dynamic clustering with application to the image segmentation problem. Their proposed algorithm named (AFDE) is based on DE optimization algorithm. AFDE is applied to six different types of images including MRI brain image, natural image, and satellite image. PS index [16, 17] was used as an objective functions to evaluate the solutions generated during the evolution process. In this study, the authors modify the standard DE algorithm in a way to be more suitable for the dynamic clustering problem and at the same time avoid the traditional EAs problem known as stagnation and/or premature convergence. For the later, the authors first modified the mutation constant factor ‘F’ and made it randomly ranged between 0.5 and 1. Secondly, instead of being fix during the evolving process, the crossover rate Cr value has been modified to be variable, therefore, started from rate value 1 and linearly decreased till it reached the minimum acceptable value which is 0.5 over the time. For the former, the authors modified the chromosome representation in a way that can make the AFDE dynamically determine the appropriate number of clusters that the dataset may have. Each chromosome encode (using real encoding as original DE) a candidate number of cluster centres where the length of it is determined previously by user, which represents the expected maximum number of cluster centrees that the test dataset may possess. The hard version of this algorithm (AFDE) can be found in [20] named as ACDE. ACDE is the same as AFDE except that ACDE use different objective function named the CS index [17] and also they used the DB index [23] as an alternative option. A new variant of ACDE is proposed by Gong, Cai [27] named ACDEPS, where the authors used the same framework as ACDE except for the objective function. They replaced the CS index [17] with slight modification on Symindex [11] in calculating the fitness function of each evolved chromosome. Limitations of AFDE: The objective function (PS index) that is used in AFDE has some limitations and may lead to undesirable results as reported by [10]. These limitations are summarized as follows: • The computational load required by PS index is O ( c.n 2 ) that becomes very expensive as the • number of cluster centrees c and data points n increase [10, 20] (e.g., in case of 512512 image, the number of pixels = 262144). The PS validity index may produce unwished for clustering results. This is because the PS index may fail to determine the proper cluster centrees for data point when the clusters themselves are symmetrical with respect to some intermediate point [10]. ACO-based Dynamic Clustering: A dynamic fuzzy clustering algorithm based on ACO was proposed by Gu and Hall [28]. They replace the Euclidean distance that is normally used as similarity measurement in FCM with kernel-induced distance metric. This modification is used to overcome the FCM shortcoming when the cluster shapes are not hyper-spherical. A reformulated kernel induced distance-based XB index is proposed in this study for measuring the improvement of the optimization process (i.e., fitness function). The reformulated version is based merely on calculating cluster centres and excludes calculating membership matrix U. The coordinate of ants to move centres of cluster in feature space to explore for optimal cluster centres. Promising results were obtained by applying the ACO-based clustering algorithm over three datasets, the Iris data, an artificial five classes dataset and a one feature MRI image with three classes (i.e., CSF, WM, and GM). The same technique was also proposed by Hall and Kanade [30], a swarm based fuzzy clustering technique by the XB partition validity metric, which find the clusters number wonderful for many datasets. They keep the Euclidean distance as a similarity measurement instead of using kernel-induced distance metric as in [28]. The XB validity metric used in this work was based on the modified objective function of the FCM algorithm, where the membership matrix does not need to be computed [34]. PSO-based Dynamic Clustering: Omran et al. came up with an automatic hard clustering algorithm known as (DCPSO) [52-54]. The algorithm starts by partitioning the dataset into a relatively huge clusters number to decrease the influence of the initialization. By binary PSO, an optimal clusters number is chose. Various cluster validity indices such as Dunn index, S Dbw index and Turi index have been used as an objective function to measure the evolving process. Finally, the centreoids of the selection clusters are refined by the Kmeans technique. The authors applied the method for segmentation of multi-spectral, natural, synthetic images. They compared the performance of their proposed algorithm with unsupervised fuzzy approach (UFA) [46], the SOM approach [44], dynamic clustering using (DCGA), and dynamic clustering using random search (DCRS). They demonstrated that PSO-based dynamic clustering algorithm outperforms the others. HS-based Dynamic Clustering : Alia, Mandava [3] present a new dynamic clustering algorithm based on the hybridization of harmony search (HS) and fuzzy c-means to automatically segment MRI brain images in an intelligent manner. In this approach, the capability of standard HS is modified to automatically evolve the appropriate number of clusters as well as the locations of cluster centrees. By incorporating the concept of variable length encoding in each harmony memory vector, this algorithm is able to represent variable numbers of candidate cluster centrees at each iteration. Evaluation of the proposed algorithm has been performed using both real MRI data obtained from the Centree for Morphometric Analysis at Massachusetts General Hospital and simulated MRI data generated using the McGill University BrainWeb MRI simulator. Experimental results show the ability of this algorithm to find the appropriate number of naturally occurring regions in brain images. Furthermore, the superiority of the proposed algorithm over various state-of-the-art segmentation algorithms is demonstrated quantitatively. 4 Discussion It is evident from the literature mentioned above that the metaheuristic -based algorithms are efficient in tackling the local optima problem of the partitional clustering. However, since these algorithms are heuristic and do not have any mathematical basis to support them when they are first introduced, their performance is proven through extensive experimentation. The challenge is in adapting them to the domain. Since their proof is through experimentation, researchers go a step further to continuously try several variations and combinations that may further improve the performance of these algorithms. This is clear from the GA-based clustering algorithms mentioned above where various modifications have been introduced. These modifications are even based on the optimization behavior, i.e., balancing between exploitation and exploration, of the algorithm by incorporating some local search mechanism or through using various evolving techniques such as encoding schemes (i.e., real or binary), selection mechanism or crossover and mutation operators. Furthermore, an investigation of the new metaheuristic algorithms to solve the optimization problems is also a target of the research committee even to prove its applicability or to improve solutions of these problems a bit further. Based on what has been discussed earlier, there are three approaches that have been proposed in the literature to overcome the limitation of partitional clustering where the appropriate number of clusters in the given dataset is unknown a priori. However, metaheuristic based algorithms proved their capacity to solve such problem while the others have remained helpless as aforementioned. This is because metaheuristic algorithms are able to cope with local optima and explore large solution spaces with the ability to facilitate the prediction of the appropriate number of clusters in the given dataset. To cope with a different number of clusters, a modification to the solution representation in metaheuristic algorithm takes place with a utilization of cluster validity indices as an objective function. Despite the encouraging results obtained from the metaheuristic approach, it is evident from the literature mentioned above and from what has been reported in [35]that such approach is still in its early stage since the number of published articles is meager. Looking into these algorithms and into the foundations upon which they were based one can say that the competition in improving the performance of these algorithms for solving the clustering problem was the goal behind these developments. These developments were based on improving the natural behaviour of the optimization process of these algorithms. For instance, balancing between the exploration and exploitation strategies of metaheuristic algorithms is one way of improving the metaheuristic-based clustering algorithms. Also using various evolving techniques such as encoding schemes (i.e., real or binary), selection mechanism or crossover and mutation operators is another way of modifying these algorithms to improve their performance and accuracy. Furthermore, an investigation into the new metaheuristic algorithms to solve such problem is also another way to improve them. All of that is based on one fact about the metaheuristic approach that there is no available exact solution in such categories, therefore researchers go a step further to continuously try several variations and combinations that may further improve the performance of these algorithms. References 1. 2. 3. 4. 5. 6. 7. Al-Sultan K S, "A tabu search approach to the clustering problem", Pattern Recognition, vol. 28, n. 9, pp. 14431451, 1995. Al-Sultan K S. and Fedjki C A, "A tabu search-based algorithm for the fuzzy clustering problem", Pattern Recognition, vol. 30, n. 12, pp. 2023-2030, 1997. Alia O d., Mandava R., and Aziz M, "A hybrid harmony search algorithm for MRI brain segmentation", Evolutionary Intelligence, vol. 4, n. 1, pp. 31-49, 2011. Alia O M., Mandava R., Ramachandram D., and Aziz M E, "Harmony searchbased cluster initialization for fuzzy cmeans segmentation of MR images", TENCON 2009 - 2009 IEEE Region 10 Conference, pp. 1-6, 2009. Alomoush W., ABDULLAH S N H S., SAHRAN S., and HUSSAIN R I, "MRI BRAIN SEGMENTATION VIA HYBRID FIREFLY SEARCH ALGORITHM", Journal of Theoretical & Applied Information Technology, vol. 61, n. 1, 2014. Alomoush W K., Abdullah S N H S., Sahran S., and Hussain R I, "Segmentation of MRI Brain Images Using FCM Improved by Firefly Algorithms", Journal of Applied Sciences, vol. 14, n. 1, 2014. Alrosan a., Norwawi N., Ismail w., and Alomoush W, "Artificial bee colony based fuzzy clustering algorithms for MRI image segmentation", InternationalConference on Advances in 8. 9. 10. 11. 12. 13. 14. Computer Science and Electronics Engineering, pp. 225-228, 2014. Ayvaz M T, "Simultaneous determination of aquifer parameters and zone structures with fuzzy c-means clustering and meta-heuristic harmony search algorithm", Advances in Water Resources, vol. 30, n. 11, pp. 23262338, 2007. Bandyopadhyay S. and Maulik U, "Nonparametric genetic clustering: comparison of validity indices", Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE Transactions on, vol. 31, n. 1, pp. 120125, 2001. Bandyopadhyay S. and Saha S, "GAPS: A clustering method using a new point symmetry-based distance measure", Pattern Recognition, vol. 40, n. 12, pp. 3430-3451, 2007. Bandyopadhyay S. and Saha S, "A point symmetry-based clustering technique for automatic evolution of clusters", Knowledge and Data Engineering, IEEE Transactions on, vol. 20, n. 11, pp. 1441-1457, 2008. Bandyopadhyay S. and Saha S, "Clustering Algorithms", in Unsupervised Classification, Springer, p. 75-92, 2013. Bezdek J C, "Pattern Recognition with Fuzzy Objective Function Algorithms", vol.: Kluwer Academic Publishers, 256, 1981, Bezdek J C., Hathaway R J., Sabin M J., and Tucker W T, "Convergence theory for fuzzy c-means: counterexamples and repairs", Systems, Man and Cybernetics, 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. IEEE Transactions on, vol. 17, n. 5, pp. 873-877, 1987. Bsoul Q W. and Mohd M, "Effect of ISRI stemming on similarity measure for arabic document clustering", SpringerVerlag, p. 584-593, 2011. Chou C-H., Su M-C., and Lai E, "A new cluster validity measure for clusters with different densities", IASTED International Conference on Intelligent Systems and Control, pp. 276-281, 2003. Chou C-H., Su M-C., and Lai E, "A new cluster validity measure and its application to image compression", Pattern Analysis and Applications, vol. 7, n. 2, pp. 205-220, 2004. Cui X. and Potok T E, "Document clustering analysis based on hybrid PSO+ K-means algorithm", Journal of Computer Sciences (special issue), vol. 27, n. pp. 33, 2005. Cui X., Potok T E., and Palathingal P, "Document clustering using particle swarm optimization", Swarm Intelligence Symposium, 2005. SIS 2005. Proceedings 2005 IEEE, pp. 185-191, 2005. Das S., Abraham A., and Konar A, "Particle swarm optimization and differential evolution algorithms: technical analysis, applications and hybridization perspectives", in Advances of Computational Intelligence in Industrial Systems, Springer, p. 1-38, 2008. Das S. and Konar A, "Automatic image pixel clustering with an improved differential evolution", Applied Soft Computing, vol. 9, n. 1, pp. 226-236, 2009. Dave R N, "Characterization and detection of noise in clustering", Pattern Recognition Letters, vol. 12, n. 11, pp. 657-664, 1991. Dave R N, "Validating fuzzy partitions obtained through c-shells clustering", Pattern Recognition Letters, vol. 17, n. 6, pp. 613-623, 1996. Egan M., Krishnamoorthy M., and Rajan K, "Comparative study of a genetic fuzzy c-means algorithm and a validity guided fuzzy c-means algorithm for locating clusters in noisy data", Evolutionary 25. 26. 27. 28. 29. 30. 31. 32. Computation Proceedings, 1998. IEEE World Congress on Computational Intelligence., The 1998 IEEE International Conference on, pp. 440445, 1998. Falkenauer E, "Genetic algorithms and grouping problems", vol.: John Wiley & Sons, Inc., 1998, Forsati R., Mahdavi M., Kangavari M., and Safarkhani B, "Web page clustering using harmony search optimization", Electrical and Computer Engineering, 2008. CCECE 2008. Canadian Conference on, pp. 001601-001604, 2008. Gong W., Cai Z., Ling C X., and Huang B, "A Point Symmetry-Based Automatic Clustering Approach Using Differential Evolution", in Advances in Computation and Intelligence, Springer, p. 151-162, 2009. Gu Y. and Hall L O, "Kernel based fuzzy ant clustering with partition validity", Fuzzy Systems, 2006 IEEE International Conference on, pp. 61-65, 2006. Hall L., Bezdek J., Boggavarpu S., and Bensaid A, "Genetic fuzzy clustering", Fuzzy Information Processing Society Biannual Conference, 1994. Industrial Fuzzy Control and Intelligent Systems Conference, and the NASA Joint Technology Workshop on Neural Networks and Fuzzy Logic, pp. 411-415, 1994. Hall L O. and Kanade P M, "Swarm based fuzzy clustering with partition validity", Fuzzy Systems, 2005. FUZZ'05. The 14th IEEE International Conference on, pp. 991-995, 2005. Hall L O. and Ozyurt B, "Scaling genetically guided fuzzy clustering", Proceedings of ISUMA-NAFIPS'95 The Third International Symposium on Uncertainty Modeling and Analysis and Annual Conference of the North American Fuzzy Information Processing Society, pp. 328-332, 1995. Hall L O., Ozyurt I B., and Bezdek J C, "Clustering with a genetically optimized approach", Evolutionary Computation, IEEE Transactions on, vol. 3, n. 2, pp. 103-112, 1999. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. Hathaway R J. and Bezdek J C, "Local convergence of the fuzzy C-Means algorithms", Pattern Recognition, vol. 19, n. 6, pp. 477-480, 1986. Hathaway R J. and Bezdek J C, "Optimization of clustering criteria by reformulation", Fuzzy Systems, IEEE Transactions on, vol. 3, n. 2, pp. 241245, 1995. Hruschka E R., Campello R J G B., Freitas A A., and De Carvalho A P L F, "A survey of evolutionary algorithms for clustering", Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE Transactions on, vol. 39, n. 2, pp. 133-155, 2009. Ingram G. and Zhang T, "Overview of Applications and Developments in the Harmony Search Algorithm", in MusicInspired Harmony Search Algorithm, Z. Geem, Editor, Springer Berlin Heidelberg, p. 15-37, 2009. Jain A K, "Data clustering: 50 years beyond K-means", Pattern Recognition Letters, vol. 31, n. 8, pp. 651-666, 2010. Jain A K., Murty M N., and Flynn P J, "Data clustering: a review", ACM Comput. Surv., vol. 31, n. 3, pp. 264323, 1999. Kanade P M. and Hall L O, "Fuzzy ant clustering by centroid positioning", Fuzzy Systems, 2004. Proceedings. 2004 IEEE International Conference on, pp. 371-376, 2004. Kanade P M. and Hall L O, "Fuzzy Ants and Clustering", Systems, Man and Cybernetics, Part A: Systems and Humans, IEEE Transactions on, vol. 37, n. 5, pp. 758-769, 2007. Kannan S., Sathya A., and Ramathilagam S, "Effective fuzzy clustering techniques for segmentation of breast MRI", Soft Computing, vol. 15, n. 3, pp. 483-491, 2011. Karaboga D. and Ozturk C, "A novel clustering approach: Artificial Bee Colony (ABC) algorithm", Applied Soft Computing, vol. 11, n. 1, pp. 652-657, 2011. Klawonn F. and Keller A, "Fuzzy clustering with evolutionary algorithms", 44. 45. 46. 47. 48. 49. 50. 51. 52. International Journal of Intelligent Systems, vol. 13, n. 10-11, pp. 975991, 1998. Kohonen T, "Self-organizing maps", vol. 30: Springer, 2001, Liu J. and Xie W, "A genetics-based approach to fuzzy clustering", Fuzzy Systems, 1995. International Joint Conference of the Fourth IEEE International Conference on Fuzzy Systems and The Second International Fuzzy Engineering Symposium., Proceedings of 1995 IEEE International Conference on, pp. 2233-2240, 1995. Lorette A., Descombes X., and Zerubia J, "Fully unsupervised fuzzy clustering with entropy criterion", Pattern Recognition, 2000. Proceedings. 15th International Conference on, pp. 986-989, 2000. Mahdavi M., Chehreghani M H., Abolhassani H., and Forsati R, "Novel meta-heuristic algorithms for clustering web documents", Applied Mathematics and Computation, vol. 201, n. 1, pp. 441-451, 2008. Mahdavi M., Fesanghary M., and Damangir E, "An improved harmony search algorithm for solving optimization problems", Applied mathematics and computation, vol. 188, n. 2, pp. 15671579, 2007. Malaki M., Pourbaghery J., and Abolhassani H, "A combinatory approach to fuzzy clustering with harmony search and its applications to space shuttle data", SCIS & ISIS, pp. 1721, 2008. Maulik U. and Bandyopadhyay S, "Fuzzy partitioning using a real-coded variablelength genetic algorithm for pixel classification", Geoscience and Remote Sensing, IEEE Transactions on, vol. 41, n. 5, pp. 1075-1081, 2003. Maulik U. and Saha I, "Modified differential evolution based fuzzy clustering for pixel classification in remote sensing imagery", Pattern Recognition, vol. 42, n. 9, pp. 21352149, 2009. Omran M., Engelbrecht A P., and Salman A, "Particle Swarm Optimization Method For Image Clustering ", International 53. 54. 55. 56. 57. 58. Journal of Pattern Recognition and Artificial Intelligence, vol. 19, n. 03, pp. 297-321, 2005. Omran M., Salman A., and Engelbrecht A, "Dynamic clustering using particle swarm optimization with application in unsupervised image classification", Fifth World Enformatika Conference (ICCI 2005), Prague, Czech Republic, pp. 199204, 2005. Omran M G., Salman A., and Engelbrecht A P, "Dynamic clustering using particle swarm optimization with application in image segmentation", Pattern Analysis and Applications, vol. 8, n. 4, pp. 332-344, 2006. Pakhira M K., Bandyopadhyay S., and Maulik U, "Validity index for crisp and fuzzy clusters", Pattern Recognition, vol. 37, n. 3, pp. 487-501, 2004. Pakhira M K., Bandyopadhyay S., and Maulik U, "A study of some fuzzy cluster validity indices, genetic clustering and application to pixel classification", Fuzzy sets and systems, vol. 155, n. 2, pp. 191-214, 2005. Paterlini S. and Krink T, "Differential evolution and particle swarm optimisation in partitional clustering", Computational Statistics & Data Analysis, vol. 50, n. 5, pp. 1220-1247, 2006. Pham D., Otri S., Afify A., Mahmuddin M., and Al-Jabbouli H, "Data clustering using the bees algorithm", Computing: Theory and Applications, 2007. ICCTA'07. International Conference on pp. 516-522, 2007. 59. Ross T J, "Fuzzy logic with engineering applications", vol.: John Wiley & Sons, 2009, 60. Saha S. and Bandyopadhyay S, "A fuzzy genetic clustering technique using a new symmetry based distance for automatic evolution of clusters", Computing: Theory and Applications, 2007. ICCTA'07. International Conference on, pp. 309-314, 2007. 61. Saha S. and Bandyopadhyay S, "A new point symmetry based fuzzy genetic clustering technique for automatic 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. evolution of clusters", Information Sciences, vol. 179, n. 19, pp. 32303246, 2009. Selim S Z. and Alsultan K, "A simulated annealing algorithm for the clustering problem", Pattern Recognition, vol. 24, n. 10, pp. 1003-1008, 1991. Senthilnath J., Omkar S N., and Mani V, "Clustering using firefly algorithm: Performance study", Swarm and Evolutionary Computation, vol. 1, n. 3, pp. 164-171, 2011. Srinivas M. and Patnaik L M, "Adaptive probabilities of crossover and mutation in genetic algorithms", Systems, Man and Cybernetics, IEEE Transactions on, vol. 24, n. 4, pp. 656-667, 1994. Sung C S. and Jin H W, "A tabu-searchbased heuristic for clustering", Pattern Recognition, vol. 33, n. 5, pp. 849858, 2000. Supratid S. and Kim H, "Modified fuzzy ants clustering approach", Applied Intelligence, vol. 31, n. 2, pp. 122134, 2009. Van Le T, "Evolutionary fuzzy clustering", Evolutionary Computation, 1995., IEEE International Conference on, pp. 753-758, 1995. Wang X., Gao X Z., and Ovaska S J, "A hybrid optimization method for fuzzy classification systems", Hybrid Intelligent Systems, 2008. HIS'08. Eighth International Conference on, pp. 264271, 2008. Xiao X., Dow E R., Eberhart R., Miled Z B., and Oppelt R J, "Gene clustering using self-organizing maps and particle swarm optimization", Parallel and Distributed Processing Symposium, 2003. Proceedings. International, pp. 10 pp., 2003. Zadeh L A, "Is there a need for fuzzy logic?", Information Sciences, vol. 178, n. 13, pp. 2751-2779, 2008. Zanaty E A., Aljahdali S., and Debnath N C, "Improving Fuzzy Algorithms for Automatic Magnetic Resonance Image Segmentation", SEDE, pp. 61-67, 2008.
9cs.NE
arXiv:1303.2209v4 [math.ST] 23 Jun 2016 Bernoulli 22(4), 2016, 2401–2441 DOI: 10.3150/15-BEJ733 Aggregation of autoregressive random fields and anisotropic long-range dependence DONATA PUPLINSKAITĖ1 and DONATAS SURGAILIS2 1 Faculty of Mathematics and Informatics, Vilnius University, Naugarduko 24, LT-03225 Vilnius, Lithuania. E-mail: [email protected] 2 Institute of Mathematics and Informatics, Vilnius University, Akademijos 4, LT-08663 Vilnius, Lithuania. E-mail: [email protected] We introduce the notions of scaling transition and distributional long-range dependence for stationary random fields Y on Z2 whose normalized partial sums on rectangles with sides growing at rates O(n) and O(nγ ) tend to an operator scaling random field Vγ on R2 , for any γ > 0. The scaling transition is characterized by the fact that there exists a unique γ0 > 0 such that the scaling limits Vγ are different and do not depend on γ for γ > γ0 and γ < γ0 . The existence of scaling transition together with anisotropic and isotropic distributional long-range dependence properties is demonstrated for a class of α-stable (1 < α ≤ 2) aggregated nearestneighbor autoregressive random fields on Z2 with a scalar random coefficient A having a regularly varying probability density near the “unit root” A = 1. Keywords: α-stable mixed moving average; autoregressive random field; contemporaneous aggregation; isotropic/anisotropic long-range dependence; lattice Green function; operator scaling random field; scaling transition 1. Introduction Following Biermé et al. [7], a scalar-valued random field (RF) V = {V (x); x ∈ Rν } is called operator scaling random field (OSRF) if there exist a H > 0 and a ν × ν real matrix E whose all eigenvalues have positive real parts, such that for any λ > 0 f.d.d. {V (λE x); x ∈ Rν } = {λH V (x); x ∈ Rν }. (1.1) (See the end of this section for all unexplained notation.) In the case when E = I is the unit matrix, (1.1) agrees with the definition of H-self-similar random field (SSRF), the latter referred to as self-similar process when ν = 1. OSRFs may exhibit strong anisotropy and play an important role in various physical theories; see [7] and the references therein. Several classes of OSRFs were constructed and discussed in [7, 9]. This is an electronic reprint of the original article published by the ISI/BS in Bernoulli, 2016, Vol. 22, No. 4, 2401–2441. This reprint differs from the original in pagination and typographic detail. 1350-7265 c 2016 ISI/BS 2 D. Puplinskaitė and D. Surgailis It is well known that the class of self-similar processes is very large, SSRFs and OSFRs being even more numerous. According to a popular view, the “value” of a concrete selfsimilar process depends on its “domain of attraction”. In the case ν = 1, the domain of attraction of a self-similar stationary increment process V = {V (τ ); τ ≥ 0} is defined in [31] as the class of all stationary processes Y = {Y (t); t ∈ Z+ } whose normalized partial sums tend to V in the distributional sense, namely, Bn−1 [nτ ] X t=1 f.d.d. Y (t) −→ V (τ ), τ ∈ R+ , n → ∞. (1.2) The classical Lamperti’s theorem [31] says that in the case of (1.2), the normalizing constants Bn necessarily grow as nH (modulus a slowly varying factor) and the limit random process in (1.2) is H-self-similar. The limit process V in (1.2) characterizes largescale and dependence properties of Y , leading to the important concept of distributional short/long memory originating in Cox [10]; see also ([11], pages 76–77), [22, 41–44]. There exists a large probabilistic literature devoted to studying the partial sums limits of various classes of strongly and weakly dependent processes and RFs. In particular, several works [12, 13, 16, 32, 36, 47] discussed the partial sums limits of (stationary) RFs indexed by t ∈ Zν : X f.d.d. Bn−1 Y (t) −→ V (x), x = (x1 , . . . , xν ) ∈ Rν+ , n → ∞, (1.3) t∈K[nx] where K[nx] := {t = (t1 , . . . , tν ) ∈ Zν : 1 ≤ ti ≤ nxi } is a sequence of rectangles whose all sides increase as O(n). Related results for Gaussian or linear (shot-noise) and their subordinated RFs, with a particular focus on large-time behavior of statistical solutions of partial differential equations, were obtained in [1, 2, 35–37]. See also the recent paper Anh et al. [3] and the numerous references therein. Most of the above mentioned studies deal with “nearly isotropic” models of RFs characterized by a single memory parameter H and a limiting SSRF {V (x)} in (1.3). Similarly as in the case of random processes indexed by Z, stationary RFs usually exhibit two types of dependence: weak dependence and strong dependence. The second type of dependence is often called long memory or long-range dependence (LRD). Although there is no single satisfactory definition of LRD, usually it refers to a stationary RF Y having an unbounded spectral density f : supx∈[−π,π]ν f (x) = ∞ or a non-summable P | cov(Y (0), Y (t))| = ∞; see [5, 13, 15–17, 21, 32]. The auto-covariance function: ν t∈Z above definitions of LRD do not apply to RFs with infinite variance and are of limited use since these properties are very hard to test in practice. On the other hand, the characterization of LRD based on partial sums as in the case of distributional long memory is directly related to the asymptotic distribution of the sample mean. As noted in [27], in many applications the auto-covariance of RF decays with different exponents (Hurst indices) Qν in different directions. In the latter case, the partial sums of such RF on rectangles i=1 [1, ni ] may grow at different rate with ni → ∞, leading to a limiting anisotropic OSRF. Aggregation of autoregressive random fields 3 The present paper attempts a systematic study of anisotropic distributional long-range dependence, by exhibiting some natural classes of RFs whose partial sums tend to OSRFs. Our study is limited to the case ν = 2 and RFs with anisotropy along the coordinate axes and a diagonal matrix E. Note that for ν = 2 and E = diag(1, γ), 0 < γ 6= 1, relation (1.1) f.d.d. writes as {V (λx, λγ y)} = {λH V (x, y)}, or f.d.d. {λV (x, y); (x, y) ∈ R2 } = {V (λ1/H x, λγ/H y); (x, y) ∈ R2 } ∀λ > 0. (1.4) The OSRFs V = Vγ depending on γ > 0 are obtained by taking the partial sums limits n−H(γ) X f.d.d. (t,s)∈K[nx,nγ y] Y (t, s) −→ Vγ (x, y), (x, y) ∈ R2+ , n → ∞ (1.5) on rectangles K[nx,nγ y] := {(t, s) ∈ Z2 : 1 ≤ t ≤ nx, 1 ≤ s ≤ nγ y} whose sides grow at possibly different rate O(n) and O(nγ ). Somewhat unexpectedly, it turned out that for a large class of RFs Y = {Y (t, s); (t, s) ∈ Z2 }, the limit in (1.5) exists for any γ > 0. What is more surprising, many LRD RFs Y exhibit a dramatic change of their scalf.d.d. ing behavior at some point γ0 > 0, in the sense that Vγ = V± do not depend on γ f.d.d. for γ > γ0 or γ < γ0 and V+ 6= V− . This phenomenon which we call scaling transition seems to be of general nature, suggesting an exciting new area in spatial research [45]. It occurs for α-stable (1 < α ≤ 2) aggregated autoregressive RFs studied in this paper, for a natural class of LRD Gaussian RFs discussed in [45] and Remark 2.2 below, but also in a very different context of network traffic models; see Remark 2.3. In most of the above mentioned works, the limit Vγ0 is different from V+ and V− , and the differences between Vγ0 , V+ , V− can be characterized by dependence properties of increments Vγ (K) := Vγ (x, y) − Vγ (u, y) − Vγ (x, v) + Vγ (u, v) on rectangles K = (u, x] × (v, y] ⊂ R2+ , which may change from independent increments in the vertical direction for γ > γ0 to independent increments in the horizontal direction (or completely dependent increments in the vertical direction) for γ < γ0 , or vice versa. Further on, depending on whether γ0 = 1 or γ0 6= 1, the corresponding RF Y is said to have isotropic distributional LRD or anisotropic distributional LRD properties. The main purpose of this work is establishing scaling transition and Type I isotropic and anisotropic distributional LRD properties for a natural class of aggregated nearestneighbor random-coefficient autoregressive RFs with finite and infinite variance. We recall that the idea of contemporaneous aggregation originates to Granger [26], who observed that aggregation of random-coefficient AR(1) equations with random beta-distributed coefficient can lead to a Gaussian process with long memory and slowly decaying covariance function. Since then, aggregation became one of the most important methods for modeling and studying long memory processes; see Beran [5]. For linear and heteroscedastic autoregressive time series models with one-dimensional time, it was developed in [8, 23, 24, 30, 40–44, 51, 52] and for some RF models in [32–34, 38]. Aggregation is also important for understanding and modeling of spatial LRD processes by relating 4 D. Puplinskaitė and D. Surgailis them to short-range dependent random-coefficient autoregressive models in a natural way. The two models of interest are given by equations: A (X3 (t − 1, s) + X3 (t, s + 1) + X3 (t, s − 1)) + ε(t, s), (1.6) 3 A X4 (t, s) = (X4 (t − 1, s) + X4 (t + 1, s) + X4 (t, s + 1) + X4 (t, s − 1)) + ε(t, s), (1.7) 4 X3 (t, s) = where {ε(t, s), (t, s) ∈ Z2 } are i.i.d. r.v.’s whose generic distribution ε belongs to the domain of (normal) attraction of α-stable law, 1 < α ≤ 2, and A ∈ [0, 1) is a r.v. independent of {ε(t, s)} and having a regularly varying probability density φ at a = 1: there exist φ1 > 0 and β > −1 such that φ(a) ∼ φ1 (1 − a)β , a ր 1. (1.8) In the sequel, we refer to (1.6) and (1.7) as the 3N and 4N models, N standing for “Neighbor”. Let X3j , X4j , j = 1, . . . , m denote m independent copies of X3 , X4 in (1.6), (1.7), respectively. As shown in Section 5, the aggregated 3N and 4N models defined as Pm f.d.d. m−1 j=1 Xij (t, s) −→ Xi (t, s), m → ∞, i = 3, 4 are written as respective mixed α-stable moving-averages: X Z gi (t − u, s − v, a)Mu,v (da), (t, s) ∈ Z2 , i = 3, 4, (1.9) Xi (t, s) = (u,v)∈Z2 [0,1) where {Mu,v (da), (u, v) ∈ Z2 } are i.i.d. copies of an α-stable random measure M on [0, 1) with control measure φ(a)da and gi is the corresponding (lattice) Green function: gi (t, s, a) = ∞ X ak pk (t, s), k=0 (t, s) ∈ Z2 , a ∈ [0, 1), i = 3, 4, (1.10) where pk (t, s) = P(Wk = (t, s)|W0 = (0, 0)) is the k-step probability of the nearestneighbor random walk {Wk , k = 0, 1, . . .} on the lattice Z2 with one-step transition probabilities p(t, s) shown in Figure 1(a)–(b). (a) 3N (b) 4N Figure 1. One-step transition probabilities of the random walk underlying models (1.6) and (1.7). Aggregation of autoregressive random fields 5 The main results of Sections 3 and 4 are Theorems 3.1 and 4.1. The first theorem identifies the scaling limits Vγ , γ > 0 in (1.5) and proves Type I anisotropic LRD property in the sense of Definition 2.4 with γ0 = 1/2 for the aggregated 3N model X3 in (1.9). Similarly, the second theorem obtains Type I isotropic LRD property (γ0 = 1) for the aggregated 4N model X4 in (1.9). The proofs of Theorems 3.1 and 4.1 rely on the asymptotics of the lattice Green function in (1.10) for models 3N and 4N. Particularly, Lemmas 3.1 and 4.1 obtain the following point-wise convergences: as λ → ∞,   √ √ z λg3 [λt], [ λs], 1 − → h3 (t, s, z), t > 0, s ∈ R, z > 0, (1.11) λ   z (t, s) ∈ R20 , z > 0, (1.12) g4 [λt], [λs], 1 − 2 → h4 (t, s, z), λ respectively, together with dominating bounds of the left-hand sides of (1.11)–(1.12). The limit functions h3 and h4 in (1.11)–(1.12) (entering stochastic integral representations of the scaling limits Vγ in Theorems 3.1 and 4.1) are given by 2 3 h3 (t, s, z) := √ e−3zt−s /(4t) 1(t, z > 0), 2 πt q 2 h4 (t, s, z) := K0 (2 z(t2 + s2 ))1(z > 0), π (1.13) where K0 is the modified Bessel function of second kind. Note that h3 in (1.13) is the Green function of one-dimensional heat equation (modulus constant coefficients), while h4 is the Green function of the Helmholtz equation in R2 . The proofs of these technical lemmas can be found in the extended version of this paper available at http://arxiv.org/abs/1303.2209v3 and will be published elsewhere. Lemmas 3.1 and 4.1 may also have independent interest for studying the behavior of the autoregressive fields (1.6) and (1.7) with deterministic coefficient A in the vicinity of A = 1, particularly, for testing stationarity near the unit root in spatial autoregressive models, cf. [6]. Notation. In what follows, C, C(K), . . . denote generic constants, possibly depending on the variables in brackets, which may be different at different locations. We d d f.d.d. f.d.d. f.d.d. write −→, =, −→ , = , 6= for the weak convergence and equality and inequality of distributions and finite-dimensional distributions, respectively. f.d.d.-lim stands for the limit in the sense of weak convergence of finite-dimensional distributions. For P∞ λ > 0 and a ν × ν matrix E, λE := eE log λ , where eA = k=0 Ak /k! is the matrix exponential. Zν+ := {(t1 , . . . , tν ) ∈ Zν : ti > 0, i = 1, . . . , ν}, Rν+ := {(x1 , . . . , xd ) ∈ Rν : xi > 0, i = 1, . . . , ν}, R̄ν+ := {(x1 , . . . , xd ) ∈ Rν : xi ≥ 0, i = 1, . . . , ν}, Z+ := Z1+ , R+ := R1+ , R̄+ := R̄1+ , R20 := R2 \ {(0, 0)}. E = diag(γ1 , . . . , γν ) denotes the diagonal ν × ν matrix with entries γ1 , . . . , γν on the diagonal. 1A stands for the indicator function of a set A. log+ (x) := log x, x ≥ 1, := 0 otherwise. [x] = ⌊x⌋ := k, x ∈ [k, k + 1), ⌈y⌉ := k + 1, y ∈ (k, k + 1], k ∈ Z. K[nx,nγ y] := {(t, s) ∈ Z2 : 1 ≤ t ≤ nx, 1 ≤ s ≤ nγ y}, K(u,v);(x,y) := {(t, s) ∈ R2+ : u < t ≤ x, v < s ≤ y}. 6 D. Puplinskaitė and D. Surgailis 2. Scaling transition and Type I distributional LRD for RFs on Z2 In this section, by RF on R̄2+ we mean a RF V = {V (x, y); (x, y) ∈ R̄2+ } such that V (x, y) = 0 for any (x, y) ∈ R̄2+ \ R2+ . A RF V on R̄2+ is said trivial if V (x, y) = 0 for any (x, y) ∈ R̄2+ , else V is said non-trivial. Definition 2.1. Let Y = {Y (t, s); (t, s) ∈ Z2 } be a stationary RF. Assume that for any γ > 0 there exist a normalization An (γ) → ∞ and a non-trivial RF Vγ = {Vγ (x, y); (x, y) ∈ R̄2+ } such that A−1 n (γ) X (t,s)∈K[nx,nγ y] f.d.d. Y (t, s) −→ Vγ (x, y), (x, y) ∈ R2+ , n → ∞. (2.1) We say that Y exhibits scaling transition if there exists γ0 > 0 such that the limits f.d.d. f.d.d. Vγ = V+ , γ > γ0 and Vγ = V− , γ < γ0 do not depend on γ for γ > γ0 and γ < γ0 and, moreover, V+ and V− are mutually different RFs, in the sense that for any a > 0 f.d.d. V+ 6= aV− . (2.2) In such case, Vγ0 will be called the well balanced and V+ , V− the unbalanced scaling limits of Y , respectively. Note that the fact that (2.2) hold for any a > 0 excludes a trivial change of the scaling limit by a linear change of normalization. It follows rather easily that under general setup scaling limits Vγ satisfy the self-similarity and stationarity of rectangular increments properties stated in Proposition 2.1 below. Let V = {V (x, y); (x, y) ∈ R̄2+ } be a RF and K = K(u,v);(x,y) ⊂ R2+ be a rectangle. By increment of V on rectangle K we mean the difference V (K) := V (x, y) − V (u, y) − V (x, v) + V (u, v). We say that V has stationary rectangular increments if for any (u, v) ∈ R2+ , f.d.d. {V (K(u,v);(x,y) ); x ≥ u, y ≥ v} = {V (K(0,0);(x−u,y−v) ); x ≥ u, y ≥ v}. (2.3) As mentioned in the Introduction, in the case of scaling transition the limits Vγ0 , V+ , V− can be characterized by dependence properties of increments V (K). To define these properties, we introduce some terminology. Let ℓ = {(x, y) ∈ R2 : ax + by = c} be a line in R2 . A line ℓ′ = {(x, y) ∈ R2 : a′ x + b′ y = c′ } is said perpendicular to ℓ (denoted ℓ′ ⊥ ℓ) if aa′ + bb′ = 0. We say that two rectangles K = K(u,v);(x,y) and K ′ = K(u′ ,v′ );(x′ ,y′ ) are separated by line ℓ′ if they lie on different sides of ℓ′ , in which case K and K ′ are necessarily disjoint: K ∩ K ′ = ∅. See Figure 2. Aggregation of autoregressive random fields 7 Figure 2. Rectangles K and K ′ separated by line ℓ′ . Definition 2.2. Let V = {V (x, y); (x, y) ∈ R̄2+ } be a RF with stationary rectangular increments, V (x, 0) = V (0, y) ≡ 0, x, y ≥ 0, and ℓ ⊂ R2 be a given line , (0, 0) ∈ ℓ. We say that V has: (i) independent rectangular increments in direction ℓ if for any orthogonal line ℓ′ ⊥ ℓ and any two rectangles K, K ′ ⊂ R2+ separated by ℓ′ , increments V (K) and V (K ′ ) are independent; (ii) invariant rectangular increments in direction ℓ if V (K) = V (K ′ ) for any two rectangles K, K ′ ⊂ R2+ such that K ′ = (x, y) + K for some (x, y) ∈ ℓ; (iii) properly dependent rectangular increments in direction ℓ if neither (i) nor (ii) holds; (iv) properly dependent rectangular increments if V has properly dependent rectangular increments in arbitrary direction; (v) independent rectangular increments if V has independent rectangular increments in arbitrary direction. Example 2.3. Fractional Brownian sheet BH1 ,H2 with parameters 0 < H1 , H2 ≤ 1 is a Gaussian process on R̄2+ with zero mean and covariance EBH1 ,H2 (x, y)BH1 ,H2 (x′ , y ′ ) 1 2H 2H = (x2H1 + x′2H1 − |x − x′ | 1 )(y 2H2 + y ′2H2 − |y − y ′ | 2 ), 4 (2.4) where (x, y), (x′ , y ′ ) ∈ R̄2+ . It follows (see [4], Corollary 3) that for any rectangles K = K(u,v);(x,y), K ′ = K(u′ ,v′ );(x′ ,y′ ) EBH1 ,H2 (K)BH1 ,H2 (K ′ ) = 14 (|x − x′ | 2H1 × (|y − y ′ | + |u − u′ | 2H2 2H1 + |v − v ′ | − |x − u′ | 2H2 2H1 − |y − v ′ | 2H2 − |x′ − u| 2H1 − |y ′ − v| ) 2H2 ) (2.5) 8 D. Puplinskaitė and D. Surgailis = E(BH1 (x) − BH1 (u))(BH1 (x′ ) − BH1 (u′ )) × E(BH2 (y) − BH2 (v))(BH2 (y ′ ) − BH2 (v ′ )), where {BH (x); x ∈ R̄+ } is a fractional Brownian motion on R̄+ = [0, ∞) with EBH (x) × BH (x′ ) = (1/2)(x2H + x′2H − |x − x′ |2H ), H ∈ (0, 1]. (Recall that B1/2 is a standard Brow2 nian motion with variance EB1/2 (x) = x and B1 (x) = xB1 (1) is a random line.) In particular, BH1 ,H2 has stationary rectangular increments; see [4], Proposition 2. It follows from (2.5) that B1/2,H2 has independent rectangular increments in the horizontal direction since EB1/2,H2 (K)B1/2,H2 (K ′ ) = 0 for any K, K ′ which are separated by a vertical line, or (u, x] ∩ (u′ , x′ ] = ∅. Similarly, BH1 ,1/2 has independent rectangular increments in the vertical direction and B1/2,1/2 has independent rectangular increments in arbitrary direction. It is also clear that for H1 = 1 (resp., H2 = 1) BH1 ,H2 has invariant rectangular increments in the horizontal (resp., vertical) direction. Let Hi 6= 1/2, 1, i = 1, 2 and ℓ be any line passing through the origin. Let K = K(x−1,y−1);(x,y), K ′ = K(0,0);(1,1) be two rectangles whose all sides are equal to 1. Clearly, if x and y are large enough, K and K ′ are separated by an orthogonal line ℓ′ ⊥ ℓ. From (2.5) and Taylor’s expansion, it easily follows that EBH1 ,H2 (K)BH1 ,H2 (K ′ ) ∼ C(H1 , H2 )x2H1 −2 y 2H2 −2 when x, y → ∞, with C(H1 , H2 ) := 2 Y (2Hi )(2Hi − 1) 6= 0. i=1 This means that for Hi ∈ / {1/2, 1}, i = 1, 2, BH1 ,H2 has properly dependent rectangular increments in arbitrary direction ℓ. Using the terminology of Definition 2.2, we conclude that fractional Brownian sheet BH1 ,H2 has: • properly dependent rectangular increments if Hi ∈ / {1/2, 1}, i = 1, 2; • independent rectangular increments in the horizontal (vertical) direction if H1 = 1/2 (H2 = 1/2); • invariant rectangular increments in the horizontal (vertical) direction if H1 = 1 (H2 = 1); • independent rectangular increments if H1 = H2 = 1/2. Definition 2.4. Let Y = {Y (t, s); (t, s) ∈ Z2 } be a stationary RF. Assume that for any γ > 0 there exist a normalization An (γ) → ∞ and a non-trivial RF Vγ = {Vγ (x, y); (x, y) ∈ R̄2+ } such that (2.1) holds. We say that Y has Type I distributional LRD (or Y is a Type I RF) if there exists γ0 > 0 such that • RF Vγ0 has properly dependent rectangular increments, and • RFs Vγ , γ 6= γ0 do not have properly dependent rectangular increments; in other words, for any γ 6= γ0 , γ > 0 there exists a line ℓ(γ) ∈ R2 such that Vγ has either independent or invariant increments in the direction ℓ(γ). Aggregation of autoregressive random fields 9 Moreover, a Type I RF Y is said to have isotropic distributional LRD if γ0 = 1 and anisotropic distributional LRD if γ0 6= 1. Remark 2.1. The above definition does not assume the occurrence of scaling transition at γ0 , although in all cases known to us, Type I distributional LRD property holds simultaneously with scaling transition. On the other hand, Remark 2.3 shows that scaling transition need not lead to Type I distributional LRD. “Type I” indicates that Vγ has properly dependent rectangular increments at a single point γ = γ0 . By contrast, “Type II” Gaussian LRD RFs mentioned in Remark 2.2 below have the property that Vγ have properly dependent rectangular increments for all γ > 0. Remark 2.2. Puplinskaitė and Surgailis [45] established scaling transition and Type I distributional LRD property for stationary Gaussian RFs with spectral density f (x, y) = g(x, y)(|x|2 + |y|2H2 /H1 )−H1 /2 , (x, y) ∈ [−π, π]2 , where Hi > 0, H1 H2 < H1 + H2 are parameters and g is a bounded positive function having nonzero limit at the origin. In this case, γ0 = H1 /H2 and the unbalanced scaling limits V± agree with a fractional Brownian sheet BH1 ,H2 where at least one of the two parameters H1 , H2 equals 1/2 or 1. Moreover, H1 = H2 (resp., H1 6= H2 ) correspond to Type I isotropic (resp., anisotropic) distributional LRD properties. By contrast, “Type II” Gaussian RFs with spectral density of the form f (x, y) = g(x, y)|x|−2d1 |y|−2d2 , 0 < d1 , d2 < 1/2 and a similar function g do not exhibit scaling transition since their scaling limits Vγ for any γ > 0 coincide with a fractional Brownian sheet Bd1 +0.5,d2 +0.5 up to a multiplicative constant; see [45]. [32, 34] discuss scaling limits of Gaussian LRD RFs with general anisotropy axis. Remark 2.3. Scaling transition different from Type I arises under joint temporal and contemporaneous aggregation of independent LRD processes in telecommunication and economics; see [14, 20, 39, 42] and the references therein. In these works, {Y (t, s); t ∈ Z}, s ∈ Z are independent copies of a stationary LRD process X = {X(t); t ∈ Z} and the scaling limits Vγ of RF Y = {Y (t, s); (t, s) ∈ Z2 } necessarily have independent increments in the vertical direction for any γ > 0, meaning that Y cannot have Type I distributional LRD by definition. Nevertheless, for heavy-tailed centered ON/OFF process X and some other duration based models, the results in [39] imply that Y exhibits a scaling transition with some γ0 ∈ (0, 1) and markedly distinct “supercritical” and “subcritical” unbalanced scaling limits V± , V+ being a Gaussian RF with dependent increments in the horizontal direction and V− having α-stable (1 < α < 2) distributions and independent increments in the horizontal direction. The well-balanced scaling limit Vγ0 termed the “intermediate process” is discussed in detail in [19, 42]. Proposition 2.1. Let Y = {Y (t, s); (t, s) ∈ Z2 } be a stationary RF satisfying (2.1) for some γ > 0 and An (γ) = L(n)nH , where H > 0 and L : [1, ∞) → R+ is a slowly varying function. Then the limit RF Vγ in (1.5) satisfies the self-similarity property (1.4). In particular, Vγ is OSRF corresponding to E := diag(1, γ). Moreover, Vγ has stationary rectangular increments. 10 D. Puplinskaitė and D. Surgailis Proof. Fix λ > 0 and let m := nλ1/H . Then L(n)/L(m) → 1, n → ∞ and Vγ (λ1/H x, λγ/H y) = f.d.d.-lim n→∞ = f.d.d.-lim m→∞ 1 nH L(n) X Y (t, s) (t,s)∈K[xλ1/H n,yλγ/H nγ ] λ L(m) L(n) mH L(m) X f.d.d. Y (t, s) = λVγ (x, y). (t,s)∈K[xm,ymγ ] The fact that Vγ has stationary rectangular increments is an easy consequence of Y being stationary.  3. Scaling transition in the aggregated 3N model This section establishes scaling transition and Type I anisotropic distributional LRD property, in the sense of Definitions 2.1 and 2.4 of Section 2, for the aggregated 3N model X3 in (1.9). We shall assume that M in (1.9) is symmetric α-stable with characteristic α function EeiθM(B) = e−|θ| Φ(B) , B ⊂ [0, 1). The case of general α-stable random measure M (see (5.36)) in (1.9) can be discussed in a similar way. Recall that g3 (t, s, a) in (1.9) is the Green function of the random walk {Wk } on Z2 with one-step transition probabilities shown in Figure 1(a). According to Remark 5.2, RF X3 in (1.9) with mixing distribution in (1.8) is well-defined if 1 < α ≤ 2, β > −(α − 1)/2. For given γ > 0, introduce a RF Vγ = {V3γ (x, y); (x, y) ∈ R̄2+ } written as a stochastic integral Z F3γ (x, y; u, v, z)M(du, dv, dz), (3.1) V3γ (x, y) := R2 ×R+ where F3γ (x, y; u, v, z) is defined as  Z xZ y   h3 (t − u, s − v, z) dt ds,    0 0    γ = 1/2,Z  Z  x     1(0 < v < y) dt h3 (t − u, w, z) dw,    0 R    γ > 1/2, 0 < β < α − 1,  Z  y   x h3 (−u, s − v, z) ds, F3γ := 0   γ > 1/2,Z−(α −Z1)/2 < β < 0,    y    1(0 < u < x) ds h3 (w, v − s, z) dw,    R 0    γ < 1/2, (α − 1)/2 < β < α − 1,  Z  x     y h3 (t − u, v, z) dt,     0 γ < 1/2, −(α − 1)/2 < β < (α − 1)/2, (3.2) Aggregation of autoregressive random fields 11 2 h3 (t, s, z) = 2√3πt e−3zt−s /(4t) 1(t > 0, z > 0) as in (1.13), and M is an α-stable random measure on R2 × R+ with control measure dµ(u, v, z) := φ1 z β du dv dz and characteristic α function EeiθM(B) = e−|θ| µ(B) , where φ1 > 0, β > −1 are the asymptotic parameters in (1.8) and B ⊂ R2 × R+ is a measurable set with µ(B) < ∞. Proposition 3.1. (i) The RF V3γ in (3.1) is well-defined for any γ > 0, 1 < α ≤ 2 and β in (3.2). It has α-stable finite-dimensional distributions and stationary rectangular increments in the sense of (2.3). (ii) V3γ is OSRF: for any λ > 0, f.d.d. {V3γ (λx, λγ y); (x, y) ∈ R̄2+ } = {λH(γ) V3γ (x, y); (x, y) ∈ R̄2+ }, where  γ +α−β   , γ ≥ 1/2, β > 0,   α     γ + α − 2βγ   , γ ≥ 1/2, β < 0,  α H(γ) := (3.3) 1 − γ + 2γ(α − β)    , γ < 1/2, β > (α − 1)/2,   α     αγ + (α + 1)/2 − β   , γ < 1/2, β < (α − 1)/2. α (iii) RF V3γ has properly dependent rectangular increments for γ = 1/2 and does not have properly dependent rectangular increments for γ 6= 1/2. (iv) RFs V3γ = V3,+ (γ > 1/2) and V3γ = V3,− (γ < 1/2) do not depend on γ for γ > 1/2 and γ < 1/2. (v) For α = 2, the RFs  B1−(β/2),1/2 , 0 < β < 1, f.d.d. V3,+ = κ3,+ B1,(1/2)−β , −1/2 < β < 0, (3.4)  B1/2,(3/2)−β , 1/2 < β < 1, f.d.d. V3,− = κ3,− B(3/4)−(β/2),1 , −1/2 < β < 1/2, agree, up to some constants κ3,± = κ3,± (β) 6= 0, with fractional Brownian sheet BH1 ,H2 where one of the parameters H1 , H2 equals 1/2 or 1. Remark 3.1. Similarly, as in the case of fractional Brownian sheet (case α = 2), the unbalanced limit RFs V3,± have a very special dependence structure, being either “independent” or “deterministic continuations” of random processes with one-dimensional time: V11 := {V3,+ (t, 1); t ≥ 0}, 0 < β < α − 1, V12 := {V3,+ (1, t); t ≥ 0}, −(α − 1)/2 < β < 0, 12 D. Puplinskaitė and D. Surgailis (3.5) V21 := {V3,− (1, t); t ≥ 0}, (α − 1)/2 < β < α − 1, V22 := {V3,− (t, 1); t ≥ 0}, −(α − 1)/2 < β < (α − 1)/2. The four processes Vij , i, j = 1, 2 in (3.5) are all symmetric α-stable (SαS) and self-similar with stationary increments (SSSI) with corresponding self-similarity parameters: 1 − 2β α−β , H12 := , α α 2(α − β) − 1 α + 1 − 2β H21 := , H22 := . α 2α H11 := These facts follow from Proposition 3.1, for example, the self-similarity property of V12 follows from the definition of V3,+ and Proposition 3.1(ii): ∀λ > 0, {V12 (λt)} = {V3,+ (1, λt)} = {V3,+ (λ1/γ λ−1/γ 1, λt)} f.d.d. = λH(γ)/γ {V3,+ (λ−1/γ 1, t)} = λ(H(γ)−1)/γ {V3,+ (1, t)} = λH12 {V12 (t)}. For α = 2, processes Vij , i, j = 1, 2 are representations of fractional Brownian motion and, for 1 < α < 2, they belong to the class of SαS SSSI processes discussed in [48]. Note that the self-similarity exponents satisfy 1/α < Hij < 1, i, j = 1, 2 and fill in all points of the interval (1/α, 1) as β vary in the corresponding intervals in (3.5). R Proof of Proposition 3.1. (i) It suffices to show Jγ (x, y) := R2 ×R+ |F3γ (x, y; u, v, z)|α × µ(du, dv, dz) < ∞, x, y > 0. For simplicity, we restrict the proof to x = y = 1, or Jγ < ∞, Jγ := Jγ (1, 1). R 1R 1 R First, consider the case γ = 1/2. Write J1/2 = J ′ + J ′′ , where J ′ := R2 ×R+ ( 0 0 h3 (t − R1R1 R u, s − v, z) dt ds)α 1(|v| ≤ 2) dµ, J ′′ := R2 ×R+ ( 0 0 h3 (t − u, s − v, z) dt ds)α 1(|v| > 2) dµ. Then α Z 0  Z 1 Z 1 Z ∞ Z 1 1(t > u) dt −3z(t−u) β ′ √ =C e du · · · z dz du + · · · + du J ≤C t−u 0 0 −∞ −∞ 0 =: C(J1′ + J2′ ). By Minkowski’s inequality, J1′ ≤ Z ≤C 1 dt 0 Z 0 Z 0 −∞ 1 dt Z 0 du (t − u)α/2 ∞ Z ∞ e−(3α/2)z(t−u) z β dz 0 du (t + u)1+β+(α/2) 1/α α =C Z 1/α α 0 1 dt t(1/2)+(β/α) 1/α <∞ Aggregation of autoregressive random fields 13 since (1/2) + (β/α) < 1 due to β < α − 1, α ≤ 2. We also have (Z )α Z ∞ Z ∞ 1 ′ β −(3α/2)zx J2 ≤ C z dz e dx =C z β−α (1 − e−z )α dz < ∞ 0 0 0 since α > 1 + β. On the other hand, since (s − v)2 ≥ v 2 /4 for |s| < 1, |v| > 2, so using Minkowski’s inequality we obtain Z ′′ J ≤ 1 dt 0 ≤C Z ∞ Z t −∞ dx du (t − u)α/2 Z x1+β+(α/2) 0 Z e −v 2 /4(t−u) Z dv |v|>2 e−v 2 ∞ e −(3α/2)z(t−u) β z dz 0 /(4x) 1/α α dv, |v|>2 where the last integral is easily seen to be finite. This proves J1/2 < ∞.R Next, consider Jγ for γ > 1/2, 0 < β < α − 1. Using h⋆ (u, z) := R h3 (u, v, z) dv = 12e−3uz 1(u > 0), similarly as above we obtain Z 1 α Z 0  Z ∞ Z 1 Z 1 β −3z(t−u) z dz du Jγ ≤ C e dt =C du · · · du + · · · + 0 −∞ u∨0 0 −∞ =: C{Jγ1 + Jγ2 }, R1 R∞ R1 where Jγ1 ≤ C{ 0 dt( 0 (t + u)−1−β du)1/α }α ≤ C{ 0 t−β/α dt}1/α < ∞ and Z 1 α Z 1 Z ∞ Z ∞ α β −3z(t−u) Jγ2 ≤ C du z dz e dt ≤C z β dz((1 − e−z )/z) < ∞ 0 0 u 0 because of β − α < −1. This proves Jγ < ∞ for γ > 1/2, 0 < β < α − 1. Next, let γ > 1/2, −(α − 1)/2 < β < 0. We have Z 1 α Z dµ Jγ ≤ C h3 (u, s − v, z) ds R+ ×R×R+ ≤C =C Z ∞ 0 Z u−α/2 du 0 Z dv R ∞ Z e−zu z β dz 0 u−(1+β+α/2) du 0 ∞ Z dv + |v|≤2 Z 1 e−(s−v) 0 Z dv |v|>2 2 /u Z 1 ds α e−(s−v) 0 2 /u ds α Here, Jγ1 ≤ C ≤C Z ∞ u−(1+β+α/2) du 0 Z 0 Z 1 0 1 u−(1+β) du + Z 1 ∞ 2 e−s /u ds α  u−(1+β+α/2) du < ∞ =: C{Jγ1 + Jγ2 }. 14 D. Puplinskaitė and D. Surgailis since β < 0, β > −α/2, while Jγ2 ≤ C ≤C Z ∞ u−(1+β+α/2) du ∞ e−v 2 /u dv 1 0 Z Z ∞ u −(1/2+β+α/2) du Z ∞ 2 e−z dz < ∞ u1/2 0 R∞ 2 as 12 + β + α2 > 1 and 1/u1/2 e−z dz decays exponentially when u → 0. This proves Jγ < ∞ for γ > 1/2, −(α − 1)/2 < β < 0. R Consider the case 0 < γ < 1/2, (α − 1)/2 < β < α − 1. Then using R h3 (w, v, z) dw = √ √ √3 e− 3z|v| 2 z Jγ ≤ C Z we obtain dv Z ∞ z β dz 0 R Z 1 z −1/2 e− √ z|s−v| ds 0 α Z =C |v|≤2 dv + · · · + Z |v|>2  dv · · · =: C{Jγ1 + Jγ2 }, where Jγ1 ≤ C α − 1 and R∞ 0 √ R1 R∞ z β−(α/2) dz( 0 e−z|s| ds)α ≤ C 0 z β−α (1 − e− z )α dz < ∞ for 0 < β < Z Jγ2 ≤ C ∞ Z dv ∞ z √ β−α/2 − zv e dz = C ∞ 1 0 1 Z v α−2−2β dv < ∞ since 2 + 2β − α > 1 for β > (α − 1)/2. R∞ R1 R Finally, let 0 < γ < 1/2, −(α−1)/2 < β < (α−1)/2. Then Jγ = C −∞ du R dv 0 z β dz × R1 R0 R1 ( 0 h3 (t − u, v, z) dt)α = C{ −∞ du + · · · + 0 du · · ·} =: C{Jγ1 + Jγ2 }. By Minkowski’s inequality, 1/α Jγ1 ≤C =C Z 1 dt 0 Z 1 0 dt Z Z ∞ du 0 Z ∞ 0 ∞ 0 dv Z 0 ∞ β hα 3 (t + u, v, z)z dz du (t + u)1+β+(α−1)/2 1/α = 1/α =C Z 1 dt 0 1/α  1 tβ+(α−1)/2 1/α <∞ and, similarly, 1/α Jγ2 ≤ C Z 0 1 dt Z 0 ∞ dv Z 0 ∞ β hα 3 (t, v, z)z dz Z 1 dt 0  1 tβ+(α+1)/2 1/α <∞ since |β| < (α − 1)/2. This proves Jγ < ∞, or the existence of V3γ , for all choices of α, β, γ in (3.2). The fact that linear combinations of integrals in (3.1) are α-stable is well known ([46]). Stationarity of increments of (3.1) is an easy consequence of the integrand (3.2) and the control measure µ. This proves part (i). Aggregation of autoregressive random fields 15 √ (ii) The OSRF property is immediate from the scaling properties h3 (λu, λv, λ−1 z) = f.d.d. λ−1/2 h3 (u, v, z) of the kernel h3 in (1.13) and {M(dλu, dλγ v, dλ−1 z)} = {λ(γ−β)/α M(du, dv, dz)} of the stable random measure M, the last property being a consequence of the scaling property of µ(dλu, dλγ v, dλ−1 z) = λγ−β µ(du, dv, dz) of the control measure µ. (iii) Let γ = γ0 := 1/2. Consider arbitrary rectangles Ki = K(ξi ,ηi );(xi ,yi ) ⊂ R2+ , i = R R R 1, 2, and write = R2 ×R+ . Then V3γ0 (Ki ) = GKi (u, v, z) dM, where GKi (u, v, z) := R Ki h3 (t − u, s − v, z) dt ds. Note GKi ≥ 0 and GKi (u, v, z) > 0 for any u < xi implying supp(GK1 ) ∩ supp(GK2 ) 6= ∅. Hence, and from ([46], Theorem 3.5.3, page 128) it follows that the increments V3γ0 (Ki ), i = 1, 2 on arbitrary nonempty rectangles K1 , K2 are dependent. It is also easy to show that V3γ0 does not have invariant rectangular increments in any direction. This proves (iii) for γ = 1/2. Next, let γ > 1/2, 0 < β < α − 1. Similarly as above, for any rectangle K = K(ξ,η);(x,y) ⊂ R Rη 2 R+ , we have V3γ (K) = GK,γ (u, v, z) dM, where GK,γ (u, v, z) := 1(η < v ≤ y) ξ h3γ (t − u, z) dt. Clearly, if Ki , i = 1, 2 are any two rectangles separated by a horizontal line, then supp(GK1 ,γ ) ∩ supp(GK2 ) = ∅, implying independence of V3γ (K1 ) and V3γ (K2 ). Thus, V3γ for 0 < β < α − 1 has independent increments in the vertical direction. The fact that V3γ for γ > 1/2, −(α − 1)/2 < β < 0 has invariant increments in the horizontal direction is obvious from (3.1) and (3.2). The properties of V3γ in the case 0 < γ < 1/2 are completely analogous. (iv) Follows from (3.1) and (3.2). (v) Since V3,± for α = 2 are zero mean Gaussian RFs, it suffices to show that their covariances agree with that of fractional Brownian sheet in (2.4). This can be easily verified by using self-similarity and stationarity of increments properties stated in (i) and (ii), as follows. Let 0 < β < 1 and ρ+ (x, x′ ) := EV3,+ (x, 1)V3,+ (x′ , 1), x, x′ ≥ 0. By (3.1) and (3.2), EV3,+ (x, y)V3,+ (x′ , y ′ ) = (y ∧ y ′ )ρ+ (x, x′ ), (x, y), (x′ , y ′ ) ∈ R2+ . According to (ii), for any λ>0 ρ+ (λx, λx′ ) = EV3,+ (λx, 1)V3,+ (λx′ , 1) = λ2H(γ) EV3,+ (x, λ−γ )V3,+ (x′ , λ−γ ) = λ2H(γ)−γ EV3,+ (x, 1)V3,+ (x′ , 1) = λ2H+ ρ(x, x′ ), (3.6) where H+ := H(γ) − (γ/2) = 1 − (β/2); see (3.3). The stationarity of rectangular increments property of RF V3,+ implies that the process {V3,+ (x, 1), x ≥ 0} has stationary increments. Together with the scaling property in (3.6), this implies that ρ+ (x, x′ ) = (κ2+ /2)(x2H+ + x′2H+ − |x − x′ |2H+ ), x, x′ ≥ 0, or EV3,+ (x, y)V3,+ (x′ , y ′ ) = κ2+ EB1−(β/2),1/2 (x, y)B1−(β/2),1/2 (x′ , y ′ ), see (2.4). The remaining relations in (v) are analogous. Proposition 3.1 is proved.  The main result of this section is Theorem 3.1. Its proof is based on the asymptotics of the Green function g3 in Lemma 3.1, below. The proof of Lemma 3.1 can be found at http://arxiv.org/abs/1303.2209v3. 16 D. Puplinskaitė and D. Surgailis Lemma 3.1. For any (t, s, z) ∈ (0, ∞) × R × (0, ∞) the point-wise convergence in (1.11) holds. This convergence is uniform on any relatively compact set {ǫ < t < 1/ǫ, ǫ < |s| < 1/ǫ, ǫ < z < 1/ǫ} ⊂ (0, ∞) × R × (0, ∞), ǫ > 0. Moreover, there exist constants C, c > 0 such that for all sufficiently large λ and any (t, s, z), t > 0, s ∈ R, 0 < z < λ the following inequality holds:   √ √ √ √ 1/2 1/3 z < C(h̄3 (t, s, z) + λe−zt−c(λt) −c( λ|s|) ), λg3 [λt], [ λs], 1 − λ where h̄3 (t, s, z) := 1 −zt−s2 /(16t) √ e , (t, s, z) ∈ t (3.7) (0, ∞) × R × (0, ∞). Theorem 3.1. Assume that the mixing density φ is bounded on any interval [0, 1 − ǫ), ǫ > 0 and satisfies (1.8), where − (α − 1)/2 < β < α − 1, 1 < α ≤ 2, β 6= 0, β 6= (α − 1)/2. (3.8) Let X3 be the aggregated RF in (1.9). Then for any γ > 0 γ n −H(γ) [nx] [n y] X X t=1 s=1 f.d.d. X3 (t, s) −→ V3γ (x, y), x, y > 0, n → ∞, (3.9) where H(γ) and V3γ are given in (3.3) and (3.1), respectively. As a consequence, the RF X3 exhibits scaling transition at γ0 = 1/2 and enjoys Type I anisotropic distributional LRD with γ0 = 1/2 in the sense of Definition 2.4. Remark 3.2. As it follows from the proof of Theorem 3.1, for γ = 1/2 the limit in (3.9) exists also when β = 0 or β = (α − 1)/2 and is given in (3.1) as in the remaining cases. On the other hand, the existence of the scaling limit (3.9) in the cases γ > 1/2, β = 0 and 0 < γ < 1/2 and β = (α − 1)/2 is an open and delicate question. Note a sharp transition in the dependence structure of the limit fields V3,+ and V3,− in the vicinity of β = 0 and β = (α − 1)/2, respectively, changing abruptly from independent rectangular increments in one direction to invariant (completely dependent) rectangular increments in the perpendicular direction. For α = 2, the above transition may be related to the fact that the covariance functions of the “vertical” and “horizontal sectional processes” {X3 (0, s); s ∈ Z} and {X3 (t, 0); t ∈ Z} change their summability properties at respective points β = 0 and β = 1/2; see Proposition 3.2 below. Let α = 2 and r3 (t, s) = EX3 (t, s)X3 (0, 0) be the covariance function of the aggregated Gaussian RF in (1.9). The proof of Proposition 3.2 using Lemma 3.1 can be found in the arXiv version http://arxiv.org/abs/1303.2209v3. Aggregation of autoregressive random fields 17 Proposition 3.2. Assume α = 2 and the conditions of Theorem 3.1. Then for any (t, s) ∈ R20  −2β−1 γ(β + 1/2, s2 /4|t|), t 6= 0, s 6= 0,   C3 |s| √ β+1/2 −2β−1 lim λ r3 ([λt], [ λs]) = C3 |s| Γ(β + 1/2), t = 0, λ→∞   −β−1/2 C4 |t| , s = 0, Rx where γ(α, x) := 0 y α−1 e−y dy is incomplete gamma function and C3 := π −1/2 22β−1 31−β σ 2 × φ1 Γ(β + 1), C4 := 4−1/2−β C3 . Proof of Theorem 3.1. Write Snγ (x, y) for the left-hand side of (3.9). It suffices to prove the convergence of characteristic functions: Eei Pp j=1 θj Snγ (xj ,yj ) → Eei Pp j=1 θj V3γ (xj ,yj ) , n → ∞, (3.10) for any p ∈ N+ , θj ∈ R, (xj , yj ) ∈ R2+ , j = 1, . . . , p. We have Eei Pp j=1 θj Snγ (xj ,yj ) Eei = e−Jnγ , Pp j=1 θj V3γ (xj ,yj ) = e−Jγ , (3.11) where Jγ := Z α R2 ×R+ |Gγ (u, v, z)| dµ, Jnγ := n−H(γ)α X E (u,v)∈Z2 p X j=1 Gγ (u, v, z) := p X θj F3γ (xj , yj ; u, v, z), j=1 X θj 1≤t≤[nxj ],1≤s≤[nγ yj ] α (3.12) g3 (t − u, s − v, a) . Thus, (3.10) follows from lim Jnγ = Jγ . n→∞ (3.13) To prove (3.13), we write Jnγ as an integral Jnγ = Z R2 ×R α + |Gnγ (u, v, z)| χn (z)µ(du, dv, dz), (3.14) where the functions χn satisfying χn (z) → 1(n → ∞) uniformly in z > 0 will be specified later, and where Gnγ : R2 × R+ → R are some functions which approach Gγ in (3.12) in the following sense. Let Wǫ := {(u, v, z) ∈ R2 × R+ : |u| + |v| < 1/ǫ, ǫ < z < 1/ǫ}, Wǫc := (R2 × R+ ) \ Wǫ , ǫ > 0. We will prove that Z α |Gnγ (u, v, z) − Gγ (u, v, z)| dµ = 0 ∀ǫ > 0, (3.15) lim n→∞ W ǫ 18 D. Puplinskaitė and D. Surgailis and lim lim sup ǫ→0 n→∞ Z α Wǫc |Gnγ (u, v, z)| dµ = 0. (3.16) Since µ(Wǫ ) < ∞, (3.15) follows from the uniform convergence lim sup n→∞ (u,v,z)∈W ǫ |Gnγ (u, v, z) − Gγ (u, v, z)| = 0 ∀ǫ > 0. (3.17) Clearly, (3.15) and (3.16) together with (3.14) and the above mentioned property of χn imply (3.13). The subsequent proof of (3.15) and (3.16) is split into several cases depending on values γ and β. Case γ = γ0 = 1/2. In this case, (3.14) holds with Gnγ0 (u, v, z) Z p X θj := j=1 0   (3.18) √ √ z ng3 ⌈nt⌉ − ⌈nu⌉, ⌈ ns⌉ − ⌈ nv⌉, 1 − dt ds n √ √ ⌊nxj ⌋/n Z ⌊ nyj ⌋/ n √ 0 and χn (z) := (z/n)−β (φ(1 − z/n)/φ1 )1(0 < z < n) → 1 boundedly on R+ as n → ∞ according to condition (1.8). To show (3.17), for given ǫ1 > 0 split Gnγ0 (u, v, z) − P3 Gγ0 (u, v, z) = i=1 Γni (u, v, z), where, for 0 < z < n, Γn1 (u, v, z) := p X θj Z √ √ ⌊nxj ⌋/n Z ⌊ nyj ⌋/ n √ Z √ √ ⌊nxj ⌋/n Z ⌊ nyj ⌋/ n √ 0 j=1   √ √ z ng3 ⌈nt⌉ − ⌈nu⌉, ⌈ ns⌉ − ⌈ nv⌉, 1 − n 0  − h3 (t − u, s − v, z) 1((t, s) ∈ Dj (ǫ1 )) dt ds, Γn2 (u, v, z) := p X θj 0 j=1 0   √ √ z ng3 ⌈nt⌉ − ⌈nu⌉, ⌈ ns⌉ − ⌈ nv⌉, 1 − n × 1((t, s) ∈ / Dj (ǫ1 )) dt ds, Z ⌊nxj ⌋/n Z ⌊√nyj ⌋/√n p X θj Γn3 (u, v, z) := − h3 (t − u, s − v, z)1((t, s) ∈ / Dj (ǫ1 )) dt ds, j=1 0 0 and where the sets Dj (ǫ1 ), j = 1, . . . , p (depending on u, v) are defined by Dj (ǫ1 ) := {(t, s) ∈ (0, xj ] × (0, yj ] : t − u > ǫ1 , |s − v| > ǫ1 }. Relation (3.17) follows from lim sup n→∞ (u,v,z)∈W ǫ lim lim sup sup |Γn1 (u, v, z)| = 0, ǫ1 →0 n→∞ (u,v,z)∈W ǫ |Γni (u, v, z)| = 0, (3.19) i = 2, 3. (3.20) Aggregation of autoregressive random fields 19 Rǫ R1 Here, (3.19) follows from Lemma 3.1. Next, |Γn3 (u, v, z)| ≤ C 0 1 t−1/2 dt+C ǫ1 t−1/2 dt× R √ ds = O( ǫ1 ), implying (3.20) for i = 3. Similarly, using (3.7) we obtain |Γn2 (u, v, z)| ≤ |s|<ǫ1 √ R1 √ 1/3 √ √ C ǫ1 + C n 0 e−c(nt) dt ≤ C ǫ1 + C/ n. This proves (3.20) for i = 2, and hence (3.17), too. Consider (3.16). W.l.g., we can assume p = 1, θ1 = x1 = y1 = 1. With (3.18) and (3.7) en (u, v, z)), where in mind, we have 0 ≤ Gnγ0 (u, v, z) ≤ C(Ḡ(u, v, z) + G Ḡ(u, v, z) := Z 1Z 0 en (u, v, z) := G 1 h̄3 (t − u, s − v, z) dt ds, 0 √ n1(0 < z < n) Z 1Z 0 1 e−z(t−u)−c(n(t−u)) 1/3 √ −c( n|s−v|)1/2 1(t > u) dt ds, 0 where c > 0 is the same as in (3.7). Relation (3.16) with Gnγ replaced by Ḡ follows from Ḡ ∈ Lα (µ) (see Proposition 5.1, proof of (i)), since h̄3 (t, s, z) and h3 (t, s, z) differ only in constants. Thus, (3.16) follows from Jen := Z α R2 ×R P3 Split Jen = i=1 Ini , where + e n (u, v, z)) dµ = o(1), (G In1 := Z (−∞,0]×R×R+ In2 := Z Z en )α dµ, (G (0,1]×[−2,2]c ×R+ [−2, 2]c := R \ [−2, 2]. Using the fact that inequality, In1 ≤ Cn α/2 Z dt ds (0,1]2 × z β du dv dz ≤ Cn(α−1)/2 Z Z 1/α α 1 dt 0 ≤ Cn−((α+1)/2−β) I, Z 0 R en )α dµ, (G 1/4 R e−cn |s−v|1/2 √ dv = C/ n and Minkowski’s e−αz(t+u)−cα(n(t+u)) 1/3 √ −cα( n|s−v|)1/2 R+ ×R×R+ ∞ (3.21) en )α dµ, (G (0,1]×[−2,2]×R+ In3 := n → ∞. e−cα(n(t+u)) 1/3 du (t + u)1+β 1/α α 20 D. Puplinskaitė and D. Surgailis where α+1 2 − β > 0 and I := { In2 ≤ Cn ≤C ≤C α/2 Z R∞ 0 ∞ β R∞ 1/3 dt( 0 e−cα(t+u) (t + u)−1−β du)1/α }α < ∞. Next, z dz 4 e −c(nt)1/3 dt 0 Z e √ −zt−c(nt)1/3 −c( n|s|)1/2 Z ∞ e −αzt β z dz 0 ∞ dt ds (0,4]2 0 Z Z e −c(nt)1/3 −(1+β)/α t dt 0 √ √ −c( n|s−v|)1/2 α 1/α α α ≤ Cn−(α−1−β) = o(1). 1/2 ≤ e−(c/2)( n|v|) for |v| ≥ 2, |s| ≤ 1 it easily follows In3 = Finally, using e −c′ n1/4 ′ O(e ) = o(1)(∃c > 0), thus completing the proof of (3.21) and (3.13) for γ = γ0 = 1/2. Case γ > 1/2, 0 < β < α − 1. In this case, (3.14) holds with Gnγ (u, v, z) := p X θj j=1 = p X θj j=1 Z Z ⌊nxj ⌋/n dtn −1/2 ⌊nγ yj ⌋ 0 X s=1 ⌊nxj ⌋/n dt 0 Z R   z g3 ⌈nt⌉ − ⌈nu⌉, s − ⌈nγ v⌉, 1 − 1(0 < z < n) n   √ √ z ds ng3 ⌈nt⌉ − ⌈nu⌉, ⌈ ns⌉, 1 − n (3.22) √ × 1(0 < z < n, 1 − ⌈nγ v⌉ ≤ ⌈ ns⌉ ≤ ⌊nγ yj ⌋ − ⌈nγ v⌉) Z xj Z p X dsfnj (t, s, u, v, z). dt θj =: j=1 0 R We first check the point-wise convergence: for any (u, z) ∈ R × R+ , v ∈ R \ {0, yj }, j = 1, . . . , p Gnγ (u, v, z) → Gγ (u, v, z) := p X j=1 θj Z 0 xj dt Z R (3.23) dsh3 (t − u, s, z)1(0 < v < yj ), n → ∞. To prove (3.23), note that from (1.11), (3.7) and γ > 1/2, for any u < t ∈ R, v ∈ R \ {0, yj }, j = 1, . . . , p, s ∈ R, and z > 0, we have the point-wise convergences (as n → ∞)   √ √ z 1(0 < z < n) → h3 (t − u, s, z), ng3 ⌈nt⌉ − ⌈nu⌉, ⌈ ns⌉, 1 − n √ 1(1 − ⌈nγ v⌉ ≤ ⌈ ns⌉ ≤ ⌊nγ yj ⌋ − ⌈nγ v⌉) → 1(0 < v < yj ) Aggregation of autoregressive random fields 21 and hence fnj (t, s; u, v, z) → fj (t, s; u, v, z) := h3 (t − u, s, z)1(0 < v < yj ). (3.24) Using (3.24), relation (3.23) can be shown similarly as in the case γ = γ0 above. Namely, P3 write Gnγ (u, v, z) − Gγ (u, v, z) = i=1 Γni (u, v, z), where, for 0 < z < n, Γn1 (u, v, z) := p X θj Γn2 (u, v, z) := θj p X j=1 dt Z θj Z Z {fnj (t, s; u, v, z) − fj (t, s; u, v, z)}1((t, s) ∈ Dj (ǫ1 )) ds, Z fj (t, s; u, v, z)1((t, s) ∈ / Dj (ǫ1 )) ds, Z fnj (t, s; u, v, z)1((t, s) ∈ / Dj (ǫ1 )) ds, R ⌊nxj ⌋/n dt 0 j=1 Γn3 (u, v, z) := ⌊nxj ⌋/n 0 j=1 p X Z R ⌊nxj ⌋/n dt 0 R and where Dj (ǫ1 ) := {(t, s) ∈ (0, xj ] × R : t − u > ǫ1 , |s − v| > ǫ1 , |s| < 1/ǫ1 }. Then (3.23) follows if we show that, for any (u, z) ∈ R × R+ , v ∈ R \ {0, y}, lim |Γn1 (u, v, z)| = 0 n→∞ lim lim sup|Γni (u, v, z)| = 0, ǫ1 →0 n→∞ ∀ǫ1 > 0 and i = 2, 3. (3.25) Here, the first relation in (3.25) follows from the uniform convergence statement of Lemma 3.1, and the second one from the dominating bound in (3.7); in particular, Z xj Z dt fnj (t, s; u, v, z)1(t − u ≤ ǫ1 ) ds 0 R ≤ Z ǫ1 +n−1 0 dt Z  R  √ √ 2 1/3 1/2 1 √ e−cs /t + ne−c(nt) −c( n|s|) ds ≤ C(ǫ1 + n−1 ) t vanishes as n → ∞ and ǫ1 → 0. With (3.23) in mind, the convergence of integrals in (3.15) and (3.16) can be established using the dominated convergence theorem and the bound (3.7) of Lemma 3.1, similarly as in the case γ = 1/2 above. Case γ > 1/2, −(α−1)/2 < β < 0. In this case, (3.14) holds with χn (z) := (z/n2γ )−β (φ(1− (z/n2γ ))/φ1 )1(0 < z < n2γ ) → 1 and Gnγ (u, v, z) := p X j=1 θj Z ⌊nxj ⌋/n 0 dt Z ⌊nγ yj ⌋/nγ dsnγ 0   z × g3 ⌈nt⌉ − ⌈n2γ u⌉, ⌈nγ s⌉ − ⌈nγ v⌉, 1 − 2γ 1(0 < z < n2γ ) n 22 D. Puplinskaitė and D. Surgailis =: p X θj j=1 Z ⌊nxj ⌋/n dt 0 Z ⌊nγ yj ⌋/nγ dsfn (t, s; u, v, z). 0 Note that in the above integral, variables t and u are rescaled by n and n2γ ≫ n, respectively. Therefore, by (1.11) the integrand fn (t, s; u, v, z) → f (s; u, v, z) := h3 (−u, s − v, z) as n → ∞ (3.26) converges point-wise to f (s; u, v, z) independent of t, for any u < 0, s, v ∈ R, s ∈ R, and z > 0 fixed. By using (3.26) and splitting Gnγ (u, v, z) similarly as in the case γ = γ0 above, we can show the uniform convergence in (3.17) with Gγ (u, v, z) := p X θj j=1 Z xj dt Z yj f (s; u, v, z) ds = 0 0 p X j=1 θj xj Z 0 yj h3 (−u, s − v, z) ds satisfying (3.12); see the definition of F3γ (x, y; u, v, z) = Gγ (u, v, z) in (3.2). The proof of (3.16) uses the dominating bound (3.7) of Lemma 3.1 similarly as in the previous cases. Case 0 < γ < 1/2, (α − 1)/2 < β < α − 1. We have (3.14) with Gnγ (u, v, z) Z p X θj := = j=1 θj dt Z ∞ Z ⌊nγ yj ⌋/nγ 0 0 j=1 p X ⌊nxj ⌋/n2γ dw 0 Z ⌊n yj ⌋/nγ   z dsnγ g3 ⌈n2γ t⌉ − ⌈nu⌉, ⌈nγ s⌉ − ⌈nγ v⌉, 1 − 2γ n γ fnj (w, s; u, v, z) ds, 0 where   z 2γ γ γ fnj (w, s; u, v, z) := n g3 ⌈n w⌉, ⌈n s⌉ − ⌈n v⌉, 1 − 2γ n   1 − ⌈nu⌉ ⌊nxj ⌋ − ⌈nu⌉ ×1 < w < n2γ n2γ γ → 1(0 < u < xj )h3 (w, s − v, z), n→∞ point-wise for each u ∈ R \ {0, xj }, w > 0, s ∈ (0, yj ), v ∈ R, s 6= v, z > 0 fixed, according to Lemma 3.1. This leads to the point-wise convergence of integrals, namely, Gnγ (u, v, z) → Gγ (u, v, z) = p X j=1 θj 1(0 < u < xj ) Z 0 ∞ dw Z 0 (3.27) yj dsh3 (w, s − v, z), n→∞ Aggregation of autoregressive random fields 23 similarly as in (3.23) above. We omit the rest of the proof of (3.15) and (3.16) which uses (3.27), Lemma 3.1 and the dominated convergence theorem. Case 0 < γ < 1/2, −(α − 1)/2 < β < (α − 1)/2. We have (3.14) with Gnγ (u, v, z) := p X θj j=1 Z ⌊nxj ⌋/n dt 0 Z ⌊nγ yj ⌋/nγ fn (t, s; u, v, z) ds 0 and   z 1(0 < z ≤ n) fn (t, s; u, v, z) := n1/2 g3 ⌈nt⌉ − ⌈nu⌉, ⌈nγ s⌉ − ⌈n1/2 v⌉, 1 − n → h3 (t − u, −v, z) tending to a limit independent of s for each t < u, s ∈ R, v ∈ R, z > 0 fixed, according γ 1/2 v⌉ to Lemma 3.1 and using the fact that sups∈[0,y] | ⌈n s⌉−⌈n − v| → 0 for any y > 0 as n1/2 γ < 1/2. Whence, the point-wise convergence, as n → ∞, Gnγ (u, v, z) → Gγ (u, v, z) = = p X p X j=1 θj y j Z xj 0 h3 (t − u, −v, z) dt (3.28) θj F3γ (xj , yj ; u, v, z), j=1 can be obtained. The details of the proof of (3.28) and subsequently (3.17) and (3.16) are similar as in other cases above. This proves (3.13), and hence the limit in (3.9) in all cases of γ and β under consideration. The second statement of the theorem follows from (3.9) and Proposition 3.1. Theorem 3.1 is proved.  4. Scaling transition in the aggregated 4N model In this section, we discuss scaling transition and Type I isotropic distributional LRD property for the aggregated 4N model X4 in (1.9). Recall that g4 (t, s, a) in (1.9) is the Green function of the random walk {Wk } on Z2 with one-step transition probabilities shown in Figure 1(b). Recall that h4 (t, s, z) = Z q 2 2 ∞ −1 −zw−(t2 +s2 )/w K0 (2 z(t2 + s2 )) = w e dw, π π 0 (t, s) ∈ R20 , z > 0 is the potential of the Brownian motion in R2 with covariance matrix diag(1/2, 1/2), written via K0 , the modified Bessel function of second kind. See [29], Chapter 7.2. 24 D. Puplinskaitė and D. Surgailis For any γ > 0, introduce a RF V4γ = {V4γ (x, y); (x, y) ∈ R̄2+ } as a stochastic integral Z F4γ (x, y; u, v, z)M(du, dv, dz), (4.1) V4γ (x, y) := R2 ×R+ where F4γ (x, y; u, v, z) is defined as  Z xZ y   h4 (t − u, s − v, z) dt ds,    0 0   Z x Z     1(0 < v < y) dt h4 (t − u, w, z) dw,    0  ZR y Z F4γ := h4 (w, s − v, z) ds, 1(0 < u < x) dw    0 R   Z y     x h4 (u, s − v, z) ds,    0   R  x y 0 h4 (t − u, v, z) dt, γ = 1, γ > 1, β > (α − 1)/2, γ < 1, β > (α − 1)/2, (4.2) γ > 1, 0 < β < (α − 1)/2, γ < 1, 0 < β < (α − 1)/2, and where M is the same α-stable random measure on R2 × R+ as in (3.1). Proposition 4.1. (i) V4γ in (4.1) is well-defined for any γ > 0, 1 < α ≤ 2, 0 < β < α − 1 with exception of γ 6= 1, β = (α − 1)/2. It has α-stable finite-dimensional distributions and stationary rectangular increments in the sense of (2.3). f.d.d. (ii) V4γ is OSRF: for any λ > 0, {V4γ (λx, λγ y); (x, y) ∈ R2+ } = {λH(γ) V4γ (x, y); (x, y) ∈ 2 R+ }, with  2(α − β)   , γ = 1,   α     γ − 1 + 2(α − β)    , γ > 1, β > (α − 1)/2,   α   α + αγ − 2βγ (4.3) H(γ) := , γ > 1, β < (α − 1)/2,  α     1 − γ + 2γ(α − β)   , γ < 1, β > (α − 1)/2,   α       α + αγ − 2β , γ < 1, β < (α − 1)/2. α (iii) RFs V4γ = V4,+ (γ > 1) and V4γ = V4,− (γ < 1) do not depend on γ for γ > 1 and γ < 1. (iv) RF V4γ has properly dependent rectangular increments for γ = 1 and does not have properly dependent rectangular increments for γ 6= 1. (v) For α = 2, the RFs  B(3/2)−β,1/2 , 1/2 < β < 1, f.d.d. V4,+ = κ4,+ B1,1−β , 0 < β < 1/2, Aggregation of autoregressive random fields f.d.d. V4,− = κ4,−  25 B1/2,(3/2)−β , 1/2 < β < 1, B1−β,1 , 0 < β < 1/2, (4.4) agree, up to some constants κ4,± = κ4,± (β) 6= 0, with fractional Brownian sheet BH1 ,H2 where one of the parameters H1 , H2 equals 1/2 or 1. R Proof. (i) As in the proof of Proposition 3.1(i), we show Jγ := R2 ×R+ (F4γ (1, 1; u, v, z))α dµ < R R √ ∞ only. First, consider the case γ = 1. We have J1 = C R2 ×R+ ( (0,1]2 K0 (2 zkv − 2 2 2 2 ′ ′′ wk) dv)α z β dw := R dz < ∞. Here, kxk R x1 + x2 , for x = (x1 , x2 ) ∈ R . Split J1 = J + J , ′ ′′ where J := {kwk≤√2}×R+ · · · , J := {kwk>√2}×R+ · · · . By Minkowski’s inequality, ′′ J ≤C ≤C ≤C Z √ dv {kvk≤ 2} Z √ {kvk≤ 2} Z √ {kvk≤ 2} ≤C ≤C √ {kwk> 2}×R+ dv Z Z R∞ ∞ β z dz 0 kv − wk−2−2β dw α ∞ 1/α α 1/α α < ∞, √ K0α (2 z)z β dz < ∞ and 0 < β < α − 1 ≤ 2. Next, Z α Z ∞ √ dw K (2 z β dz zkvk) dv 0 √ Z 0 √ 2 {kvk≤ 2} √ K0 (2 zr)r dr 0 0 Z √ zkv − wk)z β dz dw 0 √ {kwk≤ 2} Z √ {kwk> 2} K0α (2 √ −2β/α ( 2 − kvk) dv where we used the facts that J′ ≤ C Z α z β (z −α/2 1(0 < z < 1) + z −α 1(z ≥ 1)) dz < ∞, where we used 0 < β < α − 1 and the inequality  −1/2 Z √2 √ z , K0 (2 zr)r dr ≤ C z −1 , 0 0 < z ≤ 1, z > 1, which is a consequence of the fact that the function r 7→ rK0 (r) is bounded and integrable on (0, ∞). This proves J1 < ∞. R R Next, let γ > 1, (α−1)/2 < β < α−1. Using h4⋆ (u, z) := R h4 (u, w, z) dw = π2 R K0 (2× q √ p p √ 1 −2 z|u| e z(u2 + w2 )) dw = π2 4zu1/2 K−1/2 (2 z|u|) = 4πz ([25], 6.596, 8.469), we obR R1 R R R β α tain Jγ ≤ C R du R+ z dz( 0 h4⋆ (t−u, z) dt) ≤ C{ |u|≤2 · · ·+ |u|>2 · · ·} =: C{Jγ′ +Jγ′′ }, where α Z 1 α Z 1 Z ∞ Z ∞ √ z β dz Jγ′ ≤ C h4⋆ (t, z) dt ≤ C z β−(α/2) dz e−2 zt dt 0 0 0 0 26 D. Puplinskaitė and D. Surgailis ≤C Z ∞ √ z β−α dz(1 − e−2 0 z α ) , where the last integral converges for any 0 < β < α − 1, 1 < α ≤ 2. Next, Z ∞ Z ∞ Z ∞ √ ′′ β−(α/2) −2 zu dz ≤ C z β−(1+α)/2 e−2z dz < ∞ Jγ ≤ C du z e 1 0 0 provided β > (α − 1)/2 holds. Hence, Jγ < ∞. R1 R R R Consider Jγ for γ > 1, 0 < β < (α−1)/2. We have Jγ ≤ C R du R dv R+ z β dz( 0 h4 (u, s− R R v, z) ds)α ≤ C{ |v|≤2 · · · + |v|>2 · · ·} =: C{Jγ′ + Jγ′′ }. By Minkowski’s inequality, Jγ′ ≤ C ≤C ≤C Z ∞ du 0 Z ∞ z β dz 0 Z 1 ds 0 Z 0 ds ∞ h4 (u, s, z) ds du Z ∞ z 0 Z ∞ 0 since β < (α − 1)/2. Next, Z Jγ′′ ≤ C Z 1 β K0α (2 ∞ dv Z ∞ 0 ∞ dv Z 0 du Z 0 ∞ α 1/α α q 2 2 z(t + u )) dz 1/α α du 2 (t + u2 )β+1 1 ≤C 1 0 Z 0 1 Z ∞ ≤C Z 1 ds 0  1 s2β+1 1/α α <∞ z β dzhα 4 (u, v, z) du ≤C 2 (u + v 2 )β+1 Z 1 ∞ dv v 1+2β < ∞. Hence, Jγ < ∞ for γ > 1. The case 0 < γ < 1 follows by symmetry. This proves the existence of V4γ for all choices of α, β, γ in (4.2). The remaining facts in (i) are similar as in Proposition 3.1. (ii) Follows analogously as in Proposition 3.1(ii). (iii) Follows from the definition of the integrand F4γ in (4.2). (iv) The proof is completely similar to that of Proposition 3.1(iii), taking into account the form of V4γ in (4.1) and the fact that h4 (u, v, z) is everywhere positive on R2 × R+ . (v) Follows from the OSRF property in (ii) analogously as in Proposition 3.1(v). Propo sition 4.1 is proved. The main result of this section is Theorem 4.1. Its proof is based on the asymptotics of the Green function g4 in Lemma 4.1, below. The proof of Lemma 4.1 can be found at http://arxiv.org/abs/1303.2209v3. Lemma 4.1. For any (t, s, z) ∈ R20 × (0, ∞)   q 2 z lim g4 [λt], [λs], 1 − 2 = h4 (t, s, z) = K0 (2 z(t2 + s2 )). λ→∞ λ π (4.5) Aggregation of autoregressive random fields 27 The convergence in (4.5) is uniform on any relatively compact set {ǫ < |t| + |s| < 1/ǫ} × {ǫ < z < 1/ǫ} ⊂ R20 × R+ , ǫ > 0. Moreover, there exists constants C, c > 0 such that for all sufficiently large λ and any (t, s, z) ∈ R20 × (0, λ2 ) the following inequality holds:   √ 1/2 1/2 z (4.6) g4 [λt], [λs], 1 − 2 < C{h4 (t, s, z) + e−c λ(|t| +|s| ) }. λ Theorem 4.1. Assume that the mixing density φ is bounded on [0, 1) and satisfies (1.8), where 0 < β < α − 1, 1 < α ≤ 2, β 6= (α − 1)/2. (4.7) Let X4 be the aggregated 4N model in (1.9). Then for any γ > 0 γ n −H(γ) [nx] [n y] X X t=1 s=1 f.d.d. X4 (t, s) −→ V4γ (x, y), x, y > 0, n → ∞, (4.8) where H(γ) and V4γ are given in (4.3) and (4.1), respectively. As a consequence, the RF X4 exhibits scaling transition at γ0 = 1 and enjoys Type I isotropic distributional LRD property in the sense of Definition 2.4. Proof. Similarly, as in the proof of Theorem 3.1, it suffices to prove the limit lim Jnγ = Jγ , (4.9) n→∞ where Jnγ := n −αH(γ) X (u,v)∈Z2 Jγ := Z R2 ×R+ E p X θj j=1 α |Gγ (u, v, z)| dµ, X α 1≤t≤[nxj ],1≤s≤[nγ yj ] Gγ (u, v, z) := g4 (t − u, s − v, A) , p X (4.10) θj F4γ (xj , yj ; u, v, z), j=1 for any p ∈ N+ , θj ∈ R, (xj , yj ) ∈ R2+ , j = 1, . . . , p. The proof of (4.9) follows the same strategy as in the case of Theorem 3.1, that is, we write Jnγ as a Riemann sum approximation Z α |Gnγ (u, v, z)| χn (z)µ(du, dv, dz), (4.11) Jnγ = R2 ×R+ to the integral Jγ , where χn (z) → 1(n → ∞) boundedly in z > 0, and Gnγ : R2 × R+ → R are some functions tending to Gγ in (4.10). We use Lemma 4.1 and the dominated convergence theorem to deduce the convergence in (4.9). Because of the differences in the form of the integrand in (4.2), several cases of γ and β need to be discussed separately. The approximation is similar as in the proof of Theorem 3.1 and is discussed briefly below. 28 D. Puplinskaitė and D. Surgailis For ǫ > 0, denote Wǫ := {(u, v, z) ∈ R2 × R+ : |u| + |v| < 1/ǫ, ǫ < z < 1/ǫ}, Wǫc := (R2 × R+ ) \ Wǫ . Similarly, as in Theorem 3.1, (4.9) follows from Z α |Gnγ (u, v, z) − Gγ (u, v, z)| dµ = 0 ∀ǫ > 0, (4.12) lim n→∞ W ǫ and lim lim sup ǫ→0 n→∞ Z α Wǫc |Gnγ (u, v, z)| dµ = 0. Case γ = γ0 = 1. In this case, (4.10) and (4.11) hold with Gγ0 (u, v, z) := R xj R yj 0 0 h4 (t − u, s − v, z) dt ds and Gnγ0 (u, v, z) := p X θj Z 0 j=1 ⌊nxj ⌋/n Z ⌊nyj ⌋/n 0 (4.13) Pp j=1 θj ×   z g4 ⌈nt⌉ − ⌈nu⌉, ⌈ns⌉ − ⌈nv⌉, 1 − 2 n × 1(0 < z < n2 ) dt ds. P3 Then, by splitting Gnγ0 (u, v, z) − Gγ0 (u, v, z) = i=1 Γni (u, v, z) and using Lemma 4.1 similarly as in the proof of Theorem 3.1, Case γ = 1/2, relation (4.12) can be obtained. Consider (4.13). Since Gγ0 ∈ Lα (µ), see the proof of Proposition 4.1(i), relation (4.13) holds with Gnγ0 replaced by Gγ0 . Hence and with (4.6) in mind, it √ suffices to check (4.13) R 1 R 1 −c( n|t−u|+√n|s−v|) 2 e with Gnγ0 replaced by Gn (u, v, z) := 1(0 < z < n ) 0 0 e dt ds, which follows from Z en (u, v, z))α dµ = O(n2(β−α+1) ) = o(1). (G (4.14) Jen := R2 ×R+ √ √ R R1 R R1 We have Jen ≤ Cn2β+2 { R ( 0 e−c n|t−u| dt)α du}2 , where R ( 0 e−c n|t−u| dt)α du ≤ R 3 −c√nv R R α ′ ′′ ′ α dv)α ≤ C/nα and {|u|<2} (· · ·) du + {|u|≥2} (· · ·) du =: in + in . Here, in ≤ C( 0 e √ R∞ ′√ i′′n ≤ C 2 e−cα n(u−1) du = O(e−c n ), c′ > 0. This proves (4.14) and (4.13). P Case γ > 1, (α − 1)/2 < β < α − 1. We have (4.11) with Gγ (u, v, z) = pj=1 θj 1(0 < v < Rx R yj ) 0 j dt R h4 (t − u, s, z) ds and Gnγ (u, v, z) := p X j=1 θj Z 0 ⌊nxj ⌋/n dtn −1 ⌊nγ yj ⌋ X s=1   z g4 ⌈nt⌉ − ⌈nu⌉, s − ⌈nγ v⌉, 1 − 2 n × 1(0 < z < n2 )   Z ⌊nxj ⌋/n Z p X z θj dt g4 ⌈nt⌉ − ⌈nu⌉, ⌈ns⌉, 1 − 2 = n R 0 j=1 × 1(0 < z < n2 , 1 − ⌈nγ v⌉ ≤ ⌈ns⌉ ≤ ⌊nγ yj ⌋ − ⌈nγ v⌉) ds Aggregation of autoregressive random fields =: p X θj j=1 Z xj dt 0 Z 29 fnj (t, s; u, v, z) ds, R cf. (3.22). From (1.12), (4.6) and γ > 1, for any u, t ∈ R, u 6= t, v ∈ R \ {0, yj }, j = 1, . . . , p, s, and z > 0, we have point-wise convergences   z g4 ⌈nt⌉ − ⌈nu⌉, ⌈n⌉, 1 − 2 1(0 < z < n2 ) → h4 (t − u, s, z), n 1(1 − ⌈nγ v⌉ ≤ ⌈ns⌉ ≤ ⌊nγ yj ⌋ − ⌈nγ v⌉) → 1(0 < v < yj ) implying fnj (t, s, u, v, z) → h4 (t − u, s, z)1(0 < v < yj ) similarly as in (3.24) in the proof of Theorem 3.1. The remaining details of the proof of (4.12) and (4.13) are similar as in Theorem 3.1, Case γ > 1/2, 0 < β < α − 1. Ry Pp Case γ > 1, 0 < β < (α−1)/2. We have (4.11) with Gγ (u, v, z) = j=1 θj xj 0 j h4 (−u, s− v, z) ds and Gnγ (u, v, z) := p X j=1 θj Z ⌊nxj ⌋/n dt 0 Z 0 × 1(0 < z < n2γ ) Z ⌊nxj ⌋/n Z p X θj dt =: j=1 0 ⌊nγ yj ⌋/nγ ⌊nγ yj ⌋/nγ   z γ γ γ g4 ⌈nt⌉ − ⌈n u⌉, ⌈n s⌉ − ⌈n v⌉, 1 − 2γ n fn (t, s; u, v, z) ds, 0 where fn (t, s; u, v, z) → f (s; u, v, z) := h4 (−u, s − v, z) tends to a limit independent of t, as n → ∞. Again, we omit the details of the proof of (4.12) and (4.13) which are similar as in Theorem 3.1, Case γ > 1/2, −(α − 1)/2 < β < (α − 1)/2. Case 0 < γ < 1 in (4.8) follows from case γ > 1 by lattice isotropy of the 4N model. This ends the proof of (4.8). The second statement of the theorem follows from Proposition 4.1. Theorem 4.1 is proved.  The following proposition obtains the asymptotic behavior of the covariance function r4 (t, s) = EX4 (t, s)X4 (0, 0) of the aggregated Gaussian RF X4 in (1.9) (α = 2). The proof of Proposition 4.2 uses Lemma 4.1 and is omitted.  Proposition 4.2. Assume α = 2 and the conditions of Theorem 4.1. Then for any (t, s) ∈ R20 lim λ2β r4 ([λt], [λs]) = λ→∞ σ 2 φ1 Γ(β + 1)Γ(β) 2 −β (t + s2 ) . π (4.15) 5. Auxiliary results This section obtains conditions for the existence of a stationary solution of a general random-coefficient nearest-neighbor autoregressive RF in (5.1). We also discuss contem- 30 D. Puplinskaitė and D. Surgailis poraneous aggregation of (5.1) under the assumption that the innovations belong the domain of attraction of α-stable law, 0 < α ≤ 2. 5.1. Existence of random-coefficient autoregressive RF Consider a general random-coefficient nearest-neighbor autoregressive RF on Z2 : X a(u, v)X(t + u, s + v) + ε(t, s), (t, s) ∈ Z2 , (5.1) X(t, s) = |u|+|v|=1 where {ε(t, s); (t, s) ∈ Z2 } are i.i.d. r.v.’s with finite pth moment, p ∈ (0, 2], and a(t, s) ≥ 0, |t| + |s| = 1 are random coefficients independent of {ε(t, s)} and satisfying X a(t, s) ∈ (0, 1) a.s. (5.2) A := |t|+|s|=1 Set also a(t, s) := 0, (t, s) ∈ Z2 , |t| + |s| 6= 1. Clearly, the 3N and 4N models in (1.6) and (1.7) are particular cases of (5.1). Let us discuss solvability of (5.1). We will show that under certain conditions this equation admits a stationary solution given by the convergent series X g(t − u, s − v, a)ε(u, v), (t, s) ∈ Z2 , (5.3) X(t, s) = (u,v)∈Z2 where g(t, s, a), (t, s) ∈ Z2 , a = (a(t, s); |t| + |s| = 1) ∈ [0, 1)4 is the (random) Green function defined as g(t, s, a) := ∞ X a⋆k (t, s), (5.4) k=0 where a⋆k (t, s) is the k-fold convolution of a(t, s), (t, s) ∈ Z2 defined recursively by  1, (t, s) = (0, 0), ⋆0 a (t, s) = δ(t, s) := 0, (t, s) 6= (0, 0), X a⋆(k−1) (u, v)a(t − u, s − v), k ≥ 1. a⋆k (t, s) = (u,v)∈Z2 Note that (5.4) can be rewritten as g(t, s, a) = ∞ X Ak pk (t, s), (5.5) k=0 cf. (1.10), where A is defined in (5.2) and pk (t, s) = P(Wk = (t, s)|W0 = (0, 0)) is the kstep probability of nearest-neighbor random walk {Wk , k = 0, 1, . . .} on Z2 with one-step Aggregation of autoregressive random fields 31 transition probabilities p(t, s) := a(t, s) ≥ 0, A (t, s) ∈ Z2 . (5.6) Generally, the pk (t, s)’s depend also on a = (a(t, s); |t| + |s| = 1) ∈ [0, 1)4 but this dependence is suppressed below for brevity. Note that the series in (5.5) absolutely converges a.s., moreover, X g(t, s, a) = (t,s)∈Z2 ∞ X k A X pk (t, s) = (t,s)∈Z2 k=0 ∞ X Ak = k=0 1 <∞ 1−A a.s. (5.7) according to (5.2). From (5.7), it follows that the Fourier transforms p̂(x, y) := P −i(tx+sy) p(t, s) and |t|+|s|=1 e ĝ(x, y, a) := X e −i(tx+sy) g(t, s, a) = (t,s)∈Z2 = ∞ X k=0 k Ak (p̂(x, y)) = k=0 ∞ X Ak X e−i(tx+sy) pk (t, s) (t,s)∈Z2 1 1 − Ap̂(x, y) are well-defined and continuous on Π2 := [−π, π]2 , a.s. From Parseval’s identity, Z X dx dy 2 −2 . |g(t, s, a)| = (2π) |1 − Ap̂(x, y)|2 2 Π 2 (5.8) (t,s)∈Z Let q1 := p(0, 1) + p(0, −1) = 1 − p(1, 0) − p(−1, 0) =: 1 − q2 , µ1 := p(1, 0) − p(−1, 0), µ2 := p(0, 1) − p(0, −1), q := min(q1 , q2 ), (5.9) q 2 2 µ := µ1 + µ2 . Note qi ∈ [0, 1] and q1 = 0 (resp., q2 = 0) means that random walk {Wk } is concentrated on the horizontal (resp., vertical) axis of the lattice Z2 . Condition µ = 0 means that {Wk } has zero mean. Denote     1 1 µ2 Ψ(A, q, µ) := min . (5.10) , p 1 + log+ q(1 − A) µ q(1 − A) q(1 − A) The main result of this section is Theorem 5.1, below, which provides sharp sufficient conditions for the convergence of the series in (5.3) involving the quantity Ψ(A, q, µ) in (5.10). The proof of Theorem 5.1 uses the following Lemma 5.1. The proof of this lemma is given at the end of this subsection. 32 D. Puplinskaitė and D. Surgailis Lemma 5.1. There exists a (non-random) constant C < ∞ such that Z dx dy ≤ CΨ(A, q, µ). 2 Π2 |1 − Ap̂(x, y)| (5.11) Theorem 5.1. (i) Assume there exists 0 < p ≤ 2 such that p E|ε(0, 0)| < ∞ and Eε(0, 0) = 0 for 1 ≤ p ≤ 2. (5.12) Then there exists a stationary solution of random-coefficient equation (5.1) given by (5.3), where the series converges conditionally a.s. and in Lp for any a = (a(t, s) ≥ 0, |t| + |s| = 1) ∈ [0, 1)4 satisfying (5.2). (ii) In addition to (5.12), assume that q > 0 a.s. and  E[Ψ(A, q, µ)p−1 (1 − A)p−2 ] < ∞, if 1 < p ≤ 2, (5.13) 2p−3 E[(1 − A) ] < ∞, if 0 < p ≤ 1. Then the series in (5.3) converges unconditionally in Lp , moreover,  E[Ψ(A, q, µ)p−1 (1 − A)p−2 ] < ∞, 1 < p ≤ 2, p E[|X(t, s)| ] ≤ C E[(1 − A)2p−3 ] < ∞, 0 < p ≤ 1. (5.14) Proof. Part (i) follows similarly as in [43], proof of Proposition 1. Let us prove part (ii). We shall use the following inequality; see [50], also [43], (2.7). Let 0 < p ≤ 2, and let ξ1 , ξ2 , . . . be random variables with E|ξi |p < ∞. For 1 ≤ p ≤ 2,Passume inP addition that the ξi ’s are independent and have zero mean Eξi = 0. Then E| i ξi |p ≤ 2 i E|ξi |p . The last inequality and the fact that (5.3) converges conditionally in Lp (see part (i)) imply that X p p p |g(u, v, a)| . (5.15) E[|X(t, s)| |a] ≤ 2E|ε(0, 0)| (u,v)∈Z2 Accordingly, it suffices to prove that X p |g(t, s, a)| < ∞. E (5.16) (t,s)∈Z2 For p = 2, (5.16) is immediate from (5.8) and (5.11). Next, using (5.8), (5.11) and Hölder’s inequality, for any 1 < p < 2 we obtain X X 2(p−1) 2−p p |g(t, s, a)| |g(t, s, a)| |g(t, s, a)| = (t,s)∈Z2 (t,s)∈Z2 ≤  X (t,s)∈Z2 |g(t, s, a)| 2 p−1  X (t,s)∈Z2 ≤ CΨ(A, q, µ)p−1 (1 − A)p−2 . |g(t, s, a)| 2−p (5.17) Aggregation of autoregressive random fields 33 Next, consider the case 0 < p ≤ 1. Using (5.5), the inequality | Hölder’s inequality, we obtain X (t,s)∈Z2 p |g(t, s, a)| ≤ ≤ ∞ X Akp k=0 ∞ X kp A ∞ X k=0  X i xi | p ≤ P i |xi | p and ppk (t, s) |t|+|s|≤k k=0 ≤C X P |t|+|s|≤k p  X pk (t, s) Akp k 2(1−p) ≤ |t|+|s|≤k 1 1−p (5.18) C C ≤ , p 3−2p (1 − A ) (1 − A)3−2p where the last inequality follows from 1 − xp ≥ p(1 − x), x ∈ [0, 1]. Note that C in (5.17)– (5.18) are non-random. Hence, (5.16) follows from (5.13) and the bounds in (5.17)–(5.18), proving the unconditional convergence of (5.3). Inequality (5.14) is a consequence of (5.17)–(5.18) and (5.15).  Proof of Lemma 5.1. Write I for the left-hand side of (5.11). Since (5.11) holds trivially for 0 ≤ A ≤ 1/2, we assume 1/2 < A < 1 in the sequel. We have X p(t, s)(1 − ei(tx+sy) ) 1 − Ap̂(x, y) = (1 − A) + A |t|+|s|=1 = (1 − A) + A[q2 (1 − cos(x)) + q1 (1 − cos(y))] − iA(µ1 sin(x) + µ2 sin(y)) and 2 2 |1 − Ap̂(x, y)| = ((1 − A) + A[q2 (1 − cos(x)) + q1 (1 − cos(y))]) + A2 (µ1 sin(x) + µ2 sin(y)) 2 ≥ (1/4){((1 − A) + q[(1 − cos(x)) + (1 − cos(y))]) 2 (5.19) 2 + µ2 (ν1 sin(x) + ν2 sin(y)) }, R where νi := µi /µ, i = 1, 2, ν12 + ν22 = 1. Split I = I1 + I2 , where I1 := [−π/4,π/4]2 , I2 := R . Changing the coordinates sin(x) = u, sin(y) = v, ν1 u + ν2 v = s, −ν2 u + Π2 \[−π/4,π/4]2 ν1 v = t, r2 = t2 + s2 , s = r sin(φ) we get Z 1 p I1 = C √ √ 2 2 (1 − u )(1 − v 2 ) [−1/ 2,1/ 2] du dv √ √ × 2 {((1 − A) + q[(1 − 1 − u ) + (1 − 1 − v 2 )])2 + µ2 (ν1 u + ν2 v)2 } Z du dv ≤C 2 + v 2 ])2 + µ2 (ν u + ν v)2 ((1 − A) + q[u 2 2 1 2 u +v ≤1 34 D. Puplinskaitė and D. Surgailis =C Z ds dt ((1 − A) + q[s2 + t2 ])2 + µ2 s2 t2 +s2 ≤1 =C Z 1Z 0 π/2 rdr dφ . ((1 − A) + qr2 )2 + µ2 r2 sin2 (φ) 0 Using sin(φ) ≥ (1/2)φ, φ ∈ [0, π/2) with W := Z 1Z ((1−A)+qx)2 , x we obtain 1 dx dy ((1 − A) + qx)2 + µ2 xy 2 0 0 Z 1 Z 1 dx dy ≤C x W + µ2 y 2 0 0 √ Z 1/ W Z 1 du dx √ ≤C 1 + µ2 u 2 0 x W 0   Z C 1 dx µ √ min 1, √ ≤ = C(I1′ + I1′′ ), µ 0 x W W I1 ≤ C where I1′ 1 := µ Z 1 0 √ dx √ 1(µ > W ), x W I1′′ := Z 0 1 √ dx 1(µ < W ). xW Here, I1′′ Z ≤ min ∞ dx 1 , ((1 − A) + qx)2 µ 0  ≤ C min Z 1 1 , p q(1 − A) µ q(1 − A) 0 ∞  . dx x1/2 ((1 − A) + qx)  (5.20) Since I1′ = 0 for µ2 ≤ q(1 − A) we obtain I1′ 1 ≤ µ Z 0 1 dx 1(µ2 > q(1 − A)) x1/2 ((1 − A) + qx) C 1(µ2 > q(1 − A)). ≤ p µ q(1 − A) (5.21) Relations (5.20) and (5.21) yield  I1 ≤ C min  1 1 , p . q(1 − A) µ q(1 − A) (5.22) Aggregation of autoregressive random fields 35 Below we prove the bound  (1 − A + q)−2 , I2 ≤ C µ−1 (1 − A + q)−1 (1 + log(µ/(1 − A + q))), µ ≤ 1 − A + q, µ > 1 − A + q, (5.23) p with C independent of A, q, µ, as elsewhere in this proof. Since 1 − A + q ≥ q(1 − A), the desired inequality (5.11), viz., I ≤ CΨ(A, q, µ), follows from (5.22) and (5.23). Let us prove (5.23). For µ ≤ 1 − A + q it follows trivially from (5.19). Let µ > 1 − A + q in the rest of the proof. From (5.19), we obtain that Z dx dy I2 ≤ C 2 2 2 Π2 \[−π/4,π/4]2 (1 − A + q) + µ (ν1 sin(x) + ν2 sin(y)) (5.24) Z dx dy ≤C , 2 2 2 [0,π/2]2 (1 − A + q) + µ (ν̃1 sin(x) + ν̃2 sin(y)) where |ν̃i | = |νi |, i = 1, 2 satisfy ν̃12 + ν̃22 = 1. Then I2 ≤ C ≤ Z C µ2 [0,1]2 Z (1 − u2 )−1/2 (1 − v 2 )−1/2 du dv (1 − A + q)2 + µ2 (ν̃1 u + ν̃2 v)2 [0,1]2 We claim that Z [0,1]2 (ǫ2 du dv p + (ν̃1 u + ν̃2 v)2 ) (1 − u)(1 − v) (ǫ2 du dv C p ≤ (1 + log+ (1/ǫ)) 2 ǫ + (ν̃1 u + ν̃2 v) ) (1 − u)(1 − v) with ǫ := 1−A+q ≥ 0. µ (5.25) with C < ∞ independent of ǫ > 0 and ν̃i , i = 1, 2, ν̃12 + ν̃22 = 1. Bound (5.25) proves (5.23) and hence (5.11) and the lemma, too. Therefore, it remains to prove (5.25). √ √ By symmetry, it suffices to prove (5.25) for ν̃1 ≥ 1/ 2, 0 ≥ ν̃2 ≥ −1/ 2, or Z du dv C p J := ≤ (1 + log+ (1/ǫ)) 2 + (u − rv)2 ) (1 − u)(1 − v) ǫ 2 (ǫ [0,1] (5.26) uniformly in r ∈ [0, 1]. We have J = where √1 r Rr 0 J11 √dv r−v R1 1 := √ r 1 J12 := √ r du √ 0 (ǫ2 +(u−v)2 ) 1−u Z r 0 Z 0 r = 1(1 − v > 2ǫ) dv √ r−v 1(1 − v > 2ǫ) dv √ r−v √1 r Z Z 1 0 1 0 Rr 0 √dv r−v R1 dz √ 0 (ǫ2 +(1−z−v)2 ) z 1(|1 − z − v| > ǫ) dz √ , (ǫ2 + (1 − z − v)2 ) z 1(|1 − z − v| < ǫ) dz √ , (ǫ2 + (1 − z − v)2 ) z = P2 i,j=1 Jij , 36 D. Puplinskaitė and D. Surgailis 1 J21 := √ r 1 J22 := √ r Z r 0 Z r 0 1(1 − v < 2ǫ) dv √ r−v 1(1 − v < 2ǫ) dv √ r−v Z Z 1 1(|1 − z − v| > ǫ) dz √ , (ǫ2 + (1 − z − v)2 ) z 0 1 1(|1 − z − v| < ǫ) dz √ . (ǫ2 + (1 − z − v)2 ) z 0 Bound (5.26) will be proved for each Jij , i, j = 1, 2. Estimation of J22 . We have J22 1 ≤√ r Z r 1(1 − v < 2ǫ) dv 1 √ ǫ2 r−v Z 1 1(|1 − z − v| < ǫ) dz √ z 0 0 Z r Z 3ǫ Z r C 1 1(1 − v < 2ǫ) dv 1 dz 1(1 − v < 2ǫ) dv √ √ ≤ √ 3/2 √ ≤√ r 0 ǫ2 0 z rǫ r−v r−v 0 Z r C dv C √ ≤ √ 3/2 1(r > 1 − 2ǫ) ≤ 1(r > 1 − 2ǫ). ǫ rǫ r − v r−2ǫ (5.27) Estimation of J21 . We have Z 1(1 − rv < 2ǫ) dv 1 1(|1 − z − rv| > ǫ) dz √ √ (1 − z − rv)2 z 1−v 0 0 (5.28) Z 2ǫ Z Z Z dx 1 1(|x − z| > ǫ) dz 1 2 dx ∞ 1(|x − z| > 1) dz C √ √ √ √ = ≤ ≤ x 0 (x − z)2 z ǫ 0 x 0 (x − z)2 z ǫ 0 J21 ≤ Z 1 since the last double integral converges. Estimation of J12 . We have 1 J12 ≤ √ r C ≤√ r Z r 1(1 − v > 2ǫ) dv 1 √ ǫ2 r−v 0 Z C ≤√ 2 rǫ C ≤√ 2 rǫ r 0 Z 1(1 − v > 2ǫ) dv 1 √ ǫ2 r−v r 0 Z 0 r Z 0 r 1 0 Z 1(|(1 − v) − z| < ǫ) dz √ z 1−v+ǫ 1−v−ǫ dz √ z √ 1(1 − v > 2ǫ) dv √ √ ( 1 − v + ǫ − 1 − v − ǫ) r−v (5.29) ǫ C log(1/ǫ) 1(1 − v > 2ǫ) dv √ √ . ≤ ǫ r−v 1−v Rr Indeed, if r ∈ [0, 1/2] then √1r 0 then with z = w − (2ǫ + r − 1) 1 √ r Z 1(1 − v > 2ǫ) dv √ √ ≤C r−v 1−v 1(1−v>2ǫ) dv √ √ r−v 1−v Z 0 r ≤ C √ r Rr 0 dw √ w 1(w > 2ǫ + r − 1) dw √ √ w 1−r+w ≤ C, and if r ∈ [1/2, 1], ǫ ≤ 1/2 Aggregation of autoregressive random fields Z 1  dz   , √ √  z z + 2ǫ ≤ C Z0 r  dw   , √ √  w 1 −r+w 0 37 2ǫ > 1 − r, 1 − r ≥ 2ǫ, ≤ C log(1/ǫ). Estimation of J11 . We have 1 J11 ≤ √ r Z 1−r C ≤ √ ǫ r where L(w) := R∞ 0 1 Z 1(w > 2ǫ) dw p w − (1 − r) 1/ǫ (1−r)/ǫ 1(|z−w|>1) dz √ (z−w)2 z Z 1 0 1(|z − w| > ǫ) dz √ (z − w)2 z (5.30) L(w)1(w > 2) dw p , w − (1 − r)/ǫ ≤ Cw−1/2 for w ≥ 1. W.l.g., let ǫ ∈ (0, 1/2]. First, let (1 − r)/ǫ < 1, then r ∈ (1/2, 1] and w − 1−r ǫ > w/2 for w > 2. The above facts imply that J11 ≤ C ǫ Z 1/ǫ 1 dw C log(1/ǫ) ≤ w ǫ when (1 − r)/ǫ < 1, (5.31) with C independent of r, ǫ. Next, let (1 − r)/ǫ ≥ 1 then from (5.30), L(w) = O(w−1/2 ) 1−r and the change of variables w − 1−r ǫ = ǫ x we obtain J11 C ≤ √ ǫ r Z r/(1−r) 0 C log(1/ǫ) ≤ ǫ C dx ≤ √ √ √ x 1+x ǫ r ( 1/2 (r/(1 − r)) , log(r/(1 − r)), r ∈ [0, 3/4], r ∈ [3/4, 1], (5.32) when (1 − r)/ǫ ≥ 1. Bounds (5.31), (5.32) prove (5.26) for J11 , thereby completing the proof of (5.26). Lemma 5.1 is proved.  5.2. Aggregation of autoregressive RF Definition 5.2. Write ε ∈ D(α), 0 < α ≤ 2 if (i) α = 2 and Eε = 0, σ 2 := Eε2 < ∞, or (ii) 0 < α < 2 and there exist some constants c1 , c2 ≥ 0, c1 + c2 > 0 such that lim xα P(ε > x) = c1 x→∞ and lim |x|α P(ε ≤ x) = c2 ; x→−∞ moreover, Eε = 0 whenever 1 < α < 2, while for α = 1 we assume that the distribution of ε is symmetric. 38 D. Puplinskaitė and D. Surgailis Remark 5.1. Condition ε ∈ D(α) implies that the r.v. ε belongs to the domain of normal attraction of an α-stable law; in other words, N −1/α N X i=1 d εi −→ Z, N → ∞, (5.33) where Z is an α-stable r.v.; see [18], pages 574–581. The characteristic function of r.v. Z in (5.33) is given by EeiθZ = e−|θ| α ω(θ) , θ ∈ R, (5.34) where ω(θ) depends only on sign(θ) and α, c1 , c2 , σ in Definition 5.2. See, for example, [18], pages 574–581. Let {Xi (t, s)}, i = 1, 2, . . . be independent copies of (5.3) with i.i.d. innovations ε(t, s) ∈ D(α), 0 < α ≤ 2. The aggregated field {X(t, s); (t, s) ∈ Z2 } is defined as the limit in distribution: N −1/α N X i=1 f.d.d. Xi (t, s) −→ X(t, s), (t, s) ∈ Z2 , N → ∞. (5.35) Introduce an independently scattered α-stable random measure M on Z2 × [0, 1)4 with characteristic functional  X    X α E exp i θt,s Mt,s (Bt,s ) = exp − |θt,s | ω(θt,s )Φ(Bt,s ) , (5.36) (t,s)∈Z2 (t,s)∈Z2 where Φ(B) := P(a = (a(t, s), |t| + |s| = 1) ∈ B) is the mixing distribution, θt,s ∈ R, B, Bt,s ⊂ [0, 1)4 are arbitrary Borel sets, and ω is the same as in (5.34). According to the terminology in [46], Definition 3.3.1, M is called an α-stable measure with control measure Re(ω(1))Φ(da) proportional to the mixing distribution Φ, and a constant skewness intensity Im(ω(1))/ Re(ω(1)) tan(πα/2). Proposition 5.1. Let ε(0, 0) ∈ D(α), 0 < α ≤ 2. satisfies the following condition: there exists ǫ > 0    E[Ψ(A, q, µ)] < ∞, E[Ψp−1 (A, q, µ)(1 − A)p−2 ] < ∞,   E[(1 − A)2α−3−ǫ ] < ∞, Assume that the mixing distribution such that if α = 2, if 1 < α < 2, p = α ± ǫ, if 0 < α ≤ 1, (5.37) where Ψ(A, q, µ) is defined in (5.10). Then the limit aggregated RF in (5.35) exists and has the stochastic integral representation X Z X(t, s) = g(t − u, s − v, a)Mu,v (da), (t, s) ∈ Z2 . (5.38) (u,v)∈Z2 [0,1)4 Aggregation of autoregressive random fields 39 Remark 5.2. Note for the 3N and 4N models, we have µ = 1, q = 1/3, Ψ(A, 1/3, 1) ≤ √ C (1 + | log(1 − A)|) and µ = 0, q = 1/4, Ψ(A, 1/4, 0) ≤ C/(1 − A), respectively. As a 1−A consequence, for the aggregated 3N and 4N models and a regularly varying (mixing) density of A in (1.8), condition (5.37) for 1 < α ≤ 2 reduces to β > −(α − 1)/2 and β > 0, respectively. Proof of Proposition 5.1. Let T ⊂ Z2 be a finite set, θt,s ∈ R, (t, s) ∈ T , and SN = PN N −1/α i=1 Ui be a sum of i.i.d. r.v.’s with common distribution X X θt,s X(t, s) = G(u, v, a)ε(u, v), U := (u,v)∈Z2 (t,s)∈T X G(u, v, a) := (t,s)∈T θt,s g(t − u, s − v, a). P d It suffices to prove that SN −→ S(N → ∞), where S := (t,s)∈T θt,s X(t, s) is a α-stable r.v. with characteristic function   X α iwS α E[|G(u, v, a)| ω(wG(u, v, a))] . Ee = exp −|w| (u,v)∈Z2 For this, it suffices to prove that r.v. U belongs to the domain of attraction of r.v. S (in the sense of (5.33)) or U ∈ D(α), see Remark 5.1; in other words, that EU 2 = ES 2 < ∞ for α = 2, (5.39) and, for 0 < α < 2, X lim xα P(U > x) = x→∞ (u,v)∈Z2 α lim |x| P(U ≤ x) = x→−∞ X (u,v)∈Z2 α E[|G(u, v, a)| {c1 1(G(u, v, a) > 0) + c2 1(G(u, v, a) < 0)}], (5.40) E[|G(u, v, a)| {c1 1(G(u, v, a) < 0) + c2 1(G(u, v, a) > 0)}], α where ci , i = 1, 2 are the asymptotic constants in Definition 5.2 satisfied by ε(0, 0) ∼ D(α). Here, (5.39) follows from definitions of U and S and Theorem 5.1 with p = 2. To prove (5.40), we use [28], Theorem 3.1. Accordingly, it suffices to check that there exists ǫ > 0 such that for 0 < α < 2, α 6= 1, X X α+ǫ α−ǫ E|G(u, v, a)| < ∞ and E|G(u, v, a)| < ∞, (5.41) (u,v)∈Z2 (u,v)∈Z2 and E  X (u,v)∈Z2 |G(u, v, a)| α−ǫ (α+ǫ)/(α−ǫ) <∞ for α = 1. 40 D. Puplinskaitė and D. Surgailis Since T ⊂ Z2 is a finite set, it suffices to show (5.41) withPG(u, v, a) replaced by g(u, v, a). Let 1 < α < 2 and p = α ± ǫ ∈ (1, 2) in (5.37). Then (u,v)∈Z2 E|g(u, v, a)|p ≤ CE[Ψ(A, q, µ)p−1 (1 − A)p−2 ] < ∞ follows from (5.17) and (5.37). In the case 0 < α < 1, relations (5.41) immediately follow from (5.18) and (5.37) with p = α ± ǫ ∈ (0, 1). For  α = 1, (5.41) follows from (5.18) in a similar way. Acknowledgements The authors are grateful to several anonymous referees for numerous suggestions and comments which helped to improve this and the previous versions of this paper. This research was supported by a grant (No. MIP-063/2013) from the Research Council of Lithuania. References [1] Albeverio, S., Molchanov, S.A. and Surgailis, D. (1994). Stratified structure of the Universe and Burgers’ equation – a probabilistic approach. Probab. Theory Related Fields 100 457–484. MR1305783 [2] Anh, V.V., Angulo, J.M. and Ruiz-Medina, M.D. (1999). Possible long-range dependence in fractional random fields. J. Statist. Plann. Inference 80 95–110. MR1713795 [3] Anh, V.V., Leonenko, N.N. and Ruiz-Medina, M.D. (2013). Macroscaling limit theorems for filtered spatiotemporal random fields. Stoch. Anal. Appl. 31 460–508. MR3049079 [4] Ayache, A., Leger, S. and Pontier, M. (2002). Drap brownien fractionnaire. Potential Anal. 17 31–43. MR1906407 [5] Beran, J., Feng, Y., Ghosh, S. and Kulik, R. (2013). Long-Memory Processes: Probabilistic Properties and Statistical Methods. Heidelberg: Springer. MR3075595 [6] Bhattacharyya, B.B., Richardson, G.D. and Franklin, L.A. (1997). Asymptotic inference for near unit roots in spatial autoregression. Ann. Statist. 25 1709–1724. MR1463571 [7] Biermé, H., Meerschaert, M.M. and Scheffler, H.-P. (2007). Operator scaling stable random fields. Stochastic Process. Appl. 117 312–332. MR2290879 [8] Celov, D., Leipus, R. and Philippe, A. (2007). Time series aggregation, disaggregation, and long memory. Liet. Mat. Rink. 47 466–481. MR2392713 [9] Clausel, M. and Vedel, B. (2011). Explicit construction of operator scaling Gaussian random fields. Fractals 19 101–111. MR2776743 [10] Cox, D.R. (1984). Long-range dependence: A review. In Statistics: An Appraisal (H.A. David and H.T. David, eds.) 55–74. Iowa: Iowa State Univ. Press. [11] Dehling, H. and Philipp, W. (2002). Empirical process techniques for dependent data. In Empirical Process Techniques for Dependent Data (H. Dehling, T. Mikosch and M. Sørensen, eds.) 3–113. Boston, MA: Birkhäuser. MR1958777 [12] Dobrushin, R.L. (1979). Gaussian and their subordinated self-similar random generalized fields. Ann. Probab. 7 1–28. MR0515810 [13] Dobrushin, R.L. and Major, P. (1979). Non-central limit theorems for nonlinear functionals of Gaussian fields. Z. Wahrsch. Verw. Gebiete 50 27–52. MR0550122 Aggregation of autoregressive random fields 41 [14] Dombry, C. and Kaj, I. (2011). The on-off network traffic model under intermediate scaling. Queueing Syst. 69 29–44. MR2835229 [15] Doukhan, P. (2003). Models, inequalities, and limit theorems for stationary sequences. In Theory and Applications of Long-Range Dependence (P. Doukhan, G. Oppenheim and M.S. Taqqu, eds.) 43–100. Boston, MA: Birkhäuser. MR1956044 [16] Doukhan, P., Lang, G. and Surgailis, D. (2002). Asymptotics of weighted empirical processes of linear fields with long-range dependence. Ann. Inst. Henri Poincaré Probab. Stat. 38 879–896. MR1955342 [17] Doukhan, P., Oppenheim, G. and Taqqu, M.S., eds. (2003). Theory and Applications of Long-Range Dependence. Boston, MA: Birkhäuser. MR1956041 [18] Feller, W. (1966). An Introduction to Probability Theory and Its Applications. Vol. II. New York: Wiley. MR0210154 [19] Gaigalas, R. (2006). A Poisson bridge between fractional Brownian motion and stable Lévy motion. Stochastic Process. Appl. 116 447–462. MR2199558 [20] Gaigalas, R. and Kaj, I. (2003). Convergence of scaled renewal processes and a packet arrival model. Bernoulli 9 671–703. MR1996275 [21] Giraitis, L., Koul, H.L. and Surgailis, D. (2012). Large Sample Inference for Long Memory Processes. London: Imperial College Press. MR2977317 [22] Giraitis, L., Leipus, R. and Surgailis, D. (2009). ARCH(∞) models and long memory properties. In Handbook of Financial Time Series (T.G. Andersen, R.A. Davis, J.P. Kreiss and T. Mikosch, eds.) 71–84. Berlin: Springer. [23] Giraitis, L., Leipus, R. and Surgailis, D. (2010). Aggregation of the random coefficient GLARCH(1, 1) process. Econometric Theory 26 406–425. MR2600569 [24] Gonçalves, E. and Gouriéroux, C. (1988). Agrégation de processus autorégressifs d’ordre 1. Ann. Économ. Statist. 12 127–149. MR1002213 [25] Gradshteyn, I.S. and Ryzhik, I.M. (1962). In Tables of Integrals, Sums, Series and Products. Moscow: Fizmatgiz. [26] Granger, C.W.J. (1980). Long memory relationships and the aggregation of dynamic models. J. Econometrics 14 227–238. MR0597259 [27] Guo, H., Lim, C.Y. and Meerschaert, M.M. (2009). Local Whittle estimator for anisotropic random fields. J. Multivariate Anal. 100 993–1028. MR2498729 [28] Hult, H. and Samorodnitsky, G. (2008). Tail probabilities for infinite series of regularly varying random vectors. Bernoulli 14 838–864. MR2537814 [29] Itô, K. and McKean, H.P. Jr. (1974). Diffusion Processes and Their Sample Paths. Berlin: Springer. MR0345224 [30] Kazakevičius, V., Leipus, R. and Viano, M.-C. (2004). Stability of random coefficient ARCH models and aggregation schemes. J. Econometrics 120 139–158. MR2047783 [31] Lamperti, J. (1962). Semi-stable stochastic processes. Trans. Amer. Math. Soc. 104 62–78. MR0138128 [32] Lavancier, F. (2007). Invariance principles for non-isotropic long memory random fields. Stat. Inference Stoch. Process. 10 255–282. MR2321311 [33] Lavancier, F. (2011). Aggregation of isotropic autoregressive fields. J. Statist. Plann. Inference 141 3862–3866. MR2823655 [34] Lavancier, F., Leipus, R. and Surgailis, D. (2014). Anisotropic long-range dependence and aggregation of space-time models. Preprint. [35] Leonenko, N. and Olenko, A. (2013). Tauberian and Abelian theorems for long-range dependent random fields. Methodol. Comput. Appl. Probab. 15 715–742. MR3117624 [36] Leonenko, N.N. (1999). Random Fields with Singular Spectrum. Dordrecht: Kluwer. 42 D. Puplinskaitė and D. Surgailis [37] Leonenko, N.N., Ruiz-Medina, M.D. and Taqqu, M.S. (2011). Fractional elliptic, hyperbolic and parabolic random fields. Electron. J. Probab. 16 1134–1172. MR2820073 [38] Leonenko, N.N. and Taufer, E. (2013). Disaggregation of spatial autoregressive processes. Spatial Statist. 3 1–20. [39] Mikosch, T., Resnick, S., Rootzén, H. and Stegeman, A. (2002). Is network traffic approximated by stable Lévy motion or fractional Brownian motion? Ann. Appl. Probab. 12 23–68. MR1890056 [40] Oppenheim, G. and Viano, M.-C. (2004). Aggregation of random parameters OrnsteinUhlenbeck or AR processes: Some convergence results. J. Time Series Anal. 25 335– 350. MR2062677 [41] Philippe, A., Puplinskaite, D. and Surgailis, D. (2014). Contemporaneous aggregation of triangular array of random-coefficient AR(1) processes. J. Time Series Anal. 35 16– 39. MR3148246 [42] Pilipauskaitė, V. and Surgailis, D. (2014). Joint temporal and contemporaneous aggregation of random-coefficient AR(1) processes. Stochastic Process. Appl. 124 1011–1035. MR3138604 [43] Puplinskaitė, D. and Surgailis, D. (2009). Aggregation of random-coefficient AR(1) process with infinite variance and common innovations. Lith. Math. J. 49 446–463. MR2591877 [44] Puplinskaitė, D. and Surgailis, D. (2010). Aggregation of a random-coefficient AR(1) process with infinite variance and idiosyncratic innovations. Adv. Appl. Probab. 42 509–527. MR2675114 [45] Puplinskaitė, D. and Surgailis, D. (2015). Scaling transition for long-range dependent Gaussian random fields. Stochastic Process. Appl. 125 2256–2271. MR3322863 [46] Samorodnitsky, G. and Taqqu, M.S. (1994). Stable Non-Gaussian Random Processes. Stochastic Modeling. New York: Chapman & Hall. MR1280932 [47] Surgailis, D. (1982). Domains of attraction of self-similar multiple integrals. Litovsk. Mat. Sb. 22 185–201. MR0684472 [48] Surgailis, D., Rosiński, J., Mandrekar, V. and Cambanis, S. (1992). Stable generalized moving averages. Preprint, Univ. North Carolina. [49] Surgailis, D., Rosiński, J., Mandrekar, V. and Cambanis, S. (1993). Stable mixed moving averages. Probab. Theory Related Fields 97 543–558. MR1246979 [50] von Bahr, B. and Esseen, C.-G. (1965). Inequalities for the rth absolute moment of a sum of random variables, 1 ≤ r ≤ 2. Ann. Math. Statist 36 299–303. MR0170407 [51] Zaffaroni, P. (2004). Contemporaneous aggregation of linear dynamic models in large economies. J. Econometrics 120 75–102. MR2047781 [52] Zaffaroni, P. (2007). Aggregation and memory of models of changing volatility. J. Econometrics 136 237–249. MR2328592 Received December 2014 and revised March 2015
10math.ST
1 Rigorous Dynamics and Consistent Estimation in Arbitrarily Conditioned Linear Systems Alyson K. Fletcher, Mojtaba Sahraee-Ardakan, Philip Schniter, and Sundeep Rangan arXiv:1706.06054v1 [cs.IT] 19 Jun 2017 Abstract The problem of estimating a random vector x from noisy linear measurements y = Ax + w with unknown parameters on the distributions of x and w, which must also be learned, arises in a wide range of statistical learning and linear inverse problems. We show that a computationally simple iterative message-passing algorithm can provably obtain asymptotically consistent estimates in a certain high-dimensional large-system limit (LSL) under very general parameterizations. Previous message passing techniques have required i.i.d. sub-Gaussian A matrices and often fail when the matrix is ill-conditioned. The proposed algorithm, called adaptive vector approximate message passing (Adaptive VAMP) with auto-tuning, applies to all right-rotationally random A. Importantly, this class includes matrices with arbitrarily bad conditioning. We show that the parameter estimates and mean squared error (MSE) of x in each iteration converge to deterministic limits that can be precisely predicted by a simple set of state evolution (SE) equations. In addition, a simple testable condition is provided in which the MSE matches the Bayes-optimal value predicted by the replica method. The paper thus provides a computationally simple method with provable guarantees of optimality and consistency over a large class of linear inverse problems. I. I NTRODUCTION Consider the problem of estimating a random vector x0 from linear measurements y of the form y = Ax0 + w, w ∼ N (0, θ2−1 I), x0 ∼ p(x|θ1 ), (1) where A ∈ RM ×N is a known matrix, p(x|θ1 ) is a density on x0 with parameters θ1 , w is additive white Gaussian noise (AWGN) independent of x0 , and θ2 > 0 is the noise precision (inverse variance). The goal is to estimate x0 , while simultaneously learning the unknown parameters θ := (θ1 , θ2 ), from the data y and A. This problem arises in Bayesian forms of linear inverse problems in signal processing, as well as in linear regression in statistics. Exact estimation of the parameters θ via maximum likelihood or other methods is generally intractable. One promising class of approximate methods combines approximate message passing (AMP) [1] with expectationmaximization (EM). AMP and its generalizations (e.g., [2]) constitute a powerful, relatively new class of algorithms based on expectation propagation [3] (EP)-type techniques. The resulting AMP algorithms are computationally fast and have been successfully applied to a wide range of problems, e.g., [4]–[11]. Most importantly, for large, zero-mean, sub-Gaussian i.i.d. random matrices A, the performance of these AMP methods can be exactly predicted by a scalar state evolution (SE) [12], [13] that provides testable conditions for optimality, even for non-convex priors. When the parameters θ are unknown, AMP can be easily combined with EM for joint learning of the parameters θ and vector x [14]–[16]. Under more general conditions on A, however, not only do the theoretical results not hold, but standard AMP techniques often diverge and require a variety of modifications for stability [17]–[20]. For example, when A has nonzero mean, its largest singular value grows with the problem size, making A arbitrarily poorly conditioned. A recent work [21] combined EM with the so-called Vector AMP (VAMP) method of [22]. Similar to AMP, VAMP is based on EP-like [3] approximations of belief propagation [22] and can also be considered as a special case of expectation consistent (EC) approximate inference [23]–[25]. VAMP’s key attraction is that it applies to a larger class of matrices A than the original AMP method. It has provable SE analyses and convergence guarantees that apply to all right-rotationally invariant matrices A [22], [26] – a significantly larger class of matrices than i.i.d. sub-Gaussian. Under further mild conditions, the mean-squared error (MSE) of VAMP matches the replica prediction for optimality [27]–[29]. When the distributions on x and w are unknown, the work [21] proposed to combine A. K. Fletcher and M. Sahraee-Ardakan are with the University of California, Los Angeles. P. Schniter is with The Ohio State University. S. Rangan is with New York University. 2 EM and VAMP using the approximate inference framework of [30]. While [21] provided numerical simulations suggesting excellent performance for EM-VAMP on several synthetic problems, there were no provable convergence guarantees. The contributions of this work are as follows: • Rigorous state evolution analysis: We provide a rigorous analysis of a generalization of EM-VAMP that we call Adaptive VAMP. Similar to the analysis of VAMP, we consider a certain large-system limit (LSL) where the matrix A is random and right-rotationally invariant. Importantly, this class of matrices includes much more than i.i.d. Gaussian, as used in the original LSL analysis of Bayati and Montanari [12]. It is shown (Theorem 1) that, in this LSL, the parameter estimates at each iteration converge to deterministic limits θ k that can be computed from a set of SE equations that extend those of VAMP. The analysis also exactly characterizes the b and the true vector x0 . The SE equations depend only on the asymptotic joint distribution of the estimates x initial parameter estimate , the adaptation function (to be discussed), and statistics on the matrix A, the vector x0 , and the noise w. • Asymptotic consistency: It is also shown (Theorem 2) that, under an additional identifiability condition and a simple auto-tuning procedure, Adaptive VAMP can yield provably consistent parameter estimates in the LSL. This approach is inspired by an ML-estimation approach from [16]. Remarkably, the result is true under very general problem formulations. • Bayes optimality: In the case when the parameter estimates converge to the true value, the behavior of adaptive VAMP matches that of VAMP. In this case, it is shown in [22] that, when the SE equations have a unique fixed point, the MSE of VAMP matches the MSE of the Bayes optimal estimator, as predicted by the replica method [27]–[29]. In this way, we have developed a computationally efficient inference scheme for a large class of linear inverse problems. In a certain high-dimensional limit, our scheme guarantees that (i) the performance of the algorithm can be exactly characterized, (ii) the parameter estimates θb are asymptotically consistent, and (iii) the algorithm has b match the replica prediction of Bayes optimality. testable conditions for when the signal estimates x II. VAMP WITH A DAPTATION We assume that the prior density on x can be written as 1 p(x|θ1 ) = exp [−f1 (x|θ1 )] , Z1 (θ1 ) f1 (x|θ1 ) = N X f1 (xn |θ1 ), (2) n=1 where f1 (·) is a separable penalty function, θ1 is a parameter vector and Z1 (θ1 ) is a normalization constant. With some abuse of notation, we have used f1 (·) for the function on the vector x and its components xn . Since f1 (x|θ1 ) is separable, x has i.i.d. components conditioned on θ1 . The likelihood function under the AWGN model (1) can be written as θ2 1 p(y|x, θ2 ) := exp [−f2 (x, y|θ2 )] , f2 (x, y|θ2 ) := ky − Axk2 , (3) Z2 (θ2 ) 2 where Z2 (θ2 ) = (2π/θ2 )N/2 . The joint density of x, y given parameters θ = (θ1 , θ2 ) is then p(x, y|θ) = p(x|θ1 )p(y|x, θ2 ). (4) The problem is to estimate the parameters θ along with the vector x0 . The steps of the proposed adaptive VAMP algorithm that performs this estimation are shown in Algorithm 1. Adaptive VAMP is a generalization of the EM-VAMP method in [21]. At each iteration k , the algorithm produces, bik of the vector x0 . The algorithm is tuned by for i = 1, 2, estimates θbik of the parameter θi , along with estimates x selecting three key functions: (i) a denoiser function g1 (·); (ii) an adaptation statistic φ1 (·); and (iii) a parameter b1k , while the adaptation statistic and selection function T1 (·). The denoiser is used to produce the estimates x parameter estimation functions produce the estimates θb1k . 3 Algorithm 1 Adaptive VAMP Require: Matrix A ∈ RM ×N , measurement vector y, denoiser function g1 (·), statistic function φ1 (·), adaptation function T1 (·) and number of iterations Nit . b10 , θb20 . 1: Select initial r10 , γ10 ≥ 0, θ 2: for k = 0, 1, . . . , Nit − 1 do 3: // Input denoising −1 b1k = g1 (r1k , γ1k , θb1k )), 4: x η1k = γ1k /hg10 (r1k , γ1k , θb1k )i 5: γ2k = η1k − γ1k b1k − γ1k r1k )/γ2k 6: r2k = (η1k x 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: // Input parameter update θb1,k+1 = T1 (µ1k ), µ1k = hφ1 (r1k , γ1k , θb1k )i // Output estimation T b b2k = Q−1 x k (θ2k A y + γ2k r2k ), −1 η2k = (1/N ) tr(Q−1 k ) γ1,k+1 = η2k − γ2k b2k − γ2k r2k )/γ1,k+1 r1,k+1 = (η2k x Qk = θb2k AT A + γ2k I // Output parameter update −1 T b2k k2 + tr(AQ−1 θb2,k+1 = (1/N ){ky − Ax k A )} end for Denoiser function: The denoiser function g1 (·) is discussed in detail in [22] and is generally based on the prior p(x|θ1 ). In the original EM-VAMP algorithm [21], g1 (·) is selected as the so-called minimum mean-squared error (MMSE) denoiser. Specifically, in each iteration, the variables ri , γi and θbi were used to construct belief estimates, i h γi (5) bi (x|ri , γi , θbi ) ∝ exp −fi (x, y|θbi ) − kx − ri k2 , 2 which represent estimates of the posterior density p(x|y, θ). To keep the notation symmetric, we have written f1 (x, y|θb1 ) for f1 (x|θb1 ) even though the first penalty function does not depend on y. The EM-VAMP method then selects g1 (·) to be the mean of the belief estimate, g1 (r1 , γ1 , θ1 ) := E [x|r1 , γ1 , θ1 ] . (6) 0 For line 4 of Algorithm 1, we define [gP 1 (r1k , γ1k , θ1 )]n := ∂[g1 (r1k , γ1k , θ1 )]n /∂r1n and we use h·i for the empirical mean of a vector, i.e., hui = (1/N ) N n=1 un . Hence, η1k in line 4 is a scaled inverse divergence. It is shown in [22] that, for the MMSE denoiser (6), η1k is the inverse average posterior variance. a) Estimation for θ1 with finite statistics: For the EM-VAMP algorithm [21], the parameter update for θb1,k+1 is performed via a maximization h i θb1,k+1 = arg max E ln p(x|θ1 ) r1k , γ1k , θb1k , (7) θ1 where the expectation is with respect to the belief estimate bi (·) in (5). It is shown in [21] that using (7) is equivalent to approximating the M-step in the standard EM method. In the adaptive VAMP method in Algorithm 1, the M-step maximization (7) is replaced by line 9. Note that line 9 again uses h·i to denote empirical average, µ1k N 1 X b = hφ1 (r1k , γ1k , θ1k )i := φ1 (r1k,n , γ1k , θb1k ) ∈ Rd , N (8) n=1 so µ1k is the empirical average of some d-dimensional statistic φ1 (·) over the components of r1k . The parameter estimate update θb1,k+1 is then computed from some function of this statistic, T1 (µ1k ). We show in Appendix A that there are two important cases where the EM update (7) can be computed from a finite-dimensional statistic as in line 9: (i) The prior p(x|θ1 ) is given by an exponential family, f1 (x|θ1 ) = θ1T ϕ(x) 4 for some sufficient statistic ϕ(x); and (ii) There are a finite number of values for the parameter θ1 . For other cases, we can approximate more general parameterizations via discretization of the parameter values θ1 . The updates in line 9 can also incorporate other types of updates as we will see below. But, we stress that it is preferable to compute the estimate for θ1 directly from the maximization (7) – the use of a finite-dimensional statistic is for the sake of analysis. b) Estimation for θ2 with finite statistics: It will be useful to also write the adaptation of θ2 in line 18 of Algorithm 1 in a similar form as line 9. First, take a singular value decomposition (SVD) of A of the form A = USVT , S = Diag(s), (9) and define the transformed error and transformed noise, qk := VT (r2k − x0 ), ξ := UT w. Then, it is shown in Appendix A that θb2,k+1 in line 18 can be written as 1 θb2,k+1 = T2 (µ2k ) := , µ2k = hφ2 (q2 , ξ, s, γ2k , θb2k )i µ2k where γ22 s2 φ2 (q, ξ, s, γ2 , θb2 ) := (sq + ξ)2 + . (s2 θb2 + γ2 )2 s2 θb2 + γ2 (10) (11) (12) Of course, we cannot directly compute qk in (10) since we do not know the true x0 . Nevertheless, this form will be useful for analysis. III. S TATE E VOLUTION IN THE L ARGE S YSTEM L IMIT A. Large System Limit Similar to the analysis of VAMP in [22], we analyze Algorithm 1 in a certain large-system limit (LSL). The LSL framework was developed by Bayati and Montanari in [12] and we review some of the key definitions in Appendix A. As in the analysis of VAMP, the LSL considers a sequence of problems indexed by the vector dimension N . For each N , we assume that there is a “true” vector x0 ∈ RN that is observed through measurements of the form y = Ax0 + w ∈ RN , w ∼ N (0, θ2−1 IN ), (13) where A ∈ RN ×N is a known transform, w is white Gaussian noise with “true” precision θ2 . The noise precision θ2 does not change with N . Identical to [22], the transform A is modeled as a large, right-orthogonally invariant random matrix. Specifically, we assume that it has an SVD of the form (9), where U and V are N × N orthogonal matrices such that U is deterministic and V is Haar distributed (i.e. uniformly distributed on the set of orthogonal matrices). As described in [22], although we have assumed a square matrix A, we can consider general rectangular A by adding zero singular values. Using the definitions in Appendix A, we assume that the components of the singular-value vector s ∈ RN in (9) converge empirically with second-order moments as P L(2) lim {sn } = S, (14) N →∞ for some non-negative random variable S with E[S] > 0 and S ∈ [0, Smax ] for some finite maximum value Smax . Additionally, we assume that the components of the true vector, x0 , and the initial input to the denoiser, r10 , converge empirically as P L(2) lim {(r10,n , x0n )} = (R10 , X 0 ), N →∞ R10 = X 0 + P0 , P0 ∼ N (0, τ10 ), (15) where X 0 is a random variable representing the true distribution of the components x0 ; P0 is an initial error and τ10 is an initial error variance. The variable X 0 may be distributed as X 0 ∼ p(·|θ1 ) for some true parameter θ1 . However, in order to incorporate under-modeling, the existence of such a true parameter is not required. We also assume that the initial second-order term and parameter estimate converge almost surely as lim (γ10 , θb10 , θb20 ) = (γ 10 , θ 10 , θ20 ) (16) N →∞ for some γ 10 > 0 and (θ 10 , θ20 ). 5 B. Error and Sensitivity Functions We next need to introduce parametric forms of two key terms from [22]: error functions and sensitivity functions. The error functions describe MSE of the denoiser and output estimators under AWGN measurements. Specifically, for the denoiser g1 (·, γ1 , θb1 ), we define the error function as h i E1 (γ1 , τ1 , θb1 ) := E (g1 (R1 , γ1 , θb1 ) − X 0 )2 , R1 = X 0 + P, P ∼ N (0, τ1 ), (17) where X 0 is distributed according to the true distribution of the components x0 (see above). The function E1 (γ1 , τ1 , θb1 ) b = g1 (R1 , γ1 , θb1 ) from a measurement R1 corrupted by Gaussian noise thus represents the MSE of the estimate X of variance τ1 under the parameter estimate θb1 . For the output estimator, we define the error function as 1 Ekg2 (r2 , γ2 , θb2 ) − x0 k2 , N q ∼ N (0, τ2 I), y = Ax0 + w, E2 (γ2 , τ2 , θb2 ) := lim N →∞ x0 = r2 + q, w ∼ N (0, θ2−1 I), (18) which is the average per component error of the vector estimate under Gaussian noise. The dependence on the true noise precision, θ2 , is suppressed. The sensitivity functions describe the expected divergence of the estimator. For the denoiser, the sensitivity function is defined as h i A1 (γ1 , τ1 , θb1 ) := E g10 (R1 , γ1 , θb1 ) , R1 = X 0 + P, P ∼ N (0, τ1 ), (19) which is the average derivative under a Gaussian noise input. For the output estimator, the sensitivity is defined as " # b2 ) ∂g (r , γ , θ 1 2 2 2 A2 (γ2 , τ2 , θb2 ) := lim tr , (20) N →∞ N ∂r2 where r2 is distributed as in (18). The paper [22] discusses the error and sensitivity functions in detail and shows how these functions can be easily evaluated. C. State Evolution Equations We can now describe our main result, which are the SE equations for Adaptive VAMP. The equations are an extension of those in the VAMP paper [22], with modifications for the parameter estimation. For a given iteration k ≥ 1, consider the set of components, {(x b1k,n , r1k,n , x0n ), n = 1, . . . , N }. b1k and the denoiser input r1k . This set represents the components of the true vector x0 , its corresponding estimate x We will show that, under certain assumptions, these components converge empirically as P L(2) b1k , R1k , X 0 ), lim {(x b1k,n , r1k,n , x0n )} = (X N →∞ (21) b1k , R1k , X 0 ) are given by where the random variables (X R1k = X 0 + Pk , Pk ∼ N (0, τ1k ), b1k = g1 (R1k , γ 1k , θ 1k ), X (22) for constants γ 1k , θ 1k and τ1k that will be defined below. We will also see that θb1k → θ 1k , so θ 1k represents the asymptotic parameter estimate. The model (22) shows that each component r1k,n appears as the true component x0n plus Gaussian noise. The corresponding estimate x b1k,n then appears as the denoiser output with r1k,n as the input and θ 1k as the parameter estimate. Hence, the asymptotic behavior of any component x0n and its corresponding x b1k,n is identical to a simple scalar system. We will refer to (21)-(22) as the denoiser’s scalar equivalent model. We will also show that these transformed errors qk and noise ξ in (10) and singular values s converge empirically to a set of independent random variables (Qk , Ξ, S) given by P L(2) lim {(qk,n , ξn , sn )} = (Qk , Ξ, S), N →∞ Qk ∼ N (0, τ2k ), Ξ ∼ N (0, θ2−1 ), (23) 6 where S has the distribution of the singular values of A, τ2k is a variance that will be defined below and θ2 is the true noise precision in the measurement model (13). All the variables in (23) are independent. Thus (23) is a scalar equivalent model for the output estimator. The variance terms are defined recursively through the state evolution equations, γ η 1k = 1k , γ 2k = η 1k − γ 1k α1k   = T1 (µ1k ), µ1k = E φ1 (R1k , γ 1k , θ 1k )   1 E1 (γ 1k , τ1k , θ 1k ) − α21k τ1k , = 2 (1 − α1k ) γ = A2 (γ 2k , τ2k , θ2k ), η 2k = 2k , γ 1,k+1 = η 2k − γ 2k α2k   = T2 (µ2k ), µ2k = E φ2 (Qk , Ξ, S, γ 2k , θ2k )   1 = E2 (γ 2k , τ2k ) − α22k τ2k , 2 (1 − α2k ) α1k = A1 (γ 1k , τ1k , θ 1k ), θ 1,k+1 τ2k α2k θ2,k+1 τ1,k+1 (24a) (24b) (24c) (24d) (24e) (24f) which are initialized with τ10 = E[(R10 − X 0 )2 ] and the (γ 10 , θ 10 , θ20 ) defined from the limit (16). The expectation in (24b) is with respect to the random variables (21) and the expectation in (24e) is with respect to the random variables (23). Theorem 1. Consider the outputs of Algorithm 1. Under the above assumptions and definitions, assume additionally that for all iterations k : (i) The solution α1k from the SE equations (24) satisfies α1k ∈ (0, 1). (ii) The functions Ai (·), Ei (·) and Ti (·) are continuous at (γi , τi , θbi , µi ) = (γ ik , τik , θ ik , µik ). (iii) The denoiser function g1 (r1 , γ1 , θb1 ) and its derivative g10 (r1 , γ1 , θb1 ) are uniformly Lipschitz in r1 at (γ1 , θb1 ) = (γ 1k , θ 1k ). (See Appendix A for a precise definition of uniform Lipschitz continuity.) (iv) The adaptation statistic φ1 (r1 , γ1 , θb1 ) is uniformly pseudo-Lipschitz of order 2 in r1 at (γ1 , θb1 ) = (γ 1k , θ 1k ). Then, for any fixed iteration k ≥ 0, lim (αik , ηik , γik , µik , θbik ) = (αik , η ik , γ ik , µik , θ ik ) N →∞ (25) almost surely. In addition, the empirical limit (21) holds almost surely for all k > 0, and (23) holds almost surely for all k ≥ 0. Theorem 1 shows that, in the LSL, the parameter estimates θbik converge to deterministic limits θ ik that can be precisely predicted by the state-evolution equations. The SE equations incorporate the true distribution of the components on the prior x0 , the true noise precision θ2 , and the specific parameter estimation and denoiser functions used by the Adaptive VAMP method. In addition, similar to the SE analysis of VAMP in [22], the SE equations bik . This joint distribution can be used to also predict the asymptotic joint distribution of x0 and their estimates x measure various performance metrics such as MSE – see [22]. In this way, we have provided a rigorous and precise characterization of a class of adaptive VAMP algorithms that includes EM-VAMP. IV. C ONSISTENT PARAMETER E STIMATION WITH VARIANCE AUTO -T UNING By comparing the deterministic limits θ ik with the true parameters θi , one can determine under which problem conditions the parameter estimates of adaptive VAMP are asymptotically consistent. In this section, we show with a particular choice of parameter estimation functions, one can obtain provably asymptotically consistent parameter estimates under suitable identifiability conditions. We call the method variance auto-tuning, which generalizes the approach in [16]. Definition 1. Let p(x|θ1 ) be a parameterized set of densities. Given a finite-dimensional statistic φ1 (r), consider the mapping (τ1 , θ1 ) 7→ E [φ1 (R)|τ1 , θ1 ] , (26) 7 Fig. 1. Numerical simulations. Left panel: Sparse signal recovery: NMSE versus iteration for condition number for a random matrix with a condition number κ = 100. Right panel: NMSE for sparse image recovery (in AWGN at 40 dB SNR) as a function of the condition number κ. where the expectation is with respect to the model (46). We say the p(x|θ1 ) is identifiable in Gaussian noise if there exists a finite-dimensional statistic φ1 (r) ∈ Rd such that (i) φ1 (r) is pseudo-Lipschitz continuous of order 2; and (ii) the mapping (26) has a continuous inverse. Theorem 2. Under the assumptions of Theorem 1, suppose that X 0 follows X 0 ∼ p(x|θ10 ) for some true parameter θ10 . If p(x|θ1 ) is identifiable in Gaussian noise, there exists an adaptation rule such that, for any iteration k , the estimate θb1k and noise estimate τb1k are asymptotically consistent in that limN →∞ θb1k = θ10 and limN →∞ τb1k = τ1k almost surely. The theorem is proved in Appendix A which also provides details on how to perform the adaptation. The Appendix also provides a similar result for consistent estimation of the noise precision θ2 . The result is remarkable as it shows that a simple variant of EM-VAMP can provide provably consistent parameter estimates under extremely general distributions. V. N UMERICAL S IMULATIONS Sparse signal recovery: We consider a sparse linear inverse problem of estimating a vector x from measurements y from (1) without knowing the signal parameters θ1 or the noise precision θ2 > 0. The paper [21] presented several numerical experiments to assess the performance of EM-VAMP relative to other methods. To support the results in this paper, our goal is to demonstrate that state evolution can correctly predict the performance of EM-VAMP, and to validate the consistency of EM-VAMP with auto-tuning. Details are given in Appendix C. Briefly, to model the sparsity, x is drawn as an i.i.d. Bernoulli-Gaussian (i.e., spike and slab) prior with unknown sparsity level, mean and variance. The true sparsity is βx = 0.1. Following [17], [18], we take A ∈ RM ×N to be a random right-orthogonally invariant matrix with dimensions under M = 512, N = 1024 with the condition number set to κ = 100 (high condition number matrices are known to be problem for conventional AMP methods). The left panel of Fig. 1 shows the normalized mean square error (NMSE) for various algorithms. Appendix C describes the algorithms in details and also shows similar results for κ = 10. We see several important features. First, for all variants of VAMP and EM-VAMP, the SE equations provide an excellent prediction of the per iteration performance of the algorithm. Second, consistent with the simulations in [22], the oracle VAMP converges remarkably fast (∼ 10 iterations). Third, the performance of EM-VAMP with auto-tuning is virtually indistinguishable from oracle VAMP, suggesting that the parameter estimates are near perfect from the very first iteration. Fourth, the EM-VAMP method performs initially worse than the oracle-VAMP, but these errors are exactly predicted by the SE. Finally, all the VAMP and EM-VAMP algorithms exhibit much faster convergence than the EM-BG-AMP. In fact, consistent with observations in [21], EM-BG-AMP begins to diverge at higher condition numbers. In contrast, the VAMP algorithms are stable. 8 Compressed sensing image recovery: While the theory is developed on theoretical signal priors, we demonstrate that the proposed EM-VAMP algorithm can be effective on natural images. Specifically, we repeat the experiments in [31] for recovery of a sparse image. Again, see Appendix C for details including a picture of the image and the various reconstructions. An N = 256 × 256 image of a satellite with K = 6678 non-zero pixels is observed through a linear transform A = diag(s)PH diag(d) in AWGN at 40 dB SNR, where H is the fast Hadamard transform, P is a random sub-selection to M < N measurements, s is a scaling to adjust the condition number, and d is a random ±1 vector. As in the previous example, the image vector x is modeled as sparse Bernoulli-Gaussian and the EM-VAMP algorithm is used to estimate the sparsity ratio, signal variance, and noise variance. The transform is set to have measurement ratio M/N = 0.5. We see from the right panel of Fig. 1 that the EM-VAMP algorithm is able to reconstruct the images with improved performance over the standard basis pursuit denoising method SPGL1 [32] and the EM-BG-GAMP method from [15]. VI. C ONCLUSIONS Due to its analytic tractability, computational simplicity, and potential for Bayes optimal inference, VAMP is a promising technique for statistical linear inverse problems. Importantly, it does not suffer the convergence issues of standard AMP methods when A is ill conditioned. However, a key challenge in using VAMP and related methods is the need to precisely specify the problem parameters. This work provides a rigorous foundation for analyzing VAMP in combination with various parameter adaptation techniques including EM. The analysis reveals that VAMP, with appropriate tuning, can also provide consistent parameter estimates under very general settings, thus yielding a powerful approach for statistical linear inverse problems. A PPENDIX We provide two simple examples where the EM parameter update (47) can be computed from finite-dimensional statistics. Finite number of parameter values: Suppose that θ1 takes only a finite number of values θ1 ∈ {θ11 , . . . , θ1L }. Define the statistics, h i φ` (r1 , γ1 , θb1 ) := E ln p(x|θ1` )|r1 , γ1 , θb1 , where the outer expectation is with respect to the belief estimate in b1 (x|r1 , γ1 , θb1 ) given in (5). Hence, the EM ∗ update in (47) is given by θb1,k+1 = θ1` where `∗ = arg max µk,` , ` µ` = N 1 X φ` (r1k,n , γ1k , θb1k ). N n=1 Exponential family: Suppose that p(x|θ1 ) is given by an exponential family where the penalty function in (2) is given by f1 (x, θ1 ) = θ1T ϕ(x) for some sufficient statistics ϕ(x) ∈ Rd . Define the statistic, h i φ1 (r1 , γ1 , θb1 ) := E ϕ(x)|r1 , γ1 , θb1 . Then, the EM parameter update (47) can be computed by 1 θb1,k+1 = arg max θ T µ1 − ln Z1 (θ1 ), N θ1 µ1 = hφ1 (r1k , γ1k , θb1k )i. Hence, we see that the EM parameter update can be computed from a finite set of statistics. b2k in line 12 of Algorithm 1, we obtain Using the SVD (9) and the equations for Qk and x   γ2k T T T b2k ) = U y − Sx b2k = U diag U (y − Ax (Sq2k + ξ). s2 θb2k + γ2k Thus, the parameter estimate θb2,k+1 in line 18 is given by 1 −1 (a) 1 b2k k2 + θb2,k+1 = kUT (y − Ax tr(AT Qk A) N N   i γ2k 1 h 2 2b (b) 1 = k diag (Sq2k + ξ)k2 + tr S (S θ2k + γ2k I)−1 , N N s2 θb2k + γ2k 9 b2k k2 = kUT (y − Ax b2k )k2 and (b) follows from the where (a) follows since U is unitary and therefore, ky − Ax SVD (9) and some simple manipulations. Therefore, if we define φ2 (·) as in (12), we obtain (11). We review some definitions from the Bayati and Montanari paper [12], since we will use the same analysis framework in this paper. Fix a dimension r > 0, and suppose that, for each N , x(N ) is a block vector of the form x(N ) = (x1 (N ), . . . , xN (N )), where each component xn (N ) ∈ Rr . Thus, the total dimension of x(N ) is rN . In this case, we will say that x(N ) is a block vector sequence that scales with N under blocks xn (N ) ∈ Rr . When r = 1, so that the blocks are scalar, we will simply say that x(N ) is a vector sequence that scales with N . Such vector sequences can be deterministic or random. In most cases, we will omit the notational dependence on N and simply write x. Now, given p ≥ 1, a function f : Rs → Rr is called pseudo-Lipschitz of order p, if there exists a constant C > 0 such that for all x1 , x2 ∈ Rs ,   kf (x1 ) − f (x2 )k ≤ Ckx1 − x2 k 1 + kx1 kp−1 + kx2 kp−1 . Observe that in the case p = 1, pseudo-Lipschitz continuity reduces to the standard Lipschitz continuity. Given p ≥ 1, we will say that the block vector sequence x = x(N ) converges empirically with p-th order moments if there exists a random variable X ∈ Rr such that (i) E|X|p < ∞; and (ii) for any scalar-valued pseudo-Lipschitz continuous function f of order p, N 1 X lim f (xn (N )) = E [f (X)] . N →∞ N n=1 Thus, the empirical mean of the components f (xn (N )) converges to the expectation E(f (X)). In this case, with some abuse of notation, we will write P L(p) lim {xn } = X, (27) N →∞ where, as usual, we have omitted the dependence xn = xn (N ). Importantly, empirical convergence can be defined on deterministic vector sequences, with no need for a probability space. If x = x(N ) is a random vector sequence, we will often require that the limit (27) holds almost surely. Finally, let f (x, λ) be a function on x ∈ Rs , dependent on some parameter vector λ ∈ Rd . We say that f (x, λ) is uniformly pseudo-Lipschitz continuous of order p in x at λ = λ if there exists an open neighborhood U of λ, such that (i) f (x, λ) is pseudo-Lipschitz of order p in x for all λ ∈ U ; and (ii) there exists a constant L such that kf (x, λ1 ) − f (x, λ2 )k ≤ L (1 + kxk) |λ1 − λ2 |, (28) for all x ∈ Rs and λ1 , λ2 ∈ U . It can be verified that if f (x, λ) is uniformly pseudo-Lipschitz continuous of order p in x at λ = λ, and limN →∞ λ(N ) = λ, then P L(p) N   1 X f (xn (N ), λ(N )) = E f (X, λ) . N →∞ N →∞ N lim x = X =⇒ lim N →∞ lim n=1 In the case when f (·) is uniformly pseudo-Lipschitz continuous of order p = 1, we will simply say f (·) is uniformly Lipschitz. 10 The proof of Theorem 1 uses the following minor modification of the general convergence result in [22, Theorem 4]: We are given a dimension N , an orthogonal matrix V ∈ RN ×N , an initial vector u0 ∈ RN , and disturbance vectors wp , wq ∈ RN . Then, we generate a sequence of iterates by the following recursion: pk = Vuk α1k = (29a) hfp0 (pk , wp , γ1k , θb1k )i, µ1k p = hφp (pk , w , γ1k , θb1k )i (C1k , γ2k , θb1,k+1 ) = Γ1 (γ1k , α1k , µ1k , θb1k ) h i vk = C1k fp (pk , wp , γ1k , θb1k ) − α1k pk (29c) (29d) qk = V T v k α2k = (29b) (29e) hfq0 (qk , wq , γ2k , θb2k ))i, q µ2k = hφq (qk , w , γ2k , θb2k )i (C2k , γ1,k+1 , θb2,k+1 ) = Γ1 (γ2k , α2k , µ2k , θb2k ) h i uk+1 = C2k fq (qk , wq , γ2k , θb2k ) − α2k qk , (29f) (29g) (29h) which is initialized with some vector u0 , scalar γ10 and parameters θb0 = (θb10 , θb20 ). Here, fp (·), fq (·), φp (·) and φq (·) are separable functions, meaning for all components n, h i h i fp (p, wp , γ1 , θb1 ) = fp (pn , wnp , γ1 , θb1 ) fq (q, wq , γ2 , θb2 ) = fq (qn , wnq , γ2 , θb2 ), h i n h in (30) p p q φp (p, w , γ1 , θb1 ) = φp (pn , wn , γ1 , θb1 ) φq (q, w , γ2 , θb2 ) = φq (qn , wnq , γ2 , θb2 ), n n for functions fp (·), fq (·), φq (·) and φp (·). These functions may be vector-valued, but their dimensions are fixed and do not change with N . The functions Γi (·), Ci (·) and Ti (·) also have fixed dimensions with Ci (·) being scalar-valued. Similar to the analysis of EM-VAMP, we consider the following large-system limit (LSL) analysis. We consider a sequence of runs of the recursions indexed by N . We model the initial condition u0 and disturbance vectors wp and wq as deterministic sequences that scale with N and assume that their components converge empirically as P L(2) lim {u0n } = U0 , N →∞ P L(2) lim {wnp } = W p , N →∞ P L(2) lim {wnq } = W q , N →∞ (31) to random variables U0 , W p and W q . We assume that the initial constants converges as lim (γ10 , θb10 , θb20 ) = (γ 10 , θ 10 , θ20 ) N →∞ (32) for some values (γ 10 , θ 10 , θ20 ). The matrix V ∈ RN ×N is assumed to be Haar distributed (i.e. uniform on the set of orthogonal matrices) and independent of r0 , wp and wq . Since r0 , wp and wq are deterministic, the only randomness is in the matrix V. Under the above assumptions, define the SE equations     α1k = E fp0 (Pk , W p , γ 1k , θ 1k ) , µ1k = E φp (Pk , W p , γ 1k , θ 1k ) (33a) (C 1k , γ 2k , θ 1,k+1 ) = Γ1 (γ 1k , α1k , µ1k , θ 1k )  2   τ2k = C 1k E fp2 (Pk , W p , γ 1k , θ 1k ) − α21k τ1k     α2k = E fq0 (Qk , W q , γ 2k , θ2k ) , µ1k = E φq (Qk , W q , γ 2k , θ2k )  2   τ1,k+1 = C 2k E fq2 (Qk , W q , γ 2k , θ2k ) − α22k τ2k (33b) (33c) (33d) (33e) which are initialized with the values in (32) and τ10 = EU02 , (34) where U0 is the random variable in (31). In the SE equations (33), the expectations are taken with respect to random variables Pk ∼ N (0, τ1k ), Qk ∼ N (0, τ2k ), 11 where Pk is independent of W p and Qk is independent of W q . Theorem 3. Consider the recursions (29) and SE equations (33) under the above assumptions. Assume additionally that, for all k : (i) For i = 1, 2, the function Γi (γi , αi , µi , θbi ) is continuous at the points (γ ik , αik , µik , θ ik ) from the SE equations; (ii) The function fp (p, wp , γ1 , θb1 ) and its derivative fp0 (p, wp , γ1 ) are uniformly Lipschitz continuous in (p, wp ) at (γ1 , θ1 ) = (γ 1k , θ 1k ). The function fq (q, wq , γ2 , θb2 ) satisfies the analogous conditions. (iii) The function φp (p, wp , γ1 , θb1 ) is uniformly pseudo Lipschitz continuous of order 2 in (p, wp ) at (γ1 , θ1 ) = (γ 1k , θ 1k ). The function φq (q, wq , γ2 , θb2 ) satisfies the analogous conditions. Then, (a) For any fixed k , almost surely the components of (wp , p0 , . . . , pk ) empirically converge as P L(2) lim {(wnp , p0n , . . . , pkn )} = (W p , P0 , . . . , Pk ), N →∞ (35) where W p is the random variable in the limit (31) and (P0 , . . . , Pk ) is a zero mean Gaussian random vector independent of W p , with E(Pk2 ) = τ1k . In addition, we have that lim (α1k , µ1k , γ2k , C1k , θb1,k+1 ) = (α1k , µ1k , γ 2k , C 1k , θ 1,k+1 ) N →∞ (36) almost surely. (b) For any fixed k , almost surely the components of (wq , q0 , . . . , qk ) empirically converge as P L(2) lim {(wnq , q0n , . . . , qkn )} = (W q , Q0 , . . . , Qk ), N →∞ (37) where W q is the random variable in the limit (31) and (Q0 , . . . , Qk ) is a zero mean Gaussian random vector independent of W q , with E(Pk2 ) = τ2k . In addition, we have that lim (α2k , µ2k , γ1,k+1 , C2k , θb2,k+1 ) = (α2k , µ2k , γ 1,k+1 , C 2k , θ2,k+1 ) N →∞ (38) almost surely. Proof. This is a minor modification of [22, Theorem 4]. Indeed, the only change here is the addition of the terms µik and θbik . Their convergence can be proven identically to that of αik , γik . For example, consider the proof of convergence α1k → α1k in [22, Theorem 4]. This is proved as part of an induction argument where, in that part of the proof, the induction hypothesis is that (35) holds for some k and (38) holds for k −1. Thus, γ1k → γ 1k P L(2) and θb1k → θ 1k almost surely and limN →∞ (pk , wp ) = (Pk , W p ). Hence, since fp (·) is uniformly Lipschitz continuous,   lim α1k = lim hfp (pk , wp , γ1k , θb1k )i = E fp (Pk , W p , γ 1k , θ 1k ) = α1k . N →∞ N →∞ Similarly, since we have assumed the uniform pseudo-Lipschitz continuity of φp (·),   lim µ1k = lim hφp (pk , wp , γ1k , θb1k )i = E φp (Pk , W p , γ 1k , θ 1k ) = µ1k . N →∞ N →∞ Thus, we have lim (γ1k , α1k , µ1k , θb1k ) = (γ 1k , α1k , µ1k , θ 1k ), N →∞ almost surely. Then, since Γ1 (·) is continuous, (29c) shows that lim (C1k , γ2k , θb1,k+1 ) = (C 1k , γ 2k , θ 1,k+1 ) = Γ1 (γ 1k , α1k , µ1k , θ 1k ). N →∞ This proves (36). The modifications for the proof of (38) are similar. This proof is also a minor modification of the SE analysis of VAMP in [22, Theorem 1]. As in that proof, we need to simply rewrite the recursions in Algorithm 1 in the form (29) and apply the general convergence result in Theorem 3. To this end, define the error terms pk := r1k − x0 , vk := r2k − x0 , (39) 12 and their transforms, uk := VT pk , qk := VT vk . (40) Also, define the disturbance terms wq := (ξ, s), wp := x0 , ξ := UT w. (41) Define the component-wise update functions θb2 sξ + γ2 q . fq (q, (ξ, s), γ2 , θb2 ) := θb2 s2 + γ2 (42) φq (q, (ξ, s), γ2 , θb2 ) := φ2 (q, ξ, s, γ2 , θb2 ), (43) fp (p, x0 , γ1 , θb1 ) := g1 (p + x0 , γ1 , θb1 ) − x0 , Also, define the adaptation functions, φp (p, x0 , γ1 , θb1 ) := φ1 (p + x0 , γ1 , θb1 ), where φ1 (·) is the statistic function in Algorithm 1 and φ2 (·) are defined in (12). With these definitions, we claim that the outputs satisfy the recursions: pk = Vuk (44a) (1 − α1k )γ1k α1k   0 fp (pk , x , γ1k ) − α1k pk α1k = hfp0 (pk , x0 , γ1k , θb1 )i, 1 1 − α1k = T1 (µ1k ), vk = θb1,k+1 γ2k = µ1k = hφ1 (vk + x0 , γ1k , θb1k )i qk = V T v k α2k = hfq0 (qk , wq , γ2k )i, θb2,k+1 (44c) (44d) (44e) γ1,k+1 = (1 − α2k )γ2k α2k 1 [fq (qk , wq , γ2k ) − α2k qk ] 1 − α2k = T2 (µ2k ), µ2k = hφ2 (qk , ξ, γ2k , θb2k )i uk+1 = (44b) (44f) (44g) (44h) The fact that the updates in the modified Algorithm 1 satisfy (44a), (44b), (44e), (44f) can be proven exactly as in the proof of [22, Theorem 1]. The update (44d) follows from line 9 in Algorithm 1. The update (44h) follows from the definitions in (11). Now, define 1 Cik = , 1 − αi and the function,   γ (1 − α ) 1 i i , , Ti (µi ) , (45) Γi (γi , αi , µi , θbi ) = 1 − αi αi the updates (44) are equivalent to the general recursions in (29). Also, the continuity assumptions (i)–(iii) in Theorem 3 are also easily verified. For example, for assumption (i), Γi (·) in (45) is continuous, since we have assumed that αik ∈ (0, 1) and Ti (µi ) is continuous at µi = µik . For assumption (ii), the function fp (·) in (42) is uniformly Lipschitz-continuous since we have assumed that g1 (·) is uniformly Lipschitz-continuous. Also, the SE equations (24a) and (24a) and the assumption that αik > 0 show that γ ik > 0 for all i and k . In addition, the definition of T2 (·) and φ2 (·) in (11) and (12) shows that θ2k > 0 as defined in (24e). Therefore, since s is bounded in [0, smax ] and γ 2k > 0, θ2k > 0, we see that fq (·) in (42) is uniformly Lipschitz-continuous. Finally, for assumption (iii) in Theorem 3, the uniform pseudo-Lipschitz continuity of φp (·) in (43) follows from the uniform pseudo-Lipschitz continuity assumption on φ1 (·). Also, φ2 (·) in (12) is uniformly pseudo-Lipschitz continuous of order 2 since s ∈ [0, smax ]. Therefore, φq (·) in (43) is also uniformly pseudo-Lipschitz continuous of order 2. Hence, all the conditions of Theorem 3 are satisfied. The SE equations (24) then follow directly from the SE equations (33). This completes the proof. 13 A. Proof of Theorem 2 To prove Theorem 2, we perform the variance auto-tuning adaptation as follows. Suppose the X 0 follows ∼ p(x|θ10 ) for some true parameter θ10 . Then, the SE analysis shows that the components of r1k asymptotically behave as R = X 0 + P, P = N (0, τ1 ), X 0 ∼ p(x|θ1 ), (46) X0 for θ1 = θ10 and some τ1 = τ1k . The idea in variance auto-tuning is to jointly estimate (θ1 , τ1 ), say via maximum likelihood estimation, N X (τb1k , θb1k ) = arg max ln p(r1k,n |τ1 , θ1 ), (47) τ1 ,θ1 n=1 where we use the notation p(r1 |τ1 , θ1 ) to denote the density of R under the model (46). We can then use both the parameter estimate θb1k and variance estimate τb1k in the denoiser, b1k = g1 (r1k , γ1k , θb1k ), x −1 γ1k = τb1k . (48) −1 The parameter estimate (47) and precision estimate γ1k = τb1k would replace lines 9 and 14 in Algorithm 1. Since −1 we are using the estimated precision τb1k from (47) instead of the predicted precision γ1k , we call the estimation (47) with the estimate (48) variance auto-tuning. Now suppose that statistic as in Definition 1 exists. By the inverse property, there must be a continuous mapping T1 (µ) such that for any τ1 , θ1 , µ1 = E [φ1 (R)|τ1 , θ1 ] ⇒ T1 (µ1 ) = (τ1 , θ1 ). (49) Although the order of updates of θb1k and γ1k is slightly changed from Algorithm 1, we can apply an identical SE analysis and show that, in the LSL,   lim (τb1k , θb1k ) = (τ 1k , θb1k ) = T1 (µ1k ), µ1k = E φ1 (R1 )|τ1k , θ10 , (50) N →∞ where θ10 is the true parameter. Comparing (49) and (50) we see that θ 1k = θ10 and τ 1k = τ1k . This proves Theorem 2. B. Auto-Tuning Details The auto-tuning above requires solving a joint ML estimation (47). We describe a simple approximate method for this estimation using EM. First, we rewrite the ML estimation in (47) as (τb1 , θb1 ) = arg max ln p(r1 |τ1 , θ1 ), (51) τ1 ,θ1 where we have Q dropped the dependence on the iteration k to simplify the notation and we have used the notation p(r1 |τ1 , θ1 ) := n p(r1n |τ1 , θ1 ). It will be more convenient to precisions rather than variances, so we rewrite (52), (γ b1 , θb1 ) = arg max ln p(r1 |γ1 , θ1 ), (52) γ1 ,θ1 where γ1 = 1/τ1 . Treating x as latent vector, the EM procedure for the ML estimate (52) performs updates (γ b1old , θb1old ) 7→ (γ b1new , θb1new ) given by h i (γ b1new , θb1new ) = arg max E ln p(x, r1 |γ1 , θ1 ) | r1 , γ1old , θb1old , (53) γ1 ,θ1 where the expectation is with respect to the posterior density, p(x|r1 , γ b1old , θb1old ). But, this posterior density is precisely the belief estimate bi (x|r1 , γiold , θb1old ). Now, under the model (46), the log likelihood ln p(x, r1 |γ, θ1 ) is given by ln p(x, r1 |γ1 , θ1 ) = ln p(r|x, γ1 ) + ln p(x|θ1 ) γ1 N = − kr − xk2 + ln(γ1 ) + ln p(x|θ1 ). 2 2 14 Thus, the maximization in (53) with respect to γ1 is i 1 h 1 b1 − r1 k2 + η1−1 , (γ b1new )−1 = E kx − r1 k2 | |τb1old , θb1old = kx N N where h i h i 1 b 1 = E x | r1 , γ tr Cov x | r1 , γ b1old , θb1old . x b1old , θb1old , η1−1 = N The maximization in (53) with respect to θ1 is h i θb1new = arg max E p(x|θ1 )|r1 , γ1old , θb1old , (54) θ1 which is precisely the EM update (7) with the current parameter estimates. Thus, the auto-tuning estimation can be performed by repeatedly performing updates h i h i 1 b1 = E x | r1 , γ x b1old , θb1old , η1−1 = tr Cov x | r1 , γ b1old , θb1old , (55a) N 1 b1 − r1 k2 + η1−1 (γ b1new )−1 = kx (55b) N h i θb1new = arg max E p(x|θ1 )|r1 , γ1old , θb1old . (55c) θ1 Thus, each iteration of the auto-tuning involves calling the denoiser (55a) at the current estimate; updating the variance from the denoiser error (55b); and updating the parameter estimate via an EM-type update (55c). C. Consistent Estimation of θ2 We show how we can perform a similar ML estimation as in Section IV for estimating the noise precision θ2 and error variance τ2 at the output. Suppose that the true noise precision is θ2 = θ20 . Define zk = SVT r2k − UT y. (56) Then, (a) (b) zk = SVT r2k − UT (Ax0 + w) = Sqk + ξ, where (a) follows from (13) and (b) follows from (9) and (10). From Theorem 1 and the limit (23), zk converge empirically to a random variable Zk given by Zk = SQk + Ξ, Qk ∼ N (0, τ2 ), Ξ ∼ N (0, θ2−1 ), (57) where (θ2 , τ2 ) = (θ20 , τ2k ) are the true noise precision and error variance. Similar to the auto-tuning of θ1 in Section IV, we can attempt to estimate (τ2 , θ2 ) via ML estimation, N 1 X (τb2k , θb2k ) = arg max ln p(zk,n |θ2 , τ2 , sn ), N τ2 ,θ2 (58) n=1 where p(z|θ2 , τ2 , s) is the density of the random variable Zk in the model (57). Recall that the singular values sn b2k in line 12 of Algorithm 1 are known to the estimator. Then, using these estimates, we perform the estimate of x using the estimated precision γ2k = 1/τb2k . To analyze this estimator rigorously, we make the simplifying assumption that the random variable, S , representing the distribution of singular values, is discrete. That is, there are a finite number of values a1 , · · · , aL and probabilities p1 , . . . , pL such that Pr(S 2 = a` ) = p` . Then, given vectors zk and s, define the 2L statistics φ`0 (z, s) = 1{s2 =a` } , φ`1 (z, s) = z 2 1{s2 =a` } , ` = 1, . . . , L, and their empirical averages at time k , µ`0 = h1{s2n =a` } i, 2 µ`1 = hzk,n 1{s2n =a` } i. 15 Then, the ML estimate in (58) can be rewritten as (τb2k , θb2k ) = arg min J(τ2 , θ2 ), (59) τ2 ,θ2 where the objective function is " #  N L  2 X zk,n 1 X µ`1 −1 −1 2 J(τ2 , θ2 ) :== + ln(sn τ2 + θ2 ) = + µ`0 ln(a` τ2 + θ2 ) . N s2n τ2 + θ2−1 a` τ2 + θ2−1 n=1 `=1 (60) Hence, we can compute the ML estimate (58) from an objective function computed from the 2L statistics, µ`0 , µ`1 , ` = 1, . . . , L. To prove consistency of the ML estimate, first note that the SE analysis shows that µ`0 → µ`0 and µ`1 → µ`1 where the limits are given by µ`0 = E [φ`0 (Z, S)] = P (S 2 = a` ) = p` ,   µ`1 = E [φ`1 (Z, S)] = E(Z 2 |S 2 = a` )P (S 2 = a` ) = p` a` τ2k + (θ20 )−1 , where (τ2k , θ20 ) are the true values of (τ2 , θ2 ). Hence, the objective function in (60) will converge to   L X a` τ20 + (θ20 )−1 −1 lim J(τ2 , θ2 ) = p` −1 + µ`0 ln(a` τ2 + θ2 ) . N →∞ a τ + θ 2 ` 2 `=1 Now, for any y > 0, arg min x>0 (61) y + ln(x) = y. x Thus, the minima of (61) will occur at (τ 2k , θ2k ) := (τ2k , θ10 ). (62) It can also be verified that this minima is unique provided that there are at least two different values a` with non-zero probabilities p` . That is, we require that S 2 is not constant. In this case, one can show that the mapping from the statistics {µ`0 , µ`1 )} to the ML estimates (τb2k , θb2k ) in (59) is continuous at the limiting values {µ`0 , µ`1 )}. Hence, from the SE analysis, we obtain that (τb2k , θb2k ) → (τ 2k , θ2k ) = (τ2k , θ20 ), in (62). We have proven the following. Theorem 4. Under the assumptions of Theorem 1, let θ20 denote the true noise precision and τ2k be the true error variance for some iteration k . Suppose that the random variable S 2 representing the squared singular values is discrete and non-constant. Then, there exists a finite set of statistics φ`0 (zn , sn ) and φ`1 (zn , sn ) and parameter selection rule such that the estimates (τb2k , θb2k ) are asymptotically consistent in that lim (τb2k , θb2k ) = (τ2k , θ10 ), N →∞ almost surely. Sparse signal recovery: To model the sparsity, x is drawn as an i.i.d. Bernoulli-Gaussian (i.e., spike and slab) prior, p(xn |θ1 ) = (1 − βx )δ(xn ) + βx N (xn ; µx , τx ), (63) where parameters θ1 = {βx , µx , τx } represent the sparsity rate βx ∈ (0, 1], the active mean µx ∈ R, and the active variance τx > 0. Following [17], [18], we constructed A ∈ RM ×N from the SVD A = USVT , whose orthogonal matrices U and V were drawn uniformly with respect to the Haar measure and whose singular values si were constructed as a geometric series, i.e., si /si−1 = α ∀i > 1, with α and s1 chosen to achieve a desired condition number κ = s1 /smin(M,N ) as well as kAk2F = N . This matrix model provides a good test for the stability of AMP methods since it is known that the matrix having a high condition number is the main failure mechanism in b − xk2 /kxk2 averaged over 100 AMP [17]. Recovery performance was assessed using normalized MSE (NMSE) kx independent draws of A, x, and w. The left panel of figure 1 shows the NMSE versus iteration for various algorithms under M = 512, N = 1024, βx = 0.1, µx = 0, and (τx , θ2 ) giving a signal-to-noise ratio of 40 dB at a condition number of κ = 100. The identical simulation is shown in Fig. 2. The trends in both figures are discussed in the main text. The EM-VAMP 16 Fig. 2. Sparse signal recovery: Plotted are the NMSE for various algorithms with a condition number of κ = 10. algorithms were initialized with βx = (M/2)/N , τx = kyk2 /kAk2F βx , µx = 0, and θ2−1 = M −1 kyk2 . Four methods are compared: (i) VAMP-oracle, which is VAMP under perfect knowledge of θ = {τw , βx , µx , τx }; (ii) EM-VAMP from [21]; (iii) EM-VAMP with auto-tuning described in Section IV; (iv) the EM-BG-AMP algorithm from [15] with damping from [18]; and (v) a lower bound obtain by an oracle estimator that knows the support of the vector x. For algorithms (i)–(iii), we have plotted both the simulated median NMSE as well as the state-evolution (SE) predicted performance. Sparse image recovery: The true image is shown in the top left panel of Fig. 3 and can be seen to be sparse in the pixel domain. Three image recovery algorithms were tested: (i) the EM-BG-AMP algorithm [15] with damping from [18]; (ii) basis pursuit denoising using SPGL1 as described in [32]; and (iii) EM-VAMP with auto-tuning described in Section IV. For the EM-BG-AMP and EM-VAMP algorithms, the BG model was used, as before. SPGL1 was run in “BPDN mode," which solves minx kxk1 subject to ky − Axk ≤ σ for true noise variance σ 2 . All algorithms are run over 51 trials, with the median value plotted in Fig. 1. While the EM-VAMP theory provides convergence guarantees when the true distribution fits the model class and in the large-system limit, we found some damping was required on finite-size, real images that are not generated from the assumed prior. In this experiment, to obtain stable convergence, the EM-VAMP algorithm was aggressively damped as described in [22], using a damping ratio of 0.5 for the first- and second-order terms. The computation times as a function of condition number κ are shown in Fig. 4. All three methods benefit from the fact that the matrix A has a fast implementation. In addition, for EM-VAMP, the matrix has an easily computable SVD. The figure shows that the EM-VAMP algorithm achieves dramatically faster performance at high condition numbers – approximately 10 times faster than either EM-BG-AMP or SPGL1. The various panels of Fig. 3 show the images recovered by each algorithm at condition number κ = 100 for the realization that achieved the median value in Fig. 1 (right panel). R EFERENCES [1] D. L. Donoho, A. Maleki, and A. Montanari, “Message-passing algorithms for compressed sensing,” Proc. Nat. Acad. Sci., vol. 106, no. 45, pp. 18 914–18 919, Nov. 2009. [2] S. Rangan, “Generalized approximate message passing for estimation with random linear mixing,” in Proc. IEEE Int. Symp. Inform. Theory, Saint Petersburg, Russia, Jul.–Aug. 2011, pp. 2174–2178. 17 Fig. 3. Sparse image recovery: Original ’satellite’ image as used in [18] along with the median-NMSE recovered images for the various algorithms at measurement ratio M/N = 0.5, condition number κ = 100, and 40 dB SNR. Fig. 4. Computation time versus condition number for various algorithms in the satellite image recovery problem. 18 [3] T. P. Minka, “A family of algorithms for approximate Bayesian inference,” Ph.D. dissertation, Dept. Comp. Sci. Eng., MIT, Cambridge, MA, 2001. [4] A. K. Fletcher, S. Rangan, L. Varshney, and A. Bhargava, “Neural reconstruction with approximate message passing (NeuRAMP),” in Proc. Neural Information Process. Syst., Granada, Spain, Dec. 2011, pp. 2555–2563. [5] P. Schniter, “A message-passing receiver for BICM-OFDM over unknown clustered-sparse channels,” IEEE J. Sel. Topics Signal Process., vol. 5, no. 8, pp. 1462–1474, Dec. 2011. [6] S. Som and P. Schniter, “Compressive imaging using approximate message passing and a Markov-tree prior,” IEEE Trans. Signal Process., vol. 60, no. 7, pp. 3439–3448, Jul. 2012. [7] J. Ziniel and P. Schniter, “Dynamic compressive sensing of time-varying signals via approximate message passing,” IEEE Trans. Signal Process., vol. 61, no. 21, pp. 5270–5284, Nov. 2013. [8] J. P. Vila and P. Schniter, “An empirical-Bayes approach to recovering linearly constrained non-negative sparse signals,” IEEE Trans. Signal Process., vol. 62, no. 18, pp. 4689–4703, Sep. 2014. [9] P. Schniter and S. Rangan, “Compressive phase retrieval via generalized approximate message passing,” IEEE Trans. Signal Process., vol. 63, no. 4, pp. 1043–1055, 2015. [10] J. Ziniel, P. Schniter, and P. Sederberg, “Binary linear classification and feature selection via generalized approximate message passing,” IEEE Trans. Signal Process., vol. 63, no. 8, pp. 2020–2032, 2015. [11] A. K. Fletcher and S. Rangan, “Scalable inference for neuronal connectivity from calcium imaging,” in Proc. Neural Information Processing Systems, 2014, pp. 2843–2851. [12] M. Bayati and A. Montanari, “The dynamics of message passing on dense graphs, with applications to compressed sensing,” IEEE Trans. Inform. Theory, vol. 57, no. 2, pp. 764–785, Feb. 2011. [13] A. Javanmard and A. Montanari, “State evolution for general approximate message passing algorithms, with applications to spatial coupling,” Information and Inference, vol. 2, no. 2, pp. 115–144, 2013. [14] F. Krzakala, M. Mézard, F. Sausset, Y. Sun, and L. Zdeborová, “Statistical-physics-based reconstruction in compressed sensing,” Physical Review X, vol. 2, no. 2, p. 021005, 2012. [15] J. P. Vila and P. Schniter, “Expectation-maximization Gaussian-mixture approximate message passing,” IEEE Trans. Signal Process., vol. 61, no. 19, pp. 4658–4672, 2013. [16] U. S. Kamilov, S. Rangan, A. K. Fletcher, and M. Unser, “Approximate message passing with consistent parameter estimation and applications to sparse learning,” IEEE Trans. Inform. Theory, vol. 60, no. 5, pp. 2969–2985, Apr. 2014. [17] S. Rangan, P. Schniter, and A. Fletcher, “On the convergence of approximate message passing with arbitrary matrices,” in Proc. IEEE Int. Symp. Inform. Theory, Jul. 2014, pp. 236–240. [18] J. Vila, P. Schniter, S. Rangan, F. Krzakala, and L. Zdeborová, “Adaptive damping and mean removal for the generalized approximate message passing algorithm,” in Proc. IEEE Int. Conf. Acoust., Speech, and Signal Process., 2015, pp. 2021–2025. [19] A. Manoel, F. Krzakala, E. W. Tramel, and L. Zdeborová, “Swept approximate message passing for sparse estimation,” in Proc. ICML, 2015, pp. 1123–1132. [20] S. Rangan, A. K. Fletcher, P. Schniter, and U. S. Kamilov, “Inference for generalized linear models via alternating directions and Bethe free energy minimization,” IEEE Trans. Inform. Theory, vol. 63, no. 1, pp. 676–697, 2017. [21] A. K. Fletcher and P. Schniter, “Learning and free energies for vector approximate message passing,” arXiv:1602.08207, 2016. [22] S. Rangan, P. Schniter, and A. K. Fletcher, “Vector approximate message passing,” arXiv:1610.03082, 2016. [23] M. Opper and O. Winther, “Expectation consistent free energies for approximate inference,” in Proc. NIPS, 2004, pp. 1001–1008. [24] ——, “Expectation consistent approximate inference,” J. Mach. Learning Res., vol. 1, pp. 2177–2204, 2005. [25] A. K. Fletcher, M. Sahraee-Ardakan, S. Rangan, and P. Schniter, “Expectation consistent approximate inference: Generalizations and convergence,” in Proc. IEEE Int. Symp. Inform. Theory, 2016, pp. 190–194. [26] K. Takeuchi, “Rigorous dynamics of expectation-propagation-based signal recovery from unitarily invariant measurements,” arXiv:1701.05284, 2017. [27] A. M. Tulino, G. Caire, S. Verdú, and S. Shamai, “Support recovery with sparsely sampled free random matrices,” IEEE Trans. Inform. Theory, vol. 59, no. 7, pp. 4243–4271, 2013. [28] J. Barbier, M. Dia, N. Macris, and F. Krzakala, “The mutual information in random linear estimation,” arXiv:1607.02335, 2016. [29] G. Reeves and H. D. Pfister, “The replica-symmetric prediction for compressed sensing with Gaussian matrices is exact,” in Proc. IEEE ISIT, 2016. [30] T. Heskes, O. Zoeter, and W. Wiegerinck, “Approximate expectation maximization,” NIPS, vol. 16, pp. 353–360, 2004. [31] J. P. Vila and P. Schniter, “An empirical-Bayes approach to recovering linearly constrained non-negative sparse signals,” IEEE Trans. Signal Process., vol. 62, no. 18, pp. 4689–4703, 2014. [32] E. Van Den Berg and M. P. Friedlander, “Probing the Pareto frontier for basis pursuit solutions,” SIAM J. Sci. Comput., vol. 31, no. 2, pp. 890–912, 2008.
7cs.IT
arXiv:1508.04639v3 [math.AC] 15 Jun 2016 TESTS FOR INJECTIVITY OF MODULES OVER COMMUTATIVE RINGS LARS WINTHER CHRISTENSEN AND SRIKANTH B. IYENGAR Abstract. It is proved that a module M over a commutative noetherian ring R is injective if ExtiR ((R/p)p , M ) = 0 holds for every i > 1 and every prime ideal p in R. This leads to the following characterization of injective modules: If F is faithfully flat, then a module M such that HomR (F, M ) is injective and ExtiR (F, M ) = 0 for all i > 1 is injective. A limited version of this characterization is also proved for certain non-noetherian rings. 1. Introduction Let R be a commutative ring. In terms of cohomology, Baer’s criterion asserts that an R-module M is injective if (and only if) Ext1R (R/a, M ) = 0 holds for every ideal a in R. When R is also noetherian, it suffices to test against prime ideals and locally, namely, M is injective if either of the following conditions holds: • Ext1R (R/p, M ) = 0 for every prime ideal p in R; • Ext1Rp (k(p), Mp ) = 0 for every prime ideal p in R. Here, and henceforth, k(p) denotes the field (R/p)p . The main result of this paper is that injectivity can be detected by vanishing of Ext globally against these fields. Theorem 1.1. Let R be a commutative noetherian ring and let M be an R-complex. If for some integer d, one has ExtiR (k(p), M ) = 0 for every prime ideal p in R and all i > d , then the injective dimension of M is at most d. As recalled in Example 2.2, the module Ext1R (k(p), M ) can be quite different from Ext1R (R/p, M ) and Ext1Rp (k(p), Mp ). Nevertheless the appearance of ExtR (k(p), −) in this context is not unexpected in the light of the recent work on cosupport of complexes in [4]; see also the discussion around Corollary 3.3. The proof of the theorem above is given in Section 2, and applications are presented in Section 3. One such, discussed in Remark 3.2, is a characterization of injectivity of an R-module M in terms of that of HomR (F, M ), where F is a faithfully flat R-module. In Section 4, we establish a partial extension of this last result to certain non-noetherian rings. Date: 15 June 2016. 2010 Mathematics Subject Classification. 13C11; 13D05. Key words and phrases. Injective module, injective dimension, cosupport. We thank the Centre de Recerca Matemàtica, Barcelona, for hospitality during visits in Spring 2015, when part of the work reported in this article was done. L.W.C. was partly supported by NSA grant H98230-14-0140, and S.B.I. was partly supported by NSF grant DMS-1503044. 1 2 L. W. CHRISTENSEN AND S. B. IYENGAR 2. Proof of Theorem 1.1 Our standard reference for basic definitions and constructions involving complexes is [1]. We first recall that as a consequence of Baer’s criterion, the injective dimension of an R-complex is detected by vanishing of Ext against cyclic modules. Baer’s criterion. Let R be a commutative noetherian ring, M an R-complex, and d an integer. One has inj dimR M 6 d if and only if ExtiR (R/a, M ) = 0 for every ideal a in R and all i > d . This result is contained in [1, Theorem 2.4.I]. Consider the collection of ideals U := {a ⊂ R | ExtiR (R/a, M ) 6= 0 for some i > d} . If this collection is empty, then the desired inequality, inj dimR M 6 d, holds by Bear’s criterion. Thus, we assume that U is non-empty and aim for a contradiction. It is achieved by establishing a sequence of claims, the first of which is standard but included for convenience. Claim 1. With respect to inclusion, U is a poset and its maximal elements are prime ideals. Proof. Let a be a maximal element in U. Choose a prime ideal p ⊇ a such that p/a is an associated prime of R/a, and pick an element r ∈ R be such that p = (a : r). The ideal a+(r) properly contains a and hence is not in U. From the exact sequence of Ext modules associated to the standard exact sequence 0 −→ R/p −→ R/a −→ R/(a + (r)) −→ 0 it follows that p is in U. Since a is maximal in U, the equality a = p holds.  Fix a maximal element p in U; by Claim 1 it is a prime ideal. Set S := R/p and let Q be the field of fractions of the domain S. We proceed to analyze the S-complex X := RHomR (S, M ) . Claim 2. The natural map Hi (X) → Q ⊗S Hi (X) is an isomorphism for all i > d. Proof. Fix an element s 6= 0 in S. Let x be an element in R whose residue class mod p is s. By the maximality of p, the ideal p + (x) is not in U. As one has S/(s) ∼ = R/(p + (x)), it follows that ExtiR (S/(s), M ) = 0 holds for all i > d. Thus, applying RHomR (−, M ) to the exact sequence s 0 −→ S −−→ S −→ S/(s) −→ 0 , s shows that multiplication Hi (X) −→ Hi (X) is an isomorphism for i > d.  In the derived category over S, consider the triangle defining (soft) truncations (2.1) τ 6d X −→ X −→ τ >d X −→ . Claim 3. There is an isomorphism τ >d X ∼ = H(τ >d X) in the derived category over >d S, and the action of S on H(τ X) factors through the embedding S → Q. TESTS FOR INJECTIVITY OF MODULES OVER COMMUTATIVE RINGS 3 Proof. It follows from Claim 2 that the canonical morphism τ >d X → Q ⊗S τ >d X yields an isomorphism in the derived category over S. The right-hand complex is one of Q-vector spaces, so it is isomorphic to its homology, and another invocation of Claim 2 yields the claim.  Claim 4. One has inj dimS (τ 6d X) 6 d. Proof. By Baer’s criterion it suffices to show that ExtiS (S/b, τ 6d X) vanishes for every ideal b in S and all i > d. Notice first that we may assume that b is non-zero, because for i > d one has Exti (S, τ 6d X) ∼ = Hi (τ 6d X) = 0 , S where the vanishing is by construction. For b 6= 0 one has Q ⊗S S/b = 0, and Claim 3 together with Hom-tensor adjunction yields Ext∗ (S/b, τ >d X) ∼ = Ext∗ (S/b, H(τ >d X)) S S ∼ = Ext∗Q (Q ⊗S S/b, H(τ >d X)) = 0. For i > d the exact sequence in homology associated to (2.1) now gives the first isomorphism below Exti (S/b, τ 6d X) ∼ = Exti (S/b, X) S S ∼ = ExtiR (S/b, M ) ∼ Exti (R/a, M ) = R =0. The second isomorphism follows from Hom-tensor adjunction and the definition of X. The next isomorphism holds for any choice of an ideal a in R that reduces to b in S, i.e. S/b ∼ = R/a as R-modules. Since b ⊂ S is non-zero, the ideal a properly contains p and hence it is not in U. That explains the vanishing of Ext.  Claim 5. One has H(τ >d X) = 0. Proof. By construction one has Hi (τ >d X) = 0 for i 6 d. Apply RHomS (Q, −) to the exact triangle (2.1). By Claim 3, using that Q-vector spaces are injective S-modules, one has Ext∗ (Q, τ >d X) ∼ = Ext∗ (Q, H(τ >d X)) S S ∼ = HomS (Q, H(τ >d X)) ∼ = H(τ >d X) . For i > d, Claim 4 yields Hi (RHomS (Q, τ 6d X)) = 0, and together with the computation above, this explains the first two isomorphisms in the next chain Hi (τ >d X) ∼ = Exti (Q, τ >d X) S ∼ = ExtiS (Q, X) ∼ = Exti (k(p), M ) R =0. 4 L. W. CHRISTENSEN AND S. B. IYENGAR The third isomorphism follows from Hom-tensor adjunction, recalling that Q = S(0)  as an R-module is (R/p)p/p ∼ = k(p). The vanishing of Ext is by hypothesis. Finally, from Claim 5 and (2.1) one gets the second isomorphism below ExtiR (R/p, M ) ∼ = Hi (X) ∼ = Hi (τ 6d X) ; the first one holds by the definition of X. Thus one has ExtiR (R/p, M ) = 0 for all i > d, and this contradicts the assumption that p is in U. This completes the proof of Theorem 1.1.  To use Theorem 1.1 to verify injectivity of an R-module M one would have to check vanishing of ExtiR (k(p), M ), not only for all prime ideals p but also for all i > 0. However, building on this result, in recent work with Marley [8] we have been able to prove that it suffices to verify the vanishing for a single i, as long as i is large enough. The example below illustrates that such a restriction is needed. Example 2.1. If R is a complete local ring with depth R > 2, then one has Ext1R (k(p), R) = 0 for every prime ideal p in R . Indeed, if p is the maximal ideal of R, then vanishing holds by the assumption depth R > 2, and for every non-maximal prime p one has ExtiR (k(p), R) = 0 for all i; see [4, Example 4.20] and (3.1). The next example illustrates that the vanishing of ExtiR (k(p), R) does not imply that of ExtiR (R/p, R) and ExtiRp (k(p), Rp ), and vice versa. Thus Theorem 1.1 is not obviously a consequence of Baer’s criterion, nor does it subsume it. Example 2.2. Let R be as in Example 2.1 and p a prime ideal minimal over (r) where r is not a zero divisor. In this case, both Ext1R (R/p, R) and Ext1Rp (k(p), Rp ) are nonzero, whilst Ext1R (k(p), R) = 0. On the other hand, Ext1Z (Q, Z) is nonzero, whilst Ext1Z (Z, Z) = 0 = Ext1Q (Q, Q). The analogue of Theorem 1.1 for flat dimension is well-known and easier to verify. Remark 2.3. Let M be an R-complex. For each prime ideal p and integer i there is a natural isomorphism R p ∼ TorR i (k(p), M ) = Tori (k(p), Mp ) . It thus follows from [1, Proposition 5.3.F] that if there exists an integer d such that TorR i (k(p), M ) = 0 for i > d and each prime p, then the flat dimension of M is at most d. However, Theorem 1.1 does not follow, it seems, from this result by standard injective–flat duality. 3. Applications We present some applications of Theorem 1.1. The first one improves [7, Theorem 2.2] in two directions: There is no assumption on the projective dimension of flat modules, and an extension ring is replaced by a module. TESTS FOR INJECTIVITY OF MODULES OVER COMMUTATIVE RINGS 5 Corollary 3.1. For every R-complex M and every faithfully flat R-module F there is an equality inj dimR RHomR (F, M ) = inj dimR M . In particular, M is acyclic if and only if RHomR (F, M ) is acyclic. Proof. For every prime ideal p in R and every integer i one has ExtiR (k(p), RHomR (F, M )) ∼ = ExtiR (F ⊗R k(p), M ) by adjunction and flatness of F . Observe that as an R-module F ⊗R k(p) is a direct sum of copies of k(p); it is non-zero because F is faithfully flat. It follows that ExtiR (k(p), RHomR (F, M )) is zero if and only if ExtiR (k(p), M ) is zero. The equality of injective dimensions now follows from Theorem 1.1. In view of the equality, the statement about acyclicity is trivial as M is acyclic if and only if 0 is a semi-injective resolution of M if and only if inj dimR M is −∞.  Let F be a flat R-module. A module F ⊗R M is flat if M is flat, and the converse holds if F is faithfully flat; this is standard. It is equally standard that the module HomR (F, M ) is injective if M is injective. The next remark provides something close to a converse; Example 2.1 suggests that the hypotheses are optimal. Remark 3.2. Let F be a faithfully flat R-module. If M is an R-module with ExtiR (F, M ) = 0 for all i > 0, then RHomR (F, M ) is isomorphic to HomR (F, M ) in the derived category over R. Thus, for such a module Corollary 3.1 asserts that HomR (F, M ) is injective if and only if M is injective. This improves the Main Theorem in [7]; see also Theorem 4.3. The only other result in this direction we are aware of is the Main Theorem in [7]. It deals with the special case where F is a faithfully flat R-algebra, and the proof relies heavily on [4, Theorem 4.5] in the form recovered by Corollary 3.3. This points to our next application, which involves the notion of cosupport introduced in [4], in a form justified by [4, Proposition 4.4]. The cosupport of an R-complex M is the subset of Spec R given by (3.1) cosuppR M = {p ∈ Spec R | H(RHomR (k(p), M )) 6= 0} . The next result is [4, Theorem 4.5] applied to the derived category over R. The proof of op. cit. builds on the techniques developed in [3, 4] to apply to triangulated categories equipped with ring actions. Corollary 3.3. An R-complex M has cosuppR M = ∅ if and only if H(M ) = 0. Proof. The “if” is trivial, and the converse holds by Theorem 1.1 when one recalls that Hi (M ) 6= 0 implies inj dimR M > i.  Remark 3.4. One can deduce the preceding corollary also from Neeman’s classification [11, Theorem 2.8] of the localizing subcategories of the derived category over R. Indeed, the subcategory of the derived category consisting of R-complexes X with Ext∗R (X, M ) = 0 is localizing. Thus, if it contains k(p) for each p in Spec R, then it must contain R, by op. cit., that is to say, H(M ) = 0. 6 L. W. CHRISTENSEN AND S. B. IYENGAR Conversely, Corollary 3.3 can be used to deduce Neeman’s classification, by mimicking the proof of [5, Theorem 6.1]. The crucial additional observation needed to do so is that for R-complexes M and N , there is an equality cosuppR RHomR (M, N ) = suppR M ∩ cosuppR N . It follows from two applications of the standard adjunction: H(RHomR (k(p), RHomR (M, N ))) ∼ = H(RHomk(p) (k(p) ⊗L R M, RHomR (k(p), N ))) L ∼ = Homk(p) (H(k(p) ⊗ M ), H(RHomR (k(p), N ))) . R 4. Non-noetherian rings In this section we establish, over certain not necessarily noetherian rings, a characterization of injective modules in the vein of [7]; see also Remark 3.2. This involves the following invariant: splf R = sup{proj dimR F | F is a flat R-module} . L A direct sum of flat modules is flat with proj dim( i∈I Fi ) = supi∈I {proj dim Fi }, so the invariant splf R is finite if and only if every flat R-module has finite projective dimension. With a nod to Bass’ [2, Theorem P], a ring with splf R 6 d is also called a d-perfect ring. If R has cardinality at most ℵn for some natural number n, then one has splf R 6 n + 1 by a result of Gruson and Jensen [9, Theorem 7.10]. Osofsky [13, 3.1] has examples of rings for which the splf invariant is infinite. Lemma 4.1. Let R be a commutative ring with splf R < ∞ and let S be a faithfully flat R-algebra. An R-complex M with Hi (M ) = 0 for all i ≫ 0 is acyclic if and only if RHomR (S, M ) is acyclic. Proof. The “only if” is trivial, so assume that RHomR (S, M ) is acyclic. As H(M ) is bounded above, we may assume that Hi (M ) = 0 holds for all i > 0, and it suffices to prove that also H0 (M ) = 0. Set d := splf R. Application of RHomR (−, M ) to the exact sequence 0 → R → S → S/R → 0 yields M ∼ = Σ RHomR (S/R, M ) in the derived category over R. Repeated use of this isomorphism and adjunction yields M ∼ = Σd+1 RHomR ((S/R)⊗d+1 , M ). As S is faithfully flat over R, the module S/R is flat, and hence so are its tensor powers. Thus, the module (S/R)⊗d+1 has projective dimension at most d and, therefore, Hi (RHomR ((S/R)⊗d+1 , M )) = 0 holds for all i > d. In particular, H0 (M ) ∼ = H0 (Σd+1 RHomR ((S/R)⊗d+1 , M )) = Hd+1 (RHomR ((S/R)⊗d+1 , M )) =0.  Proposition 4.2. Let R be a commutative ring with splf R < ∞ and let S be a faithfully flat R-algebra of projective dimension at most 1. An R-complex M is acyclic if and only if RHomR (S, M ) is acyclic. Proof. The “only if” is trivial, so assume that RHomR (S, M ) is acyclic. To prove that M is acyclic, we show that H0 (Σn M ) = 0 holds for all n ∈ Z. Fix n and let TESTS FOR INJECTIVITY OF MODULES OVER COMMUTATIVE RINGS 7 Σn M → I be a semi-injective resolution; the assumption is now H(HomR (S, I)) = 0 and the goal is to prove H0 (I) = 0. The soft truncation τ 61 HomR (S, I) = · · · → HomR (S, I)−1 → HomR (S, I)0 → Z1 (HomR (S, I)) → 0 is acyclic, and by left-exactness of Hom one has τ 61 HomR (S, I) = HomR (S, τ 61 I). Further, still by acyclicity of HomR (S, I), there is an equality B2 (HomR (S, I)) = HomR (S, B2 (I)) . Thus, the functor HomR (S, −) leaves the sequence 0 → Z1 (I) → I 1 → B2 (I) → 0 exact, and that implies vanishing of Ext1R (S, Z1 (I)). Let π : P → S be a projective resolution over R with Pi = 0 for i > 1. Consider its mapping cone A = 0 −→ P1 −→ P0 −→ S −→ 0 . n As HomR (A, I ) is exact for every n and HomR (A, Z1 (I)) is exact by vanishing of Ext1R (S, Z1 (I)), it follows from [6, Lemma (2.5)] that HomR (A, τ 61 I) is acyclic. Thus, HomR (π, τ 61 I) yields an isomorphism RHomR (S, τ 61 I) ∼ = HomR (S, τ 61 I) in the derived category, and the latter complex is acyclic. Now Lemma 4.1 yields H(τ 61 I) = 0, in particular H0 (I) = H0 (τ 61 I) = 0.  Theorem 4.3. Let R be a commutative ring with splf R < ∞, let S be a faithfully flat R-algebra of projective dimension at most 1, and let M be an R-module. If Ext1R (S, M ) = 0 and the S-module HomR (S, M ) is injective, then M is injective. Proof. The proof of [7, Theorem 1.7] applies with one modification: in place of [7, 1.5]—at heart a reference to [4, Theorem 4.5]—one invokes Proposition 4.2.  Remark 4.4. The assumption in Theorem 4.3 that the flat R-algebra S has projective dimension at most 1 is satisfied if • R is countable; see [9, Theorem 7.10]. • S is countably related; in particular, if every ideal in R is countably generated, and S is countably generated as an R-module; see Osofsky [12, Lemma 1.2] and Jensen [10, Lemma 2]. Acknowledgments L.W.C. thanks Fatih Köksal for conversations related to this work; the joint paper [7] provided much inspiration. S.B.I. thanks Dave Benson, Henning Krause, and Julia Pevtsova for discussions related to this work. The statement of Theorem 1.1 emerged out of an on-going collaboration with them. We also thank Tom Marley for pointing out an error in an earlier version of Remark 2.3. References [1] Luchezar L. Avramov and Hans-Bjørn Foxby, Homological dimensions of unbounded complexes, J. Pure Appl. Algebra 71 (1991), no. 2-3, 129–155. MR1117631 [2] Hyman Bass, Finitistic dimension and a homological generalization of semi-primary rings, Trans. Amer. Math. Soc. 95 (1960), 466–488. MR0157984 [3] Dave Benson, Srikanth B. Iyengar, and Henning Krause, Local cohomology and support for triangulated categories, Ann. Sci. Éc. Norm. Supér. (4) 41 (2008), no. 4, 573–619. MR2489634 8 L. W. CHRISTENSEN AND S. B. IYENGAR [4] David J. Benson, Srikanth B. Iyengar, and Henning Krause, Colocalizing subcategories and cosupport, J. Reine Angew. Math. 673 (2012), 161–207. MR2999131 [5] David J. Benson, Srikanth B. Iyengar, Henning Krause, and Julia Pevtsova, Stratification and π-cosupport: Finite groups, preprint arXiv:1505.06628 [math.RT]. [6] Lars Winther Christensen, Anders Frankild, and Henrik Holm, On Gorenstein projective, injective and flat dimensions—A functorial description with applications, J. Algebra 302 (2006), no. 1, 231–279. MR2236602 [7] Lars Winther Christensen and Fatih Köksal, Injective modules under faithfully flat ring extensions, Proc. Amer. Math. Soc. 144 (2016), no. 3, 1015–1020. MR3447655 [8] Lars Winther Christensen, Srikanth B. Iyengar, and Thomas Marley, Rigidity of Ext and Tor with coefficients in residue fields of a commutative noetherian ring, in preparation. [9] Laurent Gruson and Christian U. Jensen, Dimensions cohomologiques reliées aux foncteurs lim(i) , Paul Dubreil and Marie-Paule Malliavin Algebra Seminar, 33rd Year (Paris, 1980), ←− Lecture Notes in Math., vol. 867, Springer, Berlin, 1981, pp. 234–294. MR0633523 [10] Christian U. Jensen, On homological dimensions of rings with countably generated ideals, Math. Scand. 18 (1966), 97–105. MR0207796 [11] Amnon Neeman, The chromatic tower for D(R), Topology 31 (1992), no. 3, 519–532, With an appendix by Marcel Bökstedt. MR1174255 [12] Barbara L. Osofsky, Upper bounds on homological dimensions, Nagoya Math. J. 32 (1968), 315–322. MR0232805 [13] Barbara L. Osofsky, Homological dimension and cardinality, Trans. Amer. Math. Soc. 151 (1970), 641–649. MR0265411 L.W.C. Texas Tech University, Lubbock, TX 79409, U.S.A. E-mail address: [email protected] URL: http://www.math.ttu.edu/~ lchriste S.B.I. University of Utah, Salt Lake City, UT 84112, U.S.A. E-mail address: [email protected] URL: http://www.math.utah.edu/~ iyengar
0math.AC
A DEEP LEARNING APPROACH FOR RECONSTRUCTION FILTER KERNEL DISCRETIZATION C. Syben1,2 , B. Stimpel1,2 , K. Breininger1 , T. Würfl1 , R. Fahrig1 , A. Dörfler2 and A. Maier1 1 arXiv:1710.06287v1 [cs.CV] 17 Oct 2017 2 Pattern Recognition Lab, Friedrich-Alexander-University Erlangen-Nuremberg Department of Neuroradiology, Friedrich-Alexander-University Erlangen-Nuremberg, Germany ABSTRACT In this paper, we present substantial evidence that a deep neural network will intrinsically learn the appropriate way to discretize the ideal continuous reconstruction filter. Currently, the Ram-Lak filter or heuristic filters which impose different noise assumptions are used for filtered back-projection. All of these, however, inhibit a fully data-driven reconstruction deep learning approach. In addition, the heuristic filters are not chosen in an optimal sense. To tackle this issue, we propose a formulation to directly learn the reconstruction filter. The filter is initialized with the ideal Ramp filter as a strong pre-training and learned in frequency domain. We compare the learned filter with the Ram-Lak and the Ramp filter on a numerical phantom as well as on a real CT dataset. The results show that the network properly discretizes the continuous Ramp filter and converges towards the Ram-Lak solution. In our view these observations are interesting to gain a better understanding of deep learning techniques and traditional analytic techniques such as Wiener filtering and discretization theory. Furthermore, this will allow fully trainable data-driven reconstruction deep learning approaches. Index Terms— Computed Tomography, Deep Learning, Filtered Back-Projection, Filter Discretization, Filter Learning 1. INTRODUCTION Recently deep learning has shown promising results in the field of Computed Tomography (CT) reconstruction. In his perspective article, Wang [1] states that a reconstruction pipeline implemented as a deep neural network allows to access the capability of learningbased reconstruction. Wang identifies the data-driven knowledgeenhancing abilities as the strength of deep learning-based reconstruction. Würfl et al. [2] have proposed an implementation of the filtered back-projection algorithm (FBP) as a neural network. Similar to iterative reconstruction algorithms, their proposed implementation avoids explicitly storing the system matrix, which would render the algorithm infeasible. The approach utilized the data-driven capability by learning the compensation weights in case of limited-angle tomography. Hammernik et al. [3] proposed a two-level deep learning architecture to compensate for additional streak artifacts in the limited-angle tomography case. They showed that their approach allows for a joint optimization without any heuristic parameter tuning. In both approaches the necessary filtering to perform a FBP is done with a fixed layer using an analytical discretization. This work has been supported by the project P3-Stroke, an EIT Health innovation project. EIT Health is supported by EIT, a body of the European Union. This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible. Fig. 1: Line profile through a 2D circle phantom. Ground truth (left) and FPB result based on Ramp filter (right). The ideal filter for FBP can be derived using analytic reconstruction theory. Assuming an infinite number of projections and infinitely small detector pixels, it takes the form of the absolute value function in Fourier domain, commonly referred to as Ramp filter. In practice, however, Radon inversion has to be performed using a finite number of projections. This introduces discretization errors which need to be handled by replacing the Ramp filter with an appropriate discrete version. These artifacts are commonly called cupping artifacts, and an example is shown in Figure 1. The analytically derived discrete version of the Ramp filter is the well known Ram-Lak filter introduced by Ramachandran and Lakshminarayan [4]. Both, the ideal Ramp as well as the Ram-Lak filter are sensitive to noise. Thus, many different filters have been proposed which impose different noise assumptions. The most well known example is the Shepp-Logan filter [5], which incorporates a smoothing filter. However, while the choice of filter clearly matters, none of these heuristic filters are chosen in an optimal sense. CT vendors typically have specialized departments that aim at designing optimal filters for their users. The actual filter configurations are often deemed as company secrets. This shows the demand for specialized filters and raises the question whether data-driven methods can be used to deduce optimal filters. Pelt et al. [6] proposed a method to learn such a data-dependent filter for the FPB algorithm. Their approach learns a filter approximation to increase reconstruction accuracy in specific cases. They optimize the filter with respect to the minimal error between the input data and the projection of the FBP reconstructed input. Pelt et al. use an efficient formulation and exponential binning to handle the size of the system matrix. In order to do this, handling the discretization of the Ramp filter with respect to the details around the zero frequency as well as the boundaries is necessary. We propose a formulation to learn a discrete optimal reconstruction filter directly in a deep learning context. We provide substantial evidence that a deep neural network will intrinsically learn the appropriate way to discretize the continuous filter. Furthermore, our proposed formulation leads to a straightforward implementation of the optimization using deep learning frameworks that automatically compute the gradient of the cost function using back-propagation. The gradient to our objective function f (K) in Eq. 7 with respect to K is ∂f (K) = F A (AT F H KF p − x)( F p )> . ∂K | {z } |{z} l−1 Error | {z Back-propagation (8) } 2. METHOD & MATERIALS First, we describe the filtered back-projection in continuous and discrete form for the parallel-beam geometry and introduce the theoretical filter kernel. Afterwards, the optimization problem and the related gradient to learn the filter kernel are derived. In the last Sections we describe our experiments and discuss them. 2.1. Filtered Back-Projection The filtered back-projection (FBP) algorithm is an efficient solution to the reconstruction problem. First the projection data p(s, θ) are filtered by a convolution with the filter kernel = h(s) ∗ p(s, θ) , R = |ω|e2πωs dω , q(s, θ) h(s) (1) (2) subsequently, the filtered projection data q(s, θ) are back-projected to obtain the reconstruction result f (x, y) with π Z f (x, y) = q(s, θ)|s=x·cos θ+y·sin θ dθ . (3) 0 In practice, we need a discrete description of the FBP presented in Eq. (1-3). The discrete reconstruction problem can be expressed by Ax = p , (4) where A ∈ RN ×M ·P is the system matrix, x ∈ RN is the volume and p ∈ RM ·P are the projections. Since the discrete representation of the Radon transform A is a tall matrix, it has no inverse. This means every reconstruction formula is, therefore, a unique pseudo inverse of A, A> |{z} x= Back-projection (Eq. 3) (AA> )−1 p . | {z } (5) Filter (Eq.1) Note that this analytical gradient also has an interpretation in a deep learning context. To describe Eq. 8 using the terms of backpropagation: Eq. 6 can be regarded as a network with input p and layers F , K, F H and AT with the identity as activation function between layers. K is the only layer containing trainable weights. Then, x̂ = AT F H KF p is the forward pass through the network following the considerations by Würfl et al. [2]. The gradient of the error function (Eq. 7) with respect to K is computed by multiplying two factors: 1) the partial derivative of the error function with respect to the output of the layer and 2) the transpose of the output of the previous layer (l − 1). The output of l − 1 is readily described by F p. Using the recursive formulation of back-propagation, we yield F A(x̂ − x), with (x̂−x) being the derivative of the error function. We consider these observations as interesting, as this gradient would be computed automatically in a deep learning framework such as TensorFlow. 2.3. Experiments We implemented the cost function and the analytically derived gradient in CONRAD [7] and used stochastic gradient descent to learn the filter. Unmatched projectors were used for the reconstruction (pixel driven) and the forward projections (ray driven). The filter matrix K is initialized with the frequency domain representation of the ideal Ramp filter. For the training we use 10 numerical disc phantoms with increasing radii rendered on a 512×512 pixel grid. The learned filter is evaluated on a 512×512 slice of a real CT dataset showing the head of a pig acquired at Stanford University. For evaluation we compare the filtered back-projection using the Ramp Filter, the Ram-Lak and the learned filter, in the following referred to as Ramp-reco, Ram-Lak-reco and Learned-reco, respectively. The quantitative evaluation is done on the absolute difference between the ground truth (GT) and the respective reconstruction result. These difference images are evaluated using the mean, minimum and maximum difference as well as the standard deviation (std. dev.). Note that we use the original reconstruction as the ground truth for the pig experiment. 2.2. Learning the Filter Kernel 3. RESULTS From the convolution theorem it is clear that a convolution in spatial domain is equal to a multiplication in the frequency space. Therefore, we can reformulate the filter (AA> )−1 in form of a diagonal matrix in Fourier domain x = A> F H KF p , (6) where F ∈ RN ×N and F H ∈ RN ×N represents the Fourier and inverse Fourier transform, respectively. K ∈ RN ×N is a diagonal matrix representing the filter in frequency domain. To learn the filter matrix K, which is a discrete approximation of the Ramp filter, we use Eq. 6 to formulate a objective function f (K) as a least-square minimization problem: f (K) = 1 kA> F H KF p − xk22 . 2 (7) 3.1. Qualitative Results Fig. 2 shows the results of the FBP on a numerical disc phantom (see ground truth in Fig. 2a), which was used for the training. Additionally, the results of Ramp-reco (see Fig. 2c), the Ram-Lak-reco (see Fig. 2e) and the Learned-reco (see Fig. 2g) and their respective line profiles are presented. The Ramp-reco leads to cupping artifacts in the homogeneous area of the disc that can be observed in Fig. 2c as well as in the respective line profile (see Fig. 2d). In Fig. 2f the Ram-Lak-reco is shown. The line profile in Fig. 2f illustrates that the homogeneous area of the disc is reconstructed properly. As displayed in Fig. 2g and 2h, the Learned-reco reconstructs the homogeneous area properly as well. Comparing the line profiles of the Ram-Lak-reco with the line profile from the Learned-reco, the RamLak-reco shows nearly a straight line while the line profile of the (a) GT: Phantom. (b) Line profile through GT. (c) Ramp-reco. (e) Ram-Lak-reco. (g) Learned-reco. (d) Line profile through Ramp-reco. (f) Line profile through Ram-Lak-reco. (h) Line profile through Learned-reco. Fig. 2: Reconstructions and respective line profile plots of numeric circle phantom using different filters. All images have the window/level set to: [1.03/0.50]. Fig. 3: Difference of the Ram-Lak-reco (left) and Learned-reco (right) to the GT. To enhance the difference between both images, the window/level was set to [0.02/0.04]. (a) Ram-Lak-reco. Learned-reco still shows small deviations from the ideal line. Fig. 3a denotes the absolute difference between Ram-Lak-reco and the GT, while Fig. 3b denotes the absolute difference between the Learnedreco and the GT. Both absolute difference images show errors in the homogeneous area as well as at the edge of the disc phantom. Fig. 4 presents the Ram-Lak-reco and the Learned-reco of the pig dataset with their respective line profiles. Both line profiles, aligned over the same homogeneous area of the pig, show a similar behavior and no cupping. (b) Learned-reco. Fig. 4: Reconstruction of a pig dataset filtered with Ram-Lak (left) and the learned filter kernel (right) and related line profiles along the yellow line below. For both images the window/level has set to: [2620/60] HU. 3.2. Quantitative Results In Tab. 1 the measurements of the absolute difference between the GT and the respective reconstructions are shown. The absolute mean error of the Ramp-reco is at 23.5%, while the absolute mean error of the Learned-reco is at 2.3%. The lowest absolute mean error can be observed by the Ram-Lak-reco. The standard deviation as well as the maximum value of the Ramp-reco are higher compared to the other two reconstructions. The Ram-Lak-reco and the Learned- reco show a similar standard deviation of the absolute difference as well as the absolute maximum error. In Tab. 2 the absolute error measurements between the GT and the respective reconstructions are presented. Both the Ram-Lak-reco as well as the Learned-reco exhibit a similar absolute mean error. Also the standard deviation of the absolute error as well as the absolute maximum error are closely together. Table 1: Measurements of the absolute difference between GT and respective circle reconstruction (in percent). Ramp-reco Ram-Lak-reco Learned-reco mean 0.235 0.01 0.023 std. dev. 0.07 0.031 0.03 min 0.001 0 6.76E-09 max 0.596 0.41 0.409 Table 2: Measurements of the absolute difference between GT and respective pig reconstruction in Hounsfield units (HU). a cost function to learn the filter in the frequency domain. This enables us to initialize the filter with the ideal Ramp, which can be seen as a very strong pre-training. Furthermore, the formulation can be straightforward transfered to a neural network architecture. Combining the proposed solution with the deep neural network suggested by Würfl et al. enables us to provide a fully trainable data-driven reconstruction deep learning approach. In future work, we want to apply noise models to the training data to learn a optimal discrete filter which is less sensitive to noise. 6. REFERENCES Ram-Lak-reco Learned-reco mean 66.99 83.53 std. dev. 61.401 68.06 min 6.10E-5 8.39E-5 max 1634.82 1685.70 4. DISCUSSION The evaluation of the numerical disc phantom shows that homogeneous areas can be reconstructed properly without cupping artifacts when using the learned filter. However, the line profile reveals that the result is not as good as with the Ram-Lak filter. A possible explanation for this difference is our way of implementing the optimization directly and configuring the stochastic gradient parameters heuristically. Also note that our current data set consists only of 10 cylinders of different diameter. This is only a coarse approximation of the ideal training set. We assume that using a basis that spans the entire domain of x will do much better for this job. This will be subject of future experiments. Still, we consider 10 training samples as a good start for estimating such a complex relation that generalizes to other much more complex objects such as the pig data set. The minor difference between the Learned-reco and the Ram-Lakreco in the real CT data experiment prove that the learned filter is not object dependent and not over-fitted to our training data. Utilizing discs with varying radii introduces two properties to the training process. First, narrow discs model the Dirac-impuls. Secondly, discs with larger radii exhibit large homogeneous regions. Using the initialization with the Ramp, the homogeneous area will lead to strong gradients caused by the cupping artifacts, which appear due to the wrong discretization. As a consequence, the weights converge towards the Ram-Lak solution, which is nothing else than learning the proper discretization of the continuous Ramp. We expect that augmentation approaches of this method will lead to filters that are invariant / less prone to noise characteristics imposed by CT physics intrinsically. Thus, we believe that noise augmentation will lead to filters similar to the Shepp-Logan filter. Augmentation in this context will have a very similar result as a Wiener filter that is optimal given certain noise properties. In our view these observations are interesting to gain a better understanding of deep learning techniques and traditional analytic techniques such as Wiener filtering and discretization theory. To the best of our knowledge, we did not observe such links between analytical signal processing theory and deep learning so far. 5. CONCLUSION We presented an approach to learn the discrete optimal reconstruction filter directly from the continuous Ramp filter. We have shown that the learning approach will automatically compensate for the errors inflicted by the discretization in an L2-sense optimal way with respect to our given training data. This is achieved by formulating [1] Ge Wang, “A perspective on deep imaging,” IEEE Access, vol. 4, pp. 8914–8924, 2016. [2] Tobias Würfl, Florin Cristian Ghesu, Vincent Christlein, and Andreas Maier, “Deep Learning Computed Tomography,” in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2016: 19th International Conference, Proceedings, Part III, 2016, vol. 3, pp. 432–440. [3] Kerstin Hammernik, Tobias Würfl, Thomas Pock, and Andreas Maier, “A deep learning architecture for limited-angle computed tomography reconstruction,” in Bildverarbeitung für die Medizin 2017: Algorithmen - Systeme - Anwendungen. Proceedings des Workshops vom 12. bis 14. März 2017 in Heidelberg, Berlin, Heidelberg, 2017, pp. 92–97, Springer Berlin Heidelberg. [4] GN Ramachandran and AV Lakshminarayanan, “Threedimensional reconstruction from radiographs and electron micrographs: application of convolutions instead of fourier transforms,” Proceedings of the National Academy of Sciences, vol. 68, no. 9, pp. 2236–2240, 1971. [5] Lawrence A Shepp and Benjamin F Logan, “The fourier reconstruction of a head section,” IEEE Transactions on Nuclear Science, vol. 21, no. 3, pp. 21–43, 1974. [6] Daniël M Pelt and Kees Joost Batenburg, “Improving filtered backprojection reconstruction by data-dependent filtering,” IEEE Transactions on Image Processing, vol. 23, no. 11, pp. 4750–4762, 2014. [7] Andreas Maier, Hannes Hofmann, Martin Berger, Peter Fischer, Chris Schwemmer, Haibo Wu, Kerstin Müller, Joachim Hornegger, Jang-Hwan Choi, Christian Riess, Andreas Keil, and Rebecca Fahrig, “CONRAD - A software framework for conebeam imaging in radiology,” Medical Physics, vol. 40, no. 11, 2013.
1cs.CV
arXiv:1010.3815v2 [physics.soc‐ph] Individual and Group Dynamics in Purchasing Activity Lei Gao Jin-Li Guo* Chao Fan Xue-Jiao Liu Business School, University of Shanghai for Science and Technology, Shanghai, 200093, China Abstract: As a major part of the daily operation in an enterprise, purchasing frequency is of constant change. Recent approaches on the human dynamics can provide some new insights into the economic behaviors of companies in the supply chain. This paper captures the attributes of creation times of purchase orders to an individual vendor, as well as to all vendors, and further investigates whether they have some kind of dynamics by applying logarithmic binning to the construction of distribution plot. It’s found that the former displays a power-law distribution with approximate exponent 2.0, while the latter is fitted by a mixture distribution with both power-law and exponential characteristics. Obviously, two distinctive characteristics are presented for the interval time distribution from the perspective of individual dynamics and group dynamics. Actually, this mixing feature can be attributed to the fitting deviations as they are negligible for individual dynamics, but those of different vendors are cumulated and then lead to an exponential factor for group dynamics. To better describe the mechanism generating the heterogeneity of purchase order assignment process from the objective company to all its vendors, a model driven by product life cycle is introduced, and then the analytical distribution and the simulation result are obtained, which are in good line with the empirical data. Key words: human dynamics; purchasing activity; power-law distribution; mixture distribution; individual dynamics; group dynamics 1 Introduction Humans participate in a large number of distinct activities on different purposes and these activity patterns show diverse characteristics. Although individual human behaviors are unpredictable, while all the behaviors reveal some general laws. However, it is impossible to describe all the activity patterns with a specific process model. In 1837, French mathematician Poisson derived the Poisson process based on the binomial distribution and from then on, similar models are widely used in communications, transportation, management, economic operation and so on. All these models are based on the hypothesis that the time intervals between two consecutive actions are comparable to each other. In 2005, Barabási et al. studied the e-mail communications and the correspondence patterns of Einstein et al. and indicated that human activity patterns are rather heterogeneous, with long periods of inactivity that separate bursts of intensive activity. More precisely, the inter-event times between two consecutive executions for a given task can be approximated by a heavy tailed distribution [1-3]. After that, some scholars conducted related empirical exploration and theoretical research through human daily behaviors * Corresponding author. Tel.:021-65710380. E-mail address: [email protected] (J.-L. Guo). 1 arXiv:1010.3815v2 [physics.soc‐ph] and found that power-law distributions occur in an extraordinarily diverse range of activities such as web browsing, communications via electronic and paper mails and human traffic [4-7]. According to the present research, the scaling parameter α typically lies in the range 1 < α < 3 , although there are occasional exceptions. Later, Vázquez et al. divided human dynamics into two universality classes with exponents 1 and 1.5 [8]. The fact that these patterns can’t be characterized simply is a sign of complex underlying human dynamics that merit further study. However, studies on the properties and mechanisms of human business activities based on the enterprise, an important organization in the real world, are still in the infancy, with only a few related documents. Wang et al. studied the statistical features of the task-restricted work patterns via aerial inbound operation in a logistics company and obtained five power-law distributions with exponents 1.5, 2.0 and 2.5[9]. Caldarelli et al. illustrated that some financial systems display scale-free properties, with exponents from 1.5 to 3[10]. Ho et al. investigated the time series of Taiwan stock price index and got a conclusion that the autocorrelation does not decay to zero exponentially but in a power-law manner with exponent 5 / 3 over a range of frequencies [11]. Hence, it still needs further study to clarify whether the day-to-day business in a company, for example, supply chain operation, production scheduling and staff turnover, has heavy-tailed property or follows Poisson process. Among all the daily activities in a manufacturing enterprise, supply chain management plays an important role. At present, in the dynamic environment and uncertain competitive market, the value and service provided by a good supply chain alliance is more competitive and effective than that by companies without information sharing between each other. Yet, as a separate individual in the supply chain level, a company possesses its unique view and strategy, forming a complicated relationship with other corporations under the effect of the environment and showing a power-law degree distribution with exponent 1.96[12]. And the purchase order to a large extent is an epitome of the games of all parties in the complex system. Recent approaches on the human dynamics can provide some new insights into the purchasing behaviors in the supply chain based on the time series of purchase orders and in turn, the results may give a further understanding of the characteristic of human activity pattern. The goal of this paper is to provide an empirical evidence and theoretical analysis for the purchasing process. 2 Data specification In this paper, the data come from a main business of a Fortune 500 company, called Enterprise M for short in the following. As a corporation with global coverage, the number of daily purchase orders (PO’s) for this business is as large as one thousand. Under the premise of keeping the business information of enterprise M absolutely secret, we investigate the PO’s created in the two latest fiscal quarters and analyze the scaling characteristics with these actual operation data from the angle of time intervals. There are about 4 × 10 4 5 × 10 4 PO’s in each quarter, involving approximately two thousand suppliers. This paper focuses on the inter-arrival time of two concessive orders, with the precision of a second. But for the global property of 2 arXiv:1010.3815v2 [physics.soc‐ph] enterprise M and the actual state in daily work, we don’t classify the orders by the creation time, i.e., orders placed in the weekends and other nonworking times of a certain region are not precluded. The analysis of each time interval between two consecutive purchase orders is performed by the normalized logarithmic binning to remove the noise tail and reduce the uneven statistical fluctuations common in empirical analysis. In contrast with simple logarithmic binning, it further removes the artifact while maintaining the advantage of using larger bins where there are fewer values of abscissa [13]. Naturally, prior to conducting the analysis, we compared the three fitting curves generated by this approach, probability density curves and cumulative distribution curves on logarithmic scales respectively, and finally decided to apply this method to data analysis for it is more explicit and legible on the premise of fitting accuracy without altering the real distribution characteristics of the orders [14]. During the following section, we mainly discussed two types of distributions on group and individual dynamics levels respectively: one is the time interval distribution of all the purchase orders of enterprise M without recognition of the PO suppliers, the other is of orders to a specific supplier. Table 1 Data Profile Fiscal Quarter Q1 Q2 Number of all PO’s 4.4 ×104 4.2 ×104 Number of vendors 2.7 ×103 2.6 ×103 Number of PO’s to the top ten vendors 2.4 ×104 2.4 ×104 Number of PO’s to Enterprise A 1.0 ×104 1.1×104 As shown in table 1, enterprise M placed PO’s to more than two thousand vendors during the two quarters, among which about fifty percent were assigned to only ten suppliers and over twenty percent to enterprise A. In the case of the heterogeneity during the PO assignment, here we just discuss the purchase orders to the largest supplier A in details as a paradigm to clarify the individual dynamics of the purchasing process. 3 Individual dynamics in the purchasing activity The individual characteristic of purchasing activity is analyzed through the statistical properties of the time intervals of orders to a specific vendor. Obviously, the individual purchasing frequency may show great variety with time. As demonstrated in Fig.1 and Fig.2, the PO’s from enterprise M to its supplier A show a power law shape over a range of interval times, which reveals the heterogeneity of purchasing activities. 3 arXiv:1010.3815v2 [physics.soc‐ph] a 100000 Interval time τ (s) 80000 60000 40000 20000 0 0 1000 2000 3000 4000 5000 6000 Event number 7000 8000 9000 10000 b 0 10 -2 10 slope=1.912 -4 P(τ) 10 -6 10 -8 10 -10 10 1 10 2 3 10 10 τ (s) 4 5 10 10 c Fig.1 Purchase orders to the largest supplier A in Q1. a, The interval times τ of the 1.0 × 104 consecutive PO’s to enterprise A in Q1, locating in range between 16s and 8.6 × 10 s. There are 4 dozens of large spikes in this plot, implying very long interval times for orders created successively. b, Probability-interval time plot for these PO’s in a log-log coordinate system, where time interval distribution P (τ ) ∝ τ −1.912 is represented by a solid line linear. While conducting the regression analysis, the first two points marked in red are excluded for the obvious deviation. c, Succession of PO’s in a certain week of Q1, from Sunday to Saturday. The horizontal axis denotes time with unit seconds, and each corresponding vertical line presents the creation of a PO to enterprise A. Five significant bursts (black boxes) are visible on the plot, the spacing of each 4 arXiv:1010.3815v2 [physics.soc‐ph] vertical line illustrating the gaps seen in a. b. a Interval time τ (s) 200000 150000 100000 50000 0 0 2000 4000 6000 Event number 8000 10000 b 0 10 -2 10 slope=1.973 -4 P(τ) 10 -6 10 -8 10 -10 10 1 10 2 10 3 10 τ (s) 4 10 5 10 c Fig.2 Purchase orders to enterprise A in Q2. a, The interval times τ of the 1.1 × 104 consecutive orders in Q2, locating in range from 1s to 2.0 × 10 s. Large spikes are visible on this plot as well, 5 although the locations and lengths of these spikes are different from Fig.1 a. b, Probability-interval time plot for these orders in doubly logarithmic coordinates, the probability decays in a power-law manner with exponent 1.973. All points can be well fitted by this distribution. c, Succession of orders in a certain week of Q2. Five significant bursts and two smaller black boxes can be observed on the plot. By analyzing the individual characteristics through the PO data in the given two quarters, a heavy-tailed distribution with approximate exponent 2.0 is obtained, although the power-law 5 arXiv:1010.3815v2 [physics.soc‐ph] scales of the two fiscal quarters are a little different. And since the number of purchase orders in a quarter is so large that the succession plot is unreadable, only one week’s data are discussed in Fig.1 c and Fig.2 c to provide a snapshot of the succession of orders. 4 Group dynamics in the purchasing activity Although a company assigns PO’s to various vendors for different missions, the overall purchasing activity is market oriented under the influence of productivity of the whole industry. Since the market demand varies with time, so the PO assignments in different quarters may show diverse properties accordingly. Without distinguishing any details of these orders in the two quarters, the purchasing characteristic of enterprise M is obtained. On the basis of the fitting results, a model driven by the product life cycle is then introduced. 4.1 Statistical characteristics As described in Sec.3, the heavy-tailed distribution with approximate exponent 2.0 well describes the real feature of purchasing behaviors between enterprise M and a certain supplier. Inspired by the long time inactivity of individual vendor in the purchasing process, we detected the scaling properties of order creation times, including orders to all vendors, aiming to clarify whether the power-law feature is in good agreement with the reality. But to our surprise, the fitting results are not accurate because about one-third of all data points deviate too far from them. Hence, there may be another distribution to better describe the group dynamical features in purchasing activity. a Interval time τ (s) 80000 60000 40000 20000 0 0 5000 10000 15000 20000 25000 Event number 30000 35000 40000 6 arXiv:1010.3815v2 [physics.soc‐ph] b 100 -2 10 -4 P(τ) 10 -6 10 -8 10 -10 10 0 1 10 10 2 10 3 τ (s) 4 10 10 5 10 C Fig.3 All purchase orders of enterprise M in Q1 without distinguishing the suppliers. a, The interval times τ of the 4.4 × 104 consecutive PO’s in Q1, locating in range between 0s and 7 × 10 s. Large spikes are still visible. b, Probability-interval time plot for these PO’s in 4 double-logarithmic coordinates, where the probability displays a mixture distribution with both power-law and exponential characteristics P (τ ) = 20e −0.00008τ (0.00008(τ + 25) −0.9 + 0.9(τ + 25) −1.9 ) . c, Succession of PO’s in the same week of Fig.1 c., yet each corresponding vertical line presents the creation of an order. Furthermore, the boxes are bigger and the bursts are much more significant. a 100000 Interval time τ (s) 80000 60000 40000 20000 0 0 5000 10000 15000 20000 25000 Event number 30000 35000 40000 7 arXiv:1010.3815v2 [physics.soc‐ph] 0 b 10 -2 10 -4 P(τ) 10 -6 10 -8 10 -10 10 0 10 1 10 2 10 3 τ (s) 10 4 10 5 10 c Fig.4 Purchase orders of enterprise M in Q2 without recognition of suppliers. a, The interval times τ of the 4.2 × 104 consecutive orders in Q2, from 0s to 8.0 × 104 s. some spikes illustrates the long time of inactivity during this process. b, Probability-interval time plot on doubly logarithmic axes, fitting with a mixture distribution P (τ ) = 19e −0.0001τ {0.0001(τ + 25) + 0.9(τ + 25) −1.9 } . c, −0.9 Succession of orders in the same week of Fig.2. Six significant bursts (black boxes on this box) are visible on the plot, although one is significantly smaller than others. In fact, for this week, the number of orders created in Sunday is about one sixth of that on a weekday. As shown in the above two figures, the arrival process of purchase orders without distinguishing the vendors allows for very long periods of inactivity that separate bursts of intensive activity as well as that on the individual dynamics level. Additionally, the five significant bursts in Fig.3 c illustrate that most of orders are created in weekdays, which means the PO arrival process is affected by working calendar. More precisely, the counts of purchase orders in different weekdays are diverse for the demands are dependent on the stochastic production demands of market in different periods. Furthermore, from Fig.4 c, it is confirmed that orders created in weekends are meaningful and shouldn’t be excluded while fitting the regression. In a word, the mixture distribution is in good line with the reality, although it deviates from the empirical distribution in particular for the first points on the left-hand side of the panel with larger ordinate value. Obviously, this distribution shows significant divergence compared with that in Sec.3. This can be attributed to the fitting deviations as they are negligible for individual dynamics, but those of different vendors are cumulated and lead to an exponential factor for group dynamics. Considering the real purchasing process in daily operation, we try to introduce a model and analyze the overall purchasing activity from another point of view. 8 arXiv:1010.3815v2 [physics.soc‐ph] 4.2 Model analysis The statistical result implies a fact that a certain dynamical mechanism is in action, which may reveal the overall purchasing process of enterprise M. As a company with fast production update, enterprise M takes a purchasing strategy on the basis of dynamic lot sizing model with lead-time two weeks in response to this short product life cycle. A new PO is placed when the inventory drops to order point or re-order level. The queuing process driven by this strategy can’t be explained well by the human dynamics model on task priority. So we try to describe this process with the following model driven by product life cycle: (i) The frequency of order creation in different time intervals is independent since the requirement is dependent on the stochastic market demand; (ii) Rt + S1 Let the rate of order creation λ (t ) = Pt + S at time t , where R, P, S1 , S represents demand rate, production rate, initial demand and initial stock respectively; (iii) The occurring probability of an order at time t is λ (t ) dt , and purchasing behaviors hardly occur more than twice in a short time interval dt . According to the definition above, we obtain λ (t ) = R P + PS1 − RS P ( Pt + S ) . Hence, based on the approach presented in Ref.15, the cumulative distribution function of the inter-arrival time Pτ can be given by Pτ ~ c( P RS − PS1 P ) 2 (τ + S RS − PS1 ) P 2 − e R τ for sufficiently large τ P P S Differentiating both sides of the function, we obtain the probability density function P (τ ) ~ c ( P S RS − PS1 ) P 2 − e R P τ R S { (τ + ) P P RS − PS1 P 2 + PS1 − RS P 2 (τ + S RS − PS1 ) P 2 −1 } P where the probability distribution can be approximated by this function in an small interval of length around a specific point τ . As R, P, S1 and S are all positive constants, it denotes that the theoretic inter-arrival time follows a mixture distribution with both exponential and power-law properties. 9 arXiv:1010.3815v2 [physics.soc‐ph] -1 10 -2 P(τ) 10 -3 10 -4 10 0 1 10 2 10 τ (s) 3 10 10 Fig.5 The comparison of the time interval distribution for the activity pattern predicted by the model (black points) and the analytical distribution (blue line) P (τ ) = 19e −0.0001τ {0.0001(τ + 25) + 0.9(τ + 25) −1.9 } with the same values of −0.9 R, P, S1 and S , where about 10 events was monitored over T = 10 time steps. The simulation result is in good line 4 6 with the analytical one. Based on the fitting analysis and the theoretical probability distribution of the model, it is supposed that the overall purchasing activity displays not only a power-law feature but also an exponential characteristic. This verifies that the purchasing strategy plays a significant role in the PO assignment. For both of the two fitting distributions in Fig.3 and Fig.4, the power-law RS − PS1 exponents are below zero, by which we can conclude that < 0 in practical operation, i.e. 2 P PS1 − RS > 0 . This indicates that purchasing frequency decays over time and tends to a stable R as t → ∞ for order assignment is systematic during the stable production period. While P as t → 0 , λ (t ) is larger due to the small order quantity and frequent purchasing actions at the value initial stages of product life cycle because the manufacturing process is immature. More specifically, λ (t ) = S1 / S when t = 0 , and this means that λ (t ) can be regarded as zero when there is no initial demand or purchasing quantity S1 in the product conception phase. In short, a heavy-tailed property is observed in both of the two kinds of distributions, although the group dynamical characteristic exhibits an exponential factor besides a power law. This denotes that the purchasing activity is heterogeneous with different characteristics on individual and group dynamics levels respectively. 10 arXiv:1010.3815v2 [physics.soc‐ph] 5 Conclusion This paper investigates whether purchasing behavior has some kind of dynamics by analyzing the PO data and purchasing process. Two distinctive characteristics are found for the interval time distribution from the point of view of individual dynamics and group dynamics. The decay characteristics of purchasing activity from enterprise M to supplier A are likely power-law with approximate exponent 2.0 applying the log binning method, although the scaling parameters vary in different quarters. However, for the characteristic of overall purchasing activity, the interval time distribution displays both power-law feature and exponential property. The observation of heavy-tailed in the statistical data reveals a typical purchasing activity pattern in the protean industrial environment with fast production update. Indeed, the purchasing frequency depends on the specific demand rate, production rate under the conditions of competitive market and short production life cycle. The model can address the scaling behavior of the probability distribution with the analytical function and the simulation result. Understanding the origin of the non-Poisson nature of purchasing activity pattern is meaningful for effective resource allocation and better performance of supply chain management. However, considering the complicated environment for diverse industries, one may raise several important questions. Does the power-law feature exist in purchasing behaviors of other companies? May the model be applied to other human actions and are there any models from other distinct perspectives to interpret this group dynamical characteristic? Why the characteristics on the group dynamics and individual dynamics are diverse? In the future, more data of different corporations need to be collected and much exacter model will be developed to offer a better understanding of human dynamics and supply chain management. Acknowledgments This paper is partly supported by the National Natural Science Foundation of China (70871082), the Foundation of Shanghai Leading Academic Discipline Project (S30504) and the Innovation Fund Project for Graduate Student of Shanghai (JWCXSL1002). Reference [1] [2] [3] [4] [5] A.-L. Barabási, The origin of bursts and heavy-tails in human dynamics, Nature 435 (2005) 207-211. J.G. Oliveira, A.-L. Barabási, Darwin and Einstein correspondence patterns, Nature 437(2005) 1251. A.Vázquez, Exact Results for the Barabási Model of Human Dynamics, Phys. Rev. Lett. 95(2005) 248701. Z. Dezsö, A. Lukács, B. Rácz, I. Szakadát, A.-L. Barabási, Dynamics of information access on the web, Phys. Rev. E 73 (2006) 066132. W. Hong, X.-P. Han, T. Zhou, B.-H.Wang, Heavy-tailed statistics in short-message communication, Chinese Physics Letters 26 (2009) 028902. 11 arXiv:1010.3815v2 [physics.soc‐ph] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] D. Brockmann, L. Hufnagel, T. Geisel, The scaling laws of human travel, Nature 439(2006) 462-465. Bagler G. Analysis of the Airport Network of India as a complex weighted network. Physica A 387 (2008) 2972—2980. A.Vázquez, J. G. Oliveira, Z. Dezsö, K. Goh, I. Kondor, A.-L. Barabási, Modeling bursts and heavy tails in human dynamics, Phys. Rev. E 73(2006) 036127. Q. Wang, J.-L. Guo, Human dynamics scaling characteristics for aerial inbound logistics operation, Physica A 389 (2010) 2127-2133. G. Caldarelli, S. Battiston, D. Garlaschelli, M. Catanzaro, Emergence of Complexity in Financial Networks, Lect. Notes Phys. 650(2004) 399-423. D.-S. Ho, C.-K. Lee, C.-C. Wang, M. Chuang, Scaling characteristics in the Taiwan stock market, Physica A 332 (2004) 448-460. H.-J. Sun, J.-J. Wu, Scale-Free Characteristics of Supply Chain Distribution Networks, Modern Physics Letters B 19 (2005) 841-848. E.P. White, B.J. Enquist, J.L. Green, On Estimating the exponent of Power-law Frequency Distributions, Ecology 89(2008) 905-912. M.E.J. Newman, Power laws, Pareto distributions and Zipf’s law, Contemporary Physics 46(2005) 323-351. J.-L.Guo, Weblog patterns and human dynamics with decreasing interest, arXiv:1008.0042v3 (2010). 12
5cs.CE
Shared Energy Storage Management for Renewable Energy Integration in Smart Grid Katayoun Rahbar1 , Mohammad R. Vedady Moghadam2, Sanjib Kumar Panda1,2, and Thomas Reindl1 1 arXiv:1607.06581v1 [cs.SY] 22 Jul 2016 2 Solar Energy Research Institute of Singapore, Singapore ECE Department, National University of Singapore, Singapore E-mail: {serkr, elemrvm, eleskp, sertgr}@nus.edu.sg Abstract—Energy storage systems (ESSs) are essential components of the future smart grid to smooth out the fluctuating output of renewable energy generators. However, installing large number of ESSs for individual energy consumers may not be practically implementable, due to both the space limitation and high investment cost. As a result, in this paper, we study the energy management problem of multiple users with renewable energy sources and a single shared ESS. To solve this problem, we propose an algorithm that jointly optimizes the energy charged/discharged to/from the shared ESS given a profit coefficient set that specifies the desired proportion of the total profit allocated to each user, subject to practical constraints of the system. We conduct simulations based on the real data from California, US, and show that the shared ESS can potentially increase the total profit of all users by 10% over the case that users own individual small-scale ESSs with no energy sharing. Index Terms—Shared energy storage, energy management, renewable energy, smart grid, optimization. I. I NTRODUCTION The fast-growing electric energy consumption has become a serious concern for existing power systems. According to the study reported by the US energy information administration (EIA), the worldwide energy consumption will grow by 56% from 2010 to 2040 [1]. This motivates a green power system with users widely deploying distributed renewable energy generators to meet their individual demand locally, which can effectively reduce both the carbon dioxide emissions of traditional fossil fuel based power plants and the transmission losses from power plants to far apart users. However, the intermittent and stochastic characteristics of renewable energy sources can cause imbalanced supply with demand and yield fluctuation in the power system frequency and/or voltage [2]. Deploying energy storage system (ESS) is a practical solution to smooth out the power fluctuation in the renewable energy generation and improve the system reliability [3]– [5]. In practice, integrating individual ESSs for all energy consumers (especially for residential and commercial users) may not be feasible, due to both the space limitation and high capital cost of the large number of ESSs. With the technology advances in bidirectional power flow and distributed monitoring and control in smart grids, the concept of shared ESS has become appealing [6]–[8]. In this case, the surplus renewable energy of some users can be charged into a shared (common) ESS, and then be discharged by others with renewable energy deficit. Moreover, given the real-time/dayahead price information, the shared ESS can reduce the total cost of purchasing conventional energy from the main grid by being charged within off-peak-demand period, with low electricity prices, and being discharged during peak-demand period, with high electricity prices [6]. However, the main challenge to realize the shared ESS is how to manage users to optimally charge/discharge energy to/from the shared ESS, which will be addressed in this paper. In this paper, we consider a system of multiple energy consumers with their individually owned renewable energy generators, and one ESS shared among them. Since users are self-interested in practice, each of which wants to use the shared ESS as much as possible to maximize its profit, i.e., the energy cost saving resulted from deploying the shared ESS. This can cause fairness issue in general, i.e., one user may use the shared ESS more frequently than others. To tackle this issue, we propose a centralized algorithm, under which a central controller jointly optimizes the amount of energy charged/discharged to/from the shared ESS by all users, given a profit coefficient set that specifies the desired proportion of the total profit allocated to each user. Next, for performance comparison, we formulate the profit maximization problem for the conventional case of distributed ESSs, where each user owns its small-scale ESS and does not share energy with others. To have a fair comparison, we set the sum capacity of all individual ESSs to be the same as the shared ESS. Our simulations show that the shared ESS can potentially increase the total profit of users compared to the case of distributed ESSs. This is because the surplus energy of one user can be utilized by others with energy deficit, and also the energy curtailment is avoided more effectively due to the higher capacity of shared ESS. Moreover, we show that the diversity in users’ renewable energy sources/loads can highly increase the profit gain resulting from the shared ESS, i.e., users with different types of renewable energy sources can benefit significantly by sharing an ESS. There have been previous works on the energy management problem for users with ESSs [3]–[8]. Most of the previous works, e.g., [3]–[5], assume that either each user owns its ESS (that is not shared with others) or all users belong to the same entity, where maximizing the profit of each individual user is not the case. However, this might not always be valid in practi- cal systems, especially when the number of users is large. The idea of shared ESS among users was introduced in [6], where interesting results on the shared ESS deployment in the system were presented. However, the proposed charging/discharging policy in [6] is only based on the hourly prices offered by the main grid. Recently, [7] solved the cost minimization problem for energy consumers with demand response capability, but no renewable energy integration, which limits the application of their derived solution. Moreover, [8] proposed an auction based approach for the interactions between the shared ESS and users, using game theoretical techniques. In contrast to the prior works, in this paper, we propose an algorithm under which a central controller optimally sets the charging/discharging power to/from the shared ESS by all users, using the profit coefficients technique. We then compare the profit gain in this case with the extensively studied case of users with distributed small-scale ESSs. The rest of the paper is organized as follows. Section II describes the system model. Section III formulates and solves the energy management problem for the shared ESS. Section IV describes the case of distributed ESSs. Section V presents our simulation results. Last, Section VI concludes the paper and discusses possible future directions. II. S YSTEM M ODEL We consider a time-slotted system with slot index n, n ∈ N = {1, . . . , N }, where N ≥ 1 is the total number of scheduling times slots. For simplicity, we assume that the duration of each slot is normalized to a unit time; as a result, power and energy are used interchangeably in this paper. As shown in Fig. 1, we consider M ≥ 1 number of users, indexed by m, m ∈ M = {1, · · · , M }. Particularly, each user can be a single energy consumer (residential, commercial, and/or industrial) or a group of consumers controlled by an aggregator. We assume that users have their individual renewable energy generators; thus, can supply a part or all of their load over time. However, a single large-scale energy storage system (ESS) is shared among all users, where they can charge/discharge to/from it whenever necessary. Moreover, users are all connected to the main grid, which consists of conventional fossil fuel based energy generation units, and can draw energy from it in case of renewable energy deficit. We assume that a central controller who is trusting of all users optimizes the amount of charging/discharging to/from the shared ESS while ensuring that practical constraints of the system are satisfied. Let 0 ≤ Cmn ≤ C and 0 ≤ Dmn ≤ D denote the energy charged/discharged to/from the shared ESS by user m at time slot n, respectively, where C > 0 and D > 0 are the maximum charging and discharging rates of the shared ESS, respectively. Furthermore, there are some energy losses during the charging and discharging processes of the ESS in practice, which are specified by charging and discharging efficiency parameters, denoted by 0 < α̇ < 1 and 0 < α̈ < 1, respectively. Let Sn ≥ 0 denote the available energy in the shared ESS at the beginning of time slot n, which can be derived recursively as Main Grid !" #" $" User m User 1 User M %$" ($" '& ') %!" '& (!" % Energy Storage System ') Fig. 1. #" '& (#" ') Case of shared ESS. follows: Sn+1 = Sn + α̇ M X m=1 Cmn − M 1 X Dmn . α̈ m=1 (1) In addition, a practical ESS has finite capacity and cannot be fully discharged to avoid deep charging. We thus have the following constraints for the states of the shared ESS over time S ≤ Sn ≤ S, ∀n ∈ N , (2) where S ≥ 0 and S ≥ 0 are the minimum and maximum allowed states of the shared ESS, respectively. By default, we assume S ≤ S1 ≤ S. Denote Rmn ≥ 0 and Lmn ≥ 0 as the renewable energy generation and the load of user m at time slot n. We then define ∆mn = Rmn − Lmn as the net energy profile of user m. Note that ∆mn can be either positive (case of surplus renewable energy) or negative (case of renewable energy deficit). In general, ∆mn ’s are stochastic due to the randomness in both the renewable energy generation and load, but can be predicted with finite errors. However, in this paper, we assume that ∆mn ’s are perfectly predicted and thus are known to the users prior to the scheduling, e.g., day-ahead energy management.1 By denoting Gmn ≥ 0 as the energy drawn from the main grid by user m at time slot n, we have the following constraints for each user m: Gmn − Cmn + Dmn + ∆mn ≥ 0, ∀n ∈ N . (3) The constraints in (3) ensure that the load of user m is satisfied in all time slots, from its own renewable energy generation, the shared ESS, and/or the main grid. Drawing energy from the main grid incurs some cost for user m, which can be modelled by a set of time-varying functions fmn (Gmn ), n = 1, . . . , N . Specifically, we assume that each fmn (Gmn ) is convex [9] and 1 In the practical case of stochastic net energy profiles, we can design online algorithms for the real-time implementation using, e.g., sliding-window technique given in [3]. Due to the space limitation, we do not discuss the online energy management in this paper. increasing over Gmn , e.g., piece-wise linear and/or quadratic functions [10]. Main Grid !" $" #" III. P ROBLEM F ORMULATION : S HARED ESS As discussed earlier, drawing energy from the main grid results in some cost for individual users. As a result, each user wants to use the shared ESS as much as possible in order to maximize its own profit, which is defined as the difference between its energy costs without and with the shared ESS. In this case, the central controller should ensure that the ESS is shared appropriately (fairly) among all users while satisfying the practical constraints of the system. In the following, we first formulate the profit maximization problem for each individual user, and derive its profit as a function of the charging/discharging values. Next, we apply the technique of profit coefficients under which the central controller proportionally allocates the total profit to users. Given {Gkn ≥ 0}k6=m , {0 ≤ Ckn ≤ C}k6=m , {0 ≤ Dkn ≤ D}k6=m , satisfying constraints in (2) and (3), ∀k 6= m, the profit maximization problem for each user m is given by (P1): max {Gmn }n∈N ,{Cmn }n∈N ,{Dmn }n∈N fˆm − N X fmn (Gmn ) n=1 s.t. S ≤ Sn ≤ S, ∀n ∈ N Gmn − Cmn + Dmn + ∆mn ≥ 0, ∀n ∈ N Gmn ≥ 0, 0 ≤ Cmn ≤ C, 0 ≤ Dmn ≤ D, ∀n ∈ N , PN where fˆm = n=1 fmn ([−∆mn ]+ ), with [x]+ = max{0, x}, denotes the energy cost for user m when the shared ESS is not deployed. In (P1), we can first solve the problem over {Gmn }n∈N , given fixed {0 ≤ Cmn ≤ C}n∈N and {0 ≤ Dmn ≤ D}n∈N . By solving the resulted problem, we obtain Gmn = [Cmn − Dmn − ∆mn ]+ , ∀n ∈ N . Accordingly, the user’s profit can be expressed as a function of its charging/discharging values as follow: Pm ({Cmn }n∈N , {Dmn }n∈N ) = N X n=1 fmn ([−∆mn ]+)− N X fmn ([Cmn − Dmn − ∆mn ]+). (4) n=1 Next, the central controller needs to jointly design m∈M for all users such that their in{Cmn }m∈M n∈N , {Dmn }n∈N dividual profits are maximized proportionally while practical constraints of the shared ESS are satisfied. Let Pm ({Cmn }n∈N , {Dmn }n∈N ) P = βm t∗ , where 0 ≤ βm ≤ M 1, ∀m ∈ M, satisfying m=1 βm = 1, are given 2 profit coefficients that specify the proportion of the total profit received by individual users, and t∗ ≥ 0 denotes the maximum total profit of all users, i.e., t∗ = 2 In practice, there are different approaches to design the profit coefficients βm ’s. For instance, consider the scenario that users invest to purchase a bulk battery, according to their budget. In this case, the system operator can set βm ’s such that users benefit from the shared ESS according to their initial investment. As another example, consider a scenario that the ESS is already installed in the system, e.g., by the government funding. In this case, the central controller sets the use of ESS such that users with higher average renewable energy deficit can draw more from the shared ESS. User 1 User m User M %$" )$" %#" )#" '& '( '& '( '& '( Energy Storage System Energy Storage System Energy Storage System %!" )!" Fig. 2. Case of distributed small-scale ESSs. PM Pm ({Cmn }n∈N , {Dmn }n∈N ). Specifically, t∗ can be obtained by solving the following optimization problem: m=1 (P2) : max t m∈M t,{Cmn }m∈M n∈N ,{Dmn }n∈N s.t. S ≤ Sn ≤ S, ∀n ∈ N , Pm ({Cmn }n∈N , {Dmn }n∈N ) ≥ βm t, ∀m ∈ M 0 ≤ Cmn ≤ C, 0 ≤ Dmn ≤ D, t ≥ 0, ∀m ∈ M, ∀n ∈ N. It can be easily verified that (P2) is convex [9], and thus can be solved using standard convex optimization techniques such as interior point method. Alternatively, (P2) can be solved by a bisection search over t, where in each search iteration, it suffices to solve a feasibility problem that checks whether all constraints of (P2) can be satisfied for given t. Eventually, t converges to its optimal value that is t∗ . In this paper, we use CVX software [11] to derive the optimal solution to (P2), i.e., m∈M ∗ ∗ t∗ , {Cmn }m∈M n∈N , and {Dmn }n∈N . IV. P ERFORMANCE B ENCHMARK : D ISTRIBUTED ESS S In this section, we consider a system setup of distributed ESSs, where users own their individual small-scale ESSs, but do not share energy with each other. In this case, the state of the ESS for each user m, denoted by Smn at time slot n, can be derived as 1 Smn+1 = Smn + α̇m Cmn − Dmn , (5) α̈dm where 0 < α̇m < 1 and 0 < α̈m < 1 are charging and discharging efficiency parameters, respectively. We then have the following constraints for the ESS of user m: S m ≤ Smn ≤ S m , ∀n ∈ N , (6) where S m ≥ 0 and S m ≥ 0 are the minimum and maximum allowed states of the ESS. The charging and discharging values should also satisfy 0 ≤ Cmn ≤ C m and 0 ≤ Dmn ≤ Dm , where C m > 0 and Dm > 0 are the maximum charging and discharging rates, respectively. To have a fair comparison PM with the case of shared ESS in Section III, we set S = m=1 S m , PM PM PM S = m=1 S m , C = m=1 C m , and D = m=1 Dm . TABLE I C OMPARISON BETWEEN THE SHARED AND DISTRIBUTED ESS S Users’ energy consumption (kW) 180 User 1 User 2 User 3 150 ESS values Shared ESS Distributed S 1 = 300 S = 1 MW S 2 = 600 S 3 = 100 S 1 = 450 S = 1.5 MW S 2 = 900 S 3 = 150 120 90 60 30 0 0 24 48 72 96 120 144 168 18 n (hour) Aggregate wind and solar energy (kW) 300 User 1 User 2 User 3 250 28.4% 18.5% 32.6% 25.4% ×104 15 Load profiles of the three users over one week. Increasing sum-profit region Users’ profits ($) Fig. 3. Total profit gain of all users Shared ESS Distributed ESS ESS kW kW kW kW kW kW Fixed sum-profit region 12 Decreasing sum-profit region P1 (·) P2 (·) P3 (·) P t∗ = 3m=1 Pm(·) 9 6 200 3 150 0 100 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 β2 50 0 Fig. 5. Profit of users over profit coefficient β2 , given β1 = 0.3 and β3 = 0.7 − β2 . 0 24 48 72 96 120 144 168 n (hour) Fig. 4. Renewable energy generation (both solar and wind) of the three users over one week. We now proceed to formulate the profit maximization problem for each user m. This problem can be formulated for each user independently, since ESS constraints are not coupled over users any more. Hence, the profit maximization problem for each user m can be given as follows: (P3) : max {Gmn }n∈N ,{Cmn }n∈N ,{Dmn }n∈N fˆm − N X fmn (Gmn ) n=1 s.t. S m ≤ Smn ≤ S m , ∀n ∈ N restaurant [13]. The hourly energy consumption of the three users is shown in Fig. 3. We assume that each user has its own renewable energy generators, including both solar and wind, with generation profiles shown in Fig. 4 [12], [14]. For the shared ESS setup, we set α̇ = 0.7, α̈ = 0.8, S = 0, and S = 1 MW. On the other hand, for the distributed ESSs setup, we set charging and discharging efficiency parameter of individual ESSs as α̇m = 0.7, α̈m = 0.8, ∀m ∈ M, respectively. We also set S m = 0, ∀m ∈ M, S 1 = 300 kW, S 2 = 600 kW, and S 3 = 100 kW. We model the cost function of purchasing energy from the main grid as fmn = λmn Gmn , where we set λmn = 45 $/kW, ∀m ∈ M, ∀n ∈ N [15]. Gmn − Cmn + Dmn + ∆mn ≥ 0, ∀n ∈ N Gmn ≥ 0, 0 ≤ Cmn ≤ C m , 0 ≤ Dmn ≤ Dm , ∀n ∈ N . It can be easily verified that (P3) is convex [9], and thus can be solved using CVX software [11]. In the next section, we present a numerical example to reveal the possible profit gain resulting from the shared ESS, compared to the case of distributed ESSs. We also discuss the effectiveness of the shared ESS in users’ profit maximization under different system settings. V. S IMULATION R ESULTS In this section, we consider a system with three users M = 3 based on the real data available from California, US, over one week N = 168 (from 1 January, 2006 to 7 January, 2006) [12]–[15]. Specifically, user 1 is modelled as an apartment of 30 units, user 2 as a medium-size office, and user 3 as a A. Shared versus Distributed ESSs First, we set the profit coefficients as β1 = 0.3, β2 = 0.6, and β3 = 0.1. Table I shows the total profit gain of all users, i.e., energy cost saving due to using ESS, resulting from the two system setups of shared and distributed ESSs. It is observed that shared ESS can result in higher profit, e.g., profit gain with a shared ESS of S = 1 MW is 28.4%, while distributed ESSs setup with S 1 = 300 kW, S 2 = 600 kW, and S 3 = 100 kW yields a lower profit gain of 18.5%. This is because the surplus energy of one user can be utilized by others with energy deficit and users can thus cooperatively exploit the shared ESS. In addition, the shared ESS can avoid renewable energy curtailments more effectively over the case of distributed ESSs, due to its higher capacity compared to each distributed ESS. B. Impact of Profit Coefficients Aggregate solar energy generation (kW) 300 As discussed earlier, profit coefficients βm ’s are set by the system operator to allocate a certain proportion of the total profit to each user. Fig. 5 shows the individual profits of users, i.e., Pm (·)’s given in (4), versus β2 , with β1 = 0.3 and β3 = 0.7 − β2 . It is observed that P1 (·) remains almost constant over β2 , since β1 is assumed to be fixed in this simulation. In addition, P2 (·) increases over β2 , since higher proportion of the total profit is allocated to user 2 as β2 increases, while the opposite is true for P3 (·). User 1 User 2 User 3 250 200 150 100 50 0 0 24 48 72 C. Impact of Renewable Energy Diversity VI. C ONCLUSION AND F UTURE W ORK In this paper, we study the shared ESS management problem for users with renewable energy integration. We propose an algorithm under which a central controller optimizes the charging/discharging power to/from the shared ESS by all users, given a profit coefficient set. By comparing the performance of this setup in terms of profit gain with the conventional setup of distributed small-scale ESSs, we show that the shared ESS can potentially increase the total profit of all users (up to 10% in our simulations). Our results are helpful in practical systems where installing individual ESS for each user is either very costly (due to the large number of users) or requires space that is not available. Devising efficient online algorithms for the real-time energy management of the shared ESS, given stochastic renewable energy generation/load, is an interesting future direction. R EFERENCES [1] U.S. Energy Information Administration (EIA): International energy outlook 2014, available online at http://www.eia.gov/forecasts/ieo/pdf/0484(2014).pdf. [2] M. R. V. Moghadam, R. T. B. Ma, and R. Zhang, “Distributed frequency control in smart grids via randomized demand response,” IEEE Trans. Smart Grid, vol. 5, no. 6, pp. 2798-2809, Nov. 2014. [3] K. Rahbar, J. Xu, and R. Zhang, “Real-time energy storage management for renewable integration in microgrids: an off-line optimization approach,” IEEE Trans. Smart Grid, vol. 6, no. 1, pp. 124-134, Jan. 2015. 120 144 168 Fig. 6. Renewable energy generation (only solar) of the three users over one week. 48 13.65% 8.94% 32 13.76% 40 Profit gain (%) Herein, by keeping the load profile of each user unchanged, we consider a scenario that all users have only solar energy generators (low diversity), which is in contrast to the initial setup of solar together with wind energy generators (high diversity). The solar energy generation of users is shown in Fig. 6. The total profit gain of all users for the two cases of high and low renewable energy diversity are shown in Fig. 7. It is observed that the case with high diversity of renewable energy generators yields a higher profit gain compared to the low diversity case. This is because when diversity is high, it is more likely that the energy surplus/deficit in users’ renewable energy profiles do not happen concurrently; thus, the surplus energy in one user can compensate the energy deficit in others. In addition, it is observed that the profit gain is almost constant for S > 1 MW in the low diversity case, while in the high diversity case, it happens for S > 5 MW. This is because when the diversity is low, the chance for energy cooperation among users using the shared ESS is small. 96 n (hour) 24 16 8 0 High diversity: solar and wind enegry generation Low divesity: only solar energy generation 0 1 2 3 4 5 6 7 S (MW) Fig. 7. ESS. Impact of renewable energy diversity on the performance of shared [4] I. Atzeni, L. G. Ordonez, G. Scutari, D. P. Palomar, and J. R. Fonollosa, “Demand-Side Management via Distributed Energy Generation and Storage Optimization,” IEEE Trans. Smart Grids, vol. 4, no. 2, pp. 866-876, June 2013. [5] K. Rahbar, C. C. Chai, and R. Zhang, “Real-time energy management for cooperative microgrids with renewable energy integration,” in Proc. IEEE SmartGridComm, pp. 25-30, Nov. 2014. [6] Z. Wang, C. Gu, F. Li, P. Bale, and H. Sun, “Active demand response using shared energy storage for household energy management,” IEEE Trans. Smart Grid, vol. 4, no. 4, pp. 1888-1897, Dec. 2013. [7] K. Paridari, A. Parisio, H. Sandberg, and K. H. Johansson, “Demand response for aggregated residential consumers with energy storage sharing,” in Proc. IEEE Conf. Decision and Control (CDC), pp. 2024-2030, Dec. 2015. [8] W. Tushar, B. Chai, C. Yuen, S. Huang, D. B. Smith, H. V. Poor, and Z. Yang, “Energy storage sharing in smart grid: a modified auction based approach,” IEEE Trans. Smart Grids, vol. 4, no. 2, pp. 866-876, June 2013. [9] S. Boyd and L. Vandenberghe, Convex Optimization, Cambridge University Press, 2004. [10] A. J. Wood and B. F. Wollenberg, Power Generation, Operation, and Control, Wiley, 1996. [11] M. Grant and S. Boyd, CVX: Matlab software for disciplined convex programming, version 1.21, http://cvxr.com/cvx/, Apr. 2011. [12] NREL, “Data & resources: Western wind dataset,” available online at http://www.nrel.gov/electricity/transmission/western wind disclaimer.html. [13] Open energy information, “Commercial and residential hourly load profiles for all TMY3 locations in the United States,” available online at http://en.openei.org/datasets/dataset?sectors=buildings&page=2 . [14] NREL, “Solar power data for integration studies datasets: California,” available online at http://www.nrel.gov/electricity/transmission/solar integration methodology.html. [15] Energy online, “CAISO: Average price,” http://www.energyonline.com/Data/GenericData.aspx?DataId=20&CAISO.
3cs.SY
Vol. 00 no. 00 2012 Pages 1–3 BIOINFORMATICS Biospectrogram: a tool for spectral analysis of biological sequences ∗ Nilay Chheda 1, , Naman Turakhia Jigar Raisinghani 1 1,∗, Manish K. Gupta 1†, Ruchin Shah 1 and 1 Laboratory of Natural Information Processing, Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar, Gujarat, 382007 India. Received on XXXXX; revised on XXXXX; accepted on XXXXX arXiv:1210.1472v1 [q-bio.QM] 4 Oct 2012 Associate Editor: XXXXXXX ABSTRACT Summary: Biospectrogam is an open-source software for the spectral analysis of DNA and protein sequences. The software can fetch (from NCBI server), import and manage biological data. One can analyze the data using Digital Signal Processing (DSP) techniques since the software allows the user to convert the symbolic data into numerical data using 23 popular encodings and then apply popular transformations such as Fast Fourier Transform (FFT) etc. and export it. The ability of exporting (both encoding files and transform files) as a MATLAB R .m file gives the user an option to apply variety of techniques of DSP. User can also do window analysis (both sliding in forward and backward directions and stagnant) with different size windows and search for meaningful spectral pattern with the help of exported MATLAB R file in a dynamic manner by choosing time delay in the plot using Biospectrogram. Random encodings and user choice encoding allows software to search for many possibilities in spectral space. Availability: Biospectrogam is written in Java R and is available to download freely from http://www.guptalab.org/biospectrogram. Software has been optimized to run on Windows, Mac OSX and Linux. User manual and you-tube (product demo) tutorial is also available on the website. We are in the process of acquiring open source license for it. Contact: [email protected] 1 INTRODUCTION Molecular biology has shown tremendous progress in the last decade because of various genome projects producing vast amount of biological data. This has resulted in Encode project (http://encodeproject.org) that classifies all the basic DNA elements of Human genome. This also gives us new insight into numerous molecular mechanism. In order to understand the digital biological data, people use different techniques from mathematics, computer science, etc. Digital signal processing (DSP) is a fundamental concept in information and communication technology (ICT). A natural question arises “Can DSP techniques help us to understand ∗ These authors contributed equally to the project and should be considered co-first authors † to whom correspondence should be addressed c Oxford University Press 2012. the digital biology?” It turns out that the DSP techniques are playing a major role in biology and have given birth to a new branch called genomic signal processing (Shmulevich and Dougherty, 2007). To analyse the genomic data, researchers first convert the symbolic data (example DNA or protein data) into numerical data by applying a suitable map (Kwan and Arniker, 2009; Arniker and Kwan, 2012) and then by applying signal processing transforms such as Fourier etc. to study the desired biological properties (Lorenzo-Ginori et al., 2009). In this work, we present a tool, Biospectrogram, which can help researchers to apply different encodings on the biological data and apply certain transformations to do the spectral analysis. User can also export the files (encoded or transformed) to popular MATLAB R software (MATLAB, 2010) to do the direct analysis. 2 IMPLEMENTATION AND FEATURES The tool Biospectrogram has 4 major components viz. data collector, encode, transforms and export & plot. One can use the tool in DNA or Protein mode by using the switch button. The tool has two main windows viz display window for displaying the data (collected or encoded data) and work window (encoded or transform data) to show the work. Data collector module provides a direct fetching of DNA data (both fasta and genebank file formats) from National Center of Biotechnology Information (NCBI) server by taking accession number from user which can be encoded using encode button. User can also import the files from his own machine/network. One can also select a portion of the data from the window and do further processing. One popular encoding map is the Voss representation (Voss, 1992) which maps the nucleotides A, C, G, and T from DNA space into the four binary indicator sequences xA [n], xC [n], xG [n], and xT [n] showing the presence (e.g. 1) or absence (e.g. 0) of the respective nucleotides. Similar indicator maps are available for protein space. Different possible encodings (23 available in our tool) and transformations (6 available in our tool) are shown in Figure 1. While applying encoding user has to select the fetched file from the first dropdown list and encoding scheme from the second dropdown list. The fasta file of the DNA sequence is shown in the display window and the encoded output is shown in the work window. After encoding the fetched DNA sequence or protein sequence, one can apply suitable transforms (see Figure 1) available in the tool. To apply 1 Sample et al Fig. 1. Basic architecture of Biospectrogram showing 4 major components (data collector, encode, transforms and export & plot). Different relationships between 23 encodings and transformations (with solid arrows possible in our tool) and others possible broken arrows using third party software MATLAB. other transforms (not available in our tool) and filters etc. one can export the encoded files to MATLAB R .m files and do the further analysis. For exhaustive search of a pattern, a window analysis can be done with our tool. The window button allows the user to set a window size while moving the window in both directions (forward and backward) using sliding window option whereas using stagnant window option user can select a portion of the sequence for the power spectrum from all its indicator sequences. By choosing appropriate delay time in the preferences, one can plot the transformation’s output of our tool by exporting the transformation files to MATLAB R .m files and observe the signal in a smooth automatic manner with a delay of time set by user. REFERENCES Akhtar, M., Epps, J., and Ambikairajah, E. (2007). On DNA numerical representations for period-3 based exon prediction. In Genomic Signal Processing and Statistics, 2007. GENSIPS 2007. IEEE International Workshop on, pages 1 –4. Anastassiou, D. (2001). Genomic signal processing. Signal Processing Magazine, IEEE, 18(4), 8–20. Arniker, S. and Kwan, H. K. (2012). Advanced Numerical Representation of DNA Sequences. 3, 2–6. Brodzik, A. K. and Peters, O. (2005). Symbol-balanced quaternionic periodicity transform for latent pattern detection in DNA sequences. In Proceedings. (ICASSP ’05). IEEE International Conference on Acoustics, Speech, and Signal Processing, 2005., pages 373–376. IEEE. 2 Chakravarthy, N., Spanias, A., lasemidis, L. D., and Tsakalis, K. (2004). Autoregressive modeling and feature analysis of DNA sequences,. EURASIP JASP,, 1, 13–28. Cristea, P. (2003). Phase analysis of DNA genomic signals. Proceedings of the International Symposium on Circuits and Systems, 2003. ISCAS ’03., 5, V–25–V–28. Dan Cristea, P. (2003). Large scale features in DNA genomic signals. Signal Process., 83(4), 871–888. Kwan, H. K. and Arniker, S. B. (2009). Numerical Representation of DNA Sequences. 0111. Liao, B. (2005). A 2d graphical representation of DNA sequence,. Chem Phys Lett,, 401, 196–199. Lorenzo-Ginori, J. V., Rodriguez-Fuentes, A., Abalo, R. G., and Rodriguez, R. S. (2009). Digital signal processing in the analysis of genomic sequences. Current Bioinformatics, 4(1), 28–40. MATLAB (2010). version 7.10.0 (R2010a). The MathWorks Inc., Natick, Massachusetts. Ning, J., Moore, C., and Nelson, J. (2003). Preliminary wavelet analysis of genomic sequences. In Bioinformatics Conference, 2003. CSB 2003. Proceedings of the 2003 IEEE, pages 509–510. Rao, N. and Shepherd, S. (2004). Detection of 3-periodicity for small genomic sequences based on ar technique. In Communications, Circuits and Systems, 2004. ICCCAS 2004. 2004 International Conference on, volume 2, pages 1032 – 1036 Vol.2. Rosen, G. L. (2006). Signal processing for biologically-inspired gradient source localization and DNA sequence analysis,. PhD thesis, Georgia Institute of Technology,. Biospectrogram: a tool for spectral analysis of biological sequences Shmulevich, I. and Dougherty, E. (2007). Genomic Signal Processing. Princeton Series in Applied Mathematics. Princeton University Press. Silverman, B. D. and Linsker, R. (1986). A measure of DNA periodicity. Journal of Theoretical Biology, 118, 295–300. Vaidyanathan, P. P. (2005). Genomics and proteomics: A signal processors tour. IEEE Circuits Syst. Mag, 4, 6–29. Voss, R. F. (1992). Evolution of long-range fractal correlations and 1/f noise in DNA base sequences. Physical Review Letters, 68(25), 3805+. Yau, S. T., Wang, J., Niknejad, A., Lu, C., Jin, N., and Ho, Y.K. (2003). DNA sequence representation without degeneracy. Nucleic Acids Research, 31(12), 3078–3080. Zhang, R. and Zhang, C. T. (1994). Z curves, an intuitive tool for visualizing and analyzing the DNA sequences. J. Biomol. Struct. Dyn., 11(4), 767–782. Zhang, Z.-J. (2009). DV-curve: a novel intuitive tool for visualizing and analyzing DNA sequences. Bioinformatics, 25(9), 1112– 1117. 3
5cs.CE
SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES ON TORSION AND TORSION-FREE ABELIAN GROUPS arXiv:1708.06587v1 [math.GN] 22 Aug 2017 ALEJANDRO DORANTES-ALDAMA AND DMITRI SHAKHMATOV Abstract. A space X is selectively sequentially pseudocompact if for every family {Un : n ∈ N} of non-empty open subsets of X, one can choose a point xn ∈ Un for every n ∈ N in such a way that the sequence {xn : n ∈ N} has a convergent subsequence. Let G be a group from one of the following three classes: (i) V-free groups, where V is an arbitrary variety of Abelian groups; (ii) torsion Abelian groups; (iii) torsion-free Abelian groups. Under the Singular Cardinal Hypothesis SCH, we prove that if G admits a pseudocompact group topology, then it can also be equipped with a selectively sequentially pseudocompact group topology. Since selectively sequentially pseudocompact spaces are strongly pseudocompact in the sense of Garcı́a-Ferreira and Ortiz-Castillo, this provides a strong positive (albeit partial) answer to a question of Garcı́a-Ferreira and Tomita. The symbol N denotes the set of natural numbers and N+ = N \ {0} denotes the set of positive integer numbers. The symbol Z denotes the group of integer numbers, R the set of real numbers and T the circle group {eiθ : θ ∈ R} ⊆ R2 . The symbols ω, ω1 and c stand for the first infinite cardinal, the first uncountable cardinal and the cardinality of the continuum, respectively. For a set X, the set of all finite subsets of X is denoted by [X]<ω , while [X]ω denotes the set of all countably infinite subsets of X. If X is a subset of a group G, then hXi is the smallest subgroup of G that contains X. For groups which are not necessary Abelian we use the multiplication notation, while for Abelian groups we always use the additive one. In particular, e denotes the identity element of a group and 0 is used for the zero element of an Abelian group. Recall that an element g of a group G is torsion if gn = e for some positive integer n. A group is torsion if all of its elements are torsion. A group G is bounded torsion if there exists n ∈ N such that g n = e for all g ∈ G. Let G be an Abelian group. The symbol t(G) stands for the subgroup of torsion elements of G. For each n ∈ N, note that nG = {ng : g ∈ G} is a subgroup of G and the map g 7→ ng (g ∈ G) is a homomorphism of G onto nG. For a cardinal τ we denote by G(τ ) the direct sum of τ copies of the group G. We will say that a sequence {xn : n ∈ N} of points in a topological space X: • converges to a point x ∈ X if the set {n ∈ N : xn 6∈ W } is finite for every open neighbourhood W of x in X; • is convergent if it converges to some point of X. 1. Introduction In this paper, we continue the study of the class of selectively sequentially pseudocompact spaces introduced by the authors in [9]. 2010 Mathematics Subject Classification. Primary: 22A10; Secondary: 22C05, 54A20, 54D30, 54H11. Key words and phrases. convergent sequence, pseudocompact, strongly pseudocompact, topological group, free abelian group, variety of groups, torsion group, torsion-free group. The first listed author was supported by CONACyT of México: Estancias Posdoctorales al Extranjero propuesta No. 263464. The second listed author was partially supported by the Grant-in-Aid for Scientific Research (C) No. 26400091 by the Japan Society for the Promotion of Science (JSPS). 1 2 A. DORANTES-ALDAMA AND D. SHAKHMATOV Definition 1.1. [9] A topological space X is selectively sequentially pseudocompact if for every sequence {Un : n ∈ N} of non-empty open subsets of X, one can choose a point xn ∈ Un for every n ∈ N in such a way that the sequence {xn : n ∈ N} has a convergent subsequence. A nice feature of the class of selectively sequentially pseudocompact spaces is that it is closed under taking arbitrary Cartesian products: Proposition 1.2. [9, Corollary 4.4] Arbitrary products of selectively sequentially pseudocompact spaces are selectively sequentially pseudocompact. Garcı́a-Ferreira and Ortiz-Castillo [13] have recently introduced the class of strongly pseudocompact spaces. The original definition involves the notion of a p-limit for an ultrafilter p on N. The authors have shown in [9, Theorem 2.1] that the original definition is equivalent to the following one: Definition 1.3. A topological space X is called strongly pseudocompact provided that for each sequence {Un : n ∈ N} of pairwise disjoint non-empty open subsets of X, one can choose a point xn ∈ Un for every n ∈ N such that the set {xn : n ∈ N} is not closed in X. In the class of topological groups, this property has been investigated by Garcı́a-Ferreira and Tomita in [14]. The following implications are clear from Definitions 1.1 and 1.3: (1) selectively sequentially pseudocompact → strongly pseudocompact → pseudocompact. It easily follows from Definition 1.3 that countably compact spaces are strongly pseudocompact. Since there exists a countably compact space X such that X × X is not even pseudocompact, an analogue of Proposition 1.2 for strongly pseudocompact spaces is false. Whether strong pseudocompactness is productive in the class of topological groups remains an open problem [14]. Neither of the implications in (1) can be reversed even in the class of topological (Abelian) groups. An example of a pseudocompact Abelian group which is not strongly pseudocompact was constructed by Garcı́a-Ferreira and Tomita in [14]. The authors gave a consistent example of a strongly pseudocompact Abelian group which is not selectively sequentially pseudocompact in [9, Example 5.7], A ZFC example of such a group is given in [17], thereby answering [9, Question 8.3(i)]. Garcı́a-Ferreira and Tomita asked if the last implication in (1) can be reversed when the existential quantifier is added to both sides of it. Question 1.4. [14, Question 2.7] If an Abelian group admits a pseudocompact group topology, does it admit a strongly pseudocompact group topology? In view of the implications in (1), the following version of this question is even harder to answer in the positive. Question 1.5. If an Abelian group admits a pseudocompact group topology, does it also admit a selectively sequentially pseudocompact group topology? The goal of this paper is to provide a positive answer to both questions for the following classes of groups: (a) V-free groups, where V is a precompact variety of groups (Corollary 3.8); (b) V-free groups, where V is any variety of Abelian groups (Corollary 3.12); (c) torsion Abelian groups (Theorem 5.2); (d) torsion-free Abelian groups (Corollary 6.4; see also Theorem 6.3 for a more general result). Our results depend on some additional set-theoretic assumptions which we outline below. Let τ be a cardinal. As usual, symbol τ ω denotes the cardinality of the set [X]ω of all countably infinite subsets of some (equivalently, every) set X such that |X| = τ , while 2τ denotes the SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 3 cardinality of the set of all subsets of some (equivalently, every) set X such that |X| = τ . Symbol cf(τ ) denotes the cofinality of τ , i.e. the smallest cardinal λ for which there exists a representation τ = Σ{τα : α < λ} where τα < τ for all α < λ. Finally, τ + denotes the smallest cardinal bigger than τ . We fix the symbol SCH for denoting the following condition on cardinals: (2) if τ ≥ c is a cardinal and cf(τ ) 6= ω, then τ ω = τ. We choose the abbreviation symbol SCH for denoting the condition (2) since it is known to be equivalent to the Singular Cardinals Hypothesis; see [15, Chapter 8]. The Generalized Continuum Hypothesis (abbreviated GCH) states that 2τ = τ + for every infinite cardinal τ . It is well known that GCH implies SCH and that GCH is consistent with the usual axioms ZFC of set theory. Prikry and Silver have constructed models of set theory violating SCH assuming the consistency of supercompact cardinals; see [15, chapter 36]. Devlin and Jensen proved that the failure of SCH implies the existence of an inner model with a large cardinal; see [4]. Therefore, large cardinals are needed in order to violate SCH, and so SCH can be viewed as a “mild” additional set-theoretic assumption beyond the axioms of ZFC. Our results mentioned in items (b), (c) and (d) above hold under SCH, while we were able to prove item (a) only under GCH. It is worth mentioning that our results are close in spirit to those obtained by Galindo and Macario [12]. Indeed, they prove, under SCH, that if an Abelian group has a pseudocompact group topology, then it also admits a pseudocompact group topology without infinite compact subsets. This additional property is important in the Pontryagin duality theory. Clearly, group topologies we construct are substantially different from those in [12], as selectively sequentially pseudocompact spaces have many non-trivial convergent sequences [9, Proposition 3.1]. We refer the interested reader to [9] for a detailed survey of connections of selective pseudocompactness and strong pseudocompactness to other classical compactness-like notions, including the notion of sequential pseudocompactness of Artico, Marconi, Pelant, Rotter and Tkachenko [1]. We finish this introduction with the simple proposition from [9] which shall be used later: Proposition 1.6. [9, Corollary 3.4] If a space X has a dense selectively sequentially pseudocompact (strongly pseudocompact) subspace, then X is selectively sequentially pseudocompact (respectively, strongly pseudocompact). 2. Building selectively sequentially pseudocompact V-independent sets for a variety V of groups Recall that a variety of groups is a class of (abstract) groups closed under Cartesian products, subgroups and quotients [16]. Definition 2.1. [7, Definition 2.1] Let V be a variety of groups and let G be a group. A subset X of G is said to be V-independent if (a) hXi ∈ V, and (b) for each map f : X → H ∈ V there exists a unique homomorphism f˜ : hXi → H extending f. The cardinal rV (G) = sup{|X| : X is a V-independent subset of G} is called the V-rank of G. We shall need the following useful fact from [7]. Lemma 2.2. Let V be a variety of groups and X be a subset of a group G. 4 A. DORANTES-ALDAMA AND D. SHAKHMATOV (i) X is V-independent if and only if each finite subset of X is V-independent. (ii) If H is a group and f : G → H is a homomorphism such that f (X) is a V-independent subset of H, hXi ∈ V and f ↾ X : X → H is an injection, then f ↾ hXi : X → H is an injection and X is a V-independent subset of G. Proof. Item (i) is [7, Lemma 2.3]. The first statement in the conclusion of item (ii) is [7, Lemma 2.4] and the second statement can be proved similarly to the proof of [7, Lemma 2.4].  The next two lemmas are the main technical tool in this paper. Lemma 2.3. Let V be a variety of groups. Suppose that H ∈ V is a compact metric group with rV (H) ≥ ω. Let σ be an infinite cardinal such that σ ω = σ. Then there exist a dense Vindependent selectively sequentially pseudocompact subset Y of H σ and a set C ⊆ σ such that |Y | = |C| = |σ \ C| = σ and hY i ∩ H C = {e}, where H C = {f ∈ H σ : f (γ) = e for all γ ∈ σ \ C}. Q Proof. A subset B of H σ shall be called basic if B = γ∈σ Bγ , where Bγ ⊆ H for all γ ∈ σ and the set supp(B) = {γ ∈ σ : Bγ 6= H} is finite. Let B be a base for H σ of size σ consisting of basic open sets. Since |B ω | = |B|ω = σ ω = σ, we can enumerate (3) B ω = {{Uα,n : n ∈ N} : α ∈ σ}. (4) S Let α ∈ σ. Since supp(Uα,n ) is finite for every n ∈ N, the set Sα = n∈N supp(Uα,n ) is a countable subset of σ. For every n ∈ N take a point xα,n ∈ Uα,n . Since H Sα is compact metric, there are an infinite set Jα ⊆ N and a point xα,ω ∈ H σ such that {xα,n ↾Sα : n ∈ Jα } converges to xα,ω ↾Sα . Since σ is infinite, there exists a subset C of σ such that |C| = |D| = σ, where D = σ \ C. Since the set [σ × (ω + 1)]<ω of all finite subsets of σ × (ω + 1) has cardinality σ = |D|, we can fix an enumeration [σ × (ω + 1)]<ω = {Fγ : γ ∈ D} such that (5) |{γ ∈ D : Fγ = F }| = σ for every F ∈ [σ × (ω + 1)]<ω . Since rV (H) ≥ ω, for every γ ∈ σ we can fix an injection hγ : Fγ → H such that hγ (Fγ ) is a V-independent subset of H. For every (α, n) ∈ σ × (ω + 1), define yα,n ∈ H σ by  x (γ) if γ ∈ Sα ;    α,n hγ (α, n) if γ ∈ D \ Sα and (α, n) ∈ Fγ ; (6) yα,n (γ) = hγ (α, ω) if γ ∈ D \ Sα , (α, n) 6∈ Fγ and (α, ω) ∈ Fγ ;    e otherwise for all γ ∈ σ. Finally, let (7) Y = {yα,n : (α, n) ∈ σ × (ω + 1)}. Claim 1. yα,n ∈ Uα,n for every (α, n) ∈ σ × ω. Proof. Since supp(Uα,n ) ⊆ Sα , xα,n ∈ Uα,n and yα,n ↾Sα = xα,n ↾Sα by (6), we get yα,n ∈ Uα,n .  Claim 2. Y is V-independent and hY i ∩ H C = {e}. Proof. By Lemma 2.2 (i), in order to prove that Y is V-independent, it suffices to show that every finite subset X of Y is V-independent. Similarly, in order to show that hY i ∩ H C = {e}, it suffices to check that hXi ∩ H C = {e} for every finite subset X of Y . Therefore, we fix an arbitrary finite subset X of Y , and we are going to prove that X is V-independent and satisfies hXi ∩ H C = {e}. SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 5 Since X is a finite subset of Y , we can use (7) to fix a finite set F ⊆ σ × (ω + 1) such that X = {yα,n : (α, n) ∈ F }. (8) Since F S is finite, so is the set A = {α ∈ σ : (α, n) ∈ F for some n ∈ ω + 1}. Therefore, the set S = α∈A Sα is at most countable. Since σ ω = σ ≥ ω, the cardinal σ is uncountable. Since |{γ ∈ D : Fγ = F }| = σ by (5), there exists γ ∈ D \ S such that Fγ = F . Let πγ : H σ → H be the projection on the γ’s coordinate. To prove that X is V-independent, it suffices to check that G = H σ , X and f = πγ satisfy the assumptions of Lemma 2.2 (ii). Since V is a variety of groups, it is closed under taking arbitrary products and subgroups. Since H ∈ V and hXi is a subgroup of H σ , this implies hXi ∈ V. Let g : F → X be the map defined by g(α, n) = yα,n for (α, n) ∈ F . Suppose that (α, n) ∈ F = Fγ . Since Sα ⊆ S and γ ∈ D \ S, we get γ ∈ D \ Sα , so πγ (g(α, n)) = πγ (yα,n ) = yα,n (γ) = hγ (α, n) by (6). This shows that πγ ◦ g = hγ . Since hγ is an injection, so is πγ ◦ g = πγ ↾X ◦g. Since g is a surjection, this implies that πγ ↾X is an injection. Finally, πγ (X) = πγ (g(F )) = hγ (F ) is a V-independent subset of H by the choice of hγ . Applying Lemma 2.2 (ii), we conclude that X is V-independent and πγ ↾hXi is an injection. Let x ∈ hXi \ {e} be arbitrary. Then x(γ) = πγ (x) 6= e, because πγ is injective on hXi. Since γ ∈ D = σ \ C, it follows from (3) that x 6∈ H C . This proves the equation hXi ∩ H C = {e}.  Claim 3. Y is selectively sequentially pseudocompact. Proof. Let {Un : n ∈ N} ∈ B ω . By (4), there exists α ∈ σ such that Un = Uα,n for every n ∈ N. Since yα,n ∈ Uα,n = Un for every n ∈ N by Claim 1, it suffices to prove that the subsequence {yα,n : n ∈ Jα } of the sequence {yα,n : n ∈ N} ⊆ Y converges to yα,ω ∈ Y . Note that the sequence {yα,n ↾Sα : n ∈ Jα } = {xα,n ↾Sα : n ∈ Jα } converges to xα,ω ↾Sα = yα,ω ↾Sα by (6) and the choice of {xα,n : n ∈ N} and Jα . Therefore, it suffices to show that the sequence {yα,n (γ) : n ∈ N} converges to yα,ω (γ) for every γ ∈ σ \ Sα . We consider two cases. Case 1 . γ ∈ D \ Sα . If (α, ω) ∈ Fγ , then (6) implies that yα,ω (γ) = hγ (α, ω) and {n ∈ N : yα,n (γ) 6= hγ (α, ω)} ⊆ {n ∈ N : (α, n) ∈ Fγ }. Since Fγ is finite, the sequence {yα,n (γ) : n ∈ N} converges to yα,ω (γ). Suppose now that (α, ω) 6∈ Fγ . Then yα,ω (γ) = e and {n ∈ N : yα,n (γ) 6= e} ⊆ {n ∈ N : (α, n) ∈ Fγ } by (6). Since Fγ is finite, the sequence {yα,n (γ) : n ∈ N} converges to yα,ω (γ). Case 2 . γ ∈ σ \ (D ∪ Sα ). In this case (6) implies that yα,n (γ) = e for all n ∈ ω + 1. Therefore, the sequence {yα,n (γ) : n ∈ N} converges to yα,ω (γ).  Claim 4. Y is dense in H σ . Proof. Let V be a non-empty open subset of H σ . We need to show that Y ∩ V 6= ∅. By taking a smaller set V if necessary, we may assume that V is a basic open subset of H σ . Let Un = V for every n ∈ N. Then {Un : n ∈ N} ∈ B ω , so by (4), there exists α ∈ σ such that Un = Uα,n for every n ∈ N. Since yα,1 ∈ Uα,1 = V by Claim 1 and yα,1 ∈ Y by (7), we get Y ∩ V 6= ∅.  It follows from (7) and Claim 2 that |Y | = |σ × (ω + 1)| = σ + ω = σ.  Lemma 2.4. Let σ and τ be infinite cardinals satisfying σ ω = σ ≤ τ ≤ 2σ . If V is a variety of Abelian groups and H ∈ V is a compact metric group with rV (H) ≥ ω, then there exist a dense V-independent selectively sequentially pseudocompact subset X of H σ and a set D ⊆ σ such that |X| = τ, |D| = |σ \ D| = σ and hXi ∩ H D = {0}, where (9) H D = {f ∈ H σ : f (γ) = 0 for all γ ∈ σ \ D}. 6 A. DORANTES-ALDAMA AND D. SHAKHMATOV Proof. By Lemma 2.3, there exist a dense V-independent selectively sequentially pseudocompact subset Y of H σ and a set C ⊆ σ such that |Y | = |C| = |σ \ C| = σ and hY i ∩ H C = {0}. By [7, Lemmas 3.4 and 4.3], there exist a V-independent subset Z of H C and a set D ⊆ C such that |Z| = τ, |D| = |C \ D| = σ and hZi ∩ H D = {0}. Since Z ⊆ H C and H C is a subgroup of H σ , we have hZi ⊆ H C . Since hY i ∩ H C = {0}, this implies hY i ∩ hZi = {0}. We claim that X = Y ∪ Z and D are as required. Indeed, |X| = |Y | + |Z| = σ + τ = τ . Since Y is dense in H σ and Y ⊆ X, X is dense in H σ as well. Since Y is dense in H σ and Y ⊆ X, Y is dense in X. Since Y is selectively sequentially pseudocompact, Proposition 1.6 implies that X is selectively sequentially pseudocompact as well. Next, we shall prove that hXi ∩ H D = {0}. Since hZi ∩ H D = {0}, it suffices to check that hXi ∩ H D ⊆ hZi. Let x ∈ hXi ∩ H D be arbitrary. We are going to show that x ∈ hZi. Since x ∈ hXi, X = Y ∪ Z ⊆ H σ and the latter group is Abelian, we can find elements y ∈ hY i and z ∈ hZi such that x = y + z. Consider an arbitrary γ ∈ σ \ C. Since D ⊆ C, we have γ ∈ σ \ D, and so x(γ) = 0 by x ∈ H D and (9). Since z ∈ H D and hZi ∩ H D = {0}, we also get z(γ) = 0. Therefore, 0 = x(γ) = y(γ) + z(γ) = y(γ). Since this holds for all γ ∈ σ \ C, from (3) we conclude that y ∈ H C . Since y ∈ hY i, we get y ∈ hY i ∩ H C = {0}, which implies y = 0. Therefore, x = z ∈ hZi. Finally, we are going to check that the set X = Z ∪ Y is V-independent. To show this, we need to check items (a) and (b) of Definition 2.1. (a) Since hXi is a subgroup of H σ , H ∈ V and V is a variety of groups, hXi ∈ V. (b) Let f : X → A ∈ V be an arbitrary map. Since Y is V-independent, there exists a unique homomorphism g : hY i → A such that g ↾Y = f ↾Y . Similarly, since Z is V-independent, there exists a unique homomorphism h : hZi → A such that h ↾Z = f ↾Z . Since hY i ∩ hZi = {0} and H σ is an Abelian group, hXi = hY i ⊕ hZi, so there exists a unique homomorphism f˜ : hXi → A extending both g and h. Clearly, f˜ ↾X = f .  3. Selectively sequentially pseudocompact topologies on V-free groups Definition 3.1. [7] An infinite cardinal τ is called admissible if there exists a pseudocompact group of cardinality τ . Definition 3.2. We shall say that a cardinal τ is selectively admissible if either τ is finite or there exists an infinite cardinal σ such that σ ω = σ ≤ τ ≤ 2σ . We shall need the following lemma describing properties of (selectively) admissible cardinals. Lemma 3.3. [7, Lemma 3.4] (i) Infinite selectively admissible cardinals are admissible. (ii) Under SCH, every admissible cardinal is selectively admissible. (iii) Under GCH, σ = σ ω holds for every admissible cardinal σ. Definition 3.4. [7, Definitions 2.1 and 2.2] Let V be a variety of groups. (i) A subset X of a group G is a V-base of G if X is V-independent and hXi = G. (ii) A group is V-free if it contains a V-base. (iii) For every cardinal τ , we denote by Fτ (V) the unique (up to isomorphism) V-free group having a V-base of cardinality τ. Lemma 3.5. Let V be a variety of groups. Assume that H is a compact group, σ, τ are infinite cardinals and X is a dense V-independent selectively sequentially pseudocompact subset of H σ such that |X| = τ . Then G = hXi ∼ = Fτ (V) is a dense selectively sequentially pseudocompact V-free subgroup of H σ . Moreover, (i) if H is connected, then so is G; (ii) if H is locally connected, then so is G; SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 7 (iii) if H is zero-dimensional, then so is G. Proof. The isomorphism hXi ∼ = Fτ (V) is clear. Since X ⊆ hXi and X is dense in H σ , so is G = hXi. σ Since X is dense in H , it is also dense in G. Since X is selectively sequentially pseudocompact, Proposition 1.6 implies that G is selectively sequentially pseudocompact as well. Note that the completion of G coincides with H σ , so the rest of the statements follows from [7, Fact 2.10].  Definition 3.6. [7, Definition 5.2] A variety V is precompact if there exists a compact zerodimensional metric group H ∈ V with rV (H) ≥ ω. Non-precompact varieties are not easy to come by, as many of the known varieties are precompact. Indeed, any variety consisting of Abelian groups, the variety of all groups, the variety of all nilpotent groups, the variety of all polynilpotent groups, the variety of all soluble groups are known to be precompact [16]. For every prime number p > 665, the Burnside variety Bp consisting of all groups satisfying the identity xp = e is not precompact [5]. Theorem 3.7. Let V be a precompact variety of groups. Then for every infinite cardinal σ such that σ ω = σ, the group Fσ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology. Proof. Since V is a precompact variety, by Definition 3.6, there is a compact zero-dimensional metric group H ∈ V with rV (H) ≥ ω. By Lemma 2.3, there exists a dense V-independent selectively sequentially pseudocompact subset Y of H σ such that |Y | = σ. Applying Lemma 3.5 (with X = Y and τ = σ), we conclude that hY i ∼ = Fσ (V) is a zero-dimensional selectively sequentially pseudocompact (dense) subgroup of H σ . The subgroup topology that hY i ∼ = Fσ (V) inherits from H σ is the required group topology on Fσ (V).  Corollary 3.8. Let V be a precompact variety of groups. Under GCH, the following conditions are equivalent for every infinite cardinal σ: (i) the group Fσ (V) admits a pseudocompact group topology; (ii) the group Fσ (V) admits a strongly pseudocompact group topology; (iii) the group Fσ (V) admits a selectively sequentially pseudocompact group topology; (iv) the group Fσ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology. Proof. The implication (iv)⇒(iii) is trivial, while the implications (iii)⇒(ii)⇒(i) follow from equation (1). (i)⇒(iv) Let σ be an arbitrary infinite cardinal. Assume (i); that is, Fσ (V) admits a pseudocompact group topology. Since σ is infinite, |Fσ (V)| = σ is an admissible cardinal by Definition 3.1. Since GCH holds, Lemma 3.3 (iii) implies that σ ω = σ. Applying Theorem 3.7, we conclude that Fσ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology.  We use G for denoting the variety of all groups. Theorem 3.9. For every infinite cardinal σ such that σ ω = σ, the group Fσ (G) admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. The group H = SO(3, R) of all rotations around the origin of the three-dimensional Euclidean space R3 under the operation of composition is a compact metric group satisfying rG (SO(3, R)) ≥ ω; see [2]. Moreover, H (trivially) belongs to the variety G. By Lemma 2.3, there exists a dense G-independent selectively sequentially pseudocompact subset Y of H σ such that |Y | = σ. Since H is both connected and locally connected, applying Lemma 3.5 (with X = Y and V = G), we conclude that hY i ∼ = Fσ (G) is a connected, locally connected, selectively sequentially pseudocompact (dense) subgroup of H σ . The subgroup topology that hY i ∼ = Fσ (G) inherits from H σ is the required group topology on Fσ (G).  8 A. DORANTES-ALDAMA AND D. SHAKHMATOV Corollary 3.10. Under GCH, the following conditions are equivalent for every infinite cardinal σ: (i) Fσ (G) admits a pseudocompact group topology; (ii) Fσ (G) admits a strongly pseudocompact group topology; (iii) Fσ (G) admits a selectively sequentially pseudocompact group topology; (iv) Fσ (G) admits a zero-dimensional selectively sequentially pseudocompact group topology; (v) Fσ (G) admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. By [7, Lemma 5.3], the variety G is precompact. Hence, the equivalence of items (i)–(iv) follows from Corollary 3.8. The implication (i)⇒(v) was proved in Theorem 3.9. The implication (v)⇒(iii) is trivial.  We use A for denoting the variety of all Abelian groups. Theorem 3.11. Let V be a variety satisfying V ⊆ A. Then for every selectively admissible cardinal τ ≥ ω, the V-free group Fτ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology. Proof. Since V ⊆ A, the variety V is precompact [16]. By Definition 3.6, there exists a zerodimensional compact metric group H ∈ V with rV (H) ≥ ω. Let τ ≥ ω be a selectively admissible cardinal. By Definition 3.2, there exists an infinite cardinal σ satisfying σ ω = σ ≤ τ ≤ 2σ . By Lemma 2.4, there exists a dense V-independent selectively sequentially pseudocompact subset X of H σ such that |X| = τ . By Lemma 3.5, hXi ∼ = Fτ (V) is a zero-dimensional selectively sequentially pseudocompact (dense) subgroup of H σ . The subgroup topology that hXi ∼ = Fτ (V) inherits from H σ is the required group topology on Fτ (V).  Corollary 3.12. Let V be a variety satisfying V ⊆ A. Under SCH, the following conditions are equivalent for every infinite cardinal τ : (i) Fτ (V) admits a pseudocompact group topology; (ii) Fτ (V) admits a strongly pseudocompact group topology; (iii) Fτ (V) admits a selectively sequentially pseudocompact group topology; (iv) Fτ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology. Proof. (i)⇒(iv) By (i), Fτ (V) admits a pseudocompact group topology. Since τ is infinite, |Fτ (V)| = τ is an admissible cardinal by Definition 3.1. Since SCH holds, τ is selectively admissible by Lemma 3.3 (ii). Applying Theorem 3.11, we conclude that Fτ (V) admits a zero-dimensional selectively sequentially pseudocompact group topology. The implication (iv)⇒(iii) is trivial. The implications (iii)⇒(ii)⇒(i) follow from equation (1).  Theorem 3.13. For every selectively admissible cardinal τ ≥ ω, the A-free group Fτ (A) admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. Let τ ≥ ω be a selectively admissible cardinal. By Definition 3.2, there exists an infinite cardinal σ satisfying σ ω = σ ≤ τ ≤ 2σ . Since rA (T) = c ≥ ω, by Lemma 2.4, there exists a dense A-independent selectively sequentially pseudocompact subset X of Tσ such that |X| = τ . Since T is both connected and locally connected, by Lemma 3.5, hXi ∼ = Fτ (A) is a connected, locally connected, selectively sequentially pseudocompact (dense) subgroup of Tσ . The subgroup topology that hXi ∼  = Fτ (A) inherits from Tσ is the required group topology on Fτ (A). Corollary 3.14. Under SCH, the following conditions are equivalent for every infinite cardinal τ : (i) Fτ (A) admits a pseudocompact group topology; (ii) Fτ (A) admits a strongly pseudocompact group topology; (iii) Fτ (A) admits a selectively sequentially pseudocompact group topology; (iv) Fτ (A) admits a zero-dimensional selectively sequentially pseudocompact group topology; SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 9 (v) Fτ (A) admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. The equivalence of items (i)–(iv) follows from Corollary 3.12. The implication (i)⇒(v) was proved in Theorem 3.13. The implication (v)⇒(iii) is trivial.  4. The algebraic structure of pseudocompact torsion Abelian groups The main result in this section is Theorem 4.7 which describes the algebraic structure of pseudocompact torsion Abelian groups. One can deduce this theorem from [7, Theorem 6.2] but we decided to give a separate proof of it. Another description of the algebraic structure of pseudocompact torsion Abelian groups can be found in [3, Theorem 3.19] and [7, Theorem 6.2]. Definition 4.1. For m, n ∈ N+ with m ≤ n, a finite sequence (τm , τm+1 , . . . , τn ) of cardinals will be called: (i) good provided that, for every integer k such that m ≤ k ≤ n, the cardinal maxk≤i≤n τi is either finite or admissible; (ii) very good if τn is either finite or admissible and τi < τn for every i ∈ N+ with m ≤ i < n. Remark 4.2. Assume that m, l, n ∈ N+ and m ≤ l ≤ n. If (τm , τm+1 , . . . , τn ) is a good sequence of cardinals, then the sequence (τl , τl+1 , . . . , τn ) is good as well. The next lemma shows that each good sequence of cardinals can be partitioned into finitely many adjacent very good subsequences. Lemma 4.3. Assume that m, n ∈ N+ , m ≤ n and (τm , τm+1 , . . . , τn ) is a good sequence of cardinals. Then there exists a strictly increasing sequence (s0 , s1 , . . . , sk ) of integers such that s0 = m − 1, sk = n and the sequence (τsi +1 , τsi +2 , . . . , τsi+1 ) is very good for every i = 0, . . . , k − 1. Proof. We shall prove this lemma by induction on n − m. Basis of induction. Suppose that the sequence (τn ) is good. By item (i) of Definition 4.1, τn is either finite or admissible. It follows from item (ii) of Definition 4.1 that the sequence (τn ) is very good. Inductive step. Suppose that j ∈ N+ and our lemma has been already proved for all good sequences (τm , τm+1 , . . . , τn ) such that n − m < j. Fix a good sequence (τm , τm+1 , . . . , τn ) with n − m = j. The set K = {k ∈ N+ : m ≤ k ≤ n, τk = maxm≤i≤n τi } is non-empty, so we can define l = min K. We claim that the sequence (τm , . . . , τl ) is very good. Since the sequence (τm , τm+1 , . . . , τn ) is good by our assumption, the cardinal maxm≤i≤n τi is either finite or admissible by Definition 4.1 (i). Since l ∈ K, this means that τl = maxm≤i≤n τi is either finite or admissible. Since l = min K, it follows from the definition of K that τi < τl whenever m ≤ i < l. Therefore, the sequence (τm , . . . , τl ) is very good by Definition 4.1 (ii). Now we consider two cases. Case 1. l = n. In this case, the original sequence (τm , τm+1 , . . . , τn ) is very good. Case 2. l < n. By Remark 4.2, the sequence (τl+1 , τl+2 , . . . , τn ) is good. Since n−(l+1) < n−l ≤ n − m = j, we can apply our inductive assumption to this sequence to get a strictly increasing sequence (s1 , s2 , . . . , sk ) of integers such that s1 = l, sk = n and the sequence (τsi +1 , τsi +2 , . . . , τsi+1 ) is very good for every i = 1, . . . , k − 1. Let s0 = m − 1. Now (s0 , s1 , . . . , sk ) is the desired sequence.  Good sequences of cardinals typically appear in the situation described by our next lemma. Even though this lemma can be derived from [7, Theorem 6.2], we include its simple proof for convenience of the reader. 10 A. DORANTES-ALDAMA AND D. SHAKHMATOV Ln Lemma 4.4. If G is a pseudocompact group such that G ∼ = i=m Z(pi )(τi ) for some prime number p, positive integers m, n ∈ N+ and cardinals τm , τm+1 , . . . , τn , then the sequence (τm , τm+1 , . . . , τn ) is good. Proof. It suffices to show that, for every integer k such that m ≤ k ≤ n, the cardinal µk = maxk≤i≤n τi is either finite or admissible. Fix an integer k satisfying m ≤ k ≤ n. If all cardinals τk , τk+1 , . . . , τn are finite, then µk is finite. Assume now that at least one of the cardinals τk , τk+1 , . . . , τn is infinite. Then the group (10) p k−1 G= n M Z(pi−k+1 )(τi ) i=k is infinite, so |pk−1 G| = maxk≤i≤n τi = µk . Observe that pk−1 G is a continuous image of the pseudocompact group G under the map g 7→ pk−1 g, so pk−1 G is pseudocompact as well. Since the cardinality µk of the pseudocompact group pk−1 G is infinite, it must be admissible by Definition 3.1.  Definition 4.5. We shall say that a group G is nice provided that there exist a prime number p, positive integers m, n ∈ N+ and a very good sequence (τm , τm+1 , . . . , τn ) of cardinals such that Ln G∼ = i=m Z(pi )(τi ) . Let p be a prime number. Recall that an Abelian group G is called a p-group provided that for every g ∈ G one can find k ∈ N such that pk g = 0. Lemma 4.6. A non-trivial pseudocompact bounded torsion Abelian p-group can be decomposed into a finite direct sum of nice groups. Proof. Let G be a non-trivial pseudocompact bounded torsion p-group. Then (11) G∼ = n M Z(pj )(τj ) j=1 for a suitable n ∈ N+ and cardinals τ1 , τ2 , . . . , τn ; see [11, Theorem 17.2]. By Lemma 4.4, the sequence (τ1 , τ2 , . . . , τn ) is good. Applying Lemma 4.3 to the sequence (τ1 , τ2 , . . . , τn ), we obtain a strictly increasing sequence (s0 , s1 , . . . , sk ) of integers such that s0 = 0, sk = n and the sequence (τsi +1 , τsi +2 , . . . , τsi+1 ) is very good for every i = 0, . . . , k − 1. By Definition 4.5, the group Gi = si+1 M Z(pj )(τj ) j=si +1 is nice for every i = 0, . . . , k − 1. Clearly, G = Lk−1 i=0 Gi .  Theorem 4.7. Every non-trivial pseudocompact torsion Abelian group is isomorphic to a finite direct sum of nice groups. Proof. Let G be a non-trivial pseudocompact torsion Abelian group. Then G is bounded L torsion [7, Corollary 3.9], and so there exists a finite set P of prime numbers such that G = p∈P Gp , where Gp is a non-trivial (bounded torsion) p-group for every p ∈ P ; see [11, Theorem 17.2]. Let p ∈ P be arbitrary. For every q ∈ P \ {p}, Gq has order q kq for some kq ∈ N+ ; that is, Q q kq Gq = {0}. Define n = q∈P \{p} q kq . Since Gp is q-divisible for every prime number q different from p, it follows that nG = nGp = Gp . Since nG is an image of G under the continuous map g 7→ nG and G is pseudocompact, we conclude that Gp is also pseudocompact. Now we can apply Lemma 4.6 to Gp to get a decomposition of Gp into a finite direct sum of nice groups.  SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 11 5. Selectively sequentially pseudocompact topologies on torsion Abelian groups Lemma 5.1. Assume that p is a prime number, m, n ∈ N+ , τm , τm+1 , . . . ,L τn are cardinals such that τi ≤ τn for all i = m, . . . , n, and τn is selectively admissible. Then G = ni=m Z(pi )(τi ) can be equipped with a selectively sequentially pseudocompact group topology. Proof. Suppose that τn is finite. Since τi ≤ τj for all i = m, . . . , n, the group G is finite. The discrete topology on G is compact, so also selectively sequentially pseudocompact. Suppose now that τn is infinite. Since τn is selectively admissible, Definition 3.2 implies that σ ω = σ ≤ τn ≤ 2σ for some cardinal σ. Let H = Z(pn )ω . By Lemma 2.4 applied to this H, the variety Apn = {G : G is an Abelian group such that pn g = 0 for all g ∈ G} taken as V and the cardinal τn taken as τ , we can find a selectively sequentially pseudocompact dense Apn -independent subset X of H σ and a set D ⊆ σ such that |X| = τn , |D| = |σ \ D| = σ and hXi ∩ H D = {0}, where H D = {f ∈ H σ : f (α) = 0 for all α ∈ σ \ D}. Since X is Apn -independent and |X| = τn , we have hXi ∼ = Z(pn )(τn ) . Let ϕ : Z(pn )(τn ) → hXi be an isomorphism. Define  {0} if n = m (12) G′ = Ln−1 i )(τi ) Z(p if n > m. i=m Clearly, G = G′ ⊕ Z(pn )(τn ) . We claim that there is a monomorphism ψ : G′ → H D . This is clear for n = m, as G′ = {0} Ln−1 Sn−1 by (12). Suppose now that n > m. Then G′ = i=m Z(pi )(τi ) by (12). Let D = i=m Di be a decomposition of D into pairwise disjoint sets Di such that |Di | = |D| for all i = m, . . . , n − 1. Let i = m, . . . , n − 1 be arbitrary. Note that H Di ∼ = Z(pn )D , so rApn (H Di ) ≥ 2|D| = 2σ by = HD ∼ [7, Lemma 4.1]. Since τi ≤ τn ≤ 2σ ≤ rApn (H Di ), we can fix a monomorphism ψi Z(pn )(τi ) → H Di . Ln−1 Ln−1 Di ∼ D i (τi ) → Let ψ : G′ = = H be the unique monomorphism extending i=m Z(p ) i=m H each of ψi . Since ψ(G′ ) ⊆ H D , ϕ(Z(pn )(τn ) ) = hXi and H D ∩ hXi = {0}, there is a unique monomorphism χ : G = G′ ⊕ Z(pn )(τn ) → H D ⊕ hXi ⊆ H σ extending both ϕ and ψ. Since hXi is a dense selectively sequentially pseudocompact subgroup of H σ and hXi = ϕ(Z(pn )(τn ) ) ⊆ χ(G), the subgroup hXi of χ(G) is dense in χ(G). Since hXi is selectively sequentially pseudocompact, Proposition 1.6 implies that χ(G) is selectively sequentially pseudocompact as well. Since χ : G → χ(G) is an isomorphism, G admits a selectively sequentially pseudocompact group topology.  Theorem 5.2. Under SCH, the following conditions are equivalent for every torsion Abelian group G: (i) G has a pseudocompact group topology; (ii) G has a strongly pseudocompact group topology; (iii) G has a selectively sequentially pseudocompact group topology. Proof. The implications (iii)⇒(ii)⇒(i) follow from equation (1). (i)⇒(iii). Without loss of generality, we shall assume that G is non-trivial. By Theorem 4.7, L ∼ G = jk=1 Gk , where j ∈ N+ and each Gk is a nice group. By Proposition 1.2, it suffices to prove that each Gk admits a selectively sequentially pseudocompact group topology. Fix k = 1, . . . , j. Since Gk is nice, we can apply Definition 4.5 to fix a prime number p, positive integers m, n ∈ N+ and a very good sequence (τm , τm+1 , . . . , τn ) of cardinals such that Gk ∼ = Ln i )(τi ) . By Definition 4.1 (ii), τ is either finite or admissible and τ < τ for every i ∈ N+ Z(p n i n i=m with m ≤ i < n. If τn is finite, then it is selectively admissible by Definition 3.2. Suppose now that τn is admissible. Since SCH holds, τn is selectively admissible by Lemma 3.3 (ii). By Lemma 5.1, Gk admits a selectively sequentially pseudocompact group topology.  12 A. DORANTES-ALDAMA AND D. SHAKHMATOV 6. Selectively sequentially pseudocompact topologies on torsion-free Abelian groups Recall that a subgroup H of an Abelian group G is said to be essential in G provided that N ∩ H 6= {0} for every non-zero subgroup N of G. Lemma 6.1. If F is a maximal A-free subgroup of an Abelian group G, then H = t(G) + F = t(G) ⊕ F is an essential subgroup of G. Proof. Since F is torsion-free and t(G) is torsion, t(G) ∩ F = {0}, which means that the sum H = t(G) + F is direct. Let N be a non-zero subgroup of G. Fix a non-zero element x ∈ N . If x is torsion, then x ∈ t(G), so x ∈ t(G) ∩ N ⊆ H ∩ N , which implies H ∩ N 6= {0}. Suppose now that x is non-torsion. Then hxi is an infinite cyclic subgroup of G. If F ∩ hxi = {0}, then F ′ = F + hxi = F ⊕ hxi would be an A-free subgroup of G containing F as a proper subgroup, contradicting the maximality of F . Therefore, F ∩ hxi = 6 {0}, which implies H ∩ N 6= {0}.  Theorem 6.2. Suppose that G is an Abelian group and σ ω = σ ≤ rA (G) ≤ |G| ≤ 2σ for some infinite cardinal σ. Then G is isomorphic to a dense connected, locally connected, selectively sequentially pseudocompact subgroup of Tσ . Proof. Let F be a maximal A-free subgroup of the group G; the existence of such F follows from Zorn’s lemma. Then rA (F ) = rA (G) ≥ σ ω ≥ c, as σ is infinite. Since rA (F ) = rA (G) ≤ |G| ≤ 2σ , the cardinal rA (F ) is selectively admissible by Definition 3.2. Arguing as in the proof of Theorem 3.13, we can fix a monomorphism f : F → Tσ such that f (F ) is a dense selectively sequentially pseudocompact subgroup of Tσ . Since Tσ is divisible, rA (t(G)) = 0 ≤ 2σ = rA (Tσ ) and rAp (t(G)) ≤ |G| ≤ 2σ = rAp (Tσ ) for every prime number p, we can use [8, Lemma 3.16] to find a monomorphism g : t(G) → Tσ . Let h : H = t(G) ⊕ F → Tσ be the unique homomorphism extending both g and f . Since h(t(G)) is torsion and h(F ) = f (G) is torsion-free, h(t(G)) ∩ h(F ) = {0}. Since both g and f are monomorphisms, so is h; see [8, Lemma 3.10 (ii)]. Since Tσ is divisible, there exists a homomorphism ϕ : G → Tσ extending h; see [11, Theorem 21.1]. Since H is essential in G by Lemma 6.1 and h is a monomorphism, ϕ is a monomorphism as well; see [8, Lemma 3.5]. Therefore, G and ϕ(G) are isomorphic. Since ϕ(F ) = f (F ) is a dense selectively sequentially pseudocompact subgroup of Tσ and ϕ(F ) ⊆ ϕ(G), the group ϕ(G) is selectively sequentially pseudocompact by Proposition 1.6. Finally, since T is connected and locally connected, [7, Fact 2.11] implies that ϕ(G) is also connected and locally connected.  Theorem 6.3. Under SCH, the following conditions are equivalent for every Abelian group G satisfying rA (G) = |G|: (i) G admits a pseudocompact group topology; (ii) G admits a strongly pseudocompact group topology; (iii) G admits a selectively sequentially pseudocompact group topology; (iv) G admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. The implication (iv)⇒(iii) is trivial, while the implications (iii)⇒(ii)⇒(i) follow from equation (1). (i)⇒(iv) Suppose that G admits a pseudocompact group topology. Observe that the equality rA (G) = |G| implies that G is infinite, so |G| is admissible by Definition 3.1. Since SCH is assumed, |G| is selectively admissible by Lemma 3.3 (ii). By Definition 3.2, there exists an infinite cardinal σ such that σ ω = σ ≤ |G| ≤ 2σ . Since rA (G) = |G|, the assumptions of Theorem 6.2 are satisfied. SELECTIVELY SEQUENTIALLY PSEUDOCOMPACT GROUP TOPOLOGIES 13 Applying this theorem, we conclude that G is isomorphic to a dense connected, locally connected, selectively sequentially pseudocompact subgroup of Tσ .  Corollary 6.4. Under SCH, the following conditions are equivalent for every torsion-free Abelian group G: (i) (ii) (iii) (iv) G admits a pseudocompact group topology; G admits a strongly pseudocompact group topology; G admits a selectively sequentially pseudocompact group topology; G admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. Since G is torsion-free, G must be infinite. (i)⇒(iv) Suppose that G admits a pseudocompact group topology. Since G is infinite, |G| ≥ rA (G) ≥ c by [7, Theorem 3.8]. Since G is an uncountable, torsion-free Abelian group, rA (G) = |G|. By the implication (i)⇒(iv) of Theorem 6.3, G admits a connected, locally connected, selectively sequentially pseudocompact group topology. The implication (iv)⇒(iii) is trivial, while the implications (iii)⇒(ii)⇒(i) follow from equation (1).  Corollary 6.5. Under SCH, the following conditions are equivalent for every Abelian group G: (i) (ii) (iii) (iv) G/t(G) admits G/t(G) admits G/t(G) admits G/t(G) admits topology. a a a a pseudocompact group topology; strongly pseudocompact group topology; selectively sequentially pseudocompact group topology; connected, locally connected, selectively sequentially pseudocompact group Proof. If G is torsion, then G/t(G) is the trivial group, and so all four conditions are equivalent for G/t(G). If G is non-torsion, then G/t(G) is a torsion-free group, so Corollary 6.4 applies to G/t(G).  Theorem 6.6. Under GCH, the following conditions are equivalent for every Abelian group G satisfying the inequality |G| ≤ 2rA (G) : (i) (ii) (iii) (iv) G admits a pseudocompact group topology; G admits a strongly pseudocompact group topology; G admits a selectively sequentially pseudocompact group topology; G admits a connected, locally connected, selectively sequentially pseudocompact group topology. Proof. If rA (G) = 0, then |G| ≤ 2rA (G) = 1 by our assumption, so G is trivial, and all items (i)–(iv) are equivalent for the trivial group. Therefore, from now on we shall assume that rA (G) ≥ 1; in particular, G is infinite and non-torsion. (i)⇒(iv) Suppose that G admits a pseudocompact group topology. Since G is non-torsion, σ = rA (G) is admissible by [6, Corollary 1.19]. Since GCH is assumed, σ ω = σ by Lemma 3.3 (iii). Since |G| ≤ 2σ , the assumptions of Theorem 6.2 are satisfied. Applying this theorem, we conclude that G is isomorphic to a dense connected, locally connected, selectively sequentially pseudocompact subgroup of Tσ . The implication (iv)⇒(iii) is trivial, while the implications (iii)⇒(ii)⇒(i) follow from equation (1).  7. Two open questions We finish with two concrete versions of general Question 1.5 related to our results. 14 A. DORANTES-ALDAMA AND D. SHAKHMATOV Question 7.1. Can Corollaries 3.8 and 3.10 be proved in ZFC? Or at least, can GCH be weakened to SCH in the assumption of these corollaries? Question 7.2. Can Theorems 5.2, 6.3, 6.6 and Corollaries 3.12, 3.14, 6.4, 6.5 be proved in ZFC? Acknowledgement: This paper was written during the first listed author’s stay at the Department of Mathematics of Faculty of Science of Ehime University (Matsuyama, Japan) in the capacity of Visiting Foreign Researcher with the financial support from CONACyT of México: Estancias Posdoctorales al Extranjero propuesta No. 263464. The first author would like to thank CONACyT for its support and the host institution for its hospitality. References [1] G. Artico, U. Marconi, J. Pelant, L. Rotter, M. Tkachenko, Selections and suborderability, Fund. Math. 175 (2002), 1-33. [2] S. Balcerzyk, J. Mycielski, On the existence of free subgroups of topological groups, Fund. Math. 44 (1957), 303–308. [3] W. W. Comfort, D. Remus, Abelian torsion groups with a pseudocompact group topology, Forum Math. 6 (1994), 323–337. [4] K. I. Devlin, R. B. Jensen, Marginalia to a theorem of Silver , ISILC Logic Conference, Springer Lectures Notes 499 (1975), 115–142. [5] D. N. Dikranjan, The lattice of compact representations of an infinite group, Groups 93, Galway/St Andrews, London Math. Soc. Lectures Notes 211, 138–155. [6] D. Dikranjan, A. Giordano Bruno, w-divisible groups, Topology Appl. 155 (2008), 252–272. [7] D. N. Dikranjan, D. B. Shakhmatov, Algebraic structure of pseudocompact groups, Mem. Amer. Math. Soc. 133/633 (1998), 83 pages. [8] D. Dikranjan, D. Shakhmatov, Forcing hereditarily separable compact-like group topologies on Abelian groups, Topology Appl. 151 (2005), 2–54. [9] A. Dorantes-Aldama, D. B. Shakhmatov, Selective sequential pseudocompactness, Topology Appl. 222 (2017), 53–69. [10] R. Engelking, General Topology, Sigma Series in Pure Mathematics, Heldermann, Berlin, 1989. [11] L. Fuchs, Infinite Abelian groups, Vol. I, Academic Press, New York, 1970. [12] J. Galindo, S. Macario, Pseudocompact group topologies with no infinite compact subsets, J. Pure Appl. Algebra 215 (2011) 655-663. [13] S. Garcı́a-Ferreira, Y. F. Ortiz-Castillo, Strong pseudocompact properties, Comment. Math. Univ. Carolin. 55,1 (2014) 101–109. [14] S. Garcı́a-Ferreira, A. H. Tomita, A pseudocompact group which is not strongly pseudocompact, Topology Appl. 192 (2015) 138–144. [15] T. Jech, Set Theory, Academic Press, New York, 1978. [16] H. Neumann, Varieties of groups, (Ergebnosse der Mathematik und ihrer Grenzgebiete 37), Springer-Verlag, Berlin-Heidelberg-New York, 1967. [17] D. Shakhmatov, V. H. Yañez, Selectively pseudocompact groups without non-trivial convergent sequences, preprint, arXiv:1704.07740 [math.GN]. Department of Mathematics, Faculty of Science, Ehime University, Matsuyama 790-8577, Japan E-mail address: alejandro [email protected] Division of Mathematics, Physics and Earth Sciences, Graduate School of Science and Engineering, Ehime University, Matsuyama 790-8577, Japan E-mail address: [email protected]
4math.GR
Adversarial Dropout for Supervised and Semi-Supervised Learning Sungrae Park and Jun-Keon Park and Su-Jin Shin and Il-Chul Moon arXiv:1707.03631v2 [cs.LG] 18 Sep 2017 Department of Industrial and System Engineering KAIST Deajeon, South Korea { sungraepark and alex3012 and sujin.shin and icmoon } @kaist.ac.kr Abstract Recently, training with adversarial examples, which are generated by adding a small but worst-case perturbation on input examples, has improved the generalization performance of neural networks. In contrast to the biased individual inputs to enhance the generality, this paper introduces adversarial dropout, which is a minimal set of dropouts that maximize the divergence between 1) the training supervision and 2) the outputs from the network with the dropouts. The identified adversarial dropouts are used to automatically reconfigure the neural network in the training process, and we demonstrated that the simultaneous training on the original and the reconfigured network improves the generalization performance of supervised and semi-supervised learning tasks on MNIST, SVHN, and CIFAR-10. We analyzed the trained model to find the performance improvement reasons. We found that adversarial dropout increases the sparsity of neural networks more than the standard dropout. Finally, we also proved that adversarial dropout is a regularization term with a rank-valued hyper parameter that is different from a continuous-valued parameter to specify the strength of the regularization. Introduction Deep neural networks (DNNs) have demonstrated the significant improvement on benchmark performances in a wide range of applications. As neural networks become deeper, the model complexity also increases quickly, and this complexity leads DNNs to potentially overfit a training data set. Several techniques (Hinton et al. 2012; Poole, Sohl-Dickstein, and Ganguli 2014; Bishop 1995b; Lasserre, Bishop, and Minka 2006) have emerged over the past years to address this challenge, and dropout has become one of dominant methods due to its simplicity and effectiveness (Hinton et al. 2012; Srivastava et al. 2014). Dropout randomly disconnects neural units during training as a method to prevent the feature co-adaptation (Baldi and Sadowski 2013; Wager, Wang, and Liang 2013; Wang and Manning 2013; Li, Gong, and Yang 2016). The earlier work by Hinton et al. (2012) and Srivastava et al. (2014) interpreted dropout as an extreme form of model combinations, a.k.a. a model ensemble, by sharing extensive parameters on neural networks. They proposed learning the model combination through minimizing an expected Copyright c 2017, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. loss of models perturbed by dropout. They also pointed out that the output of dropout is the geometric mean of the outputs from the model ensemble with the shared parameters. Extending the weight sharing perspective, several studies (Baldi and Sadowski 2013; Chen et al. 2014; Jain et al. 2015) analyzed the ensemble effects from the dropout. The recent work by Laine & Aila (2016) enhanced the ensemble effect of dropout by adding self-ensembling terms. The self-ensembling term is constructed by a divergence between two sampled neural networks from the dropout. By minimizing the divergence, the sampled networks learn from each other, and this practice is similar to the working mechanism of the ladder network (Rasmus et al. 2015), which builds a connection between an unsupervised and a supervised neural network. Our method also follows the principles of self-ensembling, but we apply the adversarial training concept to the sampling of neural network structures through dropout. At the same time that the community has developed the dropout, adversarial training has become another focus of the community. Szegedy et al. (2013) showed that a certain neural network is vulnerable to a very small perturbation in the training data set if the noise direction is sensitive to the models’ label assignment y given x, even when the perturbation is so small that human eyes cannot discern the difference. They empirically proved that robustly training models against adversarial perturbation is effective in reducing test errors. However, their method of identifying adversarial perturbations contains a computationally expensive inner loop. To compensate it, Goodfellow et al. (2014) suggested an approximation method, through the linearization of the loss function, that is free from the loop. Adversarial training can be conducted on supervised learning because the adversarial direction can be defined when true y labels are known. Miyato et al. (2015) proposed a virtual adversarial direction to apply the adversarial training in the semi-supervised learning that may not assume the true y value. Until now, the adversarial perturbation can be defined as a unit vector of additive noise imposed on the input or the embedding spaces (Szegedy et al. 2013; Goodfellow, Shlens, and Szegedy 2014; Miyato et al. 2015). Our proposed method, adversarial dropout, can be viewed from the dropout and from the adversarial train- nal characteristics of adversarial dropout that specifies the strength of the regularization effect by the rank-valued parameter while the adversarial training specifies the strength with the conventional continuous-valued scale. Preliminaries Before introducing adversarial dropout, we briefly introduce stochastic noise layers for deep neural networks. Afterwards, we review adversarial training and temporal ensembling, or Π model, because two methods are closely related to adversarial dropout. Noise Layers Figure 1: Diagram description of loss functions from Π model (Laine and Aila 2016), the adversarial training (Miyato et al. 2015), and our adversarial dropout. ing perspectives. Adversarial dropout can be interpreted as dropout masks whose direction is optimized adversarially to the model’s label assignment. However, it should be noted that adversarial dropout and traditional adversarial training with additive perturbation are different because adversarial dropout induces the sparse structure of neural network while the other does not make changes in the structure of the neural network, directly. Figure 1 describes the proposed loss function construction of adversarial dropout compared to 1) the recent dropout model, which is Π model (Laine and Aila 2016) and 2) the adversarial training (Goodfellow, Shlens, and Szegedy 2014; Miyato et al. 2015). When we compare adversarial dropout to Π model, both divergence terms are similarly computed from two different dropped networks, but adversarial dropout uses an optimized dropped network to adapt the concept of adversarial training. When we compare adversarial dropout to the adversarial training, the divergence term of the adversarial training is computed from one network structure with two training examples: clean and adversarial examples. On the contrary, the divergence term of the adversarial dropout is defined with two network structures: a randomly dropped network and an adversarially dropped network. Our experiments demonstrated that 1) adversarial dropout improves the performance on MNIST supervised learning compared to the dropout suggested by Π model, and 2) adversarial dropout showed the state-of-the-art performance on the semi-supervised learning task on SVHN and CIFAR-10 when we compare the most recent techniques of dropout and adversarial training. Following the performance comparison, we visualize the neural network structure from adversarial dropout to illustrate that the adversarial dropout enables a sparse structure compared to the neural network of standard dropout. Finally, we theoretically show the origi- Corrupting training data with noises has been well-known to be a method to stabilize prediction (Bishop 1995a; Maaten et al. 2013; Wager, Wang, and Liang 2013). This section describes two types of noise injection techniques, such as additive Gaussian noise and dropout noise. Let h(l) denote the lth hidden variables in a neural network, and this layer can be replaced with a noisy version h̃(l) . We can vary the noise types as the followings. • Additive Gaussian noise: h̃(l) = h(l) + γ, where γ ∼ N (0, σ 2 Id×d ) with the parameter σ 2 to restrict the degree of noises. • Dropout noise: h̃(l) = h(l) , where is the elementwise product of two vectors, and the elements of the noise vector are i ∼ Bernoulli(1 − p) with the parameter p. To simply put, this function specifies that i = 0 with probability p and i = 1 with probability (1 − p). Both additive Gaussian noise and dropout noise are generalization techniques to increase the generality of the trained model, but they have different properties. The additive Gaussian noise increases the margin of decision boundaries while the dropout noise affects a model to be sparse (Srivastava et al. 2014). These noise layers can be easily included in a deep neural network. For example, there can be a dropout layer between two convolutional layers. Similarly, a layer of additive Gaussian noise can be placed on the input layer. Self-Ensembling Model The recently reported self-ensembling (SE) (Laine and Aila 2016), or Π model, construct a loss function that minimizes the divergence between two outputs from two sampled dropout neural networks with the same input stimulus. Their suggested regularization term can be interpreted as the following: LSE (x; θ) := D[fθ (x, 1 ), fθ (x, 2 )], (1) where 1 and 2 are randomly sampled dropout noises in a neural network fθ , whose parameters are θ. Also, D[y, y0 ] is a non-negative function that represents the distance between two output vectors: y and y0 . For example, D can be the P cross entropy function, D[y, y0 ] = − i yi log yi0 , where y and y0 are the vectors whose ith elements represent the probability of the ith class. The divergence could be calculated between two outputs of two different structures, which turn this regularization to be semi-supervised. Π model is based on the principle of Γ model, which is the ladder network by Rasmus et al. (2015). Our proposed method, adversarial dropout, can be seen as a special case of Π model when one dropout neural network is adversarially sampled. Adversarial Training Adversarial dropout follows the training mechanism of adversarial training, so we briefly introduce a generalized formulation of the adversarial training. The basic concept of adversarial training (AT) is an incorporation of adversarial examples on the training process. Additional loss function by including adversarial examples (Szegedy et al. 2013; Goodfellow, Shlens, and Szegedy 2014; Miyato et al. 2015) can be defined as a generalized form: LAT (x, y; θ, δ) := D[g(x, y, θ), fθ (x + γ adv )] where γ adv (2) := argmaxγ;kγk∞ ≤δ D[g(x, y, θ), fθ (x + γ)]. Here, θ is a set of model parameters, δ is a hyperparameter controlling the intensity of the adversarial perturbation γ adv . The function fθ (x) is an output distribution of a neural network to be learned. Adversarial training can be diversified by differentiating the definition of g(x, y, θ), as the following. • Adversarial training (AT) (Goodfellow, Shlens, and Szegedy 2014; Kurakin, Goodfellow, and Bengio 2016) defines g(x, y, θ) as g(y) ignoring x and θ, so g(y) is an one-hot encoding vector of y. • Virtual adversarial training (VAT) (Miyato et al. 2015; Miyato, Dai, and Goodfellow 2016) defines g(x, y, θ) as fθ̂ (x) where θ̂ is the current estimated parameter. This training method does not use any information from y in the adversarial part of the loss function. This enables the adversarial part to be used as a regularization term for the semi-supervised learning. Method This section presents our adversarial dropout that combines the ideas of adversarial training and dropout. First, we formally define the adversarial dropout. Second, we propose a training algorithm to find the instantiations of adversarial dropouts with a fast approximation method. General Expression of Adversarial Dropout Now, we propose the adversarial dropout (AdD), which could be an adversarial training method that determines the dropout condition to be sensitive on the model’s label assignment. We use fθ (x, ) as an output distribution of a neural network with a dropout mask. The below is the description of the additional loss function by incorporating adversarial dropout. LAdD (x, y, s ; θ, δ) := D[g(x, y, θ), fθ (x, adv )] where  adv (3) := argmax;ks −k2 ≤δH D[g(x, y, θ), fθ (x, )]. Here, D[·, ·] indicates a divergence function; g(x, y, θ) represents an adversarial target function that can be diversified by its definition; adv is an adversarial dropout mask under the function fθ when θ is a set of model parameters; s is a sampled random dropout mask instance; δ is a hyperparameter controlling the intensity of the noise; and H is the dropout layer dimension. We introduce the boundary condition, ks − k2 ≤ δH, which indicates a restriction of the number of the difference between two dropout conditions. An adversarial dropout mask should be infinitesimally different from the random dropout mask. Without this constraint, the network with adversarial dropout may become a neural network layer without connections. By restricting the adversarial dropout with the random dropout, we prevent finding such irrational layer, which does not support the back propagation. We found that the Euclidean distance between two  vectors can be calculated by using the graph edit distance or the Jaccard distance. In the supplementary material, we proved that the graph edit distance and the Jaccard distance can be abstracted as Euclidean distances between two  vectors. In the general form of adversarial training, the key point is the existence of the linear perturbation γ adv . We can interpret the input with the adversarial perturbation as this adversarial noise input x̃adv = x + γ adv . From this perspective, the authors of adversarial training limited the adversarial direction only on the space of the additive Gaussian noise x̃ = x + γ 0 , where γ 0 is a sampled Gaussian noise on the input layer. In contrast, adversarial dropout can be considered as a noise space generated by masking hidden units, h̃adv = h adv where h is hidden units, and adv is an adversarially selected dropout condition. If we assume the adversarial training as the Gaussian additive perturbation on the input, the perturbation is linear in nature, but adversarial dropout could be non-linear perturbation if the adversarial dropout is imposed upon multiple layers. Supervised Adversarial Dropout Supervised Adversarial dropout (SAdD) defines g(x, y, θ) as y, so g is a one-hot vector of y as the typical neural network. The divergence term from Formula 3 can be converted as follows: LSAdD (x, y, s ; θ, δ) := D[g(y), fθ (x, adv )] where  adv (4) := argmax;ks −k2 ≤δH D[g(y), fθ (x, )]. In this case, the divergence term can be seen as the pure loss function for a supervised learning with a dropout regularization. However, adv is selected to maximize the divergence between the true information and the output from the dropout network, so adv eventually becomes the mask on the most contributing features. This adversarial mask provides the learning opportunity on neurons, so called dead filter, that was considered to be less informative. Virtual Adversarial Dropout Virtual adversarial dropout (VAdD) defines g(x, y, θ) = fθ (x, s ). This uses the loss function as a regularization term for semisupervised learning. The divergence term in Formula 3 can be represented as bellow: LV AdD (x, y, s ; θ, δ) := D[fθ (x, s ), fθ (x, adv )] where  adv s (5) := argmax;ks −k2 ≤δH D[fθ (x,  ), fθ (x, )]. VAdD is a special case of a self-ensembling model with two dropouts. They are 1) a dropout, s , sampled from a random distribution with a hyperparameter and 2) a dropout, adv , composed to maximize the divergence function of the learner, which is the concept of the noise injection from the virtual adversarial training. The two dropouts create a regularization as the virtual adversarial training, and the inference procedure optimizes the parameters to reduce the divergence between the random dropout and the adversarial dropout. This optimization triggers the self-ensemble learning in (Laine and Aila 2016). However, the adversarial dropout is different from the previous self-ensembling because one dropout is induced by the adversarial setting, not by a random sampling. Learning with Adversarial Dropout The full objective function for the learning with the adversarial dropout is given by l(y, fθ (x, s )) + λLAdD (x, y, s ; θ, δ) (6) s where l(y, fθ (x,  )) is the negative log-likelihood for y given x under the sampled dropout instance s . There are two scalar-scale hyper-parameters: (1) a trade-off parameter, λ, for controlling the impact of the proposed regularization term and (2) the constraints, δ, specifying the intensity of adversarial dropout. Combining Adversarial Dropout and Adversarial Training Additionally, it should be noted that the adversarial training and the adversarial dropout are not exclusive training methods. A neural network can be trained by imposing the input perturbation with the Gaussian additive noise, and by enabling the adversarially chosen dropouts, simultaneously. Formula 7 specifies the loss function of simultaneously utilizing the adversarial dropout and the adversarial training. l(y, fθ (x, s )) + λ1 LAdD (x, y, s ) + λ2 LAT (x, y) (7) where λ1 and λ2 are trade-off parameters controlling the impact of the regularization terms. Fast Approximation Method for Finding Adversarial Dropout Condition Once the adversarial dropout, adv , is identified, the evaluation of LAdD simply becomes the computation of the loss and the divergence functions. However, the inference on adv is difficult because of three reasons. First, we cannot obtain a closed-form solution on the exact adversarial noise value, adv . Second, the feasible space for adv is restricted under ks − adv k2 ≤ δH, which becomes a constraint in the optimization. Third, adv is a binary-valued vector rather than a continuous-valued vector because adv indicates the activation of neurons. This discrete nature requires an optimization technique like integer programming. To mitigate this difficulty, we approximated the objective function, LAdD , with the first order of the Taylor expansion by relaxing the domain space of adv . This Taylor expansion of the objective function was used in the earlier works of adversarial training (Goodfellow, Shlens, and Szegedy 2014; Miyato et al. 2015). After the approximation, we found an adversarial dropout condition by solving an integer programming problem. To define a neural network with a dropout layer, we separate the output function into two neural sub-networks, fθ (x, ) = fθupper (h(x) ), where fθupper is the upper part 1 1 neural network of the dropout layer and h(x) = fθunder (x) 2 is the under part neural network. Our objective is optimizing an adversarial dropout noise adv by maximizing the following divergence function under the constraint ks − adv k2 ≤ δH: D(x, ; θ, s ) = D[g(x, y, θ, s ), fθupper (h(x) 1 ))] (8) s where  is a sampled dropout mask, and θ is a parameter of the neural network model. We approximate the above divergence function by deriving the first order of the Taylor expansion by relaxing the domain space of  from the multiple binary spaces, {0, 1}H , to the real value spaces, [0, 1]H . This conversion is a common step in the integer programming research as (Hemmecke et al. 2010): D(x, ; θ, s ) ≈ D(x, 0 ; θ, s ) + ( − 0 )T J(x, 0 ) (9) where J(x, 0 ) is the Jacobian vector given by J(x, 0 ) := 5 D(x, ; θ, s )|=0 when 0 = 1 indicates no noise injection. The above Taylor expansion provides a linearized optimization objective function by controlling . Therefore, we reorganized the Taylor expansion with respect to  as the below: X D(x, ; θ, s ) ∝ i Ji (x, 0 ) (10) i where Ji (x, 0 ) is the ith element of J(x, 0 ). Since we cannot proceed further with the given formula, we introduce an alternative Jaccobian formula that further specifies the dropout mechanism by and h(x) as the below. J(x, 0 ) ≈ h(x) 5h(x) D(x, 0 ; θ, s ) (11) where h(x) is the output vector of the under part neural network of the adversarial dropout. The control variable, , is a binary vector whose elements are either one or zero. Under this approximate divergence, finding a maximal point of  can be viewed as the 0/1 knapsack problem (Kellerer, Pferschy, and Pisinger 2004), which is one of the most popular integer programming problems. To find adv with the constraint, we propose Algorithm 1 based on the dynamic programming for the 0/1 knapsack problem. In the algorithm, adv is initialized with s , and adv changes its value by the order of the degree increasing the objective divergence until ks − adv k2 ≤ δH; or there is no increment in the divergence. After using the algorithm, we obtain adv that maximizes the divergence with the constraint, and we evaluate the loss function LAdD . We should notice that the complex vector of the Taylor expansion is not s , but 0 . In the case of virtual adversarial dropout, whose divergence is formed as D[fθ (x, s ), fθ (x, )], s is the minimal point leading the gradient to be zero because of the identical distribution between the random and the optimized dropouts. This zero gradient affects the approximation of the divergence term as Algorithm 1: Finding Adversarial Dropout Condition Input : s is current sampled dropout mask Input : δ is a hyper-parameter for the boundary Input : J is the Jacobian vector Input : H is the layer dimension. Output: adv 1 begin 2 z ←− |J| // absolute values of the Jacobian 3 i ←− Arg Sort z as zi1 ≤ ... ≤ ziH 4 adv ←− s 5 d ←− 1 6 while ks − adv k2 ≤ δH and d ≤ H do 7 if adv id = 0 and Jid > 0 then 8 adv id ←− 1 9 else if adv id = 1 and Jid < 0 then 10 adv id ←− 0 11 end 12 d ←− d + 1 13 end 14 end of 70,000 handwritten digit images of size 28 × 28 where 60,000 images are used for training and the rest for testing. Our basic structure is a convolutional neural network (CNN) containing three convolutional layers, which filters are 32, 64, and 128, respectively, and three max-pooling layers sized by 2 × 2. The adversarial dropout applied only on the final hidden layer. The structure detail and the hyperparameters are described in Appendix B.1. We conducted both supervised and semi-supervised learnings to compare the performances from the standard dropout, Π model, and adversarial training models utilizing linear perturbations on the input space. The supervised learning used 60,000 instances for training with full labels. The semi-supervised learning used 1,000 randomly selected instances with their labels and 59,000 instances with only their input images. Table 1 shows the test error rates including the baseline models. Over all experiment settings, SAdD and VAdD further reduce the error rate from Π model, which had the best performance among the baseline models. In the table, KL and QE indicate Kullback-Leibler divergence and quadratic error, respectively, to specify the divergence function, D[y, ŷ]. Table 1: Test performance with 1,000 labeled (semisupervised) and 60,000 labeled (supervised) examples on MNIST. Each setting is repeated for eight times. Supervised and Semi-supervised Learning on SVHN and CIFAR-10 Method Plain (only dropout) AT VAT Π model SAdD VAdD (KL) VAdD (QE) Error rate (%) with # labels 1,000 All (60,000) 2.99 ± 0.23 0.53 ± 0.03 0.51 ± 0.03 1.35 ± 0.14 0.50 ± 0.01 1.00 ± 0.08 0.50 ± 0.02 0.46 ± 0.01 0.99 ± 0.07 0.47 ± 0.01 0.99 ± 0.09 0.46 ± 0.02 zero. To avoid the zero gradients, we set the complex vector of the Taylor expansion as 0 . This zero gradient situation does not occur when the model function, fθ , contains additional stochastic layers because fθ (x, s , ρ1 ) 6= fθ (x, s , ρ2 ) when ρ1 and ρ2 are independently sampled noises from another stochastic layers. Experiments This section evaluates the empirical performance of adversarial dropout for supervised and semi-supervised classification tasks on three benchmark datasets, MNIST, SVHN, and CIFAR-10. In every presented task, we compared adversarial dropout, Π model, and adversarial training. We also performed additional experiments to analyze the sparsity of adversarial dropout. Supervised and Semi-supervised Learning on MNIST task In the first set of experiments, we benchmark our method on the MNIST dataset (LeCun et al. 1998), which consists We experimented the performances of the supervised and the semi-supervised tasks on the SVHN (Netzer et al. 2011) and the CIFAR-10 (Krizhevsky and Hinton 2009) datasets consisting of 32 × 32 color images in ten classes. For these experiments, we used the large-CNN (Laine and Aila 2016; Miyato et al. 2017). The details of the structure and the settings are described in Appendix B.2. Table 7 shows the reported performances of the close family of CNN-based classifiers for the supervised and semisupervised learning. We did not consider the recently advanced architectures, such as ResNet (He et al. 2016) and DenseNet (Huang et al. 2016), because we intend to compare the performance increment by the dropout and other training techniques. In supervised learning tasks using all labeled train data, adversarial dropout models achieved the top performance compared to the results from the baseline models, such as Π model and VAT, on both datasets. When applying adversarial dropout and adversarial training together, there were further improvements in the performances. Additionally, we conducted experiments on the semisupervised learning with randomly selected labeled data and unlabeled images. In SVHN, 1,000 labeled and 72,257 unlabeled data were used for training. In CIFAR-10, 4,000 labeled and 46,000 unlabeled data were used. Table 7 lists the performance of the semi-supervised learning models, and our implementations with both VAdD and VAT achieved the top performance compared to the results from (Sajjadi, Javanmardi, and Tasdizen 2016). Our experiments demonstrate that VAT and VAdD are complementary. When applying VAT and VAdD together by simply adding their divergence terms on the loss function, see Formula 7, we achieved the state-of-the-art performances on the semi-supervised learning on both datasets; Table 2: Test performances of semi-supervised and supervised learning on SVHN and CIFAR-10. Each setting is repeated for five times. KL and QE indicate Kullback-Leibler divergence and quadratic error, respectively, to specify the divergence function, D[y, ŷ] Method Π model (Laine and Aila 2016) Tem. ensembling (Laine and Aila 2016) Sajjadi et al. (Sajjadi, Javanmardi, and Tasdizen 2016) VAT (Miyato et al. 2017) Π model (our implementation) VAT (our implementation) SAdD VAdD (KL) VAdD (QE) VAdD (KL) + VAT VAdD (QE) + VAT SVHN with # labels 1,000 73,257 (All) 4.82 2.54 4.42 2.74 3.86 4.35 ± 0.04 2.53 ± 0.05 3.74 ± 0.09 2.69 ± 0.04 2.46 ± 0.05 4.16 ± 0.08 2.31 ± 0.01 4.26 ± 0.14 2.37 ± 0.03 3.55 ± 0.05 2.23 ± 0.03 3.55 ± 0.07 2.34 ± 0.05 CIFAR-10 with # labels 4,000 50,000 (All) 12.36 5.56 12.16 5.60 11.29 10.55 5.81 12.62 ± 0.29 5.77 ± 0.11 11.96 ± 0.10 5.65 ± 0.17 5.46 ± 0.16 11.68 ± 0.19 5.27 ± 0.10 11.32 ± 0.11 5.24 ± 0.12 10.07 ± 0.11 4.40 ± 0.12 9.22 ± 0.10 4.73 ± 0.04 3.55% of test error rates on SVHN, and 10.04% and 9.22% of test error rates on CIFAR-10. Additionally, VAdD alone achieved a better performance than the self-ensemble model (Π model). This indicates that considering an adversarial perturbation on dropout layers enhances the self-ensemble effect. Effect on Features and Sparsity from Adversarial Dropout Dropout prevents the co-adaptation between the units in a neural network, and the dropout decreases the dependency between hidden units (Srivastava et al. 2014). To compare the adversarial dropout and the standard dropout, we analyzed the co-adaptations by visualizing features of autoencoders on the MNIST dataset. The autoencoder consists with one hidden layer, whose dimension is 256, with the ReLU activation. When we trained the autoencoder, we set the dropout with p = 0.5, and we calculated the reconstruction error between the input data and the output layer as a loss function to update the weight values of the autoencoder with the standard dropout. On the other hand, the adversarial dropout error is also considered when we update the weight values of the autoencoder with the parameters, λ = 0.2, and δ = 0.3. The trained autoencoders showed similar reconstruction errors on the test dataset. Figure 2 shows the visualized features from the autoencoders. There are two differences identified from the visualization; 1) adversarial dropout prevents that the learned weight matrix contains black boxes, or dead filters, which may be all zero for many different inputs and 2) adversarial dropout tends to standardize other features, except for localized features viewed as black dots, while the standard dropout tends to ignore the neighborhoods of the localized features. These show that adversarial dropout standardizes the other features while preserving the characteristics of localized features from the standard dropout . These could be the main reason for the better generalization performance. The important side-effect of the standard dropout is the sparse activations of the hidden units (Hinton et al. 2012). To analyze the sparse activations by adversarial dropout, we Figure 2: Features of one hidden layer autoencoders trained on MNIST; a standard dropout (left) and an adversarial dropout (right). compared the activation values of the auto-encoder models with no-dropout, dropout, and adversarial dropout on the MNIST test dataset. A sparse model should only have a few highly activated units, and the average activation of any unit across data instances should be low (Hinton et al. 2012). Figure 3 plot the distribution of the activation values and their means across the test dataset. We found that the adversarial dropout has fewer highly activated units compared to others. Moreover, the mean activation values of the adversarial dropout were the lowest. These indicate that adversarial dropout improves the sparsity of the model than the standard dropout does. Disucssion The previous studies proved that the adversarial noise injections were an effective regularizer (Goodfellow, Shlens, and Szegedy 2014). In order to investigate the different properties of adversarial dropout, we explore a very simple case of applying adversarial training and adversarial dropout to the linear regression. Linear Regression with Adversarial Dropout Now, we turn to the case of applying adversarial dropout to a linear regression. To represent the adversarial dropout, we denote x̃i = adv xi as the adversarially dropped input of i = argmax xi )T wk2 xi where adv ;ki −1k2 ≤k kyi − (i i with the hyper-parameter, k, controlling the degree of the adversarial dropout. For simplification, we used one vector as the sampled dropout, s , of the adversarial dropout. If we apply Algorithm 1, the adversarial dropout can be defined as follows:  0 if xij 5xij l(w) ≤ min{sik , 0} adv ij = (14) 1 otherwise Figure 3: Histograms of the activation values and the mean activation values from a hidden layer of autoencoders in 1,000 MNIST test images. All values are converted by the log scale for the comparison. Linear Regression with Adversarial Training Let xi ∈ RD be a data point and yi ∈ R be a target where i = {1, ..., N }. The objective of the linear P regression is finding w ∈ RD that minimizes l(w) = i kyi − xTi wk2 . To express adversarial examples, we denote x̃i = xi + radv as the adversarial example of xi where radv = i i δsign(5xi l(w)) utilizing the fast gradient sign method (FGSM) (Goodfellow, Shlens, and Szegedy 2014), δ is a control parameter representing the degree of adversarial noises. With the adversarial examples, the objective function of the adversarial training can be viewed as follows: X T 2 lAT (w) = kyi − (xi + radv (12) i ) wk i The above equation is translated into the below formula by isolating the terms with radv as the additive noise. i X l(w) + |δ 5xij l(w)| + δ 2 wT ΓAT w (13) ij T where ΓAT = i sign(5xi l(w)) sign(5xi l(w)). The second term shows the L1 regularization by multiplying the degree of the adversarial noise, δ, at each data point. Additionally, the third term indicates the L2 regularization with ΓAT , which form the scales of w by the gradient direction differences over all data points. The penalty terms are closely related with the hyper-parameter δ. When δ approaches to zero, the regularization term disappears because the inputs become adversarial examples, not anymore. For a large δ, the regularization constant grows larger than the original loss function, and the learning becomes infeasible. The previous studies proved that the adversarial objective function based on the FGSM is an effective regularizer. This paper investigated that training a linear regression with adversarial examples provides two regularization terms of the above equation. P where sik is the k th lowest element of xi 5xi l(w). This solution satisfies the constraint, ki − s k2 ≤ k. With this adversarial dropout condition, the objective function of the adversarial dropout can be defined as the belows: X lAdD (w) = kyi − (adv xi )T wk2 (15) i i When we isolate the terms with adv , the above equation is translated into the below formula. XX l(w) + |xij 5xij l(w)| + wT ΓAdD w (16) i j∈Si P where Si = {j|adv = 0} and ΓAdD = i ((1 − adv ij i ) T adv xi ) ((1 − i ) xi ). The second term is the L1 regularization of the k largest loss changes from the features of each data point. The third term is the L2 regularization with ΓAdD . These two penalty terms are related with the hyper-parameter k controlling the degree of the adversarial dropout, because the k indicates the number of elements of the set Si , ∀i. When k becomes zero, the two penalty terms disappears because there will be no dropout by the constraint on . There are two differences between the adversarial dropout and the adversarial training. First, the regularization terms of the adversarial dropout are dependent on the scale of the features of each data point. In L1 regularization, the gradients of the loss function are re-scaled with the data points. In L2 regularization, the data points affect the scales of the weight costs. In contrast, the penalty terms of adversarial training are dependent on the degree of adversarial noise, δ, which is a static term across the instances because δ is a single-valued hyper parameter given in the training process. Second, the penalty terms of the adversarial dropout are selectively activated by the degree of the loss changes while the penalty terms of the adversarial training are always activated. Conclusion The key point of our paper is combining the ideas from the adversarial training and the dropout. The existing methods of the adversarial training control a linear perturbation with additive properties only on the input layer. In contrast, we combined the concept of the perturbation with the dropout properties on hidden layers. Adversarially dropped structure becomes a poor ensemble model for the label assignment even when very few nodes are changed. However, by learning the model with the poor structure, the model prevents over-fitting using a few effective features. The experiments showed that the generalization performances are improved by applying our adversarial dropout. Additionally, our approach achieved the-state-of-the-art performances of 3.55% on SVHN and 9.22% on CIFAR-10 by applying VAdD and VAT together for the semi-supervised learning. References Baldi, P., and Sadowski, P. J. 2013. Understanding dropout. In Advances in Neural Information Processing Systems. 2814–2822. Bishop, C. M. 1995a. Training with noise is equivalent to tikhonov regularization. Neural computation 7(1):108–116. Bishop, C. M. 1995b. Regularization and complexity control in feed-forward networks. Chen, N.; Zhu, J.; Chen, J.; and Zhang, B. 2014. Dropout training for support vector machines. arXiv preprint arXiv:1404.4171. Goodfellow, I. J.; Shlens, J.; and Szegedy, C. 2014. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572. He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Identity mappings in deep residual networks. In European Conference on Computer Vision, 630–645. Springer. Hemmecke, R.; Köppe, M.; Lee, J.; and Weismantel, R. 2010. Nonlinear integer programming. In 50 Years of Integer Programming 1958-2008. Springer. 561–618. Hinton, G. E.; Srivastava, N.; Krizhevsky, A.; Sutskever, I.; and Salakhutdinov, R. R. 2012. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580. Huang, G.; Liu, Z.; Weinberger, K. Q.; and van der Maaten, L. 2016. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993. Jain, P.; Kulkarni, V.; Thakurta, A.; and Williams, O. 2015. To drop or not to drop: Robustness, consistency and differential privacy properties of dropout. arXiv preprint arXiv:1503.02031. Kellerer, H.; Pferschy, U.; and Pisinger, D. 2004. Introduction to np-completeness of knapsack problems. In Knapsack problems. Springer. 483–493. Kingma, D., and Ba, J. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. Krizhevsky, A., and Hinton, G. 2009. Learning multiple layers of features from tiny images. Kurakin, A.; Goodfellow, I.; and Bengio, S. 2016. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533. Laine, S., and Aila, T. 2016. Temporal ensembling for semisupervised learning. arXiv preprint arXiv:1610.02242. Lasserre, J. A.; Bishop, C. M.; and Minka, T. P. 2006. Principled hybrids of generative and discriminative models. In Computer Vision and Pattern Recognition, 2006 IEEE Computer Society Conference on, volume 1, 87–94. IEEE. LeCun, Y.; Bottou, L.; Bengio, Y.; and Haffner, P. 1998. Gradient-based learning applied to document recognition. Proceedings of the IEEE 86(11):2278–2324. Lee, C.-Y.; Xie, S.; Gallagher, P.; Zhang, Z.; and Tu, Z. 2015. Deeply-supervised nets. In Artificial Intelligence and Statistics, 562–570. Li, Z.; Gong, B.; and Yang, T. 2016. Improved dropout for shallow and deep learning. In Advances in Neural Information Processing Systems, 2523–2531. Lin, M.; Chen, Q.; and Yan, S. 2013. Network in network. arXiv preprint arXiv:1312.4400. Maaten, L.; Chen, M.; Tyree, S.; and Weinberger, K. Q. 2013. Learning with marginalized corrupted features. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), 410–418. Miyato, T.; Maeda, S.-i.; Koyama, M.; Nakae, K.; and Ishii, S. 2015. Distributional smoothing with virtual adversarial training. arXiv preprint arXiv:1507.00677. Miyato, T.; Maeda, S.-i.; Koyama, M.; and Ishii, S. 2017. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. arXiv preprint arXiv:1704.03976. Miyato, T.; Dai, A. M.; and Goodfellow, I. 2016. Virtual adversarial training for semi-supervised text classification. stat 1050:25. Netzer, Y.; Wang, T.; Coates, A.; Bissacco, A.; Wu, B.; and Ng, A. Y. 2011. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, 5. Poole, B.; Sohl-Dickstein, J.; and Ganguli, S. 2014. Analyzing noise in autoencoders and deep networks. arXiv preprint arXiv:1406.1831. Rasmus, A.; Berglund, M.; Honkala, M.; Valpola, H.; and Raiko, T. 2015. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems, 3546–3554. Sajjadi, M.; Javanmardi, M.; and Tasdizen, T. 2016. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Advances in Neural Information Processing Systems, 1163–1171. Salimans, T., and Kingma, D. P. 2016. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, 901–901. Salimans, T.; Goodfellow, I. J.; Zaremba, W.; Cheung, V.; Radford, A.; and Chen, X. 2016. Improved techniques for training gans. CoRR abs/1606.03498. Sanfeliu, A., and Fu, K.-S. 1983. A distance measure between attributed relational graphs for pattern recognition. IEEE transactions on systems, man, and cybernetics (3):353–362. Springenberg, J. T.; Dosovitskiy, A.; Brox, T.; and Ried- miller, M. 2014. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806. Springenberg, J. T. 2015. Unsupervised and semisupervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390. Srivastava, N.; Hinton, G. E.; Krizhevsky, A.; Sutskever, I.; and Salakhutdinov, R. 2014. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research 15(1):1929–1958. Srivastava, R. K.; Greff, K.; and Schmidhuber, J. 2015. Highway networks. arXiv preprint arXiv:1505.00387. Szegedy, C.; Zaremba, W.; Sutskever, I.; Bruna, J.; Erhan, D.; Goodfellow, I.; and Fergus, R. 2013. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199. Wager, S.; Wang, S.; and Liang, P. S. 2013. Dropout training as adaptive regularization. In Advances in Neural Information Processing Systems, 351–359. Wang, S., and Manning, C. 2013. Fast dropout training. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), 118–126. Appendix A. Distance between Two Dropout Conditions In this section, we describe process of induction for the boundary condition from the constraints distance(, s ) < δ. We applied two distance metrics, graph edit distance (GED) and Jaccard distance (JD) and proved that restricting upper bounds of two metrics is same with limiting the Euclidean distance. GED(1 , 2 ) ∝ JD(1 , 2 ) ∝ ||1 − 2 ||2 (17) GED(g1 , g2 ) = (Nl + Nu )k1 − 2 k2 . 1 (19) 2 Due to  and  are binary masks, their Euclidean distance can provide the number of different dropped nodes. A.2. Jaccard Distance When we consider a dropout condition  as a set of selected hidden nodes, we can apply Jaccard distance to measure difference two dropout masks, 1 and 2 . The following equation is the definition of Jaccard distance: JD(1 , 2 ) = |1 ∪ 2 | − |1 ∩ 2 | . |1 ∪ 2 | (20) Since 1 and 2 are binary vectors, |1 ∩2 | can be converted as k1 2 k2 and |1 ∪ 2 | can be viewed as k1 + 2 − 1 2 k2 . This leads the following proposition. Proposition 2 Given two dropout masks 1 and 2 , which are binary vectors, Jaccard distance between them can be defined as: JD(1 , 2 ) = k1 − 2 k2 . k1 + 2 − 1 2 k2 (21) Appendix B. Detailed Experiment Set-up This section describes the network architectures and settings for the experimental results in this paper. The tensorflow implementations for reproducing these results can be obtained from https://github.com/sungraepark/ Adversarial-Dropout. B.1. MNIST : Convolutional Neural Networks Following sub-sections show the propositions. Table 3: The CNN architecture used on MNIST A.1. Graph Edit Distance When we consider a neural network as a graph, we can apply the graph edit distance (Sanfeliu and Fu 1983) to measure relative difference between two dropouted networks, g1 and g2 , by dropout masks, 1 and 2 . The following is the definition of graph edit distance (GED) between two networks. GED(g1 , g2 ) = min(e1 ,...,ek )∈P (g1 ,g2 ) same as c(e) = 1, graph edit distance with two dropout masks can be interpreted as: k X c(ei ), (18) i=1 where P (g1 , g2 ) denotes the set of edit path transforming g1 into g2 , c(e) ≥ 0 is the cost of each graph edit operation e, and k is the number of the edit operations required to change g1 to g2 . For simplification, we only considered edge insertion and deletion operations and their cost are same as 1. When a hidden node (vertex) is dropped, the cost of the GED is Nl + Nu where Nl is the numbers of lower layer nodes and Nu is the number of upper layer nodes. If we consider a hidden node (vertex) is revival, change of GED is same as Nl + Nu . This leads following proposition. Proposition 1 Given two networks g1 and g2 , generated by two dropout masks 1 and 2 , and all graph edit costs are Name input conv1 pool1 drop1 conv2 pool2 drop2 conv3 pool3 adt dense1 dense2 output Description 28 X 28 image 32 filters, 1 x 1, pad=’same’, ReLU Maxpool 2 x 2 pixels Dropout, p = 0.5 64 filters, 1 x 1, pad=’same’, ReLU Maxpool 2 x 2 pixels Dropout, p = 0.5 128 filters, 1 x 1, pad=’same’, ReLU Maxpool 2 x 2 pixels Adversarial dropout, p = 0.5, δ = 0.005 Fully connected 2048 → 625 Fully connected 625 → 10 Softmax The MNIST dataset (LeCun et al., 1998) consists of 70,000 handwritten digit images of size 28 × 28 where 60,000 images are used for training and the rest for testing. The CNN architecture is described in Table 1. All networks were trained using Adam (Kingma and Ba 2014) with a learning rate of 0.001 and momentum parameters of β1 = 0.9 and β2 = 0.999. In all implementations, we trained the model for 100 epochs with minibatch size of 128. For the constraint of adversarial dropout, we set δ = 0.005, which indicates 10 (2048∗0.005) adversarial changes from the randomly selected dropout mask. In all training, we ramped up the trade-off parameter, λ, for proposed regularization term, LAdD . During the first 30 epochs, we used a Gaussian ramp-up curve exp[−5(1 − T )2 ], where T advances linearly from zero to one during the ramp-up period. The maximum values of λmax are 1.0 for VAdD (KL) and VAT , and 30.0 for VAdD (QE) and Π model. B.2. SVHN and CIFAR-10 : Supervised and Semi-supervised learning Table 4: The network architecture used on SVHN and CIFAR-10 Name input noise conv1a conv1b conv1c pool1 drop1 conv2a conv2b conv2c pool2 conv3a conv3b conv3c pool3 add dense output Description 32 X 32 RGB image Additive Gaussian noise σ = 0.15 128 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) 128 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) 128 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) Maxpool 2 x 2 pixels Dropout, p = 0.5 256 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) 256 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) 256 filters, 3 x 3, pad=’same’, LReLU(α = 0.1) Maxpool 2 x 2 pixels 512 filters, 3 x 3, pad=’valid’, LReLU(α = 0.1) 256 filters, 1 x 1, LReLU(α = 0.1) 128 filters, 1 x 1, LReLU(α = 0.1) Global average pool (6 x 6 → 1 x 1)pixels Adversarial dropout, p = 1.0, δ = 0.05 Fully connected 128 → 10 Softmax The both datasets, SVHN (Netzer et al. 2011) and CIFAR10 (Krizhevsky and Hinton 2009), consist of 32 × 32 colour images in ten classes. For these experiments, we used a CNN, which used by (Laine and Aila 2016; Miyato et al. 2017) described in Table 2. In all layers, we applied batch normalization for SVHN and mean-only batch normalization (Salimans and Kingma 2016) for CIFAR-10 with momentum 0.999. All networks were trained using Adam (Kingma and Ba 2014) with the momentum parameters of β1 = 0.9 and β2 = 0.999, and the maximum learning rate 0.003. We ramped up the learning rate during the first 80 epochs using a Gaussian ramp-up curve exp[−5(1 − T )2 ], where T advances linearly from zero to one during the rampup period. Additionally, we annealed the learning rate to zero and the Adam parameter, β1 , to 0.5 during the last 50 epochs. The number of total epochs is set as 300. These learning setting are same with (Laine and Aila 2016). For adversarial dropout, we set the maximum value of regularization component weight, λmax , as 1.0 for VAdD(KL) and 25.0 for VAdD(QE). We also ramped up the weight using the Gaussian ramp-up curve during the first 80 epochs. Additionally, we set δ as 0.05 and dropout probability p as 1.0, which means dropping 6 units among the full hidden units. We set minibatch size as 100 for supervised learning and 32 labeled and 128 unlabeled data for semisupervised learning. Appendix C. Definition of Notation In this section, we describe notations used over this paper. Table 5: The notation used over this paper. Notat. x y θ γ  δ λ D[y, y0 ] fθ (x) fθ (x, ρ) fθupper 1 fθunder 2 Description An input of a neural network A true label A set of parameters of a neural network A noise vector of additive Gaussian noise layer A binary noise vector of dropout layer A hyperparameter controlling the intensity of the adversarial perturbation A trade-off parameter controlling the impact of a regularization term A nonnegative function that represents the distance between two output vectors: cross entropy(CE), KL divergence(KL), and quadratic error (QE) An output vector of a neural network with parameters (θ) and an input (x) An output vector of a neural network with parameters (θ), an input (x), and noise (ρ) A upper part of a neural network, fθ (x, ), of a adversarial dropout layer where θ = {θ 1 , θ 2 } A under part of a neural network, fθ (x, ), of a adversarial dropout layer Appendix D. Performance Comparison with Other Models D.1. CIFAR-10 : Supervised classification results with additional baselines We compared the reported performances of the additional close family of CNN-based classifier for the supervised learning. As we mentioned in the paper, we did not consider the recent advanced architectures, such as ResNet (He et al. 2016) and DenseNet (Huang et al. 2016). D.2. CIFAR-10 : Semi-supervised classification results with additional baselines We compared the reported performances of additional baseline models for the semi-supervised learning. Our implementation reproduced the closed performance from their reported results, and showed the performance improvement from adversarial dropout. Table 6: Supervised learning performance on CIFAR-10. Each setting is repeated for five times. Method Network in Network (2013) All-CNN (2014) Deep Supervised Net (2015) Highway Network (2015) Π model (2016) Temportal ensembling (2016) VAT (2017) Π model (our implementation) VAT (our implementation) AdD VAdD (KL) VAdD (QE) VAdD (KL) + VAT VAdD (QE) + VAT Error rate (%) 8.81 7.25 7.97 7.72 5.56 5.60 5.81 5.77 ± 0.11 5.65 ± 0.17 5.46 ± 0.16 5.27 ± 0.10 5.24 ± 0.12 4.40 ± 0.12 4.73 ± 0.04 Table 7: Semi-supervised learning task on CIFAR-10 with 4,000 labeled examples. Each setting is repeated for five times. Method Ladder network (2015) CatGAN (2015) GAN with feature matching (2016) Π model (2016) Temportal ensembling (2016) Sajjadi et al. (2016) VAT (2017) Π model (our implementation) VAT (our implementation) VAdD (KL) VAdD (QE) VAdD (KL) + VAT VAdD (QE) + VAT Error rate (%) 20.40 19.58 18.63 12.36 12.16 11.29 10.55 12.62 ± 0.29 11.96 ± 0.10 11.68 ± 0.19 11.32 ± 0.11 10.07 ± 0.11 9.22 ± 0.10 Appendix E. Proof of Linear Regression Regularization In this section, we showed the detailed proof of regularization terms from adversarial training and adversarial dropout. Linear Regression with Adversarial Training Let xi ∈ RD be a data point and yi ∈ R be a target where i = {1, ..., N }. The objective of linear P regression is to find a w ∈ RD that minimizes l(w) = i kyi − xTi wk2 . To express adversarial examples, we denote x̃i = xi + radv as the adversarial example of xi where radv = i i δsign(5xi l(w)) utilizing the fast gradient sign method (FGSM) (Goodfellow, Shlens, and Szegedy 2014), δ is a controlling parameter representing the degree of adversarial noises. With the adversarial examples, the objective function of adversarial training can be viewed as follows: X T 2 lAT (w) = kyi − (xi + radv (22) i ) wk i This can be divided to lAT (w) = l(w) − 2 X (yi − xTi w)wT radv i (23) i + X T adv wT (radv i ) (ri )w i where l(w) is the loss function without adversarial noise. Note that the gradient is 5xi l(w) = −2(yi − xTi w)w, and aT sign(a) = kak1 . The above equation can be transformed as the following: X lAT (w) = l(w) + |δ 5xij l(w)| + δ 2 wT ΓAT w, ij (24) where ΓAT = P i sign(5xi l(w))T sign(5xi l(w)). Linear Regression with Adversarial Dropout To represent adversarial dropout, we denote x̃i = adv xi i as the adversarially dropped input of xi where adv = i argmax;ki −1k2 ≤k kyi − (i xi )T wk2 with the hyperparameter, k, controlling the degree of adversarial dropout. For simplification, we used one vector as the base condition of a adversarial dropout. If we applied our proposed algorithm, the adversarial dropout can be defined as follows:  0 if xij 5xij l(w) ≤ min{sik , 0} adv = (25) ij 1 otherwise where sik is the k th lowest element of xi 5xi l(w). This solution satisfies the constraint, ki − 1k2 ≤ k. With this adversarial dropout condition, the objective function of adversarial dropout can be defined as the following: X lAdD (w) = kyi − (adv xi )T wk2 (26) i i This can be divided to X lAdD (w) = l(w) + 2 (yi − xTi w)((1 − adv i ) xi )T w i (27) + X wT ((1 − adv i ) xi )T ((1 − adv i ) xi )w i The second term of the right handside can be viewed as X X 2 (yi − xTi w) (1 − adv (28) ij )xij wj . i j {j|adv ij By defining a set Si = = 0}, the second term can be transformed as the following. XX − −2(yi − xTi w)wj xij . (29) i j∈Si Note that the gradient is 5xij l(w) = −2(yi − xTi w)wj and xij 5xij l(w) is always negative when j ∈ Si . The second term can be re-defined as the following. XX |xij 5xij l(w)| (30) i j∈Si Finally, the objective function of adversarial dropout is reorganized. XX |xij 5xij l(w)| + wT ΓAdD w, lAdD (w) = l(w) + i j∈Si (31) where Si = {j|adv = 0} and ΓAdD = ij ) x xi )T ((1 − adv i ). i P i ((1 − adv i )
1cs.CV
Ref: International Conference on Artificial Neural Networks (ICANN), Springer LNCS, Vol. 10614, pp. 91–99, Alghero, Italy, September, 2017. DeepAPT: Nation-State APT Attribution Using End-to-End Deep Neural Networks arXiv:1711.09666v1 [cs.CR] 27 Nov 2017 Ishai Rosenberg, Guillaume Sicard, and Eli (Omid) David Deep Instinct Ltd {ishair, guillaumes, david}@deepinstinct.com Abstract. In recent years numerous advanced malware, aka advanced persistent threats (APT) are allegedly developed by nation-states. The task of attributing an APT to a specific nation-state is extremely challenging for several reasons. Each nation-state has usually more than a single cyber unit that develops such advanced malware, rendering traditional authorship attribution algorithms useless. Furthermore, those APTs use state-of-theart evasion techniques, making feature extraction challenging. Finally, the dataset of such available APTs is extremely small. In this paper we describe how deep neural networks (DNN) could be successfully employed for nation-state APT attribution. We use sandbox reports (recording the behavior of the APT when run dynamically) as raw input for the neural network, allowing the DNN to learn high level feature abstractions of the APTs itself. Using a test set of 1,000 Chinese and Russian developed APTs, we achieved an accuracy rate of 94.6%. 1 Introduction While malware detection is always a challenging research topic, a special challenge involves nation-state advanced persistent threats (APT), highly sophisticated and evasive malware. Since the usage of such cyber weapons might be considered an act of war [10], the question “which country is responsible?” could become critical. In this paper we use raw features of dynamic analysis to train a nation-state APT attribution classifier. The main contribution of this paper is providing the first nation-state APT attribution classifier, which achieves a high accuracy on the largest test set of available nation-state developed APTs ever collected, successfully attributing new malware families. The rest of the article is structured as follows: Section 2 contains the relevant related work to our use cases. Section 3 specifies the problem definition and the unique challenges in this domain, both with nation-state APT attribution in general and especially when using feature engineering. Section 4 contains our nation-state APT attribution classifier implementation and the experimental results. Section 5 contains our concluding remarks. 2 Background and Related Work There are numerous topics related to authorship attribution, such as plagiarism detection, books authorship attribution, source code authorship attribution and binary program authorship attribution. [15] provides a broad review of many of those topics, including the natural language processing (NLP) and traditional machine learning (ML) algorithms and the relevant features used, for example lexical (e.g., word frequencies), syntactic (e.g., sentence structure), semantic (e.g., synonyms), and application specific (such as a specific structure, for instance HTML). In the following sub-sections, we focus only on the ones relevant to our work (and ignoring those that are irrelevant, such as source code authorship attribution, which cannot be used in our case since a source code is not available for the APTs). 2.1 Binary Code Authorship Attribution Certain stylistic features can survive the compilation process and remain intact in binary code, which leads to the feasibility of authorship attribution for binary code. Rosenblum et al. [13] extracted syntax-based and semantic-based features using predefined templates, such as idioms (sequences of three consecutive instructions), n-grams, and graphlets. Machine learning techniques are then applied to rank these features based on their relative correlations with authorship. Alrabaee et al. [1] extracted a sequence of instructions with specific semantics and to construct a graph-based on register manipulation, where a machine learning algorithm is applied afterwards. Caliskan et al. [5] extracted syntactical features present in source code from decompiled executable binary. Though these approaches represent a great effort in authorship attribution, it should be noted that they were not applied to real malware. Furthermore, some limitations could be observed including weak accuracy in the case of multiple authors, being potentially thwarted by light obfuscation, and their inability to decouple features related to functionality from those related to authors styles. 2.2 Malware Attribution The difficulty in obtaining ground truth labels for samples has led much work in this area to focus on clustering malware, and the wide range of obfuscation techniques in common use have led many researchers to focus on dynamic analysis rather than static features (i.e., instead of examining the static file, focus on the report generated after running the file dynamically in a sandbox). The work of Pfeffer et al. [12] examines information obtained via both static and dynamic analysis of malware samples, in order to organize code samples into lineages that indicate the order in which samples are derived from each other. Alrabaee et al. [2] have used both features extracted from the disassembled malware code (such as idioms) and from the executable itself, used mutual information and information gain to rank them, and built an SVM classifier using the top ranked features. Those methods require a large amount of pre-processing and manual domain-specific feature engineering to obtain the relevant features. The malware attribution papers mentioned so far are applicable only to cases where a malware is an evolution of another malware (e.g., by mutation), or from the same family, functionality-wise. These methods are not effective when completely different families of malware are examined. Our paper presents a novel application of DNN for APT attribution, specifying which nation has developed a specific APT, when the APTs in question are not derivatives of one another, and belong to completely different families. The work of Marquis-Boire et al. [4] examines several static features intended to provide credible links between executable malware binary produced by the same authors. However, many of these features are specific to malware, such as command and control infrastructure and data exfiltration methods, and the authors note that these features must be extracted manually. To the best of our knowledge, this is the only available paper that explicitly dealt with nation-state APTs detection (using features common in them, such as APTs). However, those use cases are limited, and no accuracy or other performance measures were provided. In addition, the paper did not deal with classifying which nation developed the malware, and rather mentioned that one could use the similarities between a known (labeled) nationstate APT to an unknown one to infer the attribution of the latter. 3 Problem Definition: Nation-State APT Attribution Given an APT as an executable file, we would like to determine which nation state developed it. This is a multi-class classification problem, i.e., one label per candidate nation-state. 3.1 The Challenges of Nation-State Attribution Trying to classify the nation that developed an APT can be an extremely challenging task for several reasons that we cover here. Each nation-state has usually more than a single cyber unit developing such products, and there is more than a single developer in each unit. This means that the accuracy of traditional authorship attribution algorithms, which associates the author of source code or program using stylistic features in the source code, or such features that have survived the compilation, would be very limited. These APTs also use state-of-the-art evasion techniques, such-as anti-VM, antidebugging, code obfuscation and encryption ([16]), making feature extraction challenging. Moreover, the number of such available APTs is small, since such APTs tend to be targeted, used for specific purposes (and, unlike common criminal malware, not for monetary gain) and therefore are not available on many computers. Their evasion mechanisms make them hard to detect as well. This results in a further decrease in the training set size from which to learn. Finally, since nation states are aware that their APTs can be caught, they commonly might try to fool the security researchers examining the APT to think that another malware developer group (e.g., another nation) has developed it (e.g., by adding the APT strings in a foreign language, embedding data associated with a previously published malware, etc.). That is, unlike traditional authorship attribution problems, in this case the “authors” are actively trying to evade attribution and encourage false attribution. Despite these issues, manual nation-state APT attribution is performed, mostly based on functional similarities, shared command and control servers (C&Cs, which provide an accurate attribution), etc. For example, the APTs Duqu, Flame and Gauss were attributed to the same origin as Stuxnet following a very cumbersome advanced manual analysis ([3]). The question is: How can we overcome these challenges and create an automated classifier (that does not require lengthy manual analysis)? 3.2 Using Raw Features in DNN Classifications in the Cyber Security Domain One of Deep Neural Networks (DNN) greatest advantages is the ability to use raw features as input, while learning higher level features on its own during the training process. In this process, each hidden layer extracts higher level features from the previous layer, creating a hierarchy of higher-level features. This is the reason why deep learning classifiers perform better than traditional machine learning classifiers in complex tasks that requires domain-specific features such as language understanding [6], speech recognition, image recognition [17], etc. In such a framework the input is not high level features, which are derived manually based on limited dataset, thus not necessarily fitting the task at hand. Instead, the input is raw features (pixels in image processing, characters in NLP, etc.). The DNN learns a high-level hierarchy of the features during the training phase. The deeper the hidden layer is the higher the abstraction level of the features (higher-level features). While most previous work on applying machine learning to malware analysis relied on manually crafted features, David et al. [7] trained DNN on raw dynamic analysis reports to generate malware signatures for use in a malware family classification context. In this paper we similarly train a DNN on raw dynamic analysis reports but the goal is obtaining a different functionality (APT attribution rather than signature generation). The benefits of using raw features are: (1) Cheaper and less time consuming than manual feature engineering. This is especially true in the case of nation-state APTs, where the code requires a lot of time to reverse engineer in-order to gain insights about features, due to obfuscation techniques commonly used by it, as mentioned above. (2) Higher accuracy of Deep Learning classifiers, since important features are never overlooked. For instance, in our nation-state APT attribution classifier, mentioned in the next section, we have used the technique suggested in [11] to assess the contribution of each of our features, by multiplying (and summing up) their weights in the network, where the highest value indicates the most significant feature. We have seen that, besides the expected API calls and IP strings of C&C servers, arbitrary hexadecimal values were surprisingly some of the most important features. A security researcher might throw such addresses away, since they are useless. However, those values were the size of data of specific PE section which contained encrypted malicious shellcode, identifying a specific malware family. (3) More flexibility due to the ability to use the same features for different classification objectives. For instance, our nation-state APT attribution classifier uses the same raw features of the malware signature generator implemented in [7]. Therefore, we could implement both, using only a single feature extraction process. 4 Implementation and Experimental Evaluation The challenges mentioned in the previous section require a novel approach inorder to mitigate them. As mentioned before, the problem at hand is not a regular authorship attribution problem, since more than a single developer is likely to be involved, some of them might be replaced in the middle of the development. This makes regular authorship attribution algorithms, using personal stylistic features irrelevant. Another approach would be to consider all of the same nation state APTs as a part of a single malware family. The rationale is that common frameworks and functionality should exist in different APTs from the same nation. However, this is also not accurate: each nation might have several cyber units, each with its own targets, frameworks, functionality, etc. Thus, it would be more accurate to look at this classification task as a malicious/benign classifier: each label might contain several “families” (benign web browsers, malicious ransomware, etc.) that might have very little in common. Fortunately, DNN is known to excel in such complex tasks. This brings us to the usage of raw features: since we do not know how many “actual APT families” are available in the dataset, we need to use raw features, letting the DNN build its feature abstraction hierarchy itself, taking into account all available APT families, as mentioned in section 1. 4.1 Raw Features Used A sandbox analysis report of an executable file can provide a lot of useful information, which can be leveraged for many different classification tasks. In order to show the advantages of using raw features by a DNN classifier, we have chosen raw features that can be used for different classification tasks. Cuckoo Sandbox is a widely used open-source project for automated dynamic malware analysis. It provides static analysis of the analyzed file: PE header metadata, imports, exports, sections, etc. Therefore, it can provide useful information even in the absence of dynamic analysis, due to, e.g., anti-VM techniques used by nation-state APTs. Cuckoo Sandbox also provides dynamic analysis and monitors the process system calls, their arguments and their return value. Thus, it can provide useful information to mitigate obfuscation techniques used by nation-state APTs. We have decided to use Cuckoo Sandbox reports as raw data for our classifiers due to their level of detail, configurability, and popularity. We used Cuckoo Sandbox default configuration. Our purpose was to let our classifiers learn the high-level abstraction hierarchy on their own, without involving any manual or domain-specific knowledge. Thus, we used words only, which are basic raw features commonly used in the text analysis domain. Although Cuckoo reports are in JSON format, which can be parsed such that specific information is obtained from them, we did not perform any parsing. In other words, we treated the reports as raw text, completely ignoring the formatting, syntax, etc. Our goal was to let our classifiers learn everything on their own, including JSON parsing, if necessary. Therefore, the markup and tagged parts of the files were extracted as well. For instance, in "api: CreateFileW" the terms extracted are "api" and "CreateFileW", while completely ignoring what each part means. Specifically, our method follows the following simple steps to convert sandbox files into fixed size inputs to the neural network: (1) Select as features the top 50,000 words with highest frequency in all Cuckoo reports, after removing the words which appear in all files. The rationale is that words which appear in all files, and words which are very uncommon do not contain lots of useful information. (2) Convert each sandbox file to a 50,000-sized bit string by checking whether each of the 50,000 words appear in it. That is, for each analyzed Cuckoo report, feature[i]=1 if the i-th most common word appears in that cuckoo report, or 0 otherwise. In other words, we first defined which words participated in our dictionary (analogous to the dictionaries used in NLP, which usually consist of the most frequent words in a language) and then we checked each sample against the dictionary for the presence of each word, thus producing a binary input vector. 4.2 Network Architecture and Hyper-Parameters We trained a classifier based on Cuckoo reports of samples of APT which were developed (allegedly) by nation-states. Due to the small quantity of available samples, we used only two classes: Russia and China (which are apparently the most prolific APT developers). Our training-set included 1,600 files from each class (training set size of 3,200 samples) of dozens of known campaigns of nation-developed APTs. 200 samples from the training set were used as a validation set. The test set contained additional 500 files from each class (test set size of 1,000 files). The labels (i.e., ground-truth attribution) of all these files are based on well-documented and extended manual analyses within the cyber-security community, conducted during the past years. Note that the above-mentioned separation between training and test sets completely separates between different APT families as well. That is, if an APT family is in test set, then all its variations are also in test set only. This makes the training challenge much more difficult (and more applicable to real-world), as in many cases inevitably we will be training on APT developed by one group of developers, and testing on APT developed by a completely different group. Our DNN architecture is a 10-layers fully-connected neural network, with 50,0002,000-1,000-1,000-1,000-1,000-1,000-1,000-500-2 neurons, (that is, 50,000 neurons on the input layer, 2,000 in the first hidden layer, etc.), with an additional output softmax layer. We used a dropout ([14]) rate of 0.5 (ignoring 50% of the neurons in hidden layers for each sample) and an input noise (zeroing) rate of 0.2 (ignoring 20% of input neurons) to prevent overfitting. A ReLU ([8]) activation function was used, and an initial learning rate of 10−2 which decayed to 10−5 over 1000 epochs. These hyper-parameters were optimized using the validation set. 4.3 Experimental Evaluation Following the training phase, we tested the accuracy of the DNN model over the test set. The accuracy for the nation-state APT attribution classifer was 94.6% on the test set, which contained only families that were not in the training set. These are test accuracies are surprising in light of the complete separation of malware families between train and test sets. Inevitably in many cases the developers or even the developing units of the APT in train and test sets are different (e.g., APTs in train set developed by one Chinese cyber unit, and APTs in test set developed by another Chinese cyber unit). Given this strict separation, and in light of the high accuracy results obtained, the results lead to the conclusion that each nation-state has (apparently) different sets of methodologies for developing APTs, such that two separate cyber units from nation A are still more similar to each other than to a cyber unit from nation B. 5 Concluding Remarks In this paper we presented the first successful method for automatic APT attribution to nation-states, using raw dynamic analysis reports as input, and training a deep neural network for the attribution task. The use of raw features has the advantages of saving costs and time involved in the manual training and analysis process. It also prevents losing indicative data and classifier accuracy, and allows flexibility, using the same raw features for many different classification tasks. Our results presented here lead to the conclusion that despite all the efforts devoted by nation states and their different cyber units in developing unattributable APTs, it is still possible to reach a rather accurate attribution. Additionally, different nation-states use different APT developing methodologies, such that the works of developers in separate cyber units are still sufficiently similar to each other that allow for attribution. While the work presented here could help facilitate automatic attribution of nation-state attacks, we are aware that nation-states could subvert the methods presented here such that they would modify their new APTs to lead to their misclassification and attribution to another nation-state. For example, using deep neural networks themselves, they could employ generative adversarial networks (GAN)[9] to modify their APT until it successfully fools our classifier into attributing it to another nation-state. Applying GAN for APT modification would prove very difficult, but theoretically possible. In our future works in this area we will examine additional nation state labels (multi-class classifier), once larger datasets of such APTs become available. References 1. Alrabaee, S., Saleem, N., Preda, S., Wang, L., and Debbabi, M. Oba2: an onion approach to binary code authorship attribution. Digital Investigation 11, S94-S103, 2014. 2. Alrabaee, S., Shirani, P., Debbabi, M. and Wang, L. On the Feasibility of Malware Authorship Attribution. arXiv preprint arXiv:1701.02711, 2017. 3. Bencsath, B., Pek G., Buttyan L., Felegyhazi M., The Cousins of Stuxnet: Duqu, Flame, and Gauss, in Proc. of Future Internet, 2012. 4. Marquis-Boire, M., Marschalek, M., and Guarnieri, C.. Big game hunting: The peculiarities in nation-state malware research. In Proc. of Black Hat USA, 2015. 5. Caliskan-Islam, A., Yamaguchi, F., Dauber, E., Harang, R., Rieck, K., Greenstadt, R., and Narayanan, A. When coding style survives compilation: De-anonymizing programmers from executable binaries. arXiv preprint arXiv:1512.08546, 2015. 6. Collobert R., Weston J., Bottou L., Karlen M., Kavukcuoglu K. and Kuksa P. Natural Language Processing (Almost) from Scratch. Journal of Machine Learning Research, 12:2493- 2537, 2011. 7. David O.E. and Netanyahu N.S. DeepSign: Deep learning for automatic malware signature generation and classification. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), pp. 1–8, 2015. 8. Glorot, X., Bordes, A. & Bengio. Y. Deep sparse rectifier neural networks. In Proc. 14th International Conference on Artificial Intelligence and Statistics 315–323, 2011. 9. Goodfellow I.J., Pouget-Abadie J., Mirza M., Xu B., Warde-Farley D., Ozair S., Courville A.C., Bengio Y.: Generative Adversarial Nets. In Advances in Neural Information Processing Systems (NIPS), pp. 2672–2680, 2014. 10. Hathaway, O. A. and Crootof, R. The Law of Cyber-Attack. Faculty Scholarship Series. Paper 3852, 2012. 11. Olden, J.D., Jackson, D.A. Illuminating the ’black-box’: a randomization approach for understanding variable contributions in artificial neural networks. Ecological Modelling. 154:135-150, 2002. 12. Pfeffer, A., Call, C., Chamberlain, J., Kellogg, L., Ouellette, J., Patten, T., Zacharias, G., Lakhotia, A., Golconda, S., Bay, J., Hall, R., Scofield, D.: Malware analysis and attribution using genetic information. In: Proceedings of the 7th IEEE International Conference on Malicious and Unwanted Software, 2012. 13. Rosenblum, N., Zhu, X., and Miller, B. P. Who wrote this code? identifying the authors of program binaries. In Computer Security-ESORICS 2011, pp. 172-189, 2011. 14. Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I. & Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. J. Machine Learning Res. 15, 1929–1958, 2014. 15. Stamatatos, E. A survey of modern authorship attribution methods. J. Am. Soc. Inf. Sci. Technol., 60(3):538–556, ISSN 1532-2882, 2009. 16. Virvilis N., Gritzalis D., The Big Four - What we did wrong in protecting critical ICT infrastructures from Advanced Persistent Threat detection?, in Proc. of the 8th International Conference on Availability, Reliability & Security, pp. 248- 254, IEEE, 2013. 17. Zeiler, M. D. and Fergus, R. Visualizing and understanding convolutional networks. In: Proc. ECCV, 2014.
9cs.NE
arXiv:1802.03631v1 [math.AC] 10 Feb 2018 COMMUTATIVE RINGS OVER WHICH THE SUPPORT OF ANY MODULE IS THE COLLECTION OF PRIME IDEALS CONTAINING THE ANNIHILATOR SOUVIK DEY Abstract : The support of any module over a commutative ring is defined as the collection of all prime ideals of the ring at which the localization of the module is non-zero. For finitely generated modules, the support is the collection of all prime ideals containing the annihilator of the module. In this article, we raise the natural question that over which commutative rings, the support of every module is the collection of all the prime ideals of its annihilator. We completely classify such rings, and in the process it also comes out that it is enough to require that only for countably generated modules, the support is the collection of all prime ideals containing the annihilator of the module. Let R be a commutative ring with unity. Let Spec R denote the set of all prime ideals of R as usual. For any subset S ⊆ R, let us denote as usual, V (S) := {p ∈ Spec R : S ⊆ p}. For a module M over R, the support of M , denoted by Supp(M ), is defined as Supp(M ) := {p ∈ Spec(R) : Mp 6= 0}. It is a standard fact that Supp(M ) is non-empty for every non-zero R-module M , and also it is well-known that Supp(M ) = V (Ann M ) , for every finitely generated Rmodule M . In view of this, it is interesting to ask, if we can characterize those commutative rings over which every module M (not only the finitely generated ones) satisfies the relation Supp(M ) = V (Ann M ). The purpose of this article is to provide a complete answer to this question by characterizing such rings. The notations and relevant concepts that we use can be found in [1]. We first begin with a lemma, probably well-known, which will be helpful in proving our main characterization. Lemma : Let R be a zero-dimensional ring (all prime ideals maximal) with fiQ R via the natural localization map in each nite spectrum. Then R ∼ = p∈Spec R p co-ordinate. Also, any R-module M is isomorphic with ⊕p∈Spec R Mp . Proof. Let p ∈ Spec(R) and J(p) be the kernel of the usual localization map R → Rp . Since R is zero-dimensional, so is Rpp, hence pRp is the unique prime ideal of Rp , hence p it ispthe nilradical. So J(p) = p. So for distinct prime ideals p, q of R, J(p), J(q) are co-maximal (every prime ideal is maximal) , so J(p), J(q) are co-maximal. Moreover, ∩p∈SpecQ R J(p) = 0. Hence by ∼ Chinese Remainder theorem, R ∼ R/ ∩ J(p) = = p∈Spec R R/J(p). Let p∈Spec R Q | Spec R| = n. Then p∈Spec R R/J(p) being a direct product of n many nonP zero rings, has p∈Spec R rp many prime ideals, where rp is the number of prime 1 2 SOUVIK DEY P Q ideals in R/J(p). But R ∼ = p∈Spec R R/J(p), so n = p∈Spec R rp , hence each rp = 1, so each R/J(p) is zero-dimensional, local. We are done if we can show that Rp ∼ = R/J(p) induced by the natural projection map. So fix a prime ideal p. Let S = R \ p. Let π : R → R/J(p) be p the natural projection map. Since R/J(p) is local with the unique prime ideal J(p)/J(p) = p/J(p), so π(s) is a unit in R/J(p) for every s ∈ S. π(a) = 0 =⇒ a ∈ J(p)=kernel of the localization map =⇒ a/1 = 0 in Rp =⇒ sa = 0 for some s ∈ S. Moreover π is surjective −1 , so every element of R/J(p) is of the form π(a)π(s) . Hence there is a unique isomorphism h : Rp → R/J(p) such that a + J(p) = π(a) = h(a/1), ∀a ∈ R. Thus Q R∼ = p∈Spec R Rp via the natural localization map in each co-ordinate. Q The module case is similar. Letting ep be the element of p∈Spec R Rp whose p coordinate is 1 and rest is 0, it is easy to verify that M is the direct sum of submodules ep M and each such ep M is naturally isomorphic with Mp .  Now we state and prove our main result. Theorem : Let R be a commutative ring with unity. Then TFAE: i) For every countably generated module M over R, Supp(M ) = V (Ann M ). ii) Spec R is a finite discrete space in the Zariski-topology i.e. R has finitely many prime ideals and all of them are maximal. iii) For every module M over R, Supp(M ) = V (Ann M ). Proof. (i) =⇒ (ii): Suppose Supp(M ) = V (Ann M ) for every countably generated R-module M . We will first prove that every prime ideal in R is maximal. Suppose p ⊂ R is prime but not maximal. Let S = R/p; then S is a domain but not a field. Let a ∈ S be a nonzero element which is not a unit, consider the countably T and L n n (a ) ⊂ S and let J be the S/(a ). Let I = generated R-module M = n n∈N inverse image of I in R. It is clear that I is the annihilator of M as an S-module, so J is the annihilator of M as an R-module. On the other hand, I generates a proper ideal in the localization S[a−1 ]. Indeed, since a is not a zero divisor, the only way I could fail to generate a proper ideal is if an ∈ I for some n, which would imply an ∈ (an+1 ) so an = an+1 b for some b ∈ S. Again since a is not a zero divisor, this implies 1 = ab so a is a unit, contrary to our choice of a. Thus I generates a proper ideal in S[a−1 ], and we can extend it to a maximal ideal. This maximal ideal pulls back to a prime ideal q ⊂ R such that J ⊆ q but ā 6∈ q where ā ∈ R is an element whose image in S is a. Since every element of M is annihilated by some power of ā, Mq = 0, so q 6∈ Supp(M ). But since J ⊆ q, q ∈ V (J) = V (AnnM). This contradicts our assumption that Supp(M ) = V (Ann M ) for all countably generated R-modules M . Thus every prime in R is maximal. Now if p is any maximal ideal, the module R/p has support {p}. Thus Lfor any countable subset A ⊆ Spec R, the countably generated R-module M = p∈A R/p has support A. Since Supp(M ) = V (AnnM) and V (I) is a closed set for any ideal I, this implies every countable subset of Spec R is closed. Now since any subset of a countable set is also countable, hence we see that every countable subset of Spec R is discrete. Now Spec R is compact, so every countable subset of Spec R , being closed, is also compact, hence every countable COMMUTATIVE RINGS OVER WHICH THE SUPPORT OF ANY MODULE IS THE COLLECTION OF PRIME IDEALS CONTA subset of Spec R is discrete and compact, so finite. Thus Spec R is finite. (ii) =⇒ (iii): Suppose R is a ring such that Spec R is a finiteQdiscrete space. Then, by the Lemma, R can be identified with the finite product p Rp of its localizations at all its prime ideals. When Q we make this identification, each prime ideal p corresponds to the elements of p Rp whose p-coordinate is in the unique maximal L ideal of Rp . Also, any R-module M is naturally isomorphic to the direct sum p Mp of its localizations at all the prime ideals. The annihilator of M is then Q Q the product p AnnRp Mp ⊆ p Rp . Thus Ann M ⊆ p iff AnnRp Mp is contained in the unique maximal ideal of Rp . Since any proper ideal in Rp is contained in the unique maximal ideal, this means Ann M ⊆ p iff Mp 6= 0. That is, p ∈ V (Ann M ) iff p ∈ Supp(M ), so Supp(M ) = V (Ann M ). (iii) =⇒ (i): obvious.  References [1] Michael Francis Atiyah, Ian G. Macdonald, Introduction to Commutative Algebra. E-mail address: [email protected]
0math.AC
Multilayer Bootstrap Networks Xiao-Lei Zhang∗ Center for Intelligent Acoustics and Immersive Communications, School of Marine Science and Technology, Northwestern Polytechnical University, China arXiv:1408.0848v8 [cs.LG] 6 Mar 2018 Abstract Multilayer bootstrap network builds a gradually narrowed multilayer nonlinear network from bottom up for unsupervised nonlinear dimensionality reduction. Each layer of the network is a nonparametric density estimator. It consists of a group of k-centroids clusterings. Each clustering randomly selects data points with randomly selected features as its centroids, and learns a one-hot encoder by one-nearest-neighbor optimization. Geometrically, the nonparametric density estimator at each layer projects the input data space to a uniformly-distributed discrete feature space, where the similarity of two data points in the discrete feature space is measured by the number of the nearest centroids they share in common. The multilayer network gradually reduces the nonlinear variations of data from bottom up by building a vast number of hierarchical trees implicitly on the original data space. Theoretically, the estimation error caused by the nonparametric density estimator is proportional to the correlation between the clusterings, both of which are reduced by the randomization steps. Keywords: Resampling, ensemble, nearest neighbor, tree 1. Introduction Principal component analysis (PCA) (Pearson, 1901) is a simple and widely used unsupervised dimensionality reduction method, which finds a coordinate system in the original Euclidean space that the linearly uncorrelated coordinate axes (called principal components) describe the most variances of data. Because PCA is insufficient to capture highly-nonlinear data distributions, many dimensionality reduction methods are explored. Dimensionality reduction has two core steps. The first step finds a suitable feature space where the density of data with the new feature representation can be well discovered, i.e. a density estimation problem. The second step discards the noise components or small variations of the data with the new feature representation, i.e. a principal component reduction problem in the new feature space. Dimensionality reduction methods are either linear (He & Niyogi, 2004) or nonlinear based on the connection between the data space and the feature space. This paper focuses on nonlinear methods, which can be categorized to three classes. The first class is kernel methods. It first projects data to a kernelinduced feature space, and then conducts PCA or its variants in the new space. Examples include kernel PCA (Schölkopf et al., 1998), Isomap (Tenenbaum et al., 2000), locally linear embedding (LLE) (Roweis & Saul, 2000), Laplacian eigenmaps (Shi & Malik, 2000; Ng et al., 2002; Belkin & Niyogi, 2003), t-distributed stochastic neighbor embedding (t-SNE) (Van der ∗ Corresponding author Email address: [email protected], [email protected] (Xiao-Lei Zhang) URL: www.xiaolei-zhang.net (Xiao-Lei Zhang) Preprint submitted to Neural Networks Maaten & Hinton, 2008), and their generalizations (Yan et al., 2007; Nie et al., 2011). The second class is probabilistic models. It assumes that data are generated from an underlying probability function, and takes the posterior parameters as the feature representation. Examples include Gaussian mixture model and latent Dirichlet allocation (Blei et al., 2003). The third class is autoassociative neural networks (Hinton & Salakhutdinov, 2006). It learns a piecewise-linear coordinate system explicitly by backpropagation, and uses the output of the bottleneck layer as the new representation. However, the feature representations produced by the aforementioned methods are defined in continuous spaces. A fundamental weakness of using a continuous space is that it is hard to find a simple mathematical form that transforms the data space to an ideal continuous feature space, since a real-world data distribution may be non-uniform and irregular. To overcome this difficulty, a large number of machine learning methods have been proposed, such as distance metric learning (Xing et al., 2002) and kernel learning (Lanckriet et al., 2004) for kernel methods, and Dirichlet process prior for Baysian probabilistic models (Teh et al., 2005), in which advanced optimization methods have to be applied. Recently, learning multiple layers of nonlinear transforms, named deep learning, is a trend (Hinton & Salakhutdinov, 2006). A deep network contains more than one nonlinear layers. Each layer consists of a group of nonlinear computational units in parallel. Due to the hierarchical structure and distributed representation at each layer, the representation learning ability of a deep network is exponentially more powerful than that of a shallow network when given the same number of nonlinear units. However, the development of deep learning was mostly supervised, e.g. (Schmidhuber, 2015; Hinton et al., 2012; Wang & Chen, 2017; He et al., 2016; March 7, 2018 Zhou & Feng, 2017; Wang et al., 2017). To our knowledge, deep learning for unsupervised dimensionality reduction seems far from explored (Hinton & Salakhutdinov, 2006). To overcome the aforementioned weakness in a simple way, we revisit the definition of frequentist probability for the density estimation subproblem of dimensionality reduction. Frequentist probability defines an event’s probability as the limit of its relative frequency in a large number of trials (Wikipedia, 2017). In other words, the density of a local region of a probability distribution can be approximated by counting the events that fall into the local region. This paper focuses on exploring this idea. To generate the events, we resort to random resampling in statistics (Efron, 1979; Efron & Tibshirani, 1993). To count the events, we resort to one-nearest-neighbor optimization and binarize the feature space to a discrete space. To further reduce the small variations and noise components of data, i.e. the second step of dimensionality reduction, we extend the density estimator to a gradually narrowed deep architecture, which essentially builds a vast number of hierarchical trees on the discrete feature space. The overall simple algorithm is named multilayer bootstrap networks (MBN). To our knowledge, although ensemble learning (Breiman, 2001; Freund & Schapire, 1995; Friedman et al., 2000; Dietterich, 2000; Tao et al., 2006), which was triggered by random resampling, is a large family of machine learning, it is not very prevalent in unsupervised dimensionality reduction. Furthermore, we did not find methods that estimate the density of data in discrete spaces by random resampling, nor their extensions to deep learning. This paper is organized as follows. In Section 2, we describe MBN. In Section 3, we give a geometric interpretation of MBN. In Section 4, we justify MBN theoretically. In Section 5, we study MBN empirically. In Section 6, we introduce some related work. In Section 7, we summarize our contributions. PCA Layer 3 (k=2) Cyclic-sh Layer 2 (k=3) W1 W2 W3 (b) Layer 1 (k=6) (a) Figure 1: Network structure. The dimension of the input data for this demo network is 4. Each colored square represents a k-centroids clustering. Each layer contains 3 clusterings. Parameters k at layers 1, 2, and 3 are set to 6, 3, and 2 respectively. The outputs of all clusterings in a layer are concatenated as the input of their upper layer. • Random sampling of features. The first step randomly selects d̂ dimensions of X (d̂ ≤ d) to form a subset of X , denoted as X̂ = {x̂1 , . . . , x̂n }. • Random sampling of data. The second step randomly selects k data points from X̂ as the k centroids of the clustering, denoted as {w1 , . . . , wk }. • One-nearest-neighbor learning. The new representation of an input x̂ produced by the current clustering is an indicator vector h which indicates the nearest centroid of x̂. For example, if the second centroid is the nearest one to x̂, then h = [0, 1, 0, . . . , 0]T . The similarity metric between the centroids and x̂ at the bottom layer is customized, e.g. the squared Euclidean distance arg minki=1 kwi − x̂k2 , and set to arg maxki=1 wTi x̂ at all other hidden layers. 2.3. Novelty and advantages Two novel components of MBN distinguish it from other dimensionality reduction methods. The first component is that each layer is a nonparametric density estimator based on resampling, which has the following major merits: 2. Multilayer bootstrap networks 2.1. Network structure • It estimates the density of data correctly without any predefined model assumptions. As a corollary, it is insensitive to outliers. MBN contains multiple hidden layers and an output layer (Fig. 1). Each hidden layer consists of a group of mutually independent k-centroids clusterings; each k-centroids clustering has k output units, each of which indicates one cluster; the output units of all k-centroids clusterings are concatenated as the input of their upper layer. The output layer is PCA. The network is gradually narrowed from bottom up, which is implemented by setting parameter k as large as possible at the bottom layer and be smaller and smaller along with the increase of the number of layers until a predefined smallest k is reached. • The representation ability of a group of k-centroids clusterings is exponentially more powerful than that of a single k-centroids clustering. • The estimation error introduced by binarizing the feature space can be controlled to a small value by simply increasing the number of the clusterings. The second component is that MBN reduces the small variations and noise components of data by an unsupervised deep ensemble architecture, which has the following main merits: 2.2. Training method MBN is trained layer-by-layer from bottom up. For training each layer given a d-dimensional input data set X = {x1 , . . . , xn } either from the lower layer or from the original data space, we simply need to focus on training each k-centroids clustering, which consists of the following steps: • It reduces larger and larger local variations of data gradually from bottom up by building as many as O(kL 2V ) hierarchical trees on the data space (instead of on data points) 2 Step 2: Application Prediction of training data output are close to each other in a distribution with a small variance (e.g., x3 and x4 in a distribution P2 ). If we use the Euclidean distance as the similarity metric, then the similarity between x1 and x2 is smaller than that between x3 and x4 , which is not true. The proposed method provides a simple solution to the above similarity metric learning problem. It outputs a new feature representation of x1 as follows. Each k-centroids clustering contributes a neighboring centroid of x1 . The centroid partitions the local region of x1 to two disconnected parts, one containing x1 and the other not. The data point x1 owns a local region supported by the centroids of all clusterings that are closest to the data point.1 These centroids partition the local region to as many as O(2V ) fractions. Each fraction is represented as a unique binary code at the output space of the estimator in a way illustrated in Fig. 4.2 The new representation of x1 in the output feature space is a binary code that represents the local fraction of the data space where x1 is located. With the new representation, the similarity between two data points is calculated by counting the number of the nearest centroids they share in common—a method in frequentist methodology. In Fig. 3, (i) if the local region in P1 is partitioned in the same way as the local region in P2 , and if the only difference between them is that the local region in P1 is an amplification of the local region in P2 , then the surfaces of the two local regions are the same in the discrete feature space. (ii) x1 and x2 share 5 common nearest centroids, and x3 and x4 also share 5 common nearest centroids, so that the similarity between x1 and x2 in P1 equals to the similarity between x3 and x4 in P2 . Note that because V k-centroids clusterings are able to partition the data space to O(k2V ) fractions at the maximum, its representation ability is exponentially more powerful than a single k-centroids clustering. 10 5 15x400 30x400 65x400 125x400 Step 1: MBN training 250x400 500x400 Input 1000x400 10 2000x400 2048 4000x400 2048 784 784 Step 3: NN training Figure 2: Principle of compressive MBN. The numbers are the dimensions of representations. implicitly, where L is the total number of layers, kL is parameter k at the L-th layer, V is the number of the clusterings at the layer, and function O(·) is the order in mathematics. • It does not inherit the problems of deep neural networks such as local minima, overfitting to small-scale data, and gradient vanishing, since it is trained simply by random resampling and stacking. As a result, it can be trained with as many hidden layers as needed and with both small-scale and large-scale data. See Sections 3 and 4 for the analysis of the above properties. 2.4. Weaknesses The main weakness of MBN is that the size of the network is large. Although MBN supports parallel computing, its prediction process is inefficient, compared to a neural network. To overcome this weakness, we propose compressive MBN (Fig. 2). Compressive MBN uses a neural network to learn a mapping function from the training data to the output of MBN at the training stage, and uses the neural network for prediction. More generally, if MBN is applied to some specific task, then we can use compressive MBN to learn a mapping function from the input data to the output of the task directly. 3.2. Dimensionality reduction by a deep ensemble architecture The nonparametric density estimator captures the variances of the input data, however, it is not responsible for reducing the small variances and noise components. To reduce the nonlinear variations, we build a gradually narrowed deep network. The network essentially reduces the nonlinear variations of data by building a vast number of hierarchical trees on the data space (instead of on data points) implicitly. We present its geometric principle as follows. Suppose MBN has L layers, parameters k at layers 1 to L are k1 , k2 , . . . , kL respectively, and k1 > k2 > . . . > kL . From Fig. 4, we know that the l-th layer partitions the input data space to O(kl 2V ) disconnected small fractions. Each fraction is encoded as a single point in the output feature space. The points in the output feature space are the nodes of the trees. Hence, the l-th layer has O(kl 2V ) nodes. The bottom layer has O(k1 2V ) leaf nodes. The top layer has O(kL 2V ) root nodes, which is the number of the trees that MBN builds. 3. Geometric interpretation In this section, we analyze the two components of MBN from the geometric point of view. 3.1. Feature learning by a nonparametric density estimator based on resampling As presented in Section 1, a core problem of machine learning is to find a suitable similarity metric that maps the original data space to a uniformly-distributed feature space. Here we give an example on its importance. As shown in Fig. 3, the similarity between the data points that are far apart in a distribution with a large variance (e.g., x1 and x2 in a distribution P1 ) might be the same as the similarity between the data points that 1 It is important to keep parameter k of the k-centroids clusterings in a layer the same. Otherwise, the density of the centroids between the clusterings are different, that is to say, if we regard the centroids as the coordinates axes of the local region, then the coordinate axes are built in different data spaces. 2 A small fraction should not have to contain data points as shown in Fig. 4. 3 (a) (b) 001010 001 001001 X1 100 001100 X2 100001 100100 100010 X4 X3 010001 010 010100 010010 (b) (a) Figure 3: Illustration of the similarity metric problem at the data space. (a) The similarity problem of two data points x1 (in red color) and x2 (in blue color) in a distribution P1 . The local region of x1 (or x2 ) is the area in a colored circle that is centered at x1 (or x2 ). The small hollow points that lie in the cross area of the two local regions are the shared centroids by x1 and x2 . (b) The similarity problem of two data points x3 and x4 in a distribution P2 . 000 100 10 x1 11 1 110 x1 00 0 010 011 01 (a) 101 x1111 001 (c) (b) Figure 4: Encoding the local region of a data point x1 (in blue color) by (a) one k-centroids clustering, (b) two k-centroids clusterings, and (c) three k-centroids clusterings. The centroids of the three k-centroids clusterings are the points colored in red, black, and green respectively. The local region of a centroid is the area in the circle around the centroid. The centroid itself and the edge of its local region are drawn in the same color. For two adjacent layers, because kl−1 < kl , it is easy to see that O(kl−1 /kl ) neighboring child nodes at the (l−1)-th layer will be merged to a single father node at the l-th layer on average. To generalize the above property to the entire MBN, a single root node at the L-th layer is a merging of O(k1 /kL ) leaf nodes at the bottom layer, which means that the nonlinear variations among the leaf nodes that are to be merged to the same root node will be reduced completely. Because kL  k1 , we can conclude that MBN is highly invariant to the nonlinear variations of data. 4. Theoretical analysis Although MBN estimates the density of data in the discrete feature space, its estimation error is small and controllable. Specifically, as shown in Fig. 4c, V k-centroids clusterings can partition a local region to O(2V ) disconnected small fractions at the maximum. It is easy to imagine that, for any local region, when V is increasing and the diversity between the centroids is still reserved, an ensemble of k-centroids clusterings approximates the true data distribution. Because the diversity is important, we have used two randomized steps to enlarge it. In the following, we analyze the estimation error of the proposed method formally: One special case is that, if kL = 1, the output feature spaces of all k-centroids clusterings at the top layer are just a single point. However, in practice, we never set kL = 1; instead, we usually set the termination condition of MBN as kL ≥ 1.5c where c is the ground-truth number of classes. The termination condition makes each k-centroids clustering stronger than random guess (Schapire, 1990). Theorem 1. The estimation error of the building block of MBN Eensemble and the estimation error of a single k-centroids clustering Esingle have the following relationship: ! ! 1 1 Eensemble = + 1− ρ Esingle (1) V V where ρ is the pairwise positive correlation coefficient between the k-centroids clusterings, 0 ≤ ρ ≤ 1. Note that because O(k2V )  n, the data points are distributed sparsely in the output feature space. Hence, MBN seldom merges data points. In other words, MBN learns data representations instead of doing agglomerative data clustering. Proof. We prove Theorem 1 by first transferring MBN to a supervised regression problem and then using the bias-variance 4 decomposition of the mean squared error to get the bias and variance components of MBN. The detail is as follows. Suppose the random samples for training the k-centroids clusterings are identically distributed but not necessarily independent, and the pairwise positive correlation coefficient between two random samples (i.e., {wv1 ,i }ki=1 and {wv2 , j }kj=1 , ∀v1 , v2 = 1, . . . , V and v1 , v2 ) is ρ, 0 ≤ ρ ≤ 1. We focus on analyzing a given point x, and assume that the true local coordinate of x is s which is an invariant point around x and usually found when the density of the nearest centroids around x goes to infinity (i.e. n → ∞, V → ∞, {wv }Vv=1 are identically and independently distributed, and parameter k is unchanged). We also suppose that x is projected to ŝ when given a finite number of nearest centroids {wv }Vv=1 . The correlation coefficient between the centroids {wv }Vv=1 is ρ. Note that s is used as an invariant reference point for studying ŝ. The effectiveness of MBN can be evaluated by the estimation error of the estimate ŝ to the truth s. The estimation error is defined by E(ks − ŝk2 ) where E(·) is the expectation of a random variable. From the geometric interpretation, we know that each wv owns a local space S v , and moreover, both s and ŝ are in S v . When parameter k → n, S v is small enough to be locally linear. Under the above fact and an assumption that the features of wv , i.e. wv,1 , . . . , wv,d , . . . , wv,D , are uncorrelated, we are able to assume that wv follows a multivariate normal distribution around s: wv ∼ MN (s, σ2 I) where I is the identity matrix, σ describes the variance of wv and σ2 I is the covariance matrix. We can PD further derive E(ks − ŝk2 ) = d=1 E((sd − ŝd )2 ) where we denote T s = [s1 , . . . , sD ] and ŝ = [ ŝ1 , . . . , ŝD ]T . In the following, we focus on analyzing the estimation error at a single dimension E((sd − ŝd )2 ) and will omit the index d for clarity. It is known that the mean squared error of a regression problem can be decomposed to the summation of a squared bias component and a variance component (Hastie et al., 2009):   E((s − ŝ)2 ) = (s − E ( ŝ))2 + E ( ŝ − E ( ŝ))2 = Bias ( ŝ) + Var ( ŝ) 2 σ2ensemble ! σ2 1 ρσ2 . = Var ( ŝΣ ) = + 1− V V (9) Substituting Eqs. (6) and (7) to Eq. (2) gets: Esingle = σ2 and substituting Eqs. (8) and (9) to Eq. (2) gets: ! σ2 1 Eensemble = ρσ2 . + 1− V V (10) (11) Theorem 1 is proved. From Theorem 1, we can get the following corollaries easily: Corollary 1. When ρ is reduced from 1 to 0, Eensemble is reduced from Esingle to Esingle /V accordingly. Corollary 2. When V → ∞, Eensemble reaches a lower bound ρEsingle . From Corollary 1, we know that increasing parameter V and reducing ρ can help MBN reduce the estimation error. From Corollary 2, we know that it is important to reduce ρ. We have adopted two randomization steps to reduce ρ. However, although decreasing parameters a and k can help MBN reduce ρ, it will also cause Esingle rise. In other words, reducing Esingle and reducing ρ is a pair of contradictory factors, which needs a balance through a proper parameter setting. 5. Empirical evaluation In this section, we first introduce a typical parameter setting of MBN, then demonstrate the density estimation ability of MBN on synthetic data sets, and finally apply the low dimensional output of MBN to the tasks of visualization, clustering, and document retrieval. 5.1. Parameter setting Bias2 ( ŝv ) = 0 (6) σ2single = Var ( ŝv ) = σ2 (7) When a data set is small-scale, we use the linear-kernel-based kernel PCA (Schölkopf et al., 1998; Canu et al., 2005) as the PCA toolbox of MBN. When a data set is middle- or largescale, we use the expectation-maximization PCA (EM-PCA) (Roweis, 1998).3 MBN is insensitive to parameters V and a as if V > 100 and a ∈ [0.5, 1]. If not specified, we used V = 400 and a = 0.5 as the default values. We denote parameter k at layer l as kl . To control kl , we introduce a parameter δ defined as kl+1 = δkl , δ ∈ (0, 1). MBN is relatively sensitive to parameter δ: if data are highly-nonlinear, then set δ to a large value, otherwise, set δ to a small value; if the nonlinearity of data is unknown, set δ = 0.5 which is our default. Finally, if kL+1 < 1.5c, then we stop MBN training and use the output of the L-th nonlinear layer for PCA. This terminating Bias2 ( ŝΣ ) = 0 (8) 3 The word “large-scale” means that the data cannot be handled by traditional kernel methods on a common personal computer. (2) Because wv follows a univariate normal distribution, it is easy to obtain: E(wv ) = s E(w2v ) (3) = σ +s 2 2 E(wv1 wv2 ) = ρσ2 + s2 (4) (5) For a single estimate wv , we have ŝv = wv . For a set of estimates P {wv }Vv=1 , we have ŝΣ = V1 Vv=1 wv . Based on Eqs. (3) to (5), we can derive: and 5 Table 1: Hyperparameters of MBN. Parameter Description δ A parameter that controls the network structure by kl+1 = δkl , ∀l = 1, . . . , L a Fraction of randomly selected dimensions (i.e., d̂ ) over all dimensions (i.e., d) of input data. V Number of k-centroids clusterings per layer. k1 A parameter that controls the time and storage complexities of the network. For small-scale problems, k1 = 0.5n. For large-scale problems, k1 should be tuned smaller to fit MBN to the computing power. Gaussian data MBN on Gaussian data Jain data Pathbased data MBN on Jain data MBN on pathbased data Compound data MBN on compound data Figure 5: Density estimation by MBN on synthetic data sets. The data points in different classes are drawn in different colors. condition guarantees the validness of data resampling which requires each random sample of data to be stronger than random guess (Schapire, 1990). The hyperparameters of MBN are summarized in Table 1. In the following experiments, we adopted the above default parameter setting of MBN, unless otherwise specified. MBN are show in Fig. 6. From the figure, we observe that MBN is robust to the presence of the outlier. 5.3. Data visualization 5.3.1. Visualizing AML-ALL biomedical data The acute myeloid leukemia and acute lymphoblastic leukemia (AML-ALL) biomedical data set (Golub et al., 1999) is a two-class problem that consists of 38 training examples (27 ALL, 11 AML) and 34 test examples (20 ALL, 14 AML). Each example has 7,129 dimensions produced from 6,817 human genes. We compared MBN with PCA and 2 nonlinear dimensionality reduction methods which are Isomap (Tenenbaum et al., 2000) and LLE (Roweis & Saul, 2000). We tuned the hyperparameters of Isomap and LLE for their best performance.4 The visualization result is shown in Fig. 7. 5.2. Density estimation 5.2.1. Density estimation for nonlinear data distributions Four synthetic data sets with non-uniform densities and nonlinear variations are used for evaluation. They are Gaussian data, Jain data (Jain & Law, 2005), pathbased data (Chang & Yeung, 2008), and compound data (Zahn, 1971), respectively. Parameter a was set to 1. The visualization result in Fig. 5 shows that the synthetic data in the new feature spaces produced by MBN not only are distributed uniformly but also do not contain many nonlinear variations. 5.3.2. Visualizing MNIST digits The data set of the MNIST digits (Lecun et al., 2004) contains 10 handwritten integer digits ranging from 0 to 9. It con- 5.2.2. Density estimation in the presence of outliers A data set of two-class Gaussian data with a randomly generated outlier is used for evaluation. The results of PCA and 4 It is difficult and sometimes unable to tune the hyperparameters in practice. 6 10 Data without outliers 5 x 10 15 Data with an outlier 5 10 0 Amplification are given in Table 2. The data set “20-Newsgroups”, which originally has 20,000 documents, was post-processed to a corpus of 18,846 documents, each belonging to a single topic. We compared MBN with PCA and Spectral (Ng et al., 2002). We applied k-means clustering to the low-dimensional outputs of all comparison methods as well as the original highdimensional features. To prevent the local minima problem of k-means clustering, we ran k-means clustering 50 times and picked the clustering result that corresponded to the optimal objective value of the k-means clustering among the 50 candidate objective values as the final result. We ran each comparison method 10 times and reported the average performance. The parameter settings on the data sets with IDs from 1 to 9 are as follows. For PCA, we preserved the top 98% largest eigenvalues and their corresponding eigenvectors. For Spectral, we set the output dimension to the ground-truth number of classes and adopted the RBF kernel. We reported the results with a fixed kernel width 2−4 A which behaves averagely the best over all data sets, as well as the best result by searching the kernel width from {2−4 A, 2−3 A, . . . , 24 A} on each data set, where A is the average pairwise Euclidean distance between data. The two parameter selection methods of Spectral are denoted as Spectralno_tuning and Spectraloptimal respectively. For MBN, we set the output dimension to the ground-truth number of classes. We reported the results with δ = 0.5, as well as the best results by searching δ from {0.1, 0.2, . . . , 0.9} on each data set. The two parameter selection methods of MBN are denoted as MBNno_tuning and MBNoptimal respectively. The parameter settings on the 20-Newsgroups are as follows. For PCA, we set the output dimension to 100. For all comparison methods, we used the cosine similarity as the similarity metric. We evaluated the clustering result in terms of normalized mutual information (NMI) and clustering accuracy. The clustering results in Tables 3 and 4 show that (i) MBNno_tuning achieves better performance than Spectralno_tuning and PCA, and (ii) MBNoptimal achieves better performance than Spectraloptimal . Besides the data sets in Table 2, we have also conducted experiments on the following data sets: Lung-Cancer biomedical data, COIL20 images, USPS images, Extended-YaleB images, Reuters-21578 text corpus, and TDT2 text corpus. The experimental conclusions are consistent with the results in Tables 3 and 4. 5 0 -5 -5 15 5 x 10 PCA on the data without outliers PCA on the data with an outlier 4 0 5 0 10 5 5 10 2 0 0 -2 -5 -4 20 5 x 10 MBN on the data without outliers MBN on the data with an outlier -5 0 5 0 10 100 100 50 0 0 -50 -100 -100 -100 0 100 -100 0 100 Figure 6: Density estimation by MBN on a Gaussian data with the presence of an outlier. The red cross denotes the outlier. Because the outlier is far from the Gaussian data, the resolution of the sub-figure in the top-right corner is not high enough to differentiate the two classes of the Gaussian data. sists of 60,000 training images and 10,000 test images. Each image has 784 dimensions. We compared MBN with PCA, Isomap (Tenenbaum et al., 2000), LLE (Roweis & Saul, 2000), Spectral (Ng et al., 2002), deep belief networks (Hinton & Salakhutdinov, 2006) (DBN), and t-SNE (Van der Maaten & Hinton, 2008). We tuned the hyperparameters of the 5 nonlinear comparison methods for their best performance. Because the comparison nonlinear methods are too costly to run with the full MNIST data set except DBN, we randomly sampled 5,000 images with 500 images per digit for evaluation. The visualization result in Fig. 8 shows that the lowdimensional feature produced by MBN has a small within-class variance and a large between-class distance. To demonstrate the scalability of MBN on larger data sets and its generalization ability on unseen data, we further trained MBN on all 60,000 training images, and evaluated its effectiveness on the 10,000 test images, where k1 was set to 8000 to reduce the training cost. The visualization result in Fig. 9 shows that MBN on the full MNIST provides a clearer visualization than that on the small subset of MNIST. 5.4.1. Effect of hyperparameter δ We showed the effect of parameter δ on each data set in Fig. 10. From the figure, we do not observe a stable interval of δ where MBN is supposed to achieve the optimal performance across the data sets; if the data are highly variant, then setting δ to a large value yields good performance, and vise versa. Generally, if the nonlinearity of data is unknown, then setting δ = 0.5 is safe. 5.4. Clustering 5.4.2. Effects of hyperparameters a and V Theorem 1 has guaranteed that the estimation error can be reduced by enlarging parameter V, and may also be reduced by Ten benchmark data sets were used for evaluation. They cover topics in speech processing, chemistry, biomedicine, image processing, and text processing. The details of the data sets 7 PCA Isomap LLE MBN Figure 7: Visualizations of AML-ALL produced by MBN and 3 comparison methods. PCA Isomap Spectral 0 1 2 3 4 5 6 7 8 9 t-SNE DBN MBN LLE Figure 8: Visualizations of a subset (5,000 images) of MNIST produced by MBN and 6 comparison methods. For clarity, only 250 images per digit are drawn. decreasing parameter a. In this subsection, we focus on investigating the stable working intervals of V and a. Because the experimental phenomena on all data sets are similar, we reported the phenomena on the small subset of MNIST as a representative in Fig. 11. From the figure, we know that (i) we should prevent setting a to a very small value. Empirically, we set a = 0.5. (ii) We should set V ≥ 100. Empirically, we set V = 400. structure. We only preserved the 82 leaf topics. As a result, there were 107,132 unlabeled documents. We preprocessed each document as a vector of 2,000 commonest word stems by the rainbow software (McCallum, 1998) where each entry of a vector was set to the word count. We randomly selected half of the data set for training and the other half for test. We recorded the average accuracy over all 402,207 queries in the test set at the document retrieval setting, where a query and its retrieved documents were different documents in the test set. If an unlabeled document was retrieved, it was considered as a mistake. If an unlabeled document was used as a query, no relevant documents would be retrieved, which means the precisions of the unlabeled query at all levels were zero. 5.5. Document retrieval Accuracy We applied MBN to document retrieval and compared it with latent semantic analysis (LSA) (Deerwester et al., 1990), a document method based3-dimensional on PCA, on a larger data set— 2-dimensional feature feature 5-dimensional feature B retrieval Reuters1 newswire stories (Lewis et al., 2004) which consist of 0.9 documents. The data set of the Reuters newswire sto804,414 Because the data set is relatively large, we did not adopt the 0.8 ries are divided into 103 topics which are grouped into a tree default setting of MBN where k1 = 201103. Instead, we set k1 0.7 0.6 8 0.5 0.4 0.3 10-dimensional feature 0.2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 20-dimensional feature 30-dimensional feature Table 2: Description of data sets. ID Name # data points # dimensions # classes Attribute 1 Isolet1 1560 617 26 Speech data 2 Wine 178 13 3 Chemical data 3 New-Thyroid 215 5 3 Biomedical data 4 Dermathology 366 34 6 Biomedical data 5 COIL100 7200 1024 100 Images 6 MNIST(small) 5000 768 10 Images (handwritten digits) 7 MNIST(full) 70000 768 10 Images (handwritten digits) 8 UMIST 575 1024 20 Images (faces) 9 ORL 400 1024 40 Images (faces) 10 20-Newsgroups 18846 26214 20 Text corpus Table 3: NMI on 10 data sets. The numbers after ± are the standard deviations. Raw feature PCA Spectralno_tuning MBNno_tuning Spectraloptimal MBNoptimal 1 Isolet1 77.21%±0.92% 56.74%±0.75% 75.51%±0.58% 77.89%±0.81% 79.66%±0.58% 77.97%±0.64% 2 Wine 42.88%±0.00% 40.92%±0.00% 41.58%±0.00% 55.49%±4.07% 43.02%±0.00% 76.96%±3.24% 3 New-Thyroid 49.46%±0.00% 49.46%± 0.00% 39.63%±0.00% 68.80%±5.03% 43.20%±0.00% 75.78%±2.75% 4 Dermathology 9.11%±0.11% 59.50%±0.10% 51.04%±0.15% 82.40%±2.24% 51.04%±0.15% 92.79%±1.09% 5 COIL100 76.98%±0.27% 69.64%±0.45% 89.28%±0.59% 81.66%±0.59% 89.28%±0.59% 90.37%±0.65% 6 MNIST(small) 49.69%±0.14% 27.86%±0.08% 62.06%±0.04% 77.12%±0.35% 62.06%±0.04% 78.50%±0.84% 7 MNIST(full) 50.32%±0.12% 28.05%±0.07% Timeout 91.36%±0.07% Timeout Timeout 8 UMIST 65.36%±1.21% 66.25%±1.10% 81.83%±0.58% 74.48%±1.91% 84.66%±2.38% 84.84%±1.98% 9 ORL 75.55%±1.36% 75.81%±1.17% 80.21%±1.13% 79.22%±0.84% 83.62%±1.13% 81.73%±1.19% 10 20-Newsgroups Timeout 22.49%±1.41% 27.03%±0.05% 41.61%±0.05% 27.03%±0.05% 42.23%±0.46% manually to 500 and 2000 respectively, V = 200, and kept other parameters unchanged, i.e. a = 0.5 and δ = 0.5. Experimental results in Fig. 12 show that the MBN with the small network reaches an accuracy curve of over 8% higher than LSA; the MBN with the large network reaches an accuracy curve of over 13% higher than LSA. The results indicate that enlarging the network size of MBN improves its generalization ability. 2-dimensional feature with MBN on the training set and generalizes well on the test set. The prediction time of MBN and the compressive MBN is 4857.45 and 1.10 seconds, respectively. We then studied the generalization ability of the compressive MBN in retrieving the Reuters newsware stories. The neural network here has the same structure with that on MNIST. It projects the data space to the 5-dimensional representation produced by MBN. The result in Fig. 14 shows that the compressive MBN produces an almost identical accuracy curve with MBN. The prediction time of MBN and the compressive MBN is 190,574.74 and 88.80 seconds, respectively. 5.6. Empirical study on compressive MBN This subsection studies the effects of the compressive MBN on accelerating the prediction process of MBN. We first studied the generalization ability of the compressive MBN on the 10,000 test images of MNIST, where the models of MBN and the compressive MBN are trained with the 60,000 training images of MNIST. The neural network in the compressive MBN contains 2 hidden layers with 2048 rectified linear units per layer. It projects the data space to the 2-dimensional feature space produced by MBN. The visualization results in Fig. 13 show that the compressive MBN produces an identical 6. Discussions MBN is related to many methods in statistics and machine learning. Here we introduce its connection to histogram-based density estimators, bootstrap methods, clustering ensemble, vector quantization, product of experts, sparse coding, and unsupervised deep learning. 9 Table 4: Clustering accuracy on 10 data sets. Raw feature PCA Spectralno_tuning MBNno_tuning Spectraloptimal MBNoptimal 1 Isolet1 61.47%±1.93% 38.62%±0.99% 49.63%±1.88 61.13%±2.52% 72.29%±1.92% 62.50%±1.14% 2 Wine 70.22%±0.00% 78.09%±0.00% 61.24%±0.00 81.91%±2.61% 70.79%±0.00% 93.20%±1.77% 3 New-Thyroid 86.05%±0.00% 86.05%±0.00% 79.49%±0.94 93.02%±1.60% 82.79%±0.00% 94.51%±0.93% 4 Dermathology 26.17%±0.28% 61.67%±0.26% 50.38%±0.35 82.81%±7.67% 50.38%±0.35% 96.07%±0.79% 5 COIL100 49.75%±1.31% 43.42%±1.21% 61.83%±2.27 57.38%±1.85% 61.83%±2.27% 68.29%±1.58% 6 MNIST(small) 52.64%±0.14% 34.49%±0.10% 53.30%±0.01 82.36%±0.46% 56.55%±0.20% 87.06%±1.75% 7 MNIST(full) 53.48%±0.11% 35.14%±0.11% Timeout 96.64%±0.04% Timeout Timeout 8 UMIST 43.20%±1.66% 43.44%±1.92% 70.99%±2.19 56.96%±3.73% 70.99%±2.19% 73.22%±4.02% 9 ORL 54.37%±2.41% 54.55%±2.81% 57.33%±2.37 59.68%±1.58% 68.85%±2.48% 64.25%±3.50% 10 20-Newsgroups Timeout 22.61%±1.29% 28.52%±0.03 46.57%±1.10% 28.52%±0.03% 47.69%±0.92% the resampling in MBN is used to build local coordinate systems, hence, if a data point is sampled multiple times, the duplicated data points are still viewed as a single coordinate axis. Moreover, it will cause the k-centroids clusterings built in different data spaces. However, MBN was motivated from and shares many common properties with the bootstrap methods, such as building each base clustering from a random sample of the input and de-correlating the base clusterings by the random sampling of features (Breiman, 2001) at each base clustering, hence, we adopted the phrase “bootstrap” in MBN and clarify its usage here for preventing confusion. 0 1 2 3 4 5 6 7 8 9 6.3. Clustering ensemble Clustering ensemble (Strehl & Ghosh, 2003; Dudoit & Fridlyand, 2003; Fern & Brodley, 2003; Fred & Jain, 2005; Zheng et al., 2010; Vega-Pons & Ruiz-Shulcloper, 2011) is a clustering technique that uses a consensus function to aggregate the clustering results of a set of mutually-independent base clusterings. Each base clustering is usually used to classify data to the ground-truth number of classes. An exceptional clustering ensemble method is (Fred & Jain, 2005), in which each base k-means clustering produces a subclass partition by assigning the parameter k to a random value that is slightly larger than the ground-truth number of classes. Each layer of MBN can be regarded as a clustering ensemble. However, its purpose is to estimate the density of data instead of producing an aggregated clustering result. Moreover, MBN has clear theoretical and geometric explanations. We have also found that setting k to a random value does not work for MBN, particularly when k is also small. Figure 9: Visualization of the 10,000 test images of MNIST produced by the MBN at layer 8. For clarity, only 250 images per digit are drawn. See Appendix D for the visualizations produced by other layers. 6.1. Histogram-based density estimators Histogram-based density estimation is a fundamental density estimation method, which estimates a probability function by accumulating the events that fall into the intervals of the function (Freedman et al., 2007) where the intervals may have an equivalent length or not. Our proposed density estimator is essentially such an approach. An interval in our approach is defined as the data space between two data points. The accumulated events in the interval are the shared centroids by the two data points. 6.2. Bootstrap methods Bootstrap resampling (Efron, 1979; Efron & Tibshirani, 1993) has been applied successfully to machine learning. It resamples data with replacement. MBN does not adopt the standard bootstrap resampling. In fact, MBN uses random subsampling without replacement, also known as delete-d jackknife resampling in statistics (Efron & Tibshirani, 1993). The reason why we do not adopt the standard bootstrap resampling is that 6.4. Vector quantization Each layer of MBN can be regarded as a vector quantizer to the input data space. The codebook produced by MBN is exponentially smaller than that produced by a traditional k-means clustering, when they have the same level of quantization errors. A similar idea, named product quantization, has been explored in (Jegou et al., 2011). If product quantization uses random 10 Isolate1 NMI 0.8 0.6 0.6 0.4 0.4 0.2 0.1 0.3 0.5 0.7 0.9 1 0.2 0.1 0.3 0.5 0.7 0.9 Dermathology COIL100 1 0.8 0.1 0.3 0.5 0.7 0.9 MNIST(small) 0.8 0.6 0.8 0.6 0.4 0.4 0.6 0.1 0.3 0.5 0.7 0.9 UMIST 1 NMI New-Thyroid 0.8 0.7 0.6 NMI Wine 0.8 0.2 0.1 0.3 0.5 0.7 0.9 ORL 0.85 0.1 0.3 0.5 0.7 0.9 0.8 0.8 0.4 0.6 0.75 0.2 0.4 0.7 20-Newsgroups 0.6 0 0.1 0.3 0.5 0.7 0.9 0.1 0.3 0.5 0.7 0.9 0.1 0.3 0.5 0.7 0.9 / / / Figure 10: Effect of decay factor δ on 9 benchmark data sets. 1 0.9 0.9 0.8 0.8 0.7 0.7 0.6 0.6 NMI NMI Effect of parameter a 1 0.5 and MBN is that the former are designed for reducing the computational and storage complexities, while MBN is not developed for this purpose. MBN aims at providing a simple way to overcome the difficulty of density estimation in a continuous space. Hence, it generates larger codebooks than common vector quantization methods and does not transform the sparse codes to compact binary codes. 0.5 0.4 0.4 0.3 Training accuracy Test accuracy 0.2 0.1 0 Effect of parameter V 0.05 0.1 0.2 0.5 Parameter a 1 0.3 6.5. Product of experts 0.2 PoE aims to combine multiple individual models by multiplying them, where the individual models have to be a bit more complicated and each contains one or more hidden variables (Hinton, 2002). Its general probability framework is: QV v=1 gv (x) (12) p(x) = P Q V 0 x0 v=1 gv (x ) 0.1 0 1 5 10 20 30 50 100 200 400 Parameter V Figure 11: Effect of parameters a and V on the subset of MNIST. sampling of features instead of a fixed non-overlapping partition of features in (Jegou et al., 2011), and uses random sampling of data points to train each k-means clustering instead of the expectation-maximization optimization, then product quantization equals to a single layer of MBN. We are also aware of the hierarchical product quantizer (Wichert, 2012), which builds multiple sets of sub-quantizers (where the name “hierarchy” comes) on the original feature. Our MBN builds each layer of sub-quantizers on the output sparse feature of its lower layer which is fundamentally different from the hierarchical product quantization method. An important difference between existing vector quantization methods (e.g. binarized neural networks and binary hashing) where x0 indexes all possible vectors in the data space, and gv is called an expert. A major merit of PoE is that, a function that can be fully expressed by a mixture of experts with N experts (i.e. mixtures), such as Gaussian mixture model or kmeans clustering, can be expressed compactly by a PoE with only log2 N experts at the minimum, with the expense of the P Q optimization difficulty of the partition function x0 Vv=1 gv (x0 ) which consists of an exponentially large number of components. The connection between MBN and PoE is as follows: Theorem 2. Each layer of MBN is a PoE that does not need to optimize the partition function. 11 0.4 0.35 Accuracy Accuracy 0.4 0.35 0.3 0.25 0.2 0.15 0.05 0.55 0.05 0.5 0 0.5 0 7 15 31 63 127 255 511 1023 0.45 Number of retrieved documents 0.4 Accuracy 0.55 0.35 0.5 0.3 0.45 0.25 0.4 Accuracy 0.2 0.15 0.1 0.05 0 3 1 3 LSA 0.25 MBN (k 1=500) at layer 2 0.25 0.1 MBN (k 1=500) at layer 3 0.2 0.05 0.15 0 7 15 31 63MBN 127 255 2511 1023 at layer 0.1 Number of retrieved documentsMBN at layer 2 Compressive 7 15 31 63 127 255 511 1023 Number of retrieved documents 0.45 0.15 0.3 3 0.5 0.3 0.2 LSA 0.35 MBN (k 1=500) at layer 1 1 0.55 0.35 Accuracy 0.4 1 MBN at layer 1 Compressive MBN at layer 1 0.1 0.55 0.45 Accuracy 0.2 0.15 LSA DNN approximation of LSA 0.1 0.3 0.25 0.4 MBN (k 1=2000) at layer 1 0.35 MBN (k =2000) at layer 2 1 MBN (k 1=2000) at layer 3 0.3 MBN (k 1=2000) at layer 4 0.25 MBN (k 1=2000) at layer 5 0.2 0.15 layer 3 511 1023 7 15 31 MBN 63 at 127 255 0.1 Compressive MBN at layer 3 Number of retrieved documents 0.05 1 3 0.05 Figure 12: Average 0accuracy curves of retrieved documents on the test set (82 topics) of the Reuters newswire stories. 0 1 0.55 7 15 31 63 127 255 511 1023 Number of retrieved documents 3 7 15 31 63 127 255 511 1023 Number of retrieved documents 0.55 Generalization on test data 0.5 0 0.45 1 20.4 3 0.35 4 50.3 0.5 0.45 0.4 0.25 6 70.2 8 0.15 9 0.1 0.35 0.3 0.25 0.2 0.15 MBN at layer 4 Compressive MBN at layer 4 MBN at layer 5 Compressive MBN at layer 5 0.1 0.05 0 1 Accuracy Accuracy Visualizing training data 3 0.05 1 3 7 15 31 63 127 255 511 1023 Number of retrieved documents Visualizing training data on data test data C 13: D dataGeneralization Figure Visualizations of the training (left) and test (right) of (With randomby reconstruction) MNIST produced the compressive MBN. (With random reconstruction) 0 1 3 7 15 31 63 127 255 511 1023 Number of retrieved documents Figure 14: Comparison of the generalization ability of MBN and the compressive MBN on retrieving the Reuters newsware stories. Proof. See Appendix B for the proof. 6.7. Unsupervised deep learning Learning abstract representations by deep networks is a recent trend. From the geometric point of view, the abstract representations are produced by reducing larger and larger local variations of data from bottom up in the framework of trees that are built on data spaces.5 For example, convolutional neural network merges child nodes by pooling. Hierarchical Dirichlet process (Teh et al., 2005) builds trees whose father nodes generate child nodes according to a prior distribution. DBN (Hinton & Salakhutdinov, 2006) merges child nodes by reducing the number of the nonlinear units gradually from bottom up. Subspace tree (Wichert & Moreira, 2015) merges nodes by reducing the dimensions of the subspaces gradually. PCANet (Chan et al., 2015) merges nodes by reducing the output dimensions of the local PCA associated with its patches gradually. Our MBN merges nodes by reducing the number of the randomly sampled centroids gradually. A fundamental difference between the methods is how to build effective local coordinate systems in each layer. To our knowledge, MBN is a simple method and needs little assumption and prior knowledge. It is only more complicated than 6.6. Sparse coding Given a learned dictionary W, sparse coding typically aims P to solve minhi ni=1 kxi − Whi k22 + λkhi k11 , where k · kq represents `q -norm, hi is the sparse code of the data point xi , and λ is a hyperparameter controlling the sparsity of hi . Each column of W is called a basis vector. To understand the connection between MBN and sparse coding, we may view λ as a hyperparameter that controls the number of clusterings. Specifically, if we set λ = 0, it is likely that hi contains only one nonzero element. Intuitively, we can understand it as that we use only one clustering to learn a sparse code. A good value of λ can make a small part of the elements of hi nonzero. This choice approximates to the method of partitioning the dictionary to several (probably overlapped) subsets and then grouping the basis vectors in each subset to a base clustering. Motivated by the above intuitive analysis, we introduce the connection between sparse coding and MBN formally as follows: Theorem 3. The `1 -norm sparse coding is a convex relaxation of the building block of MBN when given the same dictionary. 5 Some recent unsupervised deep models for data augmentation are out of the discussion, hence we omit them here. Proof. See Appendix C for the proof. 12 random projection which is, to our knowledge, not an effective method for unsupervised deep learning to date. Moreover, MBN is the only method working in discrete feature spaces, and it works well. Breiman, L. (2001). Random forests. Machine Learning, 45, 5–32. Canu, S., Grandvalet, Y., Guigue, V., & Rakotomamonjy, A. (2005). SVM and kernel methods Matlab toolbox. http://asi.insa-rouen.fr/ enseignants/~arakoto/toolbox/index.html. Chan, T.-H., Jia, K., Gao, S., Lu, J., Zeng, Z., & Ma, Y. (2015). Pcanet: A simple deep learning baseline for image classification? IEEE Transactions on Image Processing, 24, 5017–5032. Chang, H., & Yeung, D.-Y. (2008). Robust path-based spectral clustering. Pattern Recognition, 41, 191–203. Deerwester, S. C., Dumais, S. T., Landauer, T. K., Furnas, G. W., & Harshman, R. A. (1990). Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41, 391–407. Dietterich, T. G. (2000). Ensemble methods in machine learning. In Multiple Classifier Systems (pp. 1–15). Cagliari, Italy: Springer. Dudoit, S., & Fridlyand, J. (2003). Bagging to improve the accuracy of a clustering procedure. Bioinformatics, 19, 1090–1099. Efron, B. (1979). Bootstrap methods: another look at the jackknife. Annals of Statistics, 7, 1–26. Efron, B., & Tibshirani, R. (1993). An Introduction to the Bootstrap. CRC press. Fern, X. Z., & Brodley, C. E. (2003). Random projection for high dimensional data clustering: A cluster ensemble approach. In Proceedings of the 20th International Conference on Machine Learning (pp. 186–193). volume 3. Fred, A. L., & Jain, A. K. (2005). Combining multiple clusterings using evidence accumulation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 27, 835–850. Freedman, D., Pisani, R., & Purves, R. (2007). Statistics (4th edition). Freund, Y., & Schapire, R. E. (1995). A decision-theoretic generalization of on-line learning and an application to boosting. In Proceedings of the 2nd European Conference on Computational Learning Theory (pp. 23–37). Barcelona, Spain. Friedman, J., Hastie, T., Tibshirani, R. et al. (2000). Additive logistic regression: A statistical view of boosting (with discussion and a rejoinder by the authors). Annals of Statistics, 28, 337–407. Golub, T. R., Slonim, D. K., Tamayo, P., Huard, C., Gaasenbeek, M., Mesirov, J. P., Coller, H., Loh, M. L., Downing, J. R., Caligiuri, M. A. et al. (1999). Molecular classification of cancer: class discovery and class prediction by gene expression monitoring. Science, 286, 531–537. Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning. Springer. He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of 2016 IEEE International Conference on Computer Vision and Pattern Recognition (pp. 770–778). Las Vegas, NV. He, X., & Niyogi, X. (2004). Locality preserving projections. In Advances in Neural Information Processing Systems 17 (pp. 153–160). Vancouver, British Columbia, Canada volume 16. Hinton, G., Deng, L., Yu, D., Dahl, G. E., Mohamed, A.-r., Jaitly, N., Senior, A., Vanhoucke, V., Nguyen, P., Sainath, T. N. et al. (2012). Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29, 82–97. Hinton, G. E. (2002). Training products of experts by minimizing contrastive divergence. Neural Computation, 14, 1771–1800. Hinton, G. E., & Salakhutdinov, R. R. (2006). Reducing the dimensionality of data with neural networks. Science, 313, 504–507. Jain, A. K., & Law, M. H. (2005). Data clustering: A user’s dilemma. Lecture Notes in Computer Science, 3776, 1–10. Jegou, H., Douze, M., & Schmid, C. (2011). Product quantization for nearest neighbor search. IEEE transactions on pattern analysis and machine intelligence, 33, 117–128. Lanckriet, G. R. G., Cristianini, N., Bartlett, P., Ghaoui, L. E., & Jordan, M. I. (2004). Learning the kernel matrix with semidefinite programming. J. Mach. Learn. Res., 5, 27–72. Lecun, Y., Cortes, C., & Burges, C. J. C. (2004). THE MNIST DATABASE of handwritten digits. http://yann.lecun.com/exdb/mnist/index. html. Lewis, D. D., Yang, Y., Rose, T. G., & Li, F. (2004). RCV1: a new benchmark collection for text categorization research. Journal of Machine Learning Research, 5, 361–397. Van der Maaten, L., & Hinton, G. E. (2008). Visualizing data using t-sne. Journal of Machine Learning Research, 9, 2579–2605. McCallum, A. (1998). Rainbow. http://www.cs.cmu.edu/~mccallum/ 7. Conclusions In this paper, we have proposed multilayer bootstrap network for nonlinear dimensionality reduction. MBN has a novel network structure that each expert is a k-centroids clustering whose centroids are randomly sampled data points with randomly sampled features; the network is gradually narrowed from bottom up. MBN is composed of two novel components: (i) each layer of MBN is a nonparametric density estimator by random resampling. It estimates the density of data correctly without any model assumption. It is exponentially more powerful than a single k-centroids clustering. Its estimation error is proven to be small and controllable. (ii) The network is a deep ensemble model. It essentially reduces the nonlinear variations of data by building a vast number of hierarchical trees on the data space. It can be trained as many layers as needed with both large-scale and small-scale data. MBN performs robustly with a wide range of parameter settings. Its time and storage complexities scale linearly with the size of training data. It supports parallel computing naturally. Empirical results demonstrate its efficiency at the training stage and its effectiveness in density estimation, data visualization, clustering, and document retrieval. We have also demonstrated that the high computational complexity of MBN at the test stage can be eliminated by the compressive MBN—a framework of unsupervised model compression based on neural networks. A problem left is on the selection of parameter δ which controls the network structure. Although the performance of MBN with δ = 0.5 is good, there is still a large performance gap between δ = 0.5 and the best δ. Hence, how to select δ automatically is an important problem. Acknowledgement The author thanks Prof. DeLiang Wang for providing his computing resources. The author also thanks the action editor and reviewers for their comments which improved the quality of the paper. This work was supported by the National Natural Science Foundation of China under Grant 61671381. References References Belkin, M., & Niyogi, P. (2003). Laplacian eigenmaps for dimensionality reduction and data representation. Neural Comput., 15, 1373–1396. Bishop, C. M. et al. (2006). Pattern Recognition and Machine Learning. Springer New York:. Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent dirichlet allocation. J. Mach. Learn. Res., 3, 993–1022. Boyd, S. P., & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press. 13 respectively at the bottom layer, and are:   Otime = O kV 2 n bow/rainbow. Ng, A. Y., Jordan, M. I., & Weiss, Y. (2002). On spectral clustering: Analysis and an algorithm. In Advances in Neural Information Processing Systems 14 (pp. 849–856). Vancouver, British Columbia, Canada. Nie, F., Zeng, Z., Tsang, I. W., Xu, D., & Zhang, C. (2011). Spectral embedded clustering: A framework for in-sample and out-of-sample spectral clustering. IEEE Transactions on Neural Networks, 22, 1796–1808. Pearson, K. (1901). On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2, 559–572. Roweis, S. T. (1998). EM algorithms for PCA and SPCA. In Advances in Neural Information Processing Systems 10 (pp. 626–632). Denver, CO. Roweis, S. T., & Saul, L. K. (2000). Nonlinear dimensionality reduction by locally linear embedding. Science, 290, 2323–2326. Schapire, R. E. (1990). The strength of weak learnability. Machine Learning, 5, 197–227. Schmidhuber, J. (2015). Deep learning in neural networks: An overview. Neural Networks, 61, 85–117. Schölkopf, B., Smola, A., & Müller, K.-R. (1998). Nonlinear component analysis as a kernel eigenvalue problem. Neural Computation, 10, 1299–1319. Shi, J., & Malik, J. (2000). Normalized cuts and image segmentation. IEEE Trans. Pattern Anal. Machine Intell., 22, 888–905. Strehl, A., & Ghosh, J. (2003). Cluster ensembles—a knowledge reuse framework for combining multiple partitions. Journal of Machine Learning Research, 3, 583–617. Tao, D., Tang, X., Li, X., & Wu, X. (2006). Asymmetric bagging and random subspace for support vector machines-based relevance feedback in image retrieval. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28, 1088–1099. Teh, Y. W., Jordan, M. I., Beal, M. J., & Blei, D. M. (2005). Sharing clusters among related groups: Hierarchical dirichlet processes. In Proc. Adv. Neural Inform. Process. Syst. (pp. 1385–1392). Tenenbaum, J. B., De Silva, V., & Langford, J. C. (2000). A global geometric framework for nonlinear dimensionality reduction. Science, 290, 2319– 2323. Vega-Pons, S., & Ruiz-Shulcloper, J. (2011). A survey of clustering ensemble algorithms. International Journal of Pattern Recognition and Artificial Intelligence, 25, 337–372. Wang, D. L., & Chen, J. (2017). Supervised speech separation based on deep learning: An overview. arXiv preprint arXiv:1708.07524, . Wang, Q., Qin, Z., Nie, F., & Yuan, Y. (2017). Convolutional 2d lda for nonlinear dimensionality reduction. In Proceedings of the 26th International Joint Conference on Artificial Intelligence (pp. 2929–2935). Wichert, A. (2012). Product quantization for vector retrieval with no error. In ICEIS (1) (pp. 87–92). Wichert, A., & Moreira, C. (2015). On projection based operators in lp space for exact similarity search. Fundamenta Informaticae, 136, 461–474. Wikipedia (2017). Frequentist probability. https://en.wikipedia.org/ wiki/Frequentist_probability. Xing, E. P., Jordan, M. I., Russell, S., & Ng, A. (2002). Distance metric learning with application to clustering with side-information. In Advances in Nueral Information Processing Systems 15 (pp. 505–512). Vancouver, British Columbia, Canada. Yan, S., Xu, D., Zhang, B., Zhang, H.-J., Yang, Q., & Lin, S. (2007). Graph embedding and extensions: a general framework for dimensionality reduction. IEEE Transactions on Pattern Analysis and Machine Intelligence, 29, 40–51. Zahn, C. T. (1971). Graph-theoretical methods for detecting and describing gestalt clusters. IEEE Transactions on Computers, 100, 68–86. Zheng, L., Li, T., & Ding, C. (2010). Hierarchical ensemble clustering. In Prof. IEEE Int. Conf. Data Min. (pp. 1199–1204). Zhou, Z.-H., & Feng, J. (2017). Deep forest: Towards an alternative to deep neural networks. arXiv preprint arXiv:1702.08835, (pp. 1–10). O storage = O(2V(n + k)) Proof. Due to the length limitation of the paper, we omit the simple proof. Fortunately, as shown in Fig A.15, the empirical time complexity grows with O(V) instead of O(V 2 ). The only explanation is that the input data is sparse. Specifically, the multiplication of two sparse matrices only considers the element-wise multiplication of two elements that are both nonzero, as a result, when the input data is sparse, one factor V is offset by the sparsity factor s. The empirical time and storage complexities with other parameters are consistent with our theoretical analysis. We omit the results here. Note that, our default parameter k1 = 0.5n makes the time complexity scale squarely with the size of the data set n. To reduce the computational cost, we usually set k1 manually to a small value irrelevant to n as what we have done for visualizing the full MNSIT and retrieving the RCV1 documents in Section 5. Appendix B. Proof of Theorem 2 The optimization objective of k-means clustering can be written as: max g(x|W, h) W,h 1 kx − WT hk22 W,h 2σ2 subject to h is a one-hot code ! = max exp − (B.1) where W = [w1 , . . . , wk ] is the weight matrix whose columns are centroids, h is a vector of hidden variables, and the covariance matrix of the clustering is σ2 I with I being the identity matrix and σ → 0 (Bishop et al., 2006).   Substituting g(x|W, h) = exp −kx − WT hk22 /2σ2 to Eq. (12) gets: p(x|{Wv , hv }Vv=1 )   QV T 2 2 v=1 exp −kx − Wv hv k2 /2σ   = P Q V 2 0 T 2 x0 v=1 exp −kx − Wv hv k2 /2σ  P  exp − Vv=1 kx − WTv hv k22 /2σ2  P  = P V 2 0 T 2 x0 exp − v=1 kx − Wv hv k2 /2σ Theorem 4. The computational and storage complexities of MBN are: O storage = O((ds + V)n + kV + kds) (A.4) respectively at other layers, where d is the dimension of the original feature, s is the sparsity of the data (i.e., the ratio of the non-zero elements over all elements). If MBN is not used for prediction, then MBN needs not to be saved, which further reduces the storage complexity to O((ds + V)n) at the bottom layer and O(2Vn) at other layers. Appendix A. Complexity analysis Otime = O (dskVn) (A.3) (A.1) (A.2) 14 (B.2) 10 Running time on Reuters newswire stories 2 10 MBN Running time on MNIST 1 10 Time (Hrs) Time (Hrs) O(V 2) O(V ) 0 MBN 10 1 10 O(V 2) O(V ) -1 50 50 100 200 400 Parameter V 100 200 Parameter V (a) (b) Running time of training each layer on MNIST 10 0 O(V 2 ) O(V ) -1 10 Running time of training each layer on Reuters newswire stories Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Time (Hrs) Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 10 Time (Hrs) 1 O(V 2 ) O(V ) 0 10 -2 10 50 100 50 200 400 Parameter V 100 200 Parameter V (c) (d) Figure A.15: Time complexity of MBN with respect to parameter V. Because σ → 0, problem (B.3) can be rewritten as: where we assume that all experts have the same covariance matrix σ2 I. Maximizing the likelihood of Eq. (B.2) is equivalent to the following problem: JPoE ∝ V X minV {Wv ,hv }v=1 kx − WTv hv k22 v=1   2σ2  V   1 X   exp − + log max kx0 − WTv hv k22  2 x0 2σ v=1 = JPoE = = ∝ {Wv ,hv }v=1 {Wv ,hv }v=1 kx − JPoE ∝ v=1 subject to hv is a one-hot code x V X kx0 v=1 hv is a one-hot code (B.4) Because x0 can be any possible vector in the data space, we P have minx0 Vv=1 kx0 −WTv hv k22 = 0. Eventually, the optimization objective of PoE is: WTv hv k22   2σ V X  1 X  0 T 2   + log  exp − 2 kx − Wv hv k2  2σ v=1 x0 {Wv ,hv }v=1 kx − WTv hv k22 − min 0 subject to V 1 X kx − WTv hv k22 {Wv ,hv }v=1 2σ2 v=1   V X  1 X  0 T 2  + log exp − 2 kx − Wv hv k2  2σ v=1 x0 minV minV V X v=1 T −Wv hv k22 minV − log p(x|{Wv , hv }Vv=1 ) V X minV subject to 2 minV {Wv ,hv }v=1 V X kx − WTv hv k22 v=1 hv is a one-hot code (B.5) which is irrelevant to the partition function. It is clear that problem (B.5) is the optimization objective of an ensemble of k-means clusterings. When we assign Wv by (B.3) 15 bound of Eq. (C.5): random sampling, then problem (B.5) becomes: JPoE ∝ min V V X {hv }v=1 subject to kx − WTv hv k22  v=1 hv is a one-hot code gv (x) (C.1) hv is a one-hot code where MN denotes the multivariate normal distribution, Wv = [wv,1 , . . . , wv,k ] is the weight matrix whose columns are centroids, I is the identity matrix, and σ → 0. Given a data set {xi }ni=1 . We assume that {Wv }Vv=1 are fixed, and take the negative logarithm of Eq. (C.1): {{hv,i }i=1 }v=1 kxi − Wv hv,i k22 , (C.3) v=1 i=1 If we denote W = [W1 , . . . , WV ] and further complement the head and tail of hv,i with multiple zeros, denoted as h0v,i , such that Wh0v,i = Wv hv,i , we can rewrite Eq. (C.3) to the following equivalent problem: {{hv,i }i=1 }v=1 V X n X kxi − Wh0v,i k22 , (C.4) v=1 i=1 subject to hv,i is a one-hot code. It is an integer optimization problem that has an integer matrix variable H0v = [h0v,1 , . . . , h0v,n ]. Suppose there are totally |Hv0 | possible solutions of H0v , denoted as H0v,1 , . . . , H0v,|H0v | , we first relax Eq. (C.4) to a convex optimization problem by constructing a convex hull (Boyd & Vandenberghe, 2004) on H0v :  min0 V |H | {µv,k }k=1v V X n X v=1 i=1  |H0 |  Xv  0  xi − W  µv,k hv,k,i  k=1 v=1 subject to 0 ≤ µv,k ≤ 1, |H0v | X µv,k = 1, v=1 |Hv | X µv,k = 1, ∀v = 1, . . . , V Appendix D. Visualizations produced by intermediate layers subject to hv,i is a one-hot code. min n V (C.6) i=1 P P|H0 | where h00i = V1 Vv=1 k=1v µv,k h0v,k,i with µv,k as a variable. Recalling the definition of sparse coding given a fixed dictionary W, we observe that Eq. (C.6) is a special form of sparse coding with more strict constraints on the format of sparsity. Therefore, given the same dictionary W, each layer of MBN is a distributed sparse coding that is lower bounded by the common `1 -norm sparse coding. When we discard the expectationmaximization optimization of each k-means clustering (i.e., dictionary learning) but only preserve the default initialization method – random sampling, Eq. (C.1) becomes the building block of MBN. Given the same dictionary, the `1 -normregularized sparse coding is a convex relaxation of the building block of MBN. Theorem 3 is proved. where gv (x) is a k-means clustering with the squared error as the similarity metric:   gv (x) = MN x; Wv hv , σ2 I (C.2) V X n X 2 2 k=1 v=1 min n V xi − Wh00i subject to 0 ≤ µv,k ≤ 1, Each layer of MBN maximizes the likelihood of the following equation: subject to n X 0 Appendix C. Proof of Theorem 3 p(x) = |H0 | {µv,k }k=1v V (B.6) which is the building block of MBN. Theorem 2 is proved. V Y min V 2 (C.5) 2 ∀v = 1, . . . , V. k=1 Because Eq. (C.5) is a convex optimization problem, according to Jensen’s inequality, the following problem learns a lower 16 0 1 2 3 4 5 6 7 8 9 Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 Layer 8 Layer 9 Figure D.16: Visualizations of MNIST produced by MBN at different layers. This figure is a supplement to Fig. 9. 17
9cs.NE
A survey on trajectory clustering analysis Jiang Biana , Dayong Tianb,∗, Yuanyan Tangc , Dacheng Taod a Centre arXiv:1802.06971v1 [cs.CV] 20 Feb 2018 b School for Artificial Intelligence, FEIT, University of Technology Sydney, Australia of Electronics and Information, Northwestern Polytechnical University, China c Faculty of Science and Technology, University of Macau, China d UBTECH Sydney AI Centre, FEIT, University of Sydney, Australia Abstract This paper comprehensively surveys the development of trajectory clustering. Considering the critical role of trajectory data mining in modern intelligent systems for surveillance security, abnormal behavior detection, crowd behavior analysis, and traffic control, trajectory clustering has attracted growing attention. Existing trajectory clustering methods can be grouped into three categories: unsupervised, supervised and semi-supervised algorithms. In spite of achieving a certain level of development, trajectory clustering is limited in its success by complex conditions such as application scenarios and data dimensions. This paper provides a holistic understanding and deep insight into trajectory clustering, and presents a comprehensive analysis of representative methods and promising future directions. Keywords: trajectory clustering, object movement, pattern recognition, survey, review 1. Introduction With the development of tracking and surveillance devices, tremendous numbers of object trajectory data were collected, which makes extracting useful information imperative and challenging. Trajectory clustering is an efficient ∗ Corresponding author Email addresses: [email protected] (Jiang Bian), [email protected] (Dayong Tian), [email protected] (Yuanyan Tang), [email protected] (Dacheng Tao) Preprint submitted to Journal of LATEX Templates February 21, 2018 method to analyze trajectory data and it has been applied in pattern recognition, data analysis and machine learning, etc. Furthermore, trajectory clustering aims to gain space, time or even potential information inside trajectory data, so it is ubiquitous in some application fields such as object motion prediction [1], traffic monitoring [2][3][4], activity understanding [5][6][7], abnormal detection [8][9][10][11], 3 dimensional reconstruction[12], weather forecasting [13] and geography [14]. Trajectory data are recorded in different formats according to device types, object movements and even purposes. For instance, GPS tracking devices generate a trajectory by tracking object movement as T rajectory = (T r1 , T r2 , · · · , T rn ), which is a consecutive sequence of points in geographical space, and T ri denotes a combination of coordinates and time stamp like T ri = (xi , yi , ti ), as shown in Fig.1. In some specific circumstances, other properties relevant to object movement are added, such as velocity, direction or acceleration. As shown in Fig.2, for image data, a sequence of pixels in consecutive frames forms up a trajectory, which is similar to optical flow [15][16]. In order to measure similarities among different types of trajectory data, Figure 1: Trajectory generated by GPS tracking devices Figure 2: Trajectory generated from camera device data representation, feature extraction and distance metric selection are crit2 ical preliminary works of trajectory clustering. For example, trajectories can be represented as a vector and downsampled to an unified length, so Euclidean distance is used [17]. Trajectories also can be treated as samples of a probablistic distribution. Hence, Bhattacharyya Distance [18] is used to measure the distance between two distributions. According to the availability of labeled data, trajectory clustering methods are divided in three categories: unsupervised, supervised, semi-supervised. Unsupervised models aim at clustering data without human experts supervision or labeled data. An inference function has been drawn by analyzing unlabeled data sets [19][13][20][21]. Supervised models are learned prior to trajectory clustering. Generally, labeled data are used to learn a function mapping data to their labels, i.e. clusters. The clusters of unlabeled data are predicted by this function, then [22][9][23][24]. Labeling data need a heavy burden of manual works by human experts. It is unfeasible for large data sets. Semi-supervised compromises the previous two types of models. It is trained by labeled data and tuned by unlabeled data [4][8][9]. The rest of this paper is organized as follows. Preliminary works are introduced in Sect.2, and the models based on unsupervised algorithms are described in Sect.3. A description of the models under supervised algorithms are presented in Sect.4. Sect.5 discusses some models based on semi-supervised algorithms. Finally, promising future directions are given in Sect.6, and conclusions are made in Sect.7. 2. Preliminaries 2.1. Trajectory Clustering Preparation In some clustering models [25][26][27][28], trajectory data are required to be set as a unified length so that they could be measured. However, as shown in Fig.3, for two arbitrary trajectories, their lengths maybe largely different from each other. Therefore, representing trajectories in an unified length with little loss of information is a major preliminary work of these models. This procedure 3 is called clustering preparation. Figure 3: Trajectory data with varying lengths 2.1.1. Trajectory Transformation Algorithms For some methods, original data are represented in other space with a same length. For instance, trajectory data are projected into a subspace [29]. Linear transformation algorithm aims at representing trajectory as a combination of basis trajectories [30]. Curve fitting is another method to approximate trajectories by a parameterized quadratic curve [25]. In order to distinguish similar curves, the direction of the last trajectory point is chosen as an additional parameter. In [26], trajectory data are approximated by a uniform cubic B-spline curve, so that a representation capable of encoding both the shape and the spatiotemporal profile of trajectory data is obtained. In addition, the lengths of trajectories are added to distinguish the trajectories with similar shapes. According to the fact that trajectory data contain a lot kinds of positional information, such as coordinates, speed and directions, vector fields are employed to represent trajectory data [13]. Vector fields give trajectory a smooth streamline and induce a notion of similarity of trajectories. Principle Component Analysis (PCA) is a statistical procedure to compute a set of linearly uncorrelated variables called principle components by orthogonal transformation. To avoid partially extracted information, a number of organized segmentations substitute for the corresponding trajectory in [5] and [31]. The time ordering data are transformed and represented in frequency domain by Discrete Fourier Transformation (DFT), so 4 a trajectory can be represented as a fixed length vector comprised of Fourier coefficients in [27] and [28]. In [32], the interaction of trajectories are encoded and set as elements of codebook, so camera motion is ignored and the model’s robustness is improved. 2.1.2. Re-sampling Methods Re-sampling methods choose trajectory points by sampling rule to unify trajectory lengths. Trajectory data are segmented as sub-trajectories, and all of them are re-sampled to a fixed length so that sub-trajectories are aligned as matrix [31]. In a complex scene such as hand writing data set, Equidistant sampling fixes the problem that two same characters are recorded in different temporal sequence because of different writing speeds [33]. Since re-sampled trajectory points are discontinuous, it is critical that normalization should be involved after re-sampling [34]. It has been widely acknowledged that re-sampling method causes information loss [35]. Therefore, sparsity regularization is used in [36][37][38][39]. 2.1.3. Trajectory Substitute Sub-trajectories hold partial and hidden information of original trajectory data [28][40], so they are put together and describe trajectory more flexible. For instance, the latent motion rule beneath hurricane trajectories is figured out and a certain hurricane trend chart is printed by analyzing sub-trajectories of past hurricane trajectories in [13]. Sub-trajectories also lead to simplified trajectories which represent trajectory data as some smaller, less complex primitives suitable for storage and retrieval purposes [41]. In [42], sub-trajectories are generated by well-defined policies based on facility performance, time range or distance range. In [5] and [31], trajectory is segmented at the so-called significant changing points at which direction or speed changes dramatically. Curvature describes direction information, and it could be extracted if a tra- 5 jectory is treated as a curve by connecting consecutive trajectory points. Curvatures are computed by transforming 3-dimensional position coordinates of points into spherical system and quantized as up, down, left, right [43], then a trajectory is segmented at the points where curvature changes. In addition, Minimum Description Length (MDL) principle traces the sub-trajectories holding primary movement of trajectory data by minimizing the differences between sub-trajectories and the corresponding trajectories in [40]. Minimum Bounding Rectangles (MBR) is proposed to separate trajectories under occlusion and optimize the inter-object separability in [41]. It optimizes the bounding rectangles containing sub-trajectories to ensure that the distance between two rectangles are closer than the distance of trajectories. Some specific regions of surveillance area hold special semantic information and attract more attention so Regional Segmenting method is implemented. The whole scene is split into several regions and boundaries of the regions segment trajectories [44]. As independent motion pattern, sub-trajectories characterize more information while original trajectory presents limited information. 2.1.4. Points of Interest Some specific regions of surveillance area hold special semantic information. Thus, the points inside the special regions are used to represent trajectory or scene in [45] and all these points are called Points of Interest (POI). The points outside the regions are ignored because they are short of useful information. For instance, activity analysis is a key part in surveillance application to seek low-level situational awareness by understanding and characterizing behaviors of objects in the scene [46], so it is critical to extract POI in the special regions. In topographical map, POI inside the special regions are represented as a single node. For example, two types of POI are introduced in [46] where the first one is the points in entry/exit zones and the second one is the points at the scene landmarks that objects intend to approach, move away or stay for a long time. Except for the special areas, points are represented by a node if their 6 speed are less than a threshold in [47] and [48]. The importance of points can be measured and high-scored ones are selected in [49]. For video data, POI are obtained by Pyramid Representation [50]. In addition, optical flow is another popular implementation by estimating trajectory motion in [16] and [51]. 2.1.5. Scale-invariant Features In image frames, more robust and representative features are needed rather than only positional information of trajectory points in [32] and [50]. In [50], histograms of oriented gradients (HOG) and histograms of optical flow (HOF) features are used to describe static appearance information and local motion information of trajectories, respectively. HOG feature computes orientation information to keep scale-invariant property of tracking point and it is fast to implement [32][52][53][54][55][56]. Furthermore, Scale-invariant Feature Transform (SIFT) descriptor represents image patch around tracking point [57][58][59][60][61], and computes scale and orientation information of image patches to localize tracking object in consecutive frames. In [57], Kanade Lucas Tomasi (KLT) tracker is used to find trajectory points and SIFT is applied to represent them. In [59], Difference-of-Gaussian (DOG) detector is used to detecting trajectory points instead of KLT in [57]. 2.2. Common Distance Measurements Essentially, trajectory are allocated into cohesive groups according to their mutual similarities. An appropriate metric is necessary [62][63][64]. Euclidean Distance: Euclidean distance requires that lengths of trajectories should be unified and the distances between the corresponding trajectories points should be summed up, D(A, B) = 1 1 X x [(an − bxn )2 + (ayn − byn )2 ] 2 , N 7 (1) where axn and ayn indicate the nth point of trajectory A on Cartesian coordinate. N is the total number of points. In [17], Euclidean distance is used to measure the contemporary instantiations of trajectories. Hausdorff Distance: Hausdorff distance measures the similarities by considering how close every point of one trajectory to some points of the other one, and it measures trajectories A and B without unifying the lengths in [65][66], D(A, B) = max{d(A, B), d(B, A)},    d(A, B) = max min ||a − b|| a∈A b∈B (2) (3)   d(B, A) = max min ||b − a||, b∈B a∈A Bhattacharyya Distance: Bhattacharyya distance measures how closely of two probability distributions. In [18], it is employed to measures similarities of quantized directions of points, D(A, B) = − ln(BC(A, B)), where BC(A, B) = PT t=1 √ (4) at · bt and it is used to measure the separability of A and B. at and bt are quantized directions. Frechet distance: Frechet distance measures similarity between two curves by taking into account location and time ordering. After obtaining the curve approximations of trajectories A and B, their curves map unit interval into metric space S, and a re-parameterization is added to make sure t cannot be backtracked. Frechet distance is defined as D(A, B) = inf max {d (A(α(t)), B(β(t)))}, α,β t∈[0,1] (5) where d is distance function of S, α, β are continuous and non-decreasing reparameterization. Dynamic Time Warping (DTW) Distance: DTW is a sequence alignment method to find an optimal matching between two trajectories and measure the 8 similarity without considering lengths and time ordering [67][68]. n W (A, B) = min f 1X ||ai − bf (i) ||2 , n i=1 (6) where A has n points and B has m points, all mappings f : [1, n] → [1, m] should satisfy the requirements that f (1) = 1, f (n) = m and f (i) ≤ f (j), f or all 1 ≤ i ≤ j ≤ n. Longest Common Subsequence (LCSS) Distance: LCSS aims at finding the longest common subsequence in all sequences, and the length of the longest subsequence could be the similarity between two arbitrary trajectories with different lengths. The distance LCSS,δ (A, B) is written as    0, if A or B is empty         1 + LCSS,δ (Head(A), Head(B)),   LCSS,δ (A, B) = if ||aN − bM || <  and |N − M | < δ       max(LCSS,δ (Head(A), B),       LCSS (A, Head(B))), otherwise, (7) ,δ where Head(A) indicates first N −1 points belonging to A and Head(B) denotes first M − 1 points of B. Finally, D(A, B) = 1 − LCSS,δ (A,B) max(N,M ) . In [40][69][70], more other distance types are proposed to consider more properties such as angle distance, center distance and parallel distance, which are defined as dangle (Li , Lj ) =   ||Lj || × sin(θ), 0o ≤ θ ≤ 90o  (8) ||Lj ||, 90o ≤ θ ≤ 180o , where θ is the smaller intersecting angle between Li and Lj . dcenter (Li , Lj ) = ||centeri − centerj ||, (9) where dcenter (Li , Lj ) is the Euclidean distance between center points of Li and Lj . 9 dparallel (Li , Lj ) = min(l1 , l2 ), (10) where l1 is the Euclidean distances of ps to si and l2 is that of pe to ei . ps and pe are the projection points of sj and ej onto Li respectively. Distance metrics are used in much more fields relating to trajectories clustering, e.g., density clustering [40][69][71][72][73]. It is critical to choose an optimal distance according to the scene. For instance, LCSS distance is proved to provide outperforming performance without concerning trajectories length [62]. Hausdorff distance aims at finding the minimum distance between two trajectories and ignore time-order in data. A comparison of distance is listed in Table I, Table 1: Summary of common distance measurements Measurement types Unifying lengths Computational complexity Euclidean distance Yes O(n) Hausdorff distance No O(mn) Bhattacharyya distance Yes O(n) Frechet distance No O(mn) LCSS distance No O(mn) DTW distance No O(mn) other distance types No O(1) 3. Unsupervised Algorithms of Trajectory Clustering Unsupervised algorithms infer a function to describe internal relationships between unlabeled data. Clustering is the method to draw this hidden structure, and some models relating to trajectory clustering are reviewed such as 10 Densely Clustering models, Hierarchical Clustering models and Spectral Clustering models. 3.1. Densely Clustering Models Figure 4: DBSCAN Figure 5: DBSCAN for trajectory clustering Given the centroids, the closely points are packed together and this procedure is called densely clustering. Inspired by this idea, Density-based spatial clustering of applications with noise (DBSCAN) which has been widely applied to trajectory clustering is proposed in [19]. In DBCSAN, point p is chosen as the core point and distance threshold  is given in advance. The points inside circle of which the radius is  and the center is p are called directly reachable to p. Furthermore, points {q1 , q2 , ......, qn } are reachable to p if there is a path that q1 is directly reachable to p and each qi+1 is directly reachable qi [74][75]. Other points are the outliers. Thus, the distance metric and the core parts 11 selection are important. For solving the problem that DBSCAN cannot cluster the trajectories with large differences in densities [40][69][76], all trajectories are partitioned and substituted by sub-trajectories, then sub-trajectories are clustered and all clusters are grouped at the last step. However, different from measuring distance by Euclidean distance in [40], the distance is measured by a combination of angle distance, center distance, parallel distance with equal weight in [69] and [76]. The core trajectories are computed from the clusters and used for classifying new coming trajectory in [69], [77], [78] and [79], e.g., all trajectories points belonging to same cluster are averaged as a new point at each time, and all averaged points form the representations of clusters [69]. In an adaptive multi-kernel-based method, shrunk clusters represent all groups by considering the attributes including positions, speeds and points, which retains much more discriminative messages in [80]. Besides DBSCAN, there are some other models belonging to Densely Clustering models cluster trajectory data. K-means clusters trajectories by searching centroids of clusters repeatedly [13][48][81][82][83][84]. For improving the performance of K-means, Expectation Maximization (EM) algorithm is implemented to solve optimization problem iteratively [85]. Due to the issues such as data imprecision and complexity of large data sets, a trajectory may belong to multiple clusters so EM is used to classify them [86]. Fuzzy C-Means (FCM) algorithm employs parameters to measure the level of cluster fuzziness for each trajectory, called fuzzifier. The algorithm searches correct direction in each iteration for cluster trajectories [87][88][89]. 3.2. Hierarchical Clustering Models Hierarchical Clustering models help to understand trajectory by multiple features, so this tree-type construction is proper to implement. Hierarchical Clustering models generally fall into two clustering types, Agglomerative and Divisive. As shown in Fig.6, two hierarchical types are also known as “bottomup” and “top-down” approaches. 12 In Agglomerative frameworks, trajectories are grouped and the similar clus- (a) Agglomerative clustering (b) Divisive clustering Figure 6: Hierarchical clustering models ters are merged by searching their common properties. Optimal classifications are obtained by repeating representation computation and clusters merging until meeting the requirements. Inspired by this idea, Agglomerative clustering models were explored in [90] to mine the locations that users are interested, Hypertext Induced Topic Search (HITS) model is proposed to achieve this goal and movement tracks of users are recorded as trajectories. Top n interesting trajectory clusters are obtained iteratively and the most popular locations are generated. Different from Agglomerative, Divisive frameworks cluster trajectory data into groups and split them recursively to reach the requirements. Following this framework, trajectory data are characterized by direction feature and clustered by Dominant-set embedded Bhattacharyya distance in initial clustering stage [18]. In each cluster, trajectories are split further except for the ones holding similar positions. Because of the good performance of iterative models, Testand-Divide (TAD) model is proposed [91]. It is a Divisive framework detecting all the closed trajectories firstly and splitting them recursively. More attributes of trajectory points are considered to improve the performance in [20]. For instance, trajectory A = {a1 , a2 , · · · , an } where ai = hxi , yi , βi i. It is comprised of 2-dimensional position and an additional attribute β such as velocity or object size. In the coarse clustering step, the distance measurement between trajectory 13 A and its nearest observation trajectory B are shown as follows, f (A, B) = 1 X b b + γd(βia , βψ(i) ))||, ||(xai − xbψ(i) , yia − yψ(i) NA (11) ai ∈A where ψ(i) = arg minj∈B ||(xai − xbj , yia − yjb )|| and the minimum distance value is counted as the distance between A and B. NA is the total number of points b belonging to A, d(βia , βψ(i) ) indicates the dissimilarity of A and B, and γ is weight parameter. In the fine-clustering stage, the model aims at distinguishing distortions by considering directed similarity SA→B and confidence CA→B P c(ai , bψ(i) )s(ai , bψ(i) ) P SA→B = ai ∈A , (12) ai ∈A c(ai , bψ(i) ) CA→B where c(ai , bψ(i) ) = exp( P c(ai , bψ(i) )2 = Pai ∈A , ai ∈A c(ai , bψ(i) ) b a b −||(xa i −xψ(i) ,yi −yψ(i) )|| ) σ1 and s(ai , bψ(i) ) = (13) b exp(−d(βia ,βψ(i) ) . σ2 Furthermore, a similar hierarchical framework is explored to group videos by constructing the trajectories of video [92] as an unordered tree, and a kernel method recognizes videos by clustering the trees. In addition, Hierarchical Clustering models also recognize actions from video in [93] and [94]. For two trajectories in video, a = {xa1 , xa2 , · · · , xata } and b = {xb1 , xb2 , · · · , xbtb }, the distance is computed as follows, τ2 X 1 d(a, b) = max dspatial [t] · dvelocity [t], τ2 − τ1 t=τ t∈[τ1 ,τ2 ] (14) 1 where dspatial [t] is the positional distance at time stamp t, and dvelocity [t] is the similarity measurement of velocity. An affinity matrix w(a, b) = exp(−d(a, b)) is calculated and trajectories are clustered by greedy agglomerative hierarchical models [93][94]. The clusters are overlapped because of similar parts, so every trajectory is weighted and optimized to classify in [95]. Since one motion object may generate several trajectories, it is critical to employ as much features as possible to ensure object recognition, and a multi-layer classifier is invented in [18][96]. 14 3.3. Spectral Clustering Models Trajectory data can be represented as a matrix called affinity matrix, and the relationships between them are extracted as the elements of matrix. The top K eigenvectors form clusters with distinctive gaps between them which can be readily used to separate data into different groups [21]. In addition, affinity matrix characterizes videos [97] and represents the relationships. In [98], affinity matrix A is constructed as follows, Aij = exp[ where d¯ij = 1 n Pn k=1 −d¯ij ], 2σ 2 (15) ||xi,k − xj,k ||, and xi,k indicates the kth point of trajectory i. Considering different lengths of trajectories, some novel models are explored to construct affinity matrix [99][100] and it is constructed as Aij =  2 1  e(− σi σj ||vi −vj || ) , f or i 6= j  (16) 0, otherwise, where vi and vj are points, σi and σj indicates scale invariance computed by the median of the l nearest neighbors. In order to increase the separation of points belonging to different groups, SVD decomposition is used to construct the affinity matrix [101]. In addition, a novel distance method is explored to compute trajectories P and Q [2] so that spatial distinction can be considered. 1 s(P, Q) = e− 2 hα (P,Q)hα (Q,P )/(σp σQ ) , hα (P, Q) = ordα p∈P  min  d(p, q) , (17) (18) q∈N (C(p)) where hα (P, Q) is the directed Hausdorff distance, ordα p∈P f (p) indicates the value of f (p) and N (C(p)) denotes the subset of points which the ones matching to the point p in trajectory P . For clustering high dimensional trajectory data by Spectral Clustering models, several novel methods are explored in [102], [103] and [104]. For example, a new similarity metric captures causal relationships between time series in 15 [103] and a mixture of affinity subspaces is applied to approximate trajectory in [104]. Trajectory data are represented by considering covariance features of trajectories in [105], so it avoids considering different lengths of trajectory data. Spectral clustering works with multiple-instance learning frameworks to achieve human action recognition in [106]. Spectral Clustering models are derived from Graph Theory in which an undirected graph represents the relationships and constructs a symmetric adjacency matrix presenting them [107]. By constructing a graph, both explicit and implicit intentions inside trajectory data are mined [108]. The graph is cut into sub-graphs to classify trajectories, and each sub-graph represents its own cluster [25][109]. Hierarchical layers search sub-clusters in each cluster by treating trajectories points as graph nodes and this procedure is called Hierarchical graph partitioning [110]. For considering more variables, a novel measurement function comprised of the entropy rate of a random walk on a graph is presented in [65]. From the idea that an undirected graph can be represented as an adjacent matrix, a directed graph also can be involved [3]. Trajectory Binary Partition Tree (BPT) represents video in [111] by representing trajectories as nodes so the edges indicate relationships between a pair of trajectories, and graph cut method groups trajectory data. Because of the robustness of composite feature descriptors, the descriptors including Speeded Up Robust Features (SURF) and Maximally Stable Extremal Regions (MSER) are employed in [109]. An object creates several trajectories if different parts of the object are tracked, so a model is invented to describe trajectories by feature patches [112]. The edges are computed by geometric distance and appearance distance. Hausdorff distance is utilized to measure the similarities and set as weights of edges in [113]. Since the great performance of PageRank, it is used to score the edges in [114], too. 3.4. Discussion Densely Clustering models classify trajectories by distance metrics mostly, which may result in classifying trajectory data by spatial information. Hierar16 chical Clustering models fix this problem by considering more attributes in each level. However, this operation cost much more time in computation. Spectral Clustering models compute internal relationships by analyzing the affinity matrix, and it saves much more computational resource by processing all trajectory data together. But [115] mentions that Spectral Clustering models have their own limitation that they are well defined only for the non-negative affinities between trajectories. Furthermore, that trajectory lengths are required to be unified is another issue of applying Spectral Clustering models. 4. Supervised Algorithms of Trajectory Clustering Supervised algorithms aims at learning a function which determines the labels of testing data after analyzing labeled training data. Therefore, supervised algorithms outperform on scene understanding and utilization of ground truth, and the algorithms could save much more computation resource. In some supervised algorithms, trajectory data are classified by unsupervised algorithms and the representations of clusters are obtained to classify new inquiry trajectories. For example, in Densely Clustering models, the representations can be computed from the grouped training trajectory data and new coming trajectories are clustered quickly in [5] and [87]. Trajectory data are classified and organized in a tree-construction and new coming trajectories are clustered by searching the tree in [4] and [116]. 4.1. Nearest Neighbor Algorithms Nearest Neighbor algorithms, such as k-Nearest Neighbor algorithm (k-NN), are finding a voting system to determine the category of a new coming entity and all data are kept in the same feature space. In trajectory clustering, the distances from an inquiry trajectory to all labeled trajectory data are computed, and the label of the inquiry trajectory is voted by its k nearest neighbors. Shown 17 in Fig.7, the inquiry trajectory is assigned as blue cluster if k = 1 and assigned as red one if k = 3. In the implementation, it is important to choose a suitable distance metric Figure 7: k-NN for trajectory clustering. Inquiry trajectory is the green one, the labeled data are the red and the blue ones which means two clusters. according to the scenario, occlusion, trajectory data sources and feature types. Therefore, trajectory data are represented by MBR and classified by k-NN in [22]. It avoids occlusion and increasing inter-object separability. Furthermore, trajectory data are represented in Riemannian manifold [117] so their shapes can be modeled and compared by using an elastic metric. For accessing k-NN faster, fast nearest neighbor (fastNN) algorithm organizes trajectory data in an Octree [118]. With the increasing inquiry trajectories, the trends of trajectory data in a fixed period are required instead of general representation, so a circumstance that dynamically searches the nearest neighbors in a fixed period or the ones belonging to some specific types is considered in [119]. Support Vector Machine (SVM) is trained to generate the hypervolume, and the inquiry trajectory is determined as outliers if it falls outside the hypervolume [120]. Structural Support Vector Machine (Structural SVM) is explored to detect social groups in crowds in [121]. Furthermore, SVM works with Graph Theory to cluster trajectories in [122]. 4.2. Statistical Models Statistical models exploit a set of probability distributions to represent the data generating process such as Gaussian Mixture model (GMM) and Bayesian 18 inference. GMM usually combines with EM algorithm to train each component, and Bayesian inference obtains a set of probability functions which determine the categories of inquiry trajectory data. Bayes’ theorem is critical for Bayesian inference and written as P (A|B) = P (B|A)P (A) P (B) where A and B indicate two events in event space. GMM aims at describing the sample from {x1 , x2 , · · · , xn } in a component of GMM as P (xj ) = K X πi N (xj ; µi , Σi ), (19) i=1 where N (xj ; µi , Σi ) is the probability density of the ith component belonging to a component with mean µi and variance Σi . πi is the weight with a constraint PK that i=1 πi = 1, and they can be computed according to event frequency. Generally, EM algorithm iteratively optimizes the parameters of GMM, but Maximum Likelihood algorithm is implemented instead of EM if labeled trajectory data are available in training stage. For example, video events are treated as a linear combination of a set of event patterns, and two probabilistic terms are proposed to characterize video events in [9]. Furthermore, the abnormal patterns are scored by summarizing the probabilities of trajectory data of the corresponding video. GMM models the variance caused by the environmental factors and embedded into DTW to recognize gestures [68]. Bayesian inference classifies new coming data, and the classified ones update the probability functions of Bayesian inference. For samples {x1 , x2 , · · · , xn }, the probability of the corresponding labels y1:n is p(y1:n |x1:n ). Derived from Markov Chain Monte Carlo (MCMC) algorithm, the distribution of variables can be approximated by a joint distribution, so Gibbs sampling is used to approximate p(y1:n |x1:n ) by sampling p(yi |y−i , x1:n ) iteratively. According to Bayes’ theorem, p(yi |y−i , x1:n ) is represented as p(yi |y−i , x1:n ) ∝ p(xi |yi )p(yi |y−i ) where p(xi |yi ) is the likelihood and p(yi |y−i ) is the marginal distribution. In Dirichlet Process (DP) model which is one of the Bayesian inference frameworks, P p(yi |y−i ) is formulated as p(yi |y−i ) ∝ αG0 (yi ) + j∈−i δ(yi − yj ) where α is 19 scale parameter and G0 is base measure in sample space. The clusters can be parameterized for classifying new inquiry data, e.g., Dirichlet Process Mixture model (DPMM) is used to represent all m clusters with parameterized indexes {Θ1 , Θ2 , · · · , Θm } in [28]. Finally, the new inquiry trajectory is classified by a trained DPMM as p(Θk |R) ∝ p(R|Θk )p(Θk ) where p(R|Θk ) is the likelihood and p(Θk ) is the prior probability. In order to learn coupled spatial and temporal patterns, Hierarchical Dirichlet Process (HDP) algorithm is applied in [6]. Bayesian model is used to segment object by classifying trajectories, so that human motion is also detected [123]. 4.3. Neural Network Neural network is an artificial system simulating the biological neural network in animal brains. The network is constructed by a number of mutually connected neurons, and each neuron is represented as a real number. Neural networks can represent data such as deep generative model. It is trained to represent multivariate time series if trajectory data are generated as a vector [124], and a deep fully-connected Neural Network with weight decay and sparsity constraint transfers trajectory data from different viewpoints to a fixed viewpoint in compact representation [125]. In most cases, Neural Network is used to classify data. It can be viewed as Figure 8: CNN is one of the classical models of Neural Network and widely used in images classification a mathematical function f : X → Y where X is the observation and Y indicates the corresponding label. For example, Convolutional Neural Network (CNN, or ConvNet) consists of multiple layers including convolutional, pooling and fully 20 connected layers. That layout tolerates the variations of the input data, avoids overfitting problem and distinguishes data as similar as Multilayer perceptron (MLP). CNN has been proved efficient in clustering issue of computer vision. As Fig.8 shown, CNN is comprised by two convolutional layers, two pooling layers, two fully connected layers and one output layer which acts as an image classifier. CNN is employed for trajectory clustering in [23] and [24]. Furthermore, CNN also ranks the trajectory clustering results in [51]. A flexible deep CNN called Deep Event Network (DevNet) is trained by ImageNet data set, and the trained DevNet is tuned to extract generic image-level features of trajectory data in [126]. In order to figure out the differences between image classification and multimedia event detection, DevNet fine tunes parameters by a specific data set, and backward passing is employed to identify pixels in consecutive frames to recount events. Deep Neural Network (DNN) is another Neural Network which learns a more compact and powerful representation of trajectories [127]. Furthermore, DNN keeps the structural relationships between trajectories in [128], and mines the relationship between multiple features including spatiotemporal features, audio features and inter-class relationship to classify videos in [129] and [130]. Self-Organizing Map learns the similarities between trajectories in a 2-dimensional grid and each element of the grid indicates a specific prototype in [27] and [131]. In training steps, each training trajectory is trying to find the most suitable prototype in network, and adjust the neighbors of the matched one accordingly. 4.4. Discussion Nearest Neighbor algorithm only considers the spatial relationships between a pair of trajectory data but ignores local characters. Statistical model makes up for this imperfection by combining them in a mixture model or inferring the relationships in Bayesian models. Neural Network considers the differences of trajectory data and requires a huge number of data to train it. Though the supervised methods obtain the classifiers by observing a number of training data, 21 overfitting problem may happen when the model overreacts training data. 5. Semi-supervised Algorithms of Trajectory Clustering Semi-supervised algorithms fall between unsupervised algorithms and supervised algorithms. The algorithms make use of a small number of labeled data and continuous inquiry data to complete tasks. The model is trained by labeled data firstly, then inquiry data are kept sending to the trained model to make sure that it can be updated to outperform the previous model. Semi-supervised procedure needs only a small cost in terms of human classification efforts. This procedure not only avoids overfitting problem, but also is more accurate than the unsupervised ones. Therefore, some semi-supervised algorithms are invented from unsupervised or supervised algorithms. For example, trajectory data are classified firstly and the new inquiry ones are clustered to update the classifier automatically [4][8][9][132]. Detected anomaly trajectory data are used to recalculate the representation of anomaly trajectory clusters in [132]. Trajectory data of video are modeled as the combination of normal and abnormal patterns, and probabilistic terms characterize the patterns in [9]. From this modeling, the terms can be updated by the detected inquiry trajectory. In order to detect abnormal trajectories faster in complex scene, low-rank approximation is employed to describe trajectory data and the new detected abnormal ones update the threshold in [8]. Inspired by Hierarchical Frameworks, trajectories and the clusters are represented as a tree where children nodes indicate trajectories and roots denote the representations of the clusters in [133], [134] and [135]. A new cluster is created if no clusters close to the inquiry trajectory. Trajectory T is constructed as a vector of 2 dimensional coordinates T = {t1 , · · · , tn } where tj = {xj , yj }. A representation of cluster is computed as Ci = {ci1 , · · · , cim }, 2 2 where cij = {xij , yij , σij } and σij is an approximation of the local variance of 22 the cluster i at time j. The inquiry trajectory is assigned to the nearest cluster and the corresponding cluster should be updated by the new one. For the nearest cluster point c = {x, y, σ 2 } to the point of trajectory t = {x̂, ŷ}, c is updated as following    x = (1 − α)x + αx̂    y = (1 − α)y + αŷ      σ 2 = (1 − α)σ 2 + α[dist(t , c )]2 , i j (20) where α is the update rate between 0 and 1. Considering the fact that Bayesian model is derived from Bayes’ theorem, the parameters are optimized by sampling training data, and it is feasible to update the model by classified new inquiry data [28]. Furthermore, in order to add new trajectory data, the previous samples and the new ones are sampled by Gibbs Sampling as new p(ηi |η−i , y1:N +φ ) = p(ηi |η1:N = W1:N , η−i , y1:N +φ ), (21) where y is trajectory data, η1:N indicate the known states of the previous samnew ples, and N + 1 < i < N + φ. η−i denote the states of new inquiry tra- jectory data except for the ith one. From Bayes’ theorem, the cluster process new is rewritten as p(yi |ηi )p(ηi |η1:N = W1:N , η−i ). p(yi |ηi ) is estimated by the previous samples and it is assumed to be Gaussian distribution. The only issue need to be fixed is carrying out Gibbs Sampling on ηN +1:N +φ to compute new p(ηi |η1:N = W1:N , η−i ). 6. Promising Future Directions and Tasks In trajectory clustering, we saw that how to measure trajectories with different lengths is important. Thus, a representation method or feature descriptor is essential for trajectory clustering. In recent years, transforming trajectory data into other space are paid more attention, such as DFT which keeping data 23 information and unifying lengths of trajectory data [28]. For other preparation works, re-sampling is efficient for sparse scene [36], but it limits the robustness of model. Curve approximation fits the movement of trajectory [25][26]. Hence, trajectory data preparation may be a promising and helpful direction. Recently, Densely Clustering models have achieved great progress in trajectory clustering. In particular, novel distance metrics have been proposed to measure trajectory data according to different properties. Furthermore, for the trajectory data with large difference in density, grid construction is employed to improve the performance [136]. Besides grid-based DBCSAN, sub-trajectories are acted as the substitute for trajectory in [40], [69] and [76]. Though Spectral Clustering models and Graph method share a similar idea, they are intrinsically different. Spectral Clustering models are easy to implement and have no restriction on data dimensions, but the models require nonnegative affinities and this limitation restricts the performance and the application. Therefore, a suitable affinity matrix construction method is needed. Furthermore, it is critical to determine scale value when the affinity matrix is being computed, because it determines the clustering is fail or not. Thus, Spectral Clustering models need to handle the problem of constructing affinity matrix. In supervised algorithms, a large number of training data are required to obtain an efficient model. However, such as in Neural Network, there may have overfitting problem and some special steps are needed like pooling layers in CNN. In addition, it should be noticed that a meaningful distance metric is essential for Nearest Neighbor algorithms. 7. Conclusion In this paper, we reviewed the methods of trajectory clustering. They are classified into three categories: unsupervised, supervised and semi-supervised algorithms. Unsupervised algorithms can be grouped into three sub-categories: 24 Densely Clustering models, Hierarchical Clustering models and Spectral Clustering models. Supervised algorithms are divided into Nearest Neighbor algorithms, statistical models and Neural Network. By means of a comprehensive analysis, we found that unsupervised algorithms have the disadvantages of high computation cost and heavy memory load, although there is no training data requirement and human experts supervising. Semi-supervised algorithms combine the advantages of both previous algorithms, and may result in more efficient methods. Finally, we proposed several promising future directions and tasks, and this paper could help readers to gain a thorough understanding of trajectory clustering. References References [1] Z. Chen, H. T. Shen, X. Zhou, Y. Zheng, X. Xie, Searching trajectories by locations: an efficiency study, in: Proceedings of the 2010 ACM SIGMOD International Conference on Management of data, ACM, 2010, pp. 255– 266. [2] S. Atev, O. Masoud, N. Papanikolopoulos, Learning traffic patterns at intersections by spectral clustering of motion trajectories, in: IROS, 2006, pp. 4851–4856. [3] X. Li, J. Han, J.-G. Lee, H. Gonzalez, Traffic density-based discovery of hot routes in road networks, in: International Symposium on Spatial and Temporal Databases, Springer, 2007, pp. 441–459. [4] S. Gurung, D. Lin, W. Jiang, A. Hurson, R. Zhang, Traffic information publication with privacy preservation, ACM Transactions on Intelligent Systems and Technology (TIST) 5 (3) (2014) 44. 25 [5] F. I. Bashir, A. A. Khokhar, D. Schonfeld, Object trajectory-based activity classification and recognition using hidden markov models, IEEE transactions on Image Processing 16 (7) (2007) 1912–1919. [6] H. Wang, C. OSullivan, Globally continuous and non-markovian crowd activity analysis from videos, in: European Conference on Computer Vision, Springer, 2016, pp. 527–544. [7] T. Yao, Z. Wang, Z. Xie, J. Gao, D. D. Feng, Learning universal multiview dictionary for human action recognition, Pattern Recognition 64 (2017) 236–244. [8] L. Wang, M. Dong, Detection of abnormal human behavior using a matrix approximation-based approach, in: Machine Learning and Applications (ICMLA), 2014 13th International Conference on, IEEE, 2014, pp. 324– 329. [9] Y. Yuan, Y. Feng, X. Lu, Statistical hypothesis detector for abnormal event detection in crowded scenes, IEEE transactions on cybernetics 47 (11) (2017) 3597–3608. [10] W. Zhao, Z. Zhang, K. Huang, Gestalt laws based tracklets analysis for human crowd understanding, Pattern Recognition 75 (2018) 112–127. [11] R. Chaker, Z. Al Aghbari, I. N. Junejo, Social network model for crowd anomaly detection and localization, Pattern Recognition 61 (2017) 266– 281. [12] S. Kumar, Y. Dai, H. Li, Spatio-temporal union of subspaces for multibody non-rigid structure-from-motion, Pattern Recognition 71 (2017) 428–443. [13] N. Ferreira, J. T. Klosowski, C. E. Scheidegger, C. T. Silva, Vector field k-means: Clustering trajectories by fitting multiple vector fields, in: Computer Graphics Forum, Vol. 32, Wiley Online Library, 2013, pp. 201–210. 26 [14] Y. Mo, D. Wu, Y. Du, Application of trajectory clustering and regionalization to ocean eddies in the south china sea, in: Spatial Data Mining and Geographical Knowledge Services (ICSDM), 2015 2nd IEEE International Conference on, IEEE, 2015, pp. 45–48. [15] G. Cai, K. Lee, I. Lee, A framework for mining semantic-level tourist movement behaviours from geo-tagged photos, in: Australasian Joint Conference on Artificial Intelligence, Springer, 2016, pp. 519–524. [16] H. Wang, D. Oneata, J. Verbeek, C. Schmid, A robust and efficient video representation for action recognition, International Journal of Computer Vision 119 (3) (2016) 219–238. [17] M. Nanni, D. Pedreschi, Time-focused clustering of trajectories of moving objects, Journal of Intelligent Information Systems 27 (3) (2006) 267–289. [18] X. Li, W. Hu, W. Hu, A coarse-to-fine strategy for vehicle motion trajectory clustering, in: 18th International Conference on Pattern Recognition (ICPR’06), Vol. 1, IEEE, 2006, pp. 591–594. [19] M. Ester, H.-P. Kriegel, J. Sander, X. Xu, et al., A density-based algorithm for discovering clusters in large spatial databases with noise., in: Kdd, Vol. 96, 1996, pp. 226–231. [20] X. Wang, K. Tieu, E. Grimson, Learning semantic scene models by trajectory analysis, in: European conference on computer vision, Springer, 2006, pp. 110–123. [21] T. Xiang, S. Gong, Spectral clustering with eigenvector selection, Pattern Recognition 41 (3) (2008) 1012–1029. [22] Y.-J. Gao, C. Li, G.-C. Chen, L. Chen, X.-T. Jiang, C. Chen, Efficient k-nearest-neighbor search algorithms for historical moving object trajectories, Journal of Computer Science and Technology 22 (2) (2007) 232–244. 27 [23] Z. Wu, Y. Fu, Y.-G. Jiang, L. Sigal, Harnessing object and scene semantics for large-scale video understanding, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 3112–3121. [24] K. Cho, X. Chen, Classifying and visualizing motion capture sequences using deep neural networks, in: Computer Vision Theory and Applications (VISAPP), 2014 International Conference on, Vol. 2, IEEE, 2014, pp. 122– 130. [25] T. Zhang, H. Lu, S. Z. Li, Learning semantic scene models by object classification and trajectory clustering, in: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, IEEE, 2009, pp. 1940–1947. [26] R. R. Sillito, R. B. Fisher, Semi-supervised learning for anomalous trajectory detection., in: BMVC, Vol. 1, 2008, pp. 035–1. [27] A. Naftel, S. Khalid, Motion trajectory learning in the dft-coefficient feature space, in: Fourth IEEE International Conference on Computer Vision Systems (ICVS’06), IEEE, 2006, pp. 47–47. [28] W. Hu, X. Li, G. Tian, S. Maybank, Z. Zhang, An incremental dpmmbased method for trajectory clustering, modeling, and retrieval, IEEE transactions on pattern analysis and machine intelligence 35 (5) (2013) 1051–1065. [29] H. Hu, J. Feng, J. Zhou, Exploiting unsupervised and supervised constraints for subspace clustering, IEEE transactions on pattern analysis and machine intelligence 37 (8) (2015) 1542–1557. [30] I. Akhter, Y. Sheikh, S. Khan, T. Kanade, Trajectory space: A dual representation for nonrigid structure from motion, IEEE Transactions on Pattern Analysis and Machine Intelligence 33 (7) (2011) 1442–1456. 28 [31] F. I. Bashir, A. A. Khokhar, D. Schonfeld, Real-time motion trajectorybased indexing and retrieval of video sequences, IEEE Transactions on Multimedia 9 (1) (2007) 58–65. [32] Y.-G. Jiang, Q. Dai, X. Xue, W. Liu, C.-W. Ngo, Trajectory-based modeling of human actions with motion reference points, in: European Conference on Computer Vision, Springer, 2012, pp. 425–438. [33] J. Schenk, G. Rigoll, Novel hybrid nn/hmm modelling techniques for online handwriting recognition, in: Tenth International Workshop on Frontiers in Handwriting Recognition, Suvisoft, 2006. [34] W.-G. Liou, C.-Y. Hsieh, W.-Y. Lin, Trajectory-based sign language recognition using discriminant analysis in higher-dimensional feature space, in: 2011 IEEE International Conference on Multimedia and Expo, IEEE, 2011, pp. 1–4. [35] N. Piotto, N. Conci, F. G. De Natale, Syntactic matching of trajectories for ambient intelligence applications, IEEE Transactions on Multimedia 11 (7) (2009) 1266–1275. [36] H. Wang, M. M. Ullah, A. Klaser, I. Laptev, C. Schmid, Evaluation of local spatio-temporal features for action recognition, in: BMVC 2009British Machine Vision Conference, BMVA Press, 2009, pp. 124–1. [37] P. Ochs, J. Malik, T. Brox, Segmentation of moving objects by long term video analysis, IEEE transactions on pattern analysis and machine intelligence 36 (6) (2014) 1187–1200. [38] E. Elhamifar, R. Vidal, Sparse subspace clustering, in: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, IEEE, 2009, pp. 2790–2797. [39] O. Cappé, S. J. Godsill, E. Moulines, An overview of existing methods and recent advances in sequential monte carlo, Proceedings of the IEEE 95 (5) (2007) 899–924. 29 [40] J.-G. Lee, J. Han, K.-Y. Whang, Trajectory clustering: a partition-andgroup framework, in: Proceedings of the 2007 ACM SIGMOD international conference on Management of data, ACM, 2007, pp. 593–604. [41] A. Anagnostopoulos, M. Vlachos, M. Hadjieleftheriou, E. Keogh, P. S. Yu, Global distance-based segmentation of trajectories, in: Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, ACM, 2006, pp. 34–43. [42] Z. Yan, C. Parent, S. Spaccapietra, D. Chakraborty, A hybrid model and computing platform for spatio-semantic trajectories, in: Extended Semantic Web Conference, Springer, 2010, pp. 60–75. [43] D. R. Faria, J. Dias, 3d hand trajectory segmentation by curvatures and hand orientation for classification through a probabilistic approach, in: 2009 IEEE/RSJ International Conference on Intelligent Robots and Systems, IEEE, 2009, pp. 1284–1289. [44] Z. Zhang, K. Huang, T. Tan, L. Wang, Trajectory series analysis based event rule induction for visual surveillance, in: 2007 IEEE Conference on Computer Vision and Pattern Recognition, IEEE, 2007, pp. 1–8. [45] T. Tuytelaars, K. Mikolajczyk, Local invariant feature detectors: a survey, Foundations and trends R in computer graphics and vision 3 (3) (2008) 177–280. [46] B. T. Morris, M. M. Trivedi, A survey of vision-based trajectory learning and analysis for surveillance, IEEE transactions on circuits and systems for video technology 18 (8) (2008) 1114–1127. [47] N. Brandle, D. Bauer, S. Seer, Track-based finding of stopping pedestrians-a practical approach for analyzing a public infrastructure, in: 2006 IEEE Intelligent Transportation Systems Conference, IEEE, 2006, pp. 115–120. 30 [48] B. T. Morris, M. M. Trivedi, Trajectory learning for activity understanding: Unsupervised, multilevel, and long-term adaptive approach, IEEE transactions on pattern analysis and machine intelligence 33 (11) (2011) 2287–2301. [49] Q.-Y. Zhou, V. Koltun, Dense scene reconstruction with points of interest, ACM Transactions on Graphics (TOG) 32 (4) (2013) 112. [50] H. Wang, A. Kläser, C. Schmid, C.-L. Liu, Action recognition by dense trajectories, in: Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, IEEE, 2011, pp. 3169–3176. [51] K. Fragkiadaki, P. Arbelaez, P. Felsen, J. Malik, Learning to segment moving objects in videos, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 4083–4090. [52] A. Klaser, M. Marszalek, C. Schmid, A spatio-temporal descriptor based on 3d-gradients, in: BMVC 2008-19th British Machine Vision Conference, British Machine Vision Association, 2008, pp. 275–1. [53] I. Laptev, M. Marszalek, C. Schmid, B. Rozenfeld, Learning realistic human actions from movies, in: Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, IEEE, 2008, pp. 1–8. [54] G. Willems, T. Tuytelaars, L. Van Gool, An efficient dense and scaleinvariant spatio-temporal interest point detector, in: European conference on computer vision, Springer, 2008, pp. 650–663. [55] P. Matikainen, M. Hebert, R. Sukthankar, Trajectons: Action recognition through the motion analysis of tracked features, in: Computer Vision Workshops (ICCV Workshops), 2009 IEEE 12th International Conference on, IEEE, 2009, pp. 514–521. [56] P. Matikainen, M. Hebert, R. Sukthankar, Representing pairwise spatial and temporal relations for action recognition, in: European Conference on Computer Vision, Springer, 2010, pp. 508–521. 31 [57] H. Uemura, S. Ishikawa, K. Mikolajczyk, Feature tracking and motion compensation for action recognition., in: BMVC, 2008, pp. 1–10. [58] J. Sun, X. Wu, S. Yan, L.-F. Cheong, T.-S. Chua, J. Li, Hierarchical spatio-temporal context modeling for action recognition, in: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, IEEE, 2009, pp. 2004–2011. [59] F. Wang, Y.-G. Jiang, C.-W. Ngo, Video event detection using motion relativity and visual relatedness, in: Proceedings of the 16th ACM international conference on Multimedia, ACM, 2008, pp. 239–248. [60] E. Vig, M. Dorr, D. Cox, Space-variant descriptor sampling for action recognition based on saliency and eye movements, in: European conference on computer vision, Springer, 2012, pp. 84–97. [61] H. Wang, A. Kläser, C. Schmid, C.-L. Liu, Dense trajectories and motion boundary descriptors for action recognition, International journal of computer vision 103 (1) (2013) 60–79. [62] B. Morris, M. Trivedi, Learning trajectory patterns by clustering: Experimental studies and comparative evaluation, in: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, IEEE, 2009, pp. 312–319. [63] Z. Zhang, K. Huang, T. Tan, Comparison of similarity measures for trajectory clustering in outdoor surveillance scenes, in: 18th International Conference on Pattern Recognition (ICPR’06), Vol. 3, IEEE, 2006, pp. 1135–1138. [64] S. Atev, G. Miller, N. P. Papanikolopoulos, Clustering of vehicle trajectories, IEEE Transactions on Intelligent Transportation Systems 11 (3) (2010) 647–657. [65] M.-Y. Liu, O. Tuzel, S. Ramalingam, R. Chellappa, Entropy-rate clustering: Cluster analysis via maximizing a submodular function subject to a 32 matroid constraint, IEEE Transactions on Pattern Analysis and Machine Intelligence 36 (1) (2014) 99–112. [66] J. Chen, R. Wang, L. Liu, J. Song, Clustering of trajectories based on hausdorff distance, in: Electronics, Communications and Control (ICECC), 2011 International Conference on, IEEE, 2011, pp. 1940–1944. [67] Z. Shao, Y. Li, On integral invariants for effective 3-d motion trajectory matching and recognition, IEEE transactions on cybernetics 46 (2) (2016) 511–523. [68] M. A. Bautista, A. Hernández-Vela, S. Escalera, L. Igual, O. Pujol, J. Moya, V. Violant, M. T. Anguera, A gesture recognition system for detecting behavioral patterns of adhd, IEEE transactions on cybernetics 46 (1) (2016) 136–147. [69] J.-G. Lee, J. Han, X. Li, H. Gonzalez, Traclass: trajectory classification using hierarchical region-based and trajectory-based clustering, Proceedings of the VLDB Endowment 1 (1) (2008) 1081–1094. [70] Z. Li, J.-G. Lee, X. Li, J. Han, Incremental clustering for trajectories, in: International Conference on Database Systems for Advanced Applications, Springer, 2010, pp. 32–46. [71] A. T. Palma, V. Bogorny, B. Kuijpers, L. O. Alvares, A clustering-based approach for discovering interesting places in trajectories, in: Proceedings of the 2008 ACM symposium on Applied computing, ACM, 2008, pp. 863–868. [72] Y. Bu, L. Chen, A. W.-C. Fu, D. Liu, Efficient anomaly monitoring over moving object trajectory streams, in: Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, ACM, 2009, pp. 159–168. [73] G. Andrienko, N. Andrienko, S. Rinzivillo, M. Nanni, D. Pedreschi, F. Giannotti, Interactive visual clustering of large collections of trajectories, in: 33 Visual Analytics Science and Technology, 2009. VAST 2009. IEEE Symposium on, IEEE, 2009, pp. 3–10. [74] H. Jeung, M. L. Yiu, X. Zhou, C. S. Jensen, H. T. Shen, Discovery of convoys in trajectory databases, Proceedings of the VLDB Endowment 1 (1) (2008) 1068–1080. [75] H. Wang, C. Schmid, Action recognition with improved trajectories, in: Proceedings of the IEEE International Conference on Computer Vision, 2013, pp. 3551–3558. [76] H. S. Khaing, T. Thein, An efficient clustering algorithm for moving object trajectories, in: 3rd International Conference on Computational techniques and Artificial Intelligence (ICCTAI 2014) February, 2014, pp. 11– 12. [77] Y. Zheng, Trajectory data mining: an overview, ACM Transactions on Intelligent Systems and Technology (TIST) 6 (3) (2015) 29. [78] K. Deng, K. Xie, K. Zheng, X. Zhou, Trajectory indexing and retrieval, in: Computing with spatial trajectories, Springer, 2011, pp. 35–60. [79] Y. Zheng, X. Xie, W.-Y. Ma, Geolife: A collaborative social networking service among user, location and trajectory., IEEE Data Eng. Bull. 33 (2) (2010) 32–39. [80] H. Xu, Y. Zhou, W. Lin, H. Zha, Unsupervised trajectory clustering via adaptive multi-kernel-based shrinkage, in: Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 4328–4336. [81] N. Suzuki, K. Hirasawa, K. Tanaka, Y. Kobayashi, Y. Sato, Y. Fujino, Learning motion patterns and anomaly detection by human trajectory analysis, in: 2007 IEEE International Conference on Systems, Man and Cybernetics, IEEE, 2007, pp. 498–503. 34 [82] L. Galluccio, O. Michel, P. Comon, A. O. Hero, Graph based k-means clustering, Signal Processing 92 (9) (2012) 1970–1984. [83] W. Hu, X. Xiao, Z. Fu, D. Xie, T. Tan, S. Maybank, A system for learning statistical motion patterns, IEEE transactions on pattern analysis and machine intelligence 28 (9) (2006) 1450–1464. [84] J. Melo, A. Naftel, A. Bernardino, J. Santos-Victor, Detection and classification of highway lanes using vehicle motion trajectories, IEEE Transactions on intelligent transportation systems 7 (2) (2006) 188–200. [85] Y. Zhou, S. Yan, T. S. Huang, Detecting anomaly in videos from trajectory similarity analysis, in: 2007 IEEE International Conference on Multimedia and Expo, IEEE, 2007, pp. 1087–1090. [86] Z. Kim, Real time object tracking based on dynamic feature grouping with background subtraction, in: Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, IEEE, 2008, pp. 1–8. [87] N. Pelekis, I. Kopanakis, E. E. Kotsifakos, E. Frentzos, Y. Theodoridis, Clustering trajectories of moving objects in an uncertain world., in: ICDM, Vol. 9, 2009, pp. 417–427. [88] N. Pelekis, I. Kopanakis, E. E. Kotsifakos, E. Frentzos, Y. Theodoridis, Clustering uncertain trajectories, Knowledge and Information Systems 28 (1) (2011) 117–147. [89] D. Simonnet, E. Anquetil, M. Bouillon, Multi-criteria handwriting quality analysis with online fuzzy models, Pattern Recognition 69 (2017) 310–324. [90] Y. Zheng, L. Zhang, X. Xie, W.-Y. Ma, Mining interesting locations and travel sequences from gps trajectories, in: Proceedings of the 18th international conference on World wide web, ACM, 2009, pp. 791–800. [91] K. Zheng, Y. Zheng, N. J. Yuan, S. Shang, On discovery of gathering patterns from trajectories, in: Data Engineering (ICDE), 2013 IEEE 29th International Conference on, IEEE, 2013, pp. 242–253. 35 [92] A. Gaidon, Z. Harchaoui, C. Schmid, Activity representation with motion hierarchies, International journal of computer vision 107 (3) (2014) 219– 238. [93] M. Raptis, I. Kokkinos, S. Soatto, Discovering discriminative action parts from mid-level video representations, in: Computer Vision and Pattern Recognition, 2012 IEEE Conference on, IEEE, 2012, pp. 1242–1249. [94] S. S. Tabatabaei, M. Coates, M. Rabbat, Ganc: Greedy agglomerative normalized cut, arXiv preprint arXiv:1105.0974. [95] B. Ni, P. Moulin, X. Yang, S. Yan, Motion part regularization: Improving action recognition via trajectory selection, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 3698– 3706. [96] G. Antonini, J.-P. Thiran, Counting pedestrians in video sequences using trajectory clustering, IEEE Transactions on Circuits and Systems for Video Technology 16 (8) (2006) 1008–1020. [97] F. Turchini, L. Seidenari, A. Del Bimbo, Understanding sport activities from correspondences of clustered trajectories, in: Proceedings of the IEEE International Conference on Computer Vision Workshops, 2015, pp. 43–50. [98] W. Hu, D. Xie, Z. Fu, W. Zeng, S. Maybank, Semantic-based surveillance video retrieval, IEEE Transactions on image processing 16 (4) (2007) 1168–1181. [99] E. Brunskill, T. Kollar, N. Roy, Topological mapping using spectral clustering and classification, in: 2007 IEEE/RSJ International Conference on Intelligent Robots and Systems, IEEE, 2007, pp. 3491–3496. [100] T. Brox, J. Malik, Object segmentation by long term analysis of point trajectories, in: European conference on computer vision, Springer, 2010, pp. 282–295. 36 [101] F. Lauer, C. Schnörr, Spectral clustering of linear subspaces for motion segmentation, in: 2009 IEEE 12th International Conference on Computer Vision, IEEE, 2009, pp. 678–685. [102] Z. Zhang, K. Huang, T. Tan, P. Yang, J. Li, Red-sfa: Relation discovery based slow feature analysis for trajectory clustering, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 752–760. [103] D. Hong, Q. Gu, K. Whitehouse, High-dimensional time series clustering via cross-predictability, in: Artificial Intelligence and Statistics, 2017, pp. 642–651. [104] G. Chen, G. Lerman, Spectral curvature clustering (scc), International Journal of Computer Vision 81 (3) (2009) 317–330. [105] H. Ergezer, K. Leblebicioğlu, Anomaly detection and activity perception using covariance descriptor for trajectories, in: European Conference on Computer Vision, Springer, 2016, pp. 728–742. [106] Y. Yi, M. Lin, Human action recognition with graph-based multipleinstance learning, Pattern Recognition 53 (2016) 148–162. [107] A. E. Brouwer, W. H. Haemers, Spectra of graphs, Springer Science & Business Media, 2011. [108] W. Chen, J. J. Corso, Action detection by implicit intentional motion clustering, in: Proceedings of the IEEE international conference on computer vision, 2015, pp. 3298–3306. [109] L. Lin, Y. Lu, Y. Pan, X. Chen, Integrating graph partitioning and matching for trajectory analysis in video surveillance, IEEE Transactions on Image Processing 21 (12) (2012) 4844–4857. [110] D. Guo, S. Liu, H. Jin, A graph-based approach to vehicle trajectory analysis, Journal of Location Based Services 4 (3-4) (2010) 183–199. 37 [111] G. Palou, P. Salembier, Hierarchical video representation with trajectory binary partition tree, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2013, pp. 2099–2106. [112] X. Liu, L. Lin, S.-C. Zhu, H. Jin, Trajectory parsing by cluster sampling in spatio-temporal graph, in: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, IEEE, 2009, pp. 739–746. [113] I. N. Junejo, H. Foroosh, Euclidean path modeling for video surveillance, Image and Vision computing 26 (4) (2008) 512–528. [114] M. Cho, K. MuLee, Authority-shift clustering: Hierarchical clustering by authority seeking on graphs, in: Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, IEEE, 2010, pp. 3193–3200. [115] M. Keuper, B. Andres, T. Brox, Motion trajectory segmentation via minimum cost multicuts, in: Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 3271–3279. [116] N. Pelekis, P. Tampakis, M. Vodas, C. Doulkeridis, Y. Theodoridis, On temporal-constrained sub-trajectory cluster analysis, Data Mining and Knowledge Discovery (2017) 1–37. [117] M. Devanne, H. Wannous, S. Berretti, P. Pala, M. Daoudi, A. Del Bimbo, 3-d human action recognition by shape analysis of motion trajectories on riemannian manifold, IEEE transactions on cybernetics 45 (7) (2015) 1340–1352. [118] S. Poularakis, I. Katsavounidis, Low-complexity hand gesture recognition system for continuous streams of digits and letters, IEEE transactions on cybernetics 46 (9) (2016) 2094–2108. [119] E. Frentzos, K. Gratsias, N. Pelekis, Y. Theodoridis, Algorithms for nearest neighbor search on moving object trajectories, Geoinformatica 11 (2) (2007) 159–193. 38 [120] C. Piciarelli, C. Micheloni, G. L. Foresti, Trajectory-based anomalous event detection, IEEE Transactions on Circuits and Systems for video Technology 18 (11) (2008) 1544–1554. [121] F. Solera, S. Calderara, R. Cucchiara, Socially constrained structural learning for groups detection in crowd, IEEE transactions on pattern analysis and machine intelligence 38 (5) (2016) 995–1008. [122] D. Singh, C. K. Mohan, Graph formulation of video activities for abnormal activity recognition, Pattern Recognition 65 (2017) 265–272. [123] M. Devanne, S. Berretti, P. Pala, H. Wannous, M. Daoudi, A. Del Bimbo, Motion segment decomposition of rgb-d sequences for human behavior understanding, Pattern Recognition 61 (2017) 222–233. [124] C. Yuan, A. Chakraborty, Deep convolutional factor analyser for multivariate time series modeling, in: Data Mining (ICDM), 2016 IEEE 16th International Conference on, IEEE, 2016, pp. 1323–1328. [125] H. Rahmani, A. Mian, M. Shah, Learning a deep model for human action recognition from novel viewpoints, IEEE transactions on pattern analysis and machine intelligence 40 (3) (2018) 667–681. [126] C. Gan, N. Wang, Y. Yang, D.-Y. Yeung, A. G. Hauptmann, Devnet: A deep event network for multimedia event detection and evidence recounting, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 2568–2577. [127] M. Hasan, A. K. Roy-Chowdhury, A continuous learning framework for activity recognition using deep hybrid feature models, IEEE Transactions on Multimedia 17 (11) (2015) 1909–1922. [128] Y. Shi, W. Zeng, T. Huang, Y. Wang, Learning deep trajectory descriptor for action recognition in videos using deep neural networks, in: 2015 IEEE International Conference on Multimedia and Expo, IEEE, 2015, pp. 1–6. 39 [129] Z. Wu, Y.-G. Jiang, J. Wang, J. Pu, X. Xue, Exploring inter-feature and inter-class relationships with deep neural networks for video classification, in: Proceedings of the 22nd ACM international conference on Multimedia, ACM, 2014, pp. 167–176. [130] Y.-G. Jiang, Z. Wu, J. Wang, X. Xue, S.-F. Chang, Exploiting feature and class relationships in video categorization with regularized deep neural networks, arXiv preprint arXiv:1502.07209. [131] T. Schreck, J. Bernard, T. Von Landesberger, J. Kohlhammer, Visual cluster analysis of trajectory data with interactive kohonen maps, Information Visualization 8 (1) (2009) 14–29. [132] R. Laxhammar, G. Falkman, Online learning and sequential anomaly detection in trajectories, IEEE transactions on pattern analysis and machine intelligence 36 (6) (2014) 1158–1173. [133] C. Piciarelli, G. L. Foresti, On-line trajectory clustering for anomalous events detection, Pattern Recognition Letters 27 (15) (2006) 1835–1842. [134] D. Kulić, W. Takano, Y. Nakamura, Incremental learning, clustering and hierarchy formation of whole body motion patterns using adaptive hidden markov chains, The International Journal of Robotics Research 27 (7) (2008) 761–784. [135] X. Li, V. Ceikute, C. S. Jensen, K.-L. Tan, Effective online group discovery in trajectory databases, IEEE Transactions on Knowledge and Data Engineering 25 (12) (2013) 2752–2766. [136] O. Uncu, W. A. Gruver, D. B. Kotak, D. Sabaz, Z. Alibhai, C. Ng, Gridbscan: Grid density-based spatial clustering of applications with noise, in: Systems, Man and Cybernetics, 2006. SMC’06. IEEE International Conference on, Vol. 4, IEEE, 2006, pp. 2976–2981. 40
1cs.CV
Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs Loic Landrieu1? , Martin Simonovsky2? 1 Université Paris-Est, LASTIG MATIS IGN, ENSG 2 Université Paris-Est, Ecole des Ponts ParisTech arXiv:1711.09869v2 [cs.CV] 28 Mar 2018 [email protected], [email protected] Abstract inefficient and tends to discard small details. Deep learning architectures specifically designed for 3D point clouds [39, 45, 42, 40, 10] display good results, but are limited by the size of inputs they can handle at once. We propose a representation of large 3D point clouds as a collection of interconnected simple shapes coined superpoints, in spirit similar to superpixel methods for image segmentation [1]. As illustrated in Figure 1, this structure can be captured by an attributed directed graph called the superpoint graph (SPG). Its nodes represent simple shapes while edges describe their adjacency relationship characterized by rich edge features. The SPG representation has several compelling advantages. First, instead of classifying individual points or voxels, it considers entire object parts as whole, which are easier to identify. Second, it is able to describe in detail the relationship between adjacent objects, which is crucial for contextual classification: cars are generally above roads, ceilings are surrounded by walls, etc. Third, the size of the SPG is defined by the number of simple structures in a scene rather than the total number of points, which is typically several order of magnitude smaller. This allows us to model long-range interaction which would be intractable otherwise without strong assumptions on the nature of the pairwise connections. Our contributions are as follows: We propose a novel deep learning-based framework to tackle the challenge of semantic segmentation of largescale point clouds of millions of points. We argue that the organization of 3D point clouds can be efficiently captured by a structure called superpoint graph (SPG), derived from a partition of the scanned scene into geometrically homogeneous elements. SPGs offer a compact yet rich representation of contextual relationships between object parts, which is then exploited by a graph convolutional network. Our framework sets a new state of the art for segmenting outdoor LiDAR scans (+11.9 and +8.8 mIoU points for both Semantic3D test sets), as well as indoor scans (+12.4 mIoU points for the S3DIS dataset). 1. Introduction Semantic segmentation of large 3D point clouds presents numerous challenges, the most obvious one being the scale of the data. Another hurdle is the lack of clear structure akin to the regular grid arrangement in images. These obstacles have likely prevented Convolutional Neural Networks (CNNs) from achieving on irregular data the impressive performances attained for speech processing or images. Previous attempts at using deep learning for large 3D data were trying to replicate successful CNN architectures used for image segmentation. For example, SnapNet [5] converts a 3D point cloud into a set of virtual 2D RGBD snapshots, the semantic segmentation of which can then be projected on the original data. SegCloud [46] uses 3D convolutions on a regular voxel grid. However, we argue that such methods do not capture the inherent structure of 3D point clouds, which results in limited discrimination performance. Indeed, converting point clouds to 2D format comes with loss of information and requires to perform surface reconstruction, a problem arguably as hard as semantic segmentation. Volumetric representation of point clouds is ? • We introduce superpoint graphs, a novel point cloud representation with rich edge features encoding the contextual relationship between object parts in 3D point clouds. • Based on this representation, we are able to apply deep learning on large-scale point clouds without major sacrifice in fine details. Our architecture consists of PointNets [39] for superpoint embedding and graph convolutions for contextual segmentation. For the latter, we introduce a novel, more efficient version of EdgeConditioned Convolutions [45] as well as a new form of input gating in Gated Recurrent Units [8]. • We set a new state of the art on two publicly available datasets: Semantic3D [14] and S3DIS [3]. In particu- Both authors contributed equally to this work. 1 (a) RGB point cloud (b) Geometric partition (c) Superpoint graph (d) Semantic segmentation Figure 1: Visualization of individual steps in our pipeline. An input point cloud (a) is partitioned into geometrically simple shapes, called superpoints (b). Based on this preprocessing, a superpoints graph (SPG) is constructed by linking nearby superpoints by superedges with rich attributes (c). Finally, superpoints are transformed into compact embeddings, processed with graph convolutions to make use of contextual information, and classified into semantic labels. lar, we improve mean per-class intersection over union (mIoU) by 11.9 points for the Semantic3D reduced test set, by 8.8 points for the Semantic3D full test set, and by up to 12.4 points for the S3DIS dataset. edges [12]. Of particular interest are models supporting continuous edge attributes [45, 36], which we use to represent interactions. In image segmentation, convolutions on graphs built over superpixels have been used for postprocessing: Liang et al. [32, 31] traverses such graphs in a sequential node order based on unary confidences to improve the final labels. We update graph nodes in parallel and exploit edge attributes for informative context modeling. Xu et al. [50] convolves information over graphs of object detections to infer their contextual relationships. Our work infers relationships implicitly to improve segmentation results. Qi et al. [41] also relies on graph convolutions on 3D point clouds. However, we process large point clouds instead of small RGBD images with nodes embedded in 3D instead of 2D in a novel, rich-attributed graph. Finally, we note that graph convolutions also bear functional similarity to deep learning formulations of CRFs [51], which we discuss more in Section 3.4. 2. Related Work The classic approach to large-scale point cloud segmentation is to classify each point or voxel independently using handcrafted features derived from their local neighborhood [48]. The solution is then spatially regularized using graphical models [37, 24, 34, 44, 21, 2, 38, 35, 49] or structured optimization [27]. Clustering as preprocessing [16, 13] or postprocessing [47] have been used by several frameworks to improve the accuracy of the classification. Deep Learning on Point Clouds. Several different approaches going beyond naive volumetric processing of point clouds have been proposed recently, notably setbased [39, 40], tree-based [42, 23], and graph-based [45]. However, very few methods with deep learning components have been demonstrated to be able to segment large-scale point clouds. PointNet [39] can segment large clouds with a sliding window approach, therefore constraining contextual information within a small area only. Engelmann et al. [10] improves on this by increasing the context scope with multi-scale windows or by considering directly neighboring window positions on a voxel grid. SEGCloud [46] handles large clouds by voxelizing followed by interpolation back to the original resolution and post-processing with a conditional random field (CRF). None of these approaches is able to consider fine details and long-range contextual information simultaneously. In contrast, our pipeline partitions point clouds in an adaptive way according to their geometric complexity and allows deep learning architecture to use both fine detail and interactions over long distance. Graph Convolutions. A key step of our approach is using graph convolutions to spread contextual information. Formulations that are able to deal with graphs of variable sizes can be seen as a form of message passing over graph 3. Method The main obstacle that our framework tries to overcome is the size of LiDAR scans. Indeed, they can reach hundreds of millions of points, making direct deep learning approaches intractable. The proposed SPG representation allows us to split the semantic segmentation problem into three distinct problems of different scales, shown in Figure 2, which can in turn be solved by methods of corresponding complexity: 1 Geometrically homogeneous partition: The first step of our algorithm is to partition the point cloud into geometrically simple yet meaningful shapes, called superpoints. This unsupervised step takes the whole point cloud as input, and therefore must be computationally very efficient. The SPG can be easily computed from this partition. 2 Superpoint embedding: Each node of the SPG corresponds to a small part of the point cloud correspond2 S2 S6 S2 S6 S5 S1 point S3 S4 edge of Evor (a) Input point cloud S5 S1 S3 S4 superpoint S1 S2 S3 S4 S5 S6 superedge PointNet pointnet GRU table table GRU pointnet GRU table pointnet GRU chair pointnet chair GRU pointnet GRU chair embedding (c) Network architecture (b) Superpoint graph Figure 2: Illustration of our framework on a toy scan of a table and a chair. We perform geometric partitioning on the point cloud (a), which allows us to build the superpoint graph (b). Each superpoint is embedded by a PointNet network. The embeddings are then refined in GRUs by message passing along superedges to produce the final labeling (c). pi , and, if available, other observations oi such as color or intensity. For each point, we compute a set of dg geometric features fi ∈ Rdg characterizing the shape of its local neighborhood. In this paper, we use three dimensionality values proposed by [9]: linearity, planarity and scattering, as well as the verticality feature introduced by [13]. We also compute the elevation of each point, defined as the z coordinate of pi normalized over the whole input cloud. The global energy proposed by [13] is defined with respect to the 10-nearest neighbor adjacency graph Gnn = (C, Enn ) of the point cloud (note that this is not the SPG). The geometrically homogeneous partition is defined as the constant connected components of the solution of the following optimization problem: X X 2 arg min kgi − fi k + µ wi,j [gi − gj 6= 0] , ing to a geometrically simple primitive, which we assume to be semantically homogeneous. Such primitives can be reliably represented by downsampling small point clouds to at most hundreds of points. This small size allows us to utilize recent point cloud embedding methods such as PointNet [39]. 3 Contextual segmentation: The graph of superpoints is by orders of magnitude smaller than any graph built on the original point cloud. Deep learning algorithms based on graph convolutions can then be used to classify its nodes using rich edge features facilitating longrange interactions. The SPG representation allows us to perform end-to-end learning of the trainable two last steps. We will describe each step of our pipeline in the following subsections. g∈Rdg i∈C (i,j)∈Enn (1) |E| where [·] is the Iverson bracket. The edge weight w ∈ R+ is chosen to be linearly decreasing with respect to the edge length. The factor µ is the regularization strength and determines the coarseness of the resulting partition. The problem defined in Equation 1 is known as generalized minimal partition problem, and can be seen as a continuous-space version of the Potts energy model, or an `0 variant of the graph total variation. The minimized functional being nonconvex and noncontinuous implies that the problem cannot realistically be solved exactly for large point clouds. However, the `0 -cut pursuit algorithm introduced by [26] is able to quickly find an approximate solution with a few graph-cut iterations. In contrast to other optimization methods such as α-expansion [6], the `0 -cut pursuit algorithm does not require selecting the size of the partition in advance. The constant connected components S = {S1 , · · · , Sk } of the solution of Equation 1 define our geometrically simple elements, and are referred as super- 3.1. Geometric Partition with a Global Energy In this subsection, we describe our method for partitioning the input point cloud into parts of simple shape. Our objective is not to retrieve individual objects such as cars or chairs, but rather to break down the objects into simple parts, as seen in Figure 3. However, the clusters being geometrically simple, one can expect them to be semantically homogeneous as well, i.e. not to cover objects of different classes. Note that this step of the pipeline is purely unsupervised and makes no use of class labels beyond validation. We follow the global energy model described by [13] for its computational efficiency. Another advantage is that the segmentation is adaptive to the local geometric complexity. In other words, the segments obtained can be large simple shapes such as roads or walls, as well as much smaller components such as parts of a car or a chair. Let us consider the input point cloud C as a set of n 3D points. Each point i ∈ C is defined by its 3D position 3 Feature name mean offset offset deviation centroid offset length ratio surface ratio volume ratio point count ratio Size 3 3 3 1 1 1 1 Description meanm∈δ(S,T ) δm stdm∈δ(S,T ) δm meani∈S pi − meanj∈T pj log length (S) /length (T ) log surface (S) /surface (T ) log volume (S) /volume (T ) log |S|/|T | in isolation; contextual information required for its reliable classification is provided only in the following stage by the means of graph convolutions. Several deep learning-based methods have been proposed for this purpose recently. We choose PointNet [39] for its remarkable simplicity, efficiency, and robustness. In PointNet, input points are first aligned by a Spatial Transformer Network [19], independently processed by multilayer perceptrons (MLPs), and finally max-pooled to summarize the shape. In our case, input shapes are geometrically simple objects, which can be reliably represented by a small amount of points and embedded by a rather compact PointNet. This is important to limit the memory needed when evaluating many superpoints on current GPUs. In particular, we subsample superpoints on-the-fly down to np = 128 points to maintain efficient computation in batches and facilitate data augmentation. Superpoints of less than np points are sampled with replacement, which in principle does not affect the evaluation of PointNet due to its max-pooling. However, we observed that including very small superpoints of less than nminp = 40 points in training harms the overall performance. Thus, embedding of such superpoints is set to zero so that their classification relies solely on contextual information. In order for PointNet to learn spatial distribution of different shapes, each superpoint is rescaled to unit sphere before embedding. Points are represented by their normalized position p0i , observations oi , and geometric features fi (since these are already available precomputed from the partitioning step). Furthermore, the original metric diameter of the superpoint is concatenated as an additional feature after PointNet max-pooling in order to stay covariant with shape sizes. Table 1: List of df = 13 superedge features characterizing the adjacency between two superpoints S and T . points (i.e. set of points) in the rest of this paper. 3.2. Superpoint Graph Construction In this subsection, we describe how we compute the SPG as well as its key features. The SPG is a structured representation of the point cloud, defined as an oriented attributed graph G = (S, E, F ) whose nodes are the set of superpoints S and edges E (referred to as superedges) represent the adjacency between superpoints. The superedges are annotated by a set of df features: F ∈ RE×df characterizing the adjacency relationship between superpoints. We define Gvor = (C, Evor ) as the symmetric Voronoi adjacency graph of the complete input point cloud as defined by [20]. Two superpoints S and T are adjacent if there is at least one edge in Evor with one end in S and one end in T:  E = (S, T ) ∈ S 2 | ∃ (i, j) ∈ Evor ∩ (S × T ) . (2) Important spatial features associated with a superedge (S, T ) are obtained from the set of offsets δ(S, T ) for edges in Evor linking both superpoints: δ (S, T ) = {(pi − pj ) | (i, j) ∈ Evor ∩ (S × T )} . 3.4. Contextual Segmentation (3) The final stage of the pipeline is to classify each superpoint Si based on its embedding zi and its local surroundings within the SPG. Graph convolutions are naturally suited to this task. In this section, we explain the propagation model of our system. Our approach builds on the ideas from Gated Graph Neural Networks [30] and Edge-Conditioned Convolutions (ECC) [45]. The general idea is that superpoints refine their embedding according to pieces of information passed along superedges. Concretely, each superpoint Si maintains its state hidden in a Gated Recurrent Unit (GRU) [8]. The hidden state is initialized with embedding zi and is then processed over several iterations (time steps) t = 1 . . . T . At (t) each iteration t, a GRU takes its hidden state hi and an (t) incoming message mi as input, and computes its new hid(t+1) (t) den state hi . The incoming message mi to superpoint Superedge features can also be derived by comparing the shape and size of the adjacent superpoints. To this end, we compute |S| as the number of points comprised in a superpoint S, as well as shape features length (S) = λ1 , surface (S) = λ1 λ2 , volume (S) = λ1 λ2 λ3 derived from the eigenvalues λ1 , λ2 , λ3 of the covariance of the positions of the points comprised in each superpoint, sorted by decreasing value. In Table 1, we describe a list of the different superedge features used in this paper. Note that the break of symmetry in the edge features makes the SPG a directed graph. 3.3. Superpoint Embedding The goal of this stage is to compute a descriptor for every superpoint Si by embedding it into a vector zi of fixed-size dimensionality dz . Note that each superpoint is embedded 4 (t) edge-specific weight vector and perform element-wise multiplication as in Equation 7 (ECC-VV). Channel mixing, albeit in an edge-unspecific fashion, is postponed to Equation 5. Finally, let us remark that Θ is shared over time iterations and that self-loops as proposed in [45] are not necessary due to the existence of hidden states in GRUs. i is computed as a weighted sum of hidden states hj of neighboring superpoints j. The actual weighting for a superedge (j, i) depends on its attributes Fji,· , listed in Table 1. In particular, it is computed from the attributes by a multi-layer perceptron Θ, so-called Filter Generating Network. Formally: (t+1) = (1 − ui ) (t) (t) (t) (t) ri (t) σ(x3,i hi (t) (t) = (t) σ(x2,i + (t) h2,i ), = (t) hi (t) qi = tanh(x1,i + ri (t) ui (t) qi + ui (4) h1,i ) (t) (t) (t) (t) (t) (t) (t) (t) + (t) h3,i ) (h1,i , h2,i , h3,i )T = ρ(Wh hi + bh ) (t) (t) (t) mi (1) hi (t) mi (6) (t) hj = meanj|(j,i)∈E Θ(Fji,· ; We ) = zi , (1) Relation to CRFs. In image segmentation, postprocessing of convolutional outputs using Conditional Random Fields (CRFs) is widely popular. Several inference algorithms can be formulated as (recurrent) network layers amendable to end-to-end learning [51, 43], possibly with general pairwise potentials [33, 7, 28]. While our method of information propagation shares both these characteristics, our GRUs operate on dz -dimensional intermediate feature space, which is richer and less constrained than low-dimensional vectors representing beliefs over classes, as also discussed in [11]. Such enhanced access to information is motivated by the desire to learn a powerful representation of context, which goes beyond belief compatibilities, as well as the desire to be able to discriminate our often relatively weak unaries (superpixel embeddings). We empirically evaluate these claims in Section 4.3. (5) (x1,i , x2,i , x3,i )T = ρ(Wx xi + bx ) xi = σ(Wg hi + bg ) State Concatenation. Inspired by DenseNet [17], we concatenate hidden states over all time steps and linearly transform them to produce segmentation logits yi in Equation 8. This allows to exploit the dynamics of hidden states due to increasing receptive field for the final classification. (T +1) T yi = Wo (hi , . . . , hi ) , (7) (8) where is element-wise multiplication, σ(·) sigmoid function, and W· and b· are trainable parameters shared among all GRUs. Equation 4 lists the standard GRU rules [8] with (t) (t) its update gate ui and reset gate ri . To improve stability during training, in Equation 5 we apply Layer Normalization [4] defined as ρ(a) := (a−mean(a))/(std(a)+) sep(t) arately to linearly transformed input xi and transformed (t) hidden state hi , with  being a small constant. Finally, the model includes three interesting extensions in Equations 6– 8, which we detail below. 3.5. Further Details Adjacency Graphs. In this paper, we use two different adjacency graphs between points of the input clouds: Gnn in Section 3.1 and Gvor in Section 3.2. Indeed, different definitions of adjacency have different advantages. Voronoi adjacency is more suited to capture long-range relationships between superpoints, which is beneficial for the SPG. Nearest neighbors adjacency tends not to connect objects separated by a small gap. This is desirable for the global energy but tends to produce a SPG with many small connected components, decreasing embedding quality. Fixed radius adjacency should be avoided in general as it handles the variable density of LiDAR scans poorly. Input Gating. We argue that GRU should possess the ability to down-weight (parts of) an input vector based on its hidden state. For example, GRU might learn to ignore its context if its class state is highly certain or to direct its attention to only specific feature channels. Equation 6 achieves (t) this by gating message mi by the hidden state before using (t) it as input xi . Edge-Conditioned Convolution. ECC plays a crucial role in our model as it can dynamically generate filtering weights for any value of continuous attributes Fji,· by processing them with a multi-layer perceptron Θ. In the original formulation [45] (ECC-MV), Θ regresses a weight matrix to perform matrix-vector multiplication (t) Θ(Fji,· ; We )hj for each edge. In this work, we propose a lightweight variant with lower memory requirements and fewer parameters, which is beneficial for datasets with few but large point clouds. Specifically, we regress only an Training. While the geometric partitioning step is unsupervised, superpoint embedding and contextual segmentation are trained jointly in a supervised way with cross entropy loss. Superpoints are assumed to be semantically homogeneous and, consequently, assigned a hard ground truth label corresponding to the majority label among their contained points. We also considered using soft labels corresponding to normalized histograms of point labels and 5 training with Kullback-Leibler [25] divergence loss. It performed slightly worse in our initial experiments, though. Naive training on large SPGs may approach memory limits of current GPUs. We circumvent this issue by randomly subsampling the sets of superpoints at each iteration and training on induced subgraphs, i.e. graphs composed of subsets of nodes and the original edges connecting them. Specifically, graph neighborhoods of order 3 are sampled to select at most 512 superpoints per SPG with more than nminp points, as smaller superpoints are not embedded. Note that as the induced graph is a union of small neighborhoods, relationships over many hops may still be formed and learned. This strategy also doubles as data augmentation and a strong regularization, together with randomized sampling of point clouds described in Section 3.3. Additional data augmentation is performed by randomly rotating superpoints around the vertical axis and jittering point features by Gaussian noise N (0, 0.01) truncated to [−0.05, 0.05]. scans and 15 test scans with withheld labels. We also evaluate on the reduced set of 4 subsampled scans, as common in past work. In Table 2, we provide the results of our algorithm compared to other state of the art recent algorithms and in Figure 3, we provide qualitative results of our framework. Our framework improves significantly on the state of the art of semantic segmentation for this data set, i.e. by nearly 12 mIoU points on the reduced set and by nearly 9 mIoU points on the full set. In particular, we observe a steep gain on the ”artefact” class. This can be explained by the ability of the partitioning algorithm to detect artifacts due to their singular shape, while they are hard to capture using snapshots, as suggested by [5]. Furthermore, these small object are often merged with the road when performing spatial regularization. 4.2. Stanford Large-Scale 3D Indoor Spaces The S3DIS dataset [3] consists of 3D RGB point clouds of six floors from three different buildings split into individual rooms. We evaluate our framework following two dominant strategies found in previous works. As advocated by [39, 10], we perform 6-fold cross validation with microaveraging, i.e. computing metrics once over the merged predictions of all test folds. Following [46], we also report the performance on the fifth fold only (Area 5), corresponding to a building not present in the other folds. Since some classes in this data set cannot be partitioned purely using geometric features (such as boards or paintings on walls), we concatenate the color information o to the geometric features f for the partitioning step. The quantitative results are displayed in Table 3, with qualitative results in Figure 3 and in Appendix D. S3DIS is a difficult dataset with hard to retrieve classes such as white boards on white walls and columns within walls. From the quantitative results we can see that our framework performs better than other methods on average. Notably, doors are able to be correctly classified at a higher rate than other approaches, as long as they are open, as illustrated in Figure 3. Indeed, doors are geometrically similar to walls, but their position with respect to the door frame allows our network to retrieve them correctly. On the other hand, the partition merges white boards with walls, depriving the network from the opportunity to even learn to classify them: the IoU of boards for theoretical perfect classification of superpoints (as in Section 4.3) is only 51.3. Computation Time. In Table 4, we report computation time over the different steps of our pipeline for the inference on Area 5 measured on a 4 GHz CPU and GTX 1080 Ti GPU. While the bulk of time is spent on the CPU for partitioning and SPG computation, we show that voxelization as pre-processing, detailed in Appendix A, leads to a significant speed-up as well as improved accuracy. Testing. In modern deep learning frameworks, testing can be made very memory-efficient by discarding layer activations as soon as the follow-up layers have been computed. In practice, we were able to label full SPGs at once. To compensate for randomness due to subsampling of point clouds in PointNets, we average logits obtained over 10 runs with different seeds. 4. Experiments We evaluate our pipeline on the two currently largest point cloud segmentation benchmarks, Semantic3D [14] and Stanford Large-Scale 3D Indoor Spaces (S3DIS) [3], on both of which we set the new state of the art. Furthermore, we perform an ablation study of our pipeline in Section 4.3. Even though the two data sets are quite different in nature (large outdoor scenes for Semantic3D, smaller indoor scanning for S3DIS), we use nearly the same model for both. The deep model is rather compact and 6 GB of GPU memory is enough for both testing and training. We refer to Appendix A for precise details on hyperparameter selection, architecture configuration, and training procedure. Performance is evaluated using three metrics: per-class intersection over union (IoU), per-class accuracy (Acc), and overall accuracy (OA), defined as the proportion of correctly classified points. We stress that the metrics are computed on the original point clouds, not on superpoints. 4.1. Semantic3D Semantic3D [14] is the largest available LiDAR dataset with over 3 billion points from a variety of urban and rural scenes. Each point has RGB and intensity values (the latter of which we do not use). The dataset consists of 15 training 6 Method OA mIoU reduced test set: 78 699 329 points TMLC-MSR [15] 86.2 54.2 DeePr3SS [29] 88.9 58.5 SnapNet [5] 88.6 59.1 SegCloud [46] 88.1 61.3 SPG (Ours) 94.0 73.2 full test set: 2 091 952 018 points TMLC-MS [15] 85.0 49.4 SnapNet [5] 91.0 67.4 SPG (Ours) 92.9 76.2 man-made natural terrain terrain high low buildings vegetation vegetation hardscape scanning artefact cars 89.8 85.6 82.0 83.9 97.4 74.5 83.2 77.3 66.0 92.6 53.7 74.2 79.7 86.0 87.9 26.8 32.4 22.9 40.5 44.0 88.8 89.7 91.1 91.1 93.2 18.9 18.5 18.4 30.9 31.0 36.4 25.1 37.3 27.5 63.5 44.7 59.2 64.4 64.3 76.2 91.1 89.6 91.5 69.5 79.5 75.6 32.8 74.8 78.3 21.6 56.1 71.7 87.6 90.9 94.4 25.9 36.5 56.8 11.3 34.3 52.9 55.3 77.2 88.4 Table 2: Intersection over union metric for the different classes of the Semantic3D dataset. OA is the global accuracy, while mIoU refers to the unweighted average of IoU of each class. (a) RGB point cloud (b) Geometric partitioning (c) Prediction (d) Ground truth Semantic3D road grass tree bush buildings hardscape artefacts cars S3DIS ceiling floor wall column beam window door table chair bookcase sofa board clutter unlabelled Figure 3: Example visualizations on both datasets. The colors in (b) are chosen randomly for each element of the partition. 4.3. Ablation Studies The lower bound (Unary) is estimated by training PointNet with dz = 13 but otherwise the same architecture, denoted as PointNet13, to directly predict class logits, without SPG and GRUs. The upper bound (Perfect) corresponds to assigning each superpoint its ground truth label, and thus sets the limit of performance due to the geometric partition. We can see that contextual segmentation is able to win roughly 22 mIoU points over unaries, confirming its importance. Nevertheless, the learned model still has room of up to 26 To better understand the influence of various design choices made in our framework, we compare it to several baselines and perform an ablation study. Due to the lack of public ground truth for test sets of Semantic3D, we evaluate on S3DIS with 6-fold cross validation and show comparison of different models to our Best model in Table 5. Performance Limits. The contribution of contextual segmentation can be bounded both from below and above. 7 Method A5 PointNet [39] A5 SEGCloud [46] A5 SPG (Ours) PointNet [39] in [10] Engelmann et al. [10] SPG (Ours) OA – – 86.38 78.5 81.1 85.5 mAcc 48.98 57.35 66.50 66.2 66.4 73.0 mIoU 41.09 48.92 58.04 47.6 49.7 62.1 ceiling 88.80 90.06 89.35 88.0 90.3 89.9 floor wall beam 97.33 69.80 0.05 96.05 69.86 0.00 96.87 78.12 0.0 88.7 69.3 42.4 92.1 67.9 44.7 95.1 76.4 62.8 column 3.92 18.37 42.81 23.1 24.2 47.1 window 46.26 38.35 48.93 47.5 52.3 55.3 door 10.76 23.12 61.58 51.6 51.2 68.4 chair 52.61 75.89 84.66 42.0 47.4 73.5 table bookcase sofa board clutter 58.93 40.28 5.85 26.38 33.22 70.40 58.42 40.88 12.96 41.60 75.41 69.84 52.60 2.10 52.22 54.1 38.2 9.6 29.4 35.2 58.1 39.0 6.9 30.0 41.9 69.2 63.2 45.9 8.7 52.9 Table 3: Results on the S3DIS dataset on fold “Area 5” (top) and micro-averaged over all 6 folds (bottom). Intersection over union is shown split per class. Step Voxelization Feature computation Geometric partition SPG computation Inference Total mIoU 6-fold Full cloud 0 439 3428 3800 10 × 24 7907 54.1 2 cm 40 194 1013 958 10 × 11 2315 60.2 3 cm 24 88 447 436 10 × 6 1055 62.1 Model Best Perfect Unary iCRF CRF − ECC GRU13 NoInputGate NoConcat NoEdgeFeat ECC − VV 4 cm 16 43 238 252 10 × 5 599 57.1 Table 4: Computation time in seconds for the inference on S3DIS Area 5 (68 rooms, 78 649 682 points) for different voxel sizes. mAcc 73.0 92.7 50.8 51.5 65.6 69.1 68.6 69.3 50.1 70.2 mIoU 62.1 88.2 40.0 40.7 55.3 58.5 57.5 57.7 39.9 59.4 Table 5: Ablation study and comparison to various baselines on S3DIS (6-fold cross validation). mIoU points for improvement, while about 12 mIoU points are forfeited to the semantic inhomogeneity of superpoints. CRFs. We compare the effect of our GRU+ECCbased network to CRF-based regularization. As a baseline (iCRF), we post-process Unary outputs by CRF inference over SPG connectivity with scalar transition matrix, as described by [13]. Next (CRF − ECC), we adapt CRF-RNN framework of Zheng et al. [51] to general graphs with edgeconditioned convolutions (see Appendix B for details) and train it with PointNet13 end-to-end. Finally (GRU13), we modify Best to use PointNet13. We observe that iCRF barely improves accuracy (+1 mIoU), which is to be expected, since the partitioning step already encourages spatial regularity. CRF − ECC does better (+15 mIoU) due to end-to-end learning and use of edge attributes, though it is still below GRU13 (+18 mIoU), which performs more complex operations and does not enforce normalization of the embedding. Nevertheless, the 32 channels used in Best instead of the 13 used in GRU13 provide even more freedom for feature representation (+22 mIoU). Ablation. We explore the advantages of several design choices by individually removing them from Best in order to compare the framework’s performance with and without them. In NoInputGate we remove input gating in GRU; in NoConcat we only consider the last hidden state in GRU (T +1) for output as yi = Wo hi instead of concatenation of all steps; in NoEdgeFeat we perform homogeneous regularization by setting all superedge features to scalar 1; and in ECC − VV we use the proposed lightweight formulation of ECC. We can see that each of the first two choices accounts for about 5 mIoU points. Next, without edge features our method falls back even below iCRF to the level of Unary, which validates their design and overall motivation for SPG. ECC − VV decreases the performance on the S3DIS dataset by 3 mIoU points, whereas it has improved the performance on Semantic3D by 2 mIoU. Finally, we invite the reader to Appendix C for further ablations. 5. Conclusion We presented a deep learning framework for performing semantic segmentation of large point clouds based on a partition into simple shapes. We showed that SPGs allow us to use effective deep learning tools, which would not be able to handle the data volume otherwise. Our method significantly improves on the state of the art on two publicly available datasets. Our experimental analysis suggested that future improvements can be made in both partitioning and learning deep contextual classifiers. The source code in PyTorch as well as the trained models are available at https://github.com/loicland/ superpoint_graph. 8 References [17] G. Huang, Z. Liu, and K. Q. Weinberger. Densely connected convolutional networks. In CVPR, 2017. 5 [18] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 10 [19] M. Jaderberg, K. Simonyan, A. Zisserman, and K. Kavukcuoglu. Spatial transformer networks. In NIPS, pages 2017–2025. 2015. 4 [20] J. W. Jaromczyk and G. T. Toussaint. Relative neighborhood graphs and their relatives. Proceedings of the IEEE, 80(9):1502–1517, 1992. 4 [21] B.-S. Kim, P. Kohli, and S. Savarese. 3D scene understanding by voxel-CRF. In ICCV, 2013. 2 [22] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 11 [23] R. Klokov and V. S. Lempitsky. Escape from cells: Deep Kd-networks for the recognition of 3D point cloud models. CoRR, abs/1704.01222, 2017. 2 [24] H. S. Koppula, A. Anand, T. Joachims, and A. Saxena. Semantic labeling of 3D point clouds for indoor scenes. In NIPS, pages 244–252, 2011. 2 [25] S. Kullback and R. A. Leibler. On information and sufficiency. The Annals of Mathematical Statistics, 22 (1):79–86, 1951. 6 [26] L. Landrieu and G. Obozinski. Cut pursuit: Fast algorithms to learn piecewise constant functions on general weighted graphs. SIAM Journal on Imaging Sciences, 10(4):1724– 1766, 2017. 3 [27] L. Landrieu, H. Raguet, B. Vallet, C. Mallet, and M. Weinmann. A structured regularization framework for spatially smoothing semantic labelings of 3D point clouds. ISPRS Journal of Photogrammetry and Remote Sensing, 132:102 – 118, 2017. 2 [28] M. Larsson, F. Kahl, S. Zheng, A. Arnab, P. H. S. Torr, and R. I. Hartley. Learning arbitrary potentials in CRFs with gradient descent. CoRR, abs/1701.06805, 2017. 5 [29] F. J. Lawin, M. Danelljan, P. Tosteberg, G. Bhat, F. S. Khan, and M. Felsberg. Deep projective 3D semantic segmentation. arXiv preprint arXiv:1705.03428, 2017. 7 [30] Y. Li, D. Tarlow, M. Brockschmidt, and R. S. Zemel. Gated graph sequence neural networks. In ICLR, 2016. 4 [31] X. Liang, L. Lin, X. Shen, J. Feng, S. Yan, and E. P. Xing. Interpretable structure-evolving LSTM. In CVPR, pages 2175– 2184, 2017. 2 [32] X. Liang, X. Shen, J. Feng, L. Lin, and S. Yan. Semantic object parsing with graph LSTM. In ECCV, pages 125–143, 2016. 2 [33] G. Lin, C. Shen, A. van den Hengel, and I. D. Reid. Efficient piecewise training of deep structured models for semantic segmentation. In CVPR, 2016. 5 [34] Y. Lu and C. Rasmussen. Simplified Markov random fields for efficient semantic labeling of 3d point clouds. In IROS, pages 2690–2697, 2012. 2 [35] A. Martinovic, J. Knopp, H. Riemenschneider, and L. Van Gool. 3D all the way: Semantic segmentation of urban scenes from start to end in 3D. In CVPR, 2015. 2 [1] R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, and S. Süsstrunk. SLIC superpixels compared to state-of-the-art superpixel methods. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(11):2274–2282, 2012. 1 [2] A. Anand, H. S. Koppula, T. Joachims, and A. Saxena. Contextually guided semantic labeling and search for threedimensional point clouds. The International Journal of Robotics Research, 32(1):19–34, 2013. 2 [3] I. Armeni, O. Sener, A. R. Zamir, H. Jiang, I. Brilakis, M. Fischer, and S. Savarese. 3D semantic parsing of largescale indoor spaces. In CVPR, 2016. 1, 6 [4] L. J. Ba, R. Kiros, and G. E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016. 5 [5] A. Boulch, B. L. Saux, and N. Audebert. Unstructured point cloud semantic labeling using deep segmentation networks. In Eurographics Workshop on 3D Object Retrieval, volume 2, 2017. 1, 6, 7 [6] Y. Boykov, O. Veksler, and R. Zabih. Fast approximate energy minimization via graph cuts. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23(11):1222–1239, 2001. 3 [7] S. Chandra and I. Kokkinos. Fast, exact and multi-scale inference for semantic image segmentation with deep gaussian crfs. In ECCV, 2016. 5 [8] K. Cho, B. van Merriënboer, Ç. Gülçehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder–decoder for statistical machine translation. In EMNLP, 2014. 1, 4, 5 [9] J. Demantk, C. Mallet, N. David, and B. Vallet. Dimensionality based scale selection in 3D lidar point clouds. International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, XXXVIII-5/W12:97–102, 2011. 3 [10] F. Engelmann, T. Kontogianni, A. Hermans, and B. Leibe. Exploring spatial context for 3d semantic segmentation of point clouds. In ICCV, 3DRMS Workshop,, 2017. 1, 2, 6, 8 [11] R. Gadde, V. Jampani, M. Kiefel, D. Kappler, and P. Gehler. Superpixel convolutional networks using bilateral inceptions. In ECCV, 2016. 5 [12] J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural message passing for quantum chemistry. In ICML, pages 1263–1272, 2017. 2 [13] S. Guinard and L. Landrieu. Weakly supervised segmentation-aided classification of urban scenes from 3d LiDAR point clouds. In ISPRS 2017, 2017. 2, 3, 8 [14] T. Hackel, N. Savinov, L. Ladicky, J. D. Wegner, K. Schindler, and M. Pollefeys. Semantic3d. net: A new large-scale point cloud classification benchmark. arXiv preprint arXiv:1704.03847, 2017. 1, 6 [15] T. Hackel, J. D. Wegner, and K. Schindler. Fast semantic segmentation of 3D point clouds with strongly varying density. ISPRS Annals of Photogrammetry, Remote Sensing & Spatial Information Sciences, 3(3), 2016. 7 [16] H. Hu, D. Munoz, J. A. Bagnell, and M. Hebert. Efficient 3-d scene analysis from streaming data. In ICRA, 2013. 2 9 Appendix [36] F. Monti, D. Boscaini, J. Masci, E. Rodolà, J. Svoboda, and M. M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model CNNs. In CVPR, pages 5425–5434, 2017. 2 A. Model Details Voxelization. We pre-process input point clouds with voxelization subsampling by computing per-voxel mean positions and observations over a regular 3D grid (5 cm bins for Semantic3D and 3 cm bins for S3DIS dataset). The resulting semantic segmentation is interpolated back to the original point cloud in a nearest neighbor fashion. Voxelization helps decreasing the computation time and memory requirement, and improves the accuracy of the semantic segmentation by acting as a form of geometric and radiometric denoising as well (Table 4 in the main paper). The quality of further steps is practically not affected, as superpoints are usually strongly subsampled for embedding during learning and inference anyway (Section 3.3 in the main paper). [37] D. Munoz, J. A. Bagnell, N. Vandapel, and M. Hebert. Contextual classification with functional max-margin Markov networks. In CVPR, 2009. 2 [38] J. Niemeyer, F. Rottensteiner, and U. Soergel. Contextual classification of lidar data and building object detection in urban areas. ISPRS Journal of Photogrammetry and Remote Sensing, 87:152–165, 2014. 2 [39] C. R. Qi, H. Su, K. Mo, and L. J. Guibas. PointNet: Deep learning on point sets for 3D classification and segmentation. In CVPR, 2017. 1, 2, 3, 4, 6, 8, 11 [40] C. R. Qi, L. Yi, H. Su, and L. J. Guibas. PointNet++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017. 1, 2 [41] X. Qi, R. Liao, J. Jia, S. Fidler, and R. Urtasun. 3D graph neural networks for RGBD semantic segmentation. In ICCV, pages 5209–5218, 2017. 2 Geometric Partition. We set regularization strength µ = 0.8 for Semantic3D and µ = 0.03 for S3DIS, which strikes a balance between semantic homogeneity of superpoints and the potential for their successful discrimination (S3DIS is composed of smaller semantic parts than Semantic3D). In addition to five geometric features f (linearity, planarity, scattering, verticality, elevation), we use color information o for clustering in S3DIS due to some classes being geometrically indistinguishable, such as boards or doors. [44] R. Shapovalov, D. Vetrov, and P. Kohli. Spatial inference machines. In CVPR, 2013. 2 [45] M. Simonovsky and N. Komodakis. Dynamic edgeconditioned filters in convolutional neural networks on graphs. In CVPR, 2017. 1, 2, 4, 5, 11 np × dp STN [46] L. P. Tchapmi, C. B. Choy, I. Armeni, J. Gwak, and S. Savarese. SEGCloud: Semantic segmentation of 3D point clouds. arXiv preprint arXiv:1710.07563, 2017. 1, 2, 6, 7, 8, 11 shared MLP(64,64,128,128,256) shared maxpool [43] A. G. Schwing and R. Urtasun. Fully connected deep structured networks. CoRR, abs/1503.02351, 2015. 5 np × d p [42] G. Riegler, A. O. Ulusoy, and A. Geiger. OctNet: Learning deep 3D representations at high resolutions. In CVPR, 2017. 1, 2 MLP(256,64,32) 257 × 1 dz × 1 diameter [47] M. Weinmann, S. Hinz, and M. Weinmann. A hybrid semantic point cloud classification-segmentation framework based on geometric features and semantic rules. PFG–Journal of Photogrammetry, Remote Sensing and Geoinformation Science, 85(3):183–194, 2017. 2 Figure 4: The PointNet embedding np dp -dimensional samples of a superpoint to a dz -dimensional vector. [48] M. Weinmann, A. Schmidt, C. Mallet, S. Hinz, F. Rottensteiner, and B. Jutzi. Contextual classification of point cloud data by exploiting individual 3D neighborhoods. ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, II-3/W4:271–278, 2015. 2 PointNet. We use a simplified shallow and narrow PointNet architecture with just a single Spatial Transformer Network (STN), see Figure 4. We set np = 128 and nminp = 40. Input points are processed by a sequence of MLPs (widths 64, 64, 128, 128, 256) and max pooled to a single vector of 256 features. The scalar metric diameter is appended and the result further processed by a sequence of MLPs (widths 256, 64, dz =32). A residual matrix Φ ∈ R2×2 is regressed by STN and (I + Φ) is used to transform XY coordinates of input points as the first step. The architecture of STN is a ”small PointNet” with 3 MLPs (widths 64, 64, 128) before max pooling and 3 MLPs after (widths 128, 64, 4). Batch Normalization [18] and ReLUs are used [49] D. Wolf, J. Prankl, and M. Vincze. Fast semantic segmentation of 3D point clouds using a dense CRF with learned parameters. In ICRA, 2015. 2 [50] D. Xu, Y. Zhu, C. B. Choy, and L. Fei-Fei. Scene graph generation by iterative message passing. In CVPR, pages 3097–3106, 2017. 2 [51] S. Zheng, S. Jayasumana, B. Romera-Paredes, V. Vineet, Z. Su, D. Du, C. Huang, and P. H. S. Torr. Conditional random fields as recurrent neural networks. In ICCV, 2015. 2, 5, 8, 11 10 C. Extended Ablation Studies everywhere. Input points have dp =11 dimensional features for Semantic3D (position pi , color oi , geometric features fi ), with 3 additional ones for S3DIS (room-normalized spatial coordinates, as in past work [39]). In this section, we present additional set of experiments to validate our design choices and present their results in Table 6. a) Spatial Transformer Network. While STN makes superpoint embedding orientation invariant, the relationship with surrounding objects are still captured by superedges, which are orientation variant. In practice, STN helps by 4 mIoU points. b) Geometric Features. Geometric features fi are computed in the geometric partition step and can therefore be used in the following learning step for free. While PointNets could be expected to learn similar features from the data, this is hampered by superpoint subsampling, and therefore their explicit use helps (+4 mIoU). c) Sampling Superpoints. The main effect of subsampling SPG is regularization by data augmentation. Too small a sample size leads to disregarding contextual information (-4 mIoU) while too large a size leads to overfitting (-2 mIoU). Lower memory requirements at training is an extra benefit. There is no subsampling at test time. d) Long-range Context. We observe that limiting the range of context information in SPG harms the performance. Specifically, capping distances in Gvor to 1 m (as used in PointNet [39]) or 5 m (as used in SegCloud [46]) worsens the performance of our method (even more on our Semantic 3D validation set). e) Input Gate. We evaluate the effect of input gating (IG) for GRUs as well as LSTM units. While a LSTM unit achieves higher score than a GRU (-3 mIoU), the proposed IG reverses this situation in favor of GRU (+1 mIoU). Unlike the standard input gate of LSTM, which controls the information flow from the hidden state and input to the cell, our IG controls the input even before it is used to compute all other gates. f) Regularization Strength µ. We investigate the balance between superpoints’ discriminative potential and their homogeneity controlled by parameter µ . We observe that the system is able to perform reasonably over a range of SPG sizes. g) Superpoint Sizes. We include a breakdown of superpoint sizes for µ = 0.03 in relation to hyperparameters nminp = 40 and np = 128, showing that 93% of points are in embedded superpoints, and 79% in superpoints that are subsampled. Superedge Features. Finally, in Table 7 we evaluate empirical importance of individual superedge features by removing them from Best. Although no single feature is crucial, the most being offset deviation (+3 mIoU), we remind the reader than without any superedge features the net- Segmentation Network. We use embedding dimensionality dz = 32 and T = 10 iterations. ECC-VV is used for Semantic3D (there are only 15 point clouds even though the amount of points is large), while ECC-MV is used for S3DIS (large number of point clouds). Filter-generating network Θ is a MLP with 4 layers (widths 32, 128, 64, and 32 or 322 for ECC-VV or ECC-MV) with ReLUs. Batch Normalization is used only after the third parametric layer. No bias is used in the last layer. Superedges have df = 13 dimensional features, normalized by mean subtraction and scaling to unit variance based on the whole training set. Training. We train using Adam [22] with initial learning rate 0.01 and batch size 2, i.e. effectively up to 1024 superpoints per batch. For Semantic3D, we train for 500 epochs with stepwise learning rate decay of 0.7 at epochs 350, 400, and 450. For S3DIS, we train for 250 epochs with steps at 200 and 230. We clip gradients within [−1, 1]. B. CRF-ECC In this section, we describe our adaptation of CRFRNN mean field inference by Zheng et al. [51] for postprocessing PointNet embeddings in SPG, denoted as unary potentials Ui here. The original work proposed a dense CRF with pairwise potentials Ψ defined to be a mixture of m Gaussian kernels P as Ψij = µ m wm Km (Fij ), where µ is label compatibility matrix, w are parameters, and K are fixed Gaussian kernels applied on edge features. We replace this definition of the pairwise term with a Filter generating network Θ [45] parameterized with weights We , which generalizes the message passing and compatibility transform steps of Zheng et al. . Furthermore, we use superedge connectivity E instead of assuming a complete graph. The pseudo-code is listed in Algorithm 1. Its output are marginal probability distributions Q. In practice we run the inference for T = 10 iterations. Algorithm 1 CRF-ECC Qi ← softmax(Ui ) while not converged do P Q̂i ← j|(j,i)∈E Θ(Fji,· ; We )Qj Q̆i ← Ui − Q̂i Qi ← softmax(Q̆i ) end while Furthermore, SegCloud divides the inference into cubes without overlap, possibly causing inconsistencies across boundaries. 11 a) Spatial transf. mIoU b) Geometric features mIoU c) Max superpoints mIoU d) Superedge limit mIoU e) Input gate mIoU f) Regularization µ # superpoints perfect mIoU mIoU g) Superpoint size proportion of points no 58.1 no 58.4 256 57.9 1m 61.0 LSTM 61.0 0.01 785 010 90.6 59.1 1-40 7% D. Video Illustration yes 62.1 yes 62.1 512 62.1 5m 61.3 LSTM+IG 61.0 0.02 385 091 88.2 59.2 40-128 14% 1024 60.4 ∞ 62.1 GRU 57.5 0.03 251 266 86.6 62.1 128-1000 27% We provide a video illustrating our method and qualitative results on S3DIS dataset, which can be viewed at https://youtu.be/Ijr3kGSU_tU. GRU+IG 62.1 0.04 186 108 85.2 58.8 ≥ 1000 52% Table 6: Ablation study of design decisions on S3DIS (6fold cross validation). Our choices in bold. Model Best no mean offset no offset deviation no centroid offset no len/surf/vol ratios no point count ratio mAcc 73.0 72.5 71.7 74.5 71.2 72.7 mIoU 62.1 61.8 59.3 61.2 60.7 61.7 Table 7: Ablation study of superedge features on S3DIS (6fold cross validation). ·106 number of points 3 2 1 40 128 1,000 10,000 size of superpoints Figure 5: Histogram of points contained in superpoints of different size (in log scale) on the full S3DIS dataset. The embedding threshold nminp and subsampling threshold np are marked in red. work performs distinctly worse (NoEdgeFeat, -22 mIoU). 12
9cs.NE
LEARNING HARD ALIGNMENTS WITH VARIATIONAL INFERENCE Dieterich Lawson∗ , Chung-Cheng Chiu∗ , George Tucker∗ , Colin Raffel, Kevin Swersky, Navdeep Jaitly Google Brain {dieterichl,chungchengc,gjt,craffel,kswersky,ndjaitly}@google.com arXiv:1705.05524v2 [cs.AI] 1 Nov 2017 ABSTRACT There has recently been significant interest in hard attention models for tasks such as object recognition, visual captioning and speech recognition. Hard attention can offer benefits over soft attention such as decreased computational cost, but training hard attention models can be difficult because of the discrete latent variables they introduce. Previous work used REINFORCE and Q-learning to approach these issues, but those methods can provide high-variance gradient estimates and be slow to train. In this paper, we tackle the problem of learning hard attention for a sequential task using variational inference methods, specifically the recently introduced VIMCO and NVIL. Furthermore, we propose a novel baseline that adapts VIMCO to this setting. We demonstrate our method on a phoneme recognition task in clean and noisy environments and show that our method outperforms REINFORCE, with the difference being greater for a more complicated task. 1. INTRODUCTION Attention models have gained widespread traction from their successful use in tasks such as object recognition, machine translation, speech recognition where they are used to integrate information from different parts of the input before producing outputs. Soft attention does this by weighting and combining all input elements into a context vector while hard attention selects specific inputs and discards others, leading to computational gains and greater interpretability. While soft attention models are differentiable end-to-end and thus easy to train, hard attention models introduce discrete latent variables that often require reinforcement learning style approaches. Classic reinforcement learning methods such as REINFORCE [1] and Q-learning [2] have been used to train hard attention models, but these methods can provide high-variance gradient estimates, making training slow and providing inferior solutions. An alternative to reinforcement learning is variational inference, which trains a second model, called the approximate posterior, to be close to the true posterior over the latent variables. The approximate posterior uses information about both the input and its labels to produce settings of the latent variables used to train the original model. This can provide lower-variance gradient estimates and better solutions. In this paper, we leverage recent developments in variational inference to fit hard attention models in a sequential setting. We specialize these method to sequences and develop a model for the approximate posterior. In response to issues applying variational inference techniques to long sequences, we develop new variance control methods. Finally we show experimentally that our approach improves performance and substantially improves training time for speech recognition on the TIMIT dataset as well as a challenging noisy, multi-speaker version of TIMIT that we call Multi-TIMIT. ∗ Equal contribution. y1 b1 b3 b2 b1 b2 b3 h1 h2 h3 y1 y1 y2 h1 h2 h3 h01 h02 h03 x1 x2 x2 x1 x2 x3 (a) Model (b) Approximate Posterior Fig. 1. A diagram of our models. bs denote the Bernoulli emission decision variables, xs are inputs, ys are targets, and hs and h0 s are the hidden states of the recurrent neural networks (RNNs) that parameterize the conditional distributions of the models. Square nodes are deterministic, round nodes are stochastic. A shaded bi indicates that the model chose to consume an input and not emit an output while an unshaded bi mean that the model chose to produce an output and not consume an input. For example, in (a) note that b1 is shaded, so the model did not produce an output on timestep 1 and instead consumes the input x2 on the next timestep. b2 is unshaded, so on the second timestep the model produced output y1 . 2. METHODS 2.1. Model In this paper we use the online sequence-to-sequence model described in [3] to demonstrate our methods. We model p(y, b|x) where y = y1 , . . . , yn is a sequence of observed target tokens and x = x1 , . . . , xm is a sequence of observed inputs. The Bernoulli latent variables b = b1 , . . . , bm+n define when the model outputs tokens, i.e. bt = 1 implies the model emitted a token at timestep t, and bt = 0 implies the model did not emit a token at timestep t. If bt = 1, the model is forced to dwell on the same input at the next time step, i.e. the observation fed in at timestep t is fed in again at timestep t + 1 when bt = 1. Let n be the number of target tokens, m the number of inputs, and T = m + n the number of steps the model is run for. Our model assumes p(y, b|x) factorizes as p(y, b|x) = T Y p(yO(t) |b1:t , x1:I(t) , y1:O(t−1) )bt × t=1 p(bt |b1:t−1 , x1:I(t) , y1:O(t−1) ) (1) P where O(t) = ti=1 bi is the position in the output at time t and Pt−1 I(t) = 1 + i=1 (1 − bi ) is the input position at time t. Intuitively, this expression is the product over time of the probability assigned to the current ground truth given that the model emitted, multiplied by the probability that the model emitted. When bt = 0 the model did not emit at time t, so there is no probability assigned to the ground truth on that timestep. For brevity, we will use yt to implicitly mean yO(t) (i.e., the target at step t). Similarly, we will refer to xI(t) as xt and similarly for ranges over time for these variables. where we can simultaneously optimize q and the parameters of the model to improve the lower bound. Optimizing this bound via stochastic gradient ascent can be thought of as training p with maximum likelihood to reproduce bs sampled from q. q is then updated with REINFORCE-style gradients where the reward is the log-probability p assigns toQ y given b, similar to (2), see [4] for details. Setting q(b|x, y) = t p(bt |st ) recovers the REINFORCE objective. 2.2.1. Multi-sample Objectives Both the REINFORCE and the variational inference objectives admit multi-sample versions that give tighter bounds on the log-likelihood [5]. In particular, the multi-sample variational lower bound is " !# k 1 X p(y, b(i) |x) L = Eb(1:k) ∼q log (5) k i=1 q(b(i) |x, y) 2.2. Learning To fit the model (1) with maximum likelihood we are concerned with maximizing the probability of the observed variables y. However, (1) is written in terms of the unobserved latents, b, so we must marginalize over them. We maximize " # X  T T Y bt Eb bt log p(yt |st , bt ) =Eb log p(yt |st , bt ) t=1 where k is the number of samples and b(i)Qdenotes the ith sample of the latent variables. Setting q(b|x, y) = t p(bt |st ) recovers the multi-sample analogue to REINFORCE. The gradient of (5) takes a similar form to (2), with one lowvariance term and one REINFORCE-style term with high variance, for details see [4]. Similarly to the REINFORCE objective, we can (i) (−i) use a baseline c(b1:t−1 , x1:T , y1:T , b1:T ) to reduce the variance of (i) the gradient as long as it does not depend on bt . Notably, the baseline for trajectory i is allowed to depend on all timesteps of other (−i) trajectories, i.e. b1:T . t=1 ≤ log p(y|x), where st = {b1:t−1 , x1:t , y1:t−1 } is the state at time t and the expectations are over p(bt |st ). Note that this is a lower bound on the log probability of the observed y, so maximizing this bound will hopefully increase the likelihood of the observed data. Differentiating this objective gives  X  X   T T Eb ∇ bt log p(yt |st , bt ) + Eb Rt ∇ log p(bt |st ) t=1 (2) 2.3. Variance Reduction t=1 Training these models is challenging due to high variance gradient estimates. We can reduce the variance of the estimators by using information from multiple trajectories to construct baselines. In particular, for REINFORCE, we can write the gradient update as " T #  X (i) (j) (i) (i) Eb(i) Rt − c(st−1 , {R1:T }j6=i ) ∇ log p(bt |st−1 ) , PT 0 0 0 where Rt = t0 ≥t log p(yt |st , bt ) is the return at timestep t, understood intuitively as the log probability the model assigns to observed data for a given series of emission decisions. The first gradient term can be estimated with a single Monte Carlo sample, but the second term exhibits high variance because it involves an unbounded log probability. To reduce variance, [3] subtracts a learned baseline c(b1:t−1 , x1:T , y1:T ) from the return, which does not change the expectation as long as it is independent of bt . Performing stochastic gradient ascent with this gradient estimator is the standard REINFORCE algorithm where the reward is the log-likelihood. Unfortunately, this requires sampling bt from p(bt |st ) during training, which can lead to gradient estimates with high variance when settings of b that assign high likelihood to y are rare [4]. Variational inference is a family of techniques that use importance sampling to instead sample b from a different model, called the approximate posterior or q, which approximates the true posterior over b, p(b|x, y). We factorize the approximate posterior as q(b|x, y) = T Y q(bt |b1:t−1 , x1:T , y1:T ). t=1 where c is a baseline for sample i that is a function of the ith trajectory’s state up to time t − 1 as well as the returns produced by all other trajectories. The goal is to pick a c that is a good estimate of the return, and a straightforward choice of c is the average return from the other samples 1 X (j) c= Rt . k−1 j6=i (i) st (j) st , This ignores the fact that 6= which can make this standard baseline unusable. For example, in our setting different trajectories may have emitted different numbers of tokens on a given timestep, resulting in substantial differences in return between trajectories that do not indicate the relative merit of those trajectories. Ideally, (i) we would average over multiple trajectories starting from st , but this is computationally expensive. In [4] the authors propose the following baseline which adds a residual term to address this. Let rt = log p(yt |st , bt ) be the instantaneous reward at timestep t, then the baseline at timestep t can be written (3) t=1 The approximate posterior has access to all past and future x and y, as well as past b, and leverages this information to assign high probability to b that produce large values of p(y|b, x). Intuitively, in speech recognition, knowing the token the model must emit is helpful in deciding when to emit. Using q and an importance sampling identity we obtain a lower bound on the log-likelihood     p(y, b|x) p(y, b|x) log p(y|x) = log Eb∼q ≥ Eb∼q log (4) q(b|x, y) q(b|x, y) c= 1 X (j) 1 X X (j) (i) Rt + rt 0 − rt 0 . k−1 k−1 0 j6=i (6) j6=i t <t This baseline results in a learning signal that is the same across all timesteps, potentially increasing variance as all decisions in a 2 trajectory are rewarded or punished together. We will call this the leave-one-out (LOO) baseline because the baseline for a given sample is constructed using an average of the return of the other k−1 samples. Note that VIMCO optimizes the multisample variational lower bound in equation (5) with the leave-one-out baseline, and NVIL optimizes the single sample variational lower bound in equation (4) with a baseline that can be learned or computed from averages [6]. As the return strongly depends on the number of emitted tokens at time t, we can instead average the return of the other samples from when they have emitted the same number of tokens as sample i. In (j) particular, let et = mint0 O(j) (t0 ) ≥ O(i) (t) be the first timestep when sample j has emitted the same number of tokens as sample i at timestep t, then c= T 1 X X (j) rt 0 . k−1 (j) Table 1. PER results on TIMIT test set for various models. This shows that REINFORCE performs comparably to the variational inference methods and that our novel baselines improve training for REINFORCE. It also shows that our baselines improve performance over [3] which uses the same model with parametric baselines. Each number is the average of three runs. Our methods are above the horizontal line, while methods from the literature are listed below it. Method REINFORCE with leave-one-out (LOO) baseline NVIL with LOO baseline VIMCO with LOO baseline REINFORCE with temporal LOO baseline NVIL with temporal LOO baseline VIMCO with temporal LOO baseline Online Alignment RNN (stacked LSTM) [3] Neural Transducer with unsupervised alignments [12] Online Alignment RNN (grid LSTM) [3] Monotonic Alignment Decoder [19] Neural Transducer with supervised alignments [12] Connectionist Temporal Classification [20] (7) j6=i t0 >e t−1 We call this new baseline the temporal leave-one-out baseline because it takes into account the temporal reward structure of our setting. This baseline can be combined with the parametric baseline, and is applicable to both variational inference and REINFORCE objectives in single- and multi-sample settings. We explore the performance of these baselines empirically in the experiments section. PER 20.5 21.1 20.0 20.0 21.4 20.0 21.5 20.8 20.5 20.4 19.8 19.6 bound with the prior instead of using a variational posterior. In this work, we refer to this as REINFORCE to distinguish it from variational inference with an inference network. In [16] the authors revisit this topic, using reweighted wake sleep to train similar models. Their algorithm makes use of an inference network but does not optimize a variational lower bound. Instead they optimize separate objectives for the model and the inference network that produce a biased estimate of the gradient of the log marginal likelihood. 3. RELATED WORK In this section we first highlight the relationship between our model and other models for attention. Tang et. al. [7] proposed visual attention within the context of generative models, while Mnih et. al. [8] proposed using recurrent models of visual attention for discriminative tasks. Subsequently, visual attention was used in an image captioning model [9]. These forms of attention use discrete variables for attention location. Recently, ‘soft-attention’ models were proposed for neural machine translation and speech recognition [10, 11]. Unlike the earlier mentioned, hard-attention models, these models pay attention to the entire input and compute features by blending spatial features with an attention vector that is normalized over the entire input. Our paper is most similar to the hard attention models in that features at discrete locations are used to compute predictions. However it is different from the above models in the training method: While the hard attention models use REINFORCE for training, we follow variational techniques. We are also different from the above models in the specific application – attention in our models is over temporal locations only, rather than visual and temporal locations. As a result, we additionally propose the temporal leave-one-out baseline. Because the attention model we use is hard-attention, the model we use has parallels to prior work on online sequence-to-sequence models [12, 3]. The neural transducer model [12] can use either hard attention, or a combination of hard attention with local soft attention. However it explicitly splits the input sequences into chunks, and it is trained with an approximate maximum likelihood procedure that is similar to a policy search. The model of Luo et. al. [3] is most similar to our model. Both models use the same architecture; however, while they use REINFORCE for training, we explore VIMCO for training the attention model. We also propose the novel temporal LOO baseline. A similar model with REINFORCE has also been used for training an online translation model [13] and for training Neural Turing Machines [14]. Our work would be equally valid for these domains, which we leave for future work. There has also been work using reweighted wake sleep to train sequential models. In [15], Ba et. al. optimize a variational lower 4. EXPERIMENTS For our experiments we used the standard TIMIT phoneme recognition task. The TIMIT dataset has 3696 training utterances, 400 validation utterances, and 182 test utterances. The audio waveforms were processed into frames of log mel filterbank spectrograms every 25ms with a stride of 10ms. Each frame had 40 mel frequency channels and one energy channel; deltas and accelerations of the features were append to each frame. As a result each frame was a 123 dimensional input. The targets for each utterance were the sequence of phonemes. We used the 61 phoneme labels provided with TIMIT for training and decoding. To compute the phone error rate (PER) we collapsed the 61 phonemes to 39 as is standard on this task [17]. To model p we used a 2-layer LSTM with 256 units in each layer. For the variational posterior q we first processed the inputs x1:T with a 4-layer bidirectional LSTM and then fed the final layer’s hidden state h0 into a 2-layer unidirectional LSTM along with the current target yt and the previous emission decision bt−1 . Each layer had 256 units. Note that in this case the approximate posterior does not have access to yt+1:T at timestep t — in practice we found giving q access to y far in the future did not improve performance. We regularized the models with variational noise [18] and performed a grid search over the values {0.075, 0.1, 0.15} for the standard deviation of the noise. We also used L2 regularization and grid searched over the values {1 × 10−5 , 1 × 10−4 , 1 × 10−3 } for the weight of the regularization. 4.1. Multi-TIMIT We generated a multi-speaker dataset by mixing male and female voices from TIMIT. Each utterance in the original TIMIT dataset was 3 Fig. 2. Test set phoneme error rate (PER) curves for models trained with REINFORCE, NVIL, and VIMCO on the TIMIT dataset (left), the Multi-TIMIT 10% mixing proportion dataset (middle), and sample emission decisions for different methods on a TIMIT utterance (right). We evaluated three independent trials for each method. VIMCO converged more quickly than REINFORCE on both datasets. Furthermore, the performance gap between REINFORCE and VIMCO increases with Multi-TIMIT. We hypothesize that because Multi-TIMIT is a more challenging task, having a strong approximation to the posterior lets the model draw attention to the correct positions. NVIL performed well on TIMIT, but struggled with the more challenging Multi-TIMIT (note that only a single trial performs reasonably). VIMCO increases on Multi-TIMIT (also see table 2). Table 2. PER results on Multi-TIMIT for various algorithms. It can be seen that for this task VIMCO outperforms REINFORCE, The right panel of Figure 2 shows that REINFORCE attempts to and both VIMCO and REINFORCE outperforms RNN trained with wait to emit outputs until more information has come in, compared Connectionist Temporal Classification significantly. The benefit of to VIMCO. This is presumably because it requires more information VIMCO increases as the second speaker’s volume increases. during learning. VIMCO, on the other hand, leverages the variational Method Connectionist Temporal Classification RNN Transducer REINFORCE with LOO baseline NVIL with LOO baseline VIMCO with LOO baseline REINFORCE with temporal LOO baseline NVIL with temporal LOO baseline VIMCO with temporal LOO baseline posterior which can access future y and find the optimal place to emit. Mixing Proportion 0.50 0.25 0.1 43.8 33.3 27.3 48.9 32.2 25.7 42.9 32.5 25.9 70.1 71.8 55.2 41.7 30.7 25.4 43.5 31.6 25.6 74.3 71.9 54.9 41.7 30.75 25.2 In our experiments the difference between the performance of VIMCO and REINFORCE was larger for the more complicated task of Multi-TIMIT than for the simpler task of TIMIT. This can be explained by considering the samples that the models learn from. In the simpler problem of single speaker TIMIT, Monte-Carlo samples generated by REINFORCE have very high likelihood under p(b|x) – there are only a small number of samples that explain the entire probability mass, and these are sampled easily by a left to right ancestral pass (in time) of the model. These are very similar to the samples generated by the approximate posterior from VIMCO. As a result both methods perform approximately the same. In the case of Multi-TIMIT, however, in the ancestral pass the probabilities for individual emissions are much lower. Thus the likelihood is less ’peaked’, and a large diversity of samples is chosen, leading to higher variance and poor learning. VIMCO, on the other hand does not face this problem because it samples from the approximate posterior, which is close to the true posterior and so very peaked around the ‘correct’ samples of experience. paired with an utterance from the opposite gender. The waveform of both utterances was first scaled to lie within the same range, and then the scale of the second utterance was reduced to a smaller volume before mixing the two utterances. We used three different scales for the second utterance: 50%, 25%, and 10%. The new raw utterances were processed in the same manner as the original TIMIT utterances, resulting in a 123 dimensional input per frame. The transcript of the speaker 1 was used as the ground truth transcript for this new utterance. Multi-TIMIT has the same number of train, dev, and test utterances as the original TIMIT, as well as the same target phonemes. We trained models with the same configuration described above on the 3 different mixing scales, and also trained 2-layer unidirectional LSTM models with Connectionist Temporal Classification for comparison. The results are shown in Table 2. 6. CONCLUSION 5. RESULTS Figure 2 shows a plot of the training curves for the different methods of training and the different datasets. The variational methods (VIMCO and NVIL) require many fewer training steps compared to REINFORCE on both datasets. All methods used the same batch size and number of samples, so training steps are comparable. NVIL performs well enough on a simple task like TIMIT, but struggles with Multi-TIMIT. It can be seen that the gap between REINFORCE and In this paper we have showed how we can adapt VIMCO to perform hard attention for the case of temporal problems and introduce a new variance-reducing baseline. Our method outperforms other methods of training online sequence to sequence models, and the improvements are greater for more difficult problems such as noisy mixed speech. In the future we will apply these techniques to other challenging domains, such as visual attention. 4 7. REFERENCES [17] K-F Lee and H-W Hon, “Speaker-independent phone recognition using hidden markov models,” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 37, no. 11, pp. 1641–1648, 1989. [1] Ronald J Williams, “Simple statistical gradient-following algorithms for connectionist reinforcement learning,” Machine learning, vol. 8, no. 3-4, pp. 229–256, 1992. [18] Alex Graves, “Practical variational inference for neural networks,” in Advances in Neural Information Processing Systems, 2011, pp. 2348–2356. [2] Christopher John Cornish Hellaby Watkins, Learning from delayed rewards, Ph.D. thesis, King’s College, Cambridge, 1989. [19] Colin Raffel, Thang Luong, Peter J Liu, Ron J Weiss, and Douglas Eck, “Online and linear-time attention by enforcing monotonic alignments,” arXiv preprint arXiv:1704.00784, 2017. [3] Yuping Luo, Chung-Cheng Chiu, Navdeep Jaitly, and Ilya Sutskever, “Learning online alignments with continuous rewards policy gradient,” CoRR, vol. abs/1608.01281, 2016. [4] Andriy Mnih and Danilo Jimenez Rezende, “Variational inference for monte carlo objectives,” CoRR, vol. abs/1602.06725, 2016. [20] Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber, “Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks,” in Proceedings of the 23rd international conference on Machine learning. ACM, 2006, pp. 369–376. [5] Yuri Burda, Roger B. Grosse, and Ruslan Salakhutdinov, “Importance weighted autoencoders,” CoRR, vol. abs/1509.00519, 2015. [6] Andriy Mnih and Karol Gregor, “Neural variational inference and learning in belief networks,” CoRR, vol. abs/1402.0030, 2014. [7] Yichuan Tang, Nitish Srivastava, and Ruslan R Salakhutdinov, “Learning generative models with visual attention,” in Advances in Neural Information Processing Systems, 2014, pp. 1808– 1816. [8] Volodymyr Mnih, Nicolas Heess, Alex Graves, et al., “Recurrent models of visual attention,” in Advances in neural information processing systems, 2014, pp. 2204–2212. [9] Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C Courville, Ruslan Salakhutdinov, Richard S Zemel, and Yoshua Bengio, “Show, attend and tell: Neural image caption generation with visual attention.,” in ICML, 2015, vol. 14, pp. 77–81. [10] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio, “Neural machine translation by jointly learning to align and translate,” CoRR, vol. abs/1409.0473, 2014. [11] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio, “Attention-based models for speech recognition,” in Advances in Neural Information Processing Systems 28, C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, Eds., pp. 577–585. Curran Associates, Inc., 2015. [12] Navdeep Jaitly, David Sussillo, Quoc V. Le, Oriol Vinyals, Ilya Sutskever, and Samy Bengio, “An online sequence-to-sequence model using partial conditioning,” CoRR, vol. abs/1511.04868, 2015. [13] Jiatao Gu, Graham Neubig, Kyunghyun Cho, and Victor O. K. Li, “Learning to translate in real-time with neural machine translation,” CoRR, vol. abs/1610.00388, 2016. [14] Wojciech Zaremba and Ilya Sutskever, “Reinforcement learning neural turing machines-revised,” arXiv preprint arXiv:1505.00521, 2015. [15] Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu, “Multiple object recognition with visual attention,” arXiv preprint arXiv:1412.7755, 2014. [16] Jimmy Ba, Ruslan R Salakhutdinov, Roger B Grosse, and Brendan J Frey, “Learning wake-sleep recurrent attention models,” in Advances in Neural Information Processing Systems, 2015, pp. 2593–2601. 5
2cs.AI
EXPLICIT POLYNOMIALS HAVING THE HIGMAN-SIMS GROUP AS GALOIS GROUP OVER Q(t) arXiv:1611.04314v2 [math.NT] 19 Dec 2016 DOMINIK BARTH AND ANDREAS WENZ Abstract. We compute explicit polynomials having the sporadic HigmanSims group HS and its automorphism group Aut(HS) as Galois groups over the rational function field Q(t). 1. Introduction From a theoretical perspective it is known that Aut(HS), the automorphism group of the sporadic Higman-Sims group HS, occurs as a Galois group over Q(t) since it has a rigid rational generating triple, see [2] and [5]. In order to find explicit polynomials with Galois group Aut(HS) over Q(t) one can compute a three-point branched covering, also called Belyi map, over P1 C whose ramification corresponds to these rigid rational triples. For a thorough survey on computing Belyi maps refer to [6]. Recently, Klug et al. calculated a Belyi map of degree 50 with monodromy group isomorphic to PSU3 (F5 ) using modular forms, see [3]. We developed another efficient method of computing certain Beyli maps of higher degree which we will explain in detail in an upcoming paper. The purpose of the current note is to present a Belyi map of degree 100 with monodromy group isomorphic to Aut(HS). As a consequence, we obtain polynomials having HS and Aut(HS) as Galois groups over Q(t). 2. Ramification Data and Computed Results Our goal is to compute a Belyi map f : P1 C → P1 C of ramification type 3 (x, y, z) ∈ S100 given by x = (1, 64, 8, 54, 37)(2, 20, 81, 42, 49)(3, 98, 32, 73, 89)(4, 96, 86, 15, 79) (5, 22, 28, 78, 48)(6, 67, 97, 40, 14)(7, 58, 82, 59, 18)(9, 16, 87, 85, 60) (10, 70, 41, 56, 55)(11, 77, 36, 25, 68)(12, 17, 19, 21, 80)(13, 35, 90, 33, 91) (23, 50, 66, 84, 27)(24, 72, 95, 52, 76)(26, 99, 100, 57, 93)(29, 71, 38, 69, 65) (30, 74, 94, 53, 51)(31, 45, 47, 75, 34)(43, 63, 44, 46, 62), 2010 Mathematics Subject Classification. 12F12. Key words and phrases. Inverse Galois Problem, Belyi Maps, Higman-Sims Group. 1 2 DOMINIK BARTH AND ANDREAS WENZ y = (1, 20)(2, 64)(3, 76)(4, 45)(5, 83)(6, 26)(7, 13)(8, 74)(9, 41)(10, 63)(11, 25) (12, 66)(14, 21)(15, 52)(16, 62)(17, 33)(18, 35)(19, 42)(22, 60)(23, 58) (24, 73)(28, 98)(29, 82)(30, 53)(31, 61)(32, 59)(34, 67)(36, 95)(37, 85) (38, 47)(39, 51)(40, 80)(43, 92)(44, 78)(46, 99)(48, 55)(49, 94)(50, 91) (54, 90)(65, 88)(69, 72)(71, 75)(77, 79)(81, 87)(84, 97)(86, 100)(93, 96), z = (1, 2)(13, 18)(21, 40)(47, 71)(25, 68)(15, 95, 77)(20, 37, 87)(39, 53, 51) (49, 74, 64)(55, 78, 63)(57, 100, 96)(66, 80, 97)(73, 76, 89)(7, 91, 23) (12, 50, 33)(22, 85, 54, 35, 59, 98)(24, 32, 82, 65, 88, 69) (3, 52, 86, 99, 44, 28)(4, 31, 61, 34, 6, 93)(5, 83, 48, 56, 41, 60) (8, 30, 94, 42, 17, 90)(9, 70, 10, 43, 92, 62)(11, 36, 72, 38, 45, 79) (14, 19, 81, 16, 46, 26)(27, 84, 67, 75, 29, 58). This permutation triple is of the following type: x y z cycle structure 519 .15 247 .16 610 .310 .25 With the help of Magma [1] we can easily verify: • x·y·z =1 • Aut(HS) = hx, yi • (x, y, z) is a rigid and rational triple of genus 0 Due to the rational rigidity criterion [7, p. 48] and a rationality consideration there exists a Belyi map f ∈ Q(X) of degree 100 with monodromy group isomorphic to Aut(HS). Note that f is unique, up to inner and outer Möbius transformations. Applying our newly developed method we were able compute this Belyi map explicitly. The resulting function f : P1 C → P1 C is of the form f (X) = r(X) p(X) =1+ q(X) q(X) where p(X) = 33 · (X 4 − 8X 3 − 6X 2 + 8X + 1)5 · (X 5 − 5X 4 + 50X 3 + 70X 2 + 25X + 3)5 · (3X 5 − 5X 4 − 5X 3 + 35X 2 + 40X + 4)· (9X 10 − 30X 9 + 55X 8 − 200X 7 + 210X 6 + 924X 5 − 890X 4 − 360X 3 + 1925X 2 − 1070X + 291)5 , q(X) = (3X 5 − 35X 4 + 90X 3 − 50X 2 + 15X + 9)2 · (9X 10 − 120X 9 + 10X 8 − 1960X 7 − 1090X 6 + 3304X 5 − 760X 4 − 920X 3 + 145X 2 + 80X + 6)3 · (3X 10 − 10X 9 − 65X 8 + 160X 7 − 90X 6 − 932X 5 − 330X 4 + 880X 3 + 1255X 2 + 830X + 27)6 HIGMAN-SIMS GROUP AS A GALOIS GROUP 3 and r(X) = p(X) − q(X) 2 2 2 = 22 · 314 · 53 · (X − 1) · r5 (X) · r10 (X) · r16 (X) · r20 (X) with irreducible monic polynomials rj of degree j. From the factorizations of p, q, r and the Riemann-Hurwitz formula it is clear that f is indeed a three-point branched cover of P1 C, ramified over 0, 1 and ∞. 3. Verification of Monodromy We will present two proofs to verify that the monodromy group of our Belyi map f = p/q is isomorphic to Aut(HS). First, one can compute the corresponding dessin d’enfant, i.e. the bipartite graph drawn on the Riemann sphere P1 C obtained by taking the elements of f −1 (0) as black vertices, those of f −1 (1) as white vertices and the connected components of f −1 ((0, 1)) as edges, labelled from 1 to 100. A part of this bipartite graph is shown in Figure 1. Note that the poles of f are marked by ’×’. Listing the cyclic arrangement of adjacent edges around each black and white vertex, respectively, we obtain the cycles of x and y, up to simultaneous conjugation. Thus the monodromy group of f is isomorphic to Aut(HS). Figure 1. Dessin d’enfant corresponding to f 4 DOMINIK BARTH AND ANDREAS WENZ Another way to verify the monodromy can be done algebraically: The monodromy group of f can be viewed as the Galois group Gal(p(X)−tq(X) | Q(t)) or equivalently Gal(p(X) − f (t)q(X) | Q(f (t))). First note that Gal(p(X)−f (t)q(X) | Q(t)) equals the point stabilizer of t in the permutation group Gal(p(X) − f (t)q(X) | Q(f (t))) acting transitively on the 100 roots of p(X) − f (t)q(X). As p(X) − f (t)q(X) factorizes over Q(t)[X] into three irreducible polynomials of degrees 1, 22 and 77, respectively, we see that Gal(p(X)−f (t)q(X) | Q(f (t))) and thus also G := Gal(p(X) − tq(X) | Q(t)) are rank 3 permutation groups of degree 100 with subdegrees 1, 22 and 77. We now show that G is actually a primitive permutation group: Suppose G ≤ Sym(Ω), |Ω| = 100, has some non-trivial block ∆, i.e. 1 < |∆| < 100, such that for each g ∈ G either ∆g = ∆ or ∆g ∩∆ = ∅. Now fix some ω ∈ ∆. Then the stabilizer Gω must leave ∆ invariant, and — as G is rank 3 group — Gω has exactly the non-empty orbits {ω}, ∆ \ {ω} and Ω \ ∆. Knowing the sizes of the suborbits we find that ∆ has either length 1 + 22 = 23 or length 1 + 77 = 78. This is a contradiction as the size of a block must always divide the permutation degree, in our case 100. Now, combining the classification of all finite primitive rank 3 permutation groups (see e.g. [4]) with the subdegrees of G, only two possibilities remain: G = Aut(HS) or G = HS. Since HS, in contrary to Aut(HS), is an even permutation group, it suffices to check whether the discriminant δ of p(X) − tq(X) ∈ Q(t)[X] is a square in Q(t). Using Magma we see δ = u2 2(t − 1) for some u ∈ Q(t) and therefore G = Aut(HS). Remark. By applying the previous arguments to p(X) − (2t2 + 1)q(X) we find Gal(p(X)−(2t2 +1)q(X) | Q(t)) is either HS or Aut(HS). The discriminant, however, is a square now, thus Gal(p(X)−(2t2 +1)q(X) | Q(t)) = HS. 4. Another Example Essentially, Aut(HS) contains exactly two rigid rational generating triples of genus 0. The first one has been discussed in the previous section. The second triple (x, y, z) ∈ S100 where x = (1, 23, 53, 86)(2, 36, 29, 43)(3, 15, 46, 6)(4, 80, 71, 81)(5, 75, 16, 47) (7, 32, 60, 8)(9, 76, 100, 51)(10, 50, 49, 34)(11, 28, 74, 84)(12, 72, 37, 52) (13, 21, 96, 88)(14, 41, 40, 87)(17, 42, 45, 79)(18, 63, 19, 20)(22, 99, 39, 89) (24, 59, 77, 38)(25, 68, 26, 35)(27, 69, 73, 48)(30, 92, 33, 82)(31, 56, 93, 58) (44, 98, 67, 64)(54, 95, 85, 62)(55, 65, 94, 61)(57, 78, 83, 97)(66, 90, 70, 91), y = (1, 75, 5, 71, 15)(2, 43, 52, 89, 39)(3, 18, 100, 33, 35, 26, 58, 32, 53, 23) (4, 81, 47, 16, 86, 7, 42, 38, 77, 59)(6, 41, 14, 87, 82, 76, 9, 97, 19, 63) (8, 60, 93, 56, 13, 61, 36, 99, 70, 45)(10, 65, 55, 88, 12, 29, 94, 34, 49, 50) (11, 44, 64, 25, 92)(17, 72, 96, 69, 28, 30, 40, 46, 80, 24)(20, 83, 78, 57, 51) (21, 31, 68, 67, 98, 84, 74, 27, 48, 73)(22, 37, 79, 90, 66, 95, 54, 62, 85, 91) and z := (xy)−1 HIGMAN-SIMS GROUP AS A GALOIS GROUP 5 of ramification type x y z cycle structure 425 108 .54 235 .130 leads to the Belyi map f (X) = p(X) r(X) =1+ q(X) q(X) where p(X) = (7X 5 − 30X 4 + 30X 3 + 40X 2 − 95X + 50)4 · (2X 10 − 20X 9 + 90X 8 − 240X 7 + 435X 6 − 550X 5 + 425X 4 − 100X 3 − 175X 2 + 250X − 125)4 · (2X 10 + 5X 8 − 40X 6 + 50X 4 − 50X 2 + 125)4 , q(X) = 28 · (X 4 − 5)5 · (X 8 − 20X 6 + 60X 5 − 70X 4 + 100X 2 − 100X + 25)10 . Of course, it remains to verify that this rational function is indeed a threepoint branched cover having the desired monodromy group. However, this can be done in the exact same way we already demonstrated in the previous section. Acknowledgements We would like to thank Peter Müller for introducing us to the subject of this work as well as for sharing some tricks to verify the monodromy algebraically, and Joachim König for providing us with the rigid rational permutation triples of Aut(HS) we realized as a Galois group over Q(t) in this paper. References [1] Wieb Bosma, John Cannon, and Catherine Playoust. The Magma algebra system. I. The user language. J. Symbolic Comput., 24(3-4):235–265, 1997. Computational algebra and number theory (London, 1993). [2] David C. Hunt. Rational rigidity and the sporadic groups. J. Algebra, 99:577–592, 1986. [3] Michael Klug, Michael Musty, Sam Schiavone, and John Voight. Numerical calculation of three-point branched covers of the projective line. LMS Journal of Computation and Mathematics, 17(1):379–430, 001 2014. [4] Martin W. Liebeck and Jan Saxl. The finite primitive permutation groups of rank three. Bull. Lond. Math. Soc., 18:165–172, 1986. [5] Gunter Malle and B. Heinrich Matzat. Inverse Galois theory. Berlin: Springer, 1999. [6] Jeroen Sijsling and John Voight. On computing Belyi maps. In Numéro consacré au trimestre “Méthodes arithmétiques et applications”, automne 2013, pages 73–131. Besançon: Presses Universitaires de Franche-Comté, 2014. [7] Helmut Völklein. Groups as Galois groups: an introduction. Cambridge: Cambridge Univ. Press, 1996. Institute of Mathematics, University of Würzburg, Emil-Fischer-Straße 30, 97074 Würzburg, Germany E-mail address: [email protected] E-mail address: [email protected]
4math.GR
Quantum entropy and polarization measurements of the two-photon system 1 Moorad Alexanian1 and Vanik E. Mkrtchian2 Department of Physics and Physical Oceanography University of North Carolina Wilmington, NC 28403-5606 2 Institute for Physical Research, Armenian Academy of Sciences. Ashtarak, 0203, Republic of Armenia arXiv:1802.08276v1 [quant-ph] 22 Feb 2018 (Dated: February 26, 2018) We consider the bipartite state of a two-photon polarization system and obtain the exact analytical expression for the von Neumann entropy in the particular case of a 5-parameter polarization density matrix. We investigate and graphically illustrate the dependence of the entropy on these five parameters, in particular, the existence of exotic, transition from exotic to non-exotic, and non-exotic states, where the quantum conditional entropy is negative, both positive and negative, and positive, respectively. We study the “cooling” or “heating” effect that follows from the reduced density of photon 2 when a measurement is performed on photon 1. I. INTRODUCTION The philosophical implications of the superposition principle of quantum mechanics and quantum inseparability have profound effects for our understanding of the physical aspect of nature, which differs drastically from that provided by classical mechanics [1]. Quantum entanglement or quantum inseparability is essential for quantum information communication and processing protocols in quantum cryptography [2], dense coding [3], teleportation [4], and entanglement swapping [5], which can be used to realize quantum repeaters [6]. Entanglement can be achieved via two interacting quantum systems [7] or by an appropriate joint measurement of two systems [8]. In handling quantum information, the notion of quantum noise or decoherence enters as an unwanted interaction with the outside world. Here we deal with the dynamics of a closed quantum system and study the polarization of a two-photon system and measurements performed on the system. We show the existence of exotic states and their transition into non-exotic state (and vice versa) by suitably tuning the parameters, which is interesting in some aspects of quantum computation and quantum information. Several authors have studied how to protect coherence and thus control dissipation [9–13]. The role of the von Neumann entropy [14] has gained in importance in recent years owing to the extensive development of the physics of entangled quantum states. The entropy plays a fundamental role as a quantitative measure of entanglement [15, 16]. Accordingly, any exact result of the von Neumann entropy for a correlated quantum system is of extreme importance. In this paper, we consider the bipartite system of a pair of photons and exactly calculate the general expression for the von Neumann entropy for correlated, polarized states [17, 18]. The generalized conditional entropy has been analyzed for this system [19] for which knowledge of the eigenvalues of the density matrix is not required. Correlation transfer from one-photon to two-photon systems, not in any restricted subspace, but in the complete space of the polarization degree of freedom has been studied [20]. Three protocols for directly measuring the concurrence of two-photon polarization-entangled states, including pure states and mixed states has been considered [21]. An experimentally realizable scheme for manipulating the entanglement of an arbitrary state of two polarization-entangled qubits has been introduced, where the von Neumann entropy provides a convenient and useful measure of the purity of the state [22]. We investigate the nature of the reduced density matrix of photon 2 after a measurement is performed on photon 1. This measurement gives rise to a “cooling” (“heating”) effect of photon 2 if the final entropy of photon 2 is less (greater) than the single photon entropy. This paper is arranged as follows. In Sec. II, we review the conditional quantum entropy used in quantum information theory. In Sec. III, we consider the general expression for the von Neumann entropy for two photons. In Sec. IV, we study the four eigenvalues for the two-photon polarization density matrix. In Sec. V, we study two-photon correlations for a 5-parameter family of density matrices and obtain results for the entropy for three models that illustrate a wide-ranging behavior of the von Neumann entropy. In particular, the transition from negative to positive values of the quantum conditional entropy as a function of the photon Stokes parameter, viz., the transition from exotic to non-exotic states, as well as, the existence of strictly exotic and non-exotic states. In Sec. VI, we consider a measurement of one of the photons with an analyzer and the corresponding effect that this measurement has on the reduced entropy of the second photon. Finally, Sec. VII summarizes our results. II. QUANTUM CONDITIONAL ENTROPY The quantum conditional entropy is defined by [23] S(ρ̂(1) |ρ̂(2) ) = S(ρ̂(1,2) ) − S(ρ̂(2) ) (1) while the quantum mutual information by S(ρ̂(1) : ρ̂(2) ) = S(ρ̂(1) ) + S(ρ̂(2) ) − S(ρ̂(1,2) ), (1,2) (2) where S(ρ̂ ) is the joint entropy for the composite system and S(ρ̂(i) ) is the entropy of the i-th component, 2 i = 1, 2. Henceforth, S ≡ S(ρ̂(1,2) ) and Si ≡ S(ρ̂(i) ). For entangled states, one has the entropic inequality [24] S < Si . (3) However, there are entangled states which do not exhibit this exotic property (3) but rather satisfy the inequality S ≥ Si The conditional quantum entropy is an entropy measure used in quantum information theory. An important feature of the quantum conditional entropy (1) is that it can assume negative values [25], that is, the subsystems of the entangled system can exhibit more disorder than the system as a whole [26]. The negativity of quantum conditional entropy is a sufficient criterion for quantum non-separability and gives the additional number of bits above the classical limit that can be transmitted in a quantum dense coding protocol. The conditional entropy with a minus sign is known as the coherent information and is a fundamental quantity responsible for the capability of transmission of quantum information. The classical analog of the conditional entropy indicates that the Shannon entropy of a single random variable is never larger than the Shannon entropy of two variables [24]. Accordingly, a negative quantum conditional entropy is a definite signature of quantumentangled states. ξ̂ (1) · ξ̂ (1) + ξ̂ (2) · ξ̂ (2) + X 2 ζij ≤ 3. (7) i,j The reduced density matrix for photon 1, viz., ρ̂(1) , is obtained by taking the trace of (4) over the quantum states of photon 2, which gives us the Stokes matrix of photon 1, (1) ρ̂(1) = T r2 ρ̂(1,2) = (1/2)[Iˆ(1) + ξ̂ · σ̂ (1) ]. Similarly, by taking a trace of (4) over the quantum states of photon 1, one obtains the Stokes matrix of photon 2, viz., ρ̂(2) , ρ̂(2) = T r1 ρ̂(1,2) = (1/2)[Iˆ(2) + ξ̂ (2) · σ̂ (2) ]. VON NEUMANN ENTROPY FOR TWO-PHOTON SYSTEM S(ρ̂(1,2) ) = −T r(ρ̂(1,2) ln ρ̂(1,2) ) (10) of the two photon system in a mixed quantum state, that is, when ρ̂2 6= ρ̂. Araki and Lieb [27] have proven that (2) · σ̂ (2) + X (1) ζij σ̂i (2) ⊗ σ̂j i,j  , (4) where Iˆ(1) , Iˆ(2) and σ̂ (1) , σ̂ (2) are 2 × 2 Pauli vector matrices acting in the polarization space of photons and the real dimensionless quantities ξ (1) , ξ (2) , ζij (i, j = 1, 2, 3) are functions of the photon momenta and of the parameters of the emitting system. The dimensionless vectors ξ (1,2) are the Stokes vectors of photons 1, 2, respectively, while the parameter ζij describes the two photon polarization correlation. In the case of no photon entanglement, one has that Generally, the Stokes parameters ξ̂ inequalities [18] (1) ξi (2) + ξj Sα = ln 2−(1/2) ln[(1−ξ (α) )1−ξ (α) (1+ξ (α) )1+ξ (1) ], (12) (α) IV. ENTROPY FOR TWO-PHOTON POLARIZATION DENSITY The arbitrary polarization state of the photon pair (4) is described by 15 real parameters [18] and owing to the Araki-Lieb inequality (11), the maximum entropy attainable is (13) (5) (1,2) − 1 ≤ ζij ≤ ξi (α) where ξ (α) is the magnitude of the Stokes vector ξ̂ . The entropy Sα is a monotonically decreasing function of the Stokes parameter for 0 ≤ ξ (α) ≤ 1 and achieves its maximum value ln 2 for the completely unpolarized state when ξ (α) = 0 and its minimum value zero when the photon is in a pure polarized state, viz., ξ (α) = 1. Smax = 2 ln 2 (1) (2) ζij = ξi ξj . (11) where S1 , S2 are the reduced von Neumann entropies of photons α = 1, 2 The general form of the normalized polarization density matrix for two photons [17, 18] is given by  (1) ρ̂(1,2) = (1/4) Iˆ(1) ⊗ Iˆ(2) + ξ̂ · σ̂ (1) ⊗ Iˆ(2) + Iˆ(1) ⊗ ξ̂ (9) The goal of our paper is to calculate the von Neumann entropy [14] |S1 − S2 | ≤ S ≤ S1 + S2 , III. (8) and ζij satisfy the (2) − ξj + 1, (6) when all of 15 parameters are set equal to zero. That is to say, no correlations of any kind, neither individually nor for the pair of photons. The eigenvalue equation of the matrix (4) is λ4 − λ3 + c2 λ2 − c1 λ + c0 = 0, (14) 3 and where the coefficients are defined as follows (1)2 ξ3 c2 = (1/8) p, (2)2 + ξ3 + X ζii2 ≤ 3. (22) i  c1 = (1/16) p − 2(1 − X (2) (1) ξi ζij ξj i,j  + det ζ̂) , (15) c0 = det ρ̂(1,2) . In (15), p is a nonnegative number (see (7)) which is called the purity of the state [28] p = 3 − ξ̂ (1) · ξ̂ (1) − ξ̂ (2) · ξ̂ (2) − X 2 ζij The density matrix (18) describes interesting polarization states of the pair of photons, that is, from the completely unpolarized state to that of the pure polarized state as defined in [18] and represents entangled photons provided (5) does not hold true for at least one of the ζij . All three examples that follow represent strictly nonseparable density matrices. The eigenvalue equation (14) factors into the product of two quadratic polynomials and the eigenvalues are given by (16) and describes the “distance” of the mixed state of the system from the pure state where p = 0. [17, 18] The four non-negative solutions λj (j = 1, ..4) of (14) yield the von Neumann entropy X λj ln λj . (17) S=− j λ3,4 PHOTON CORRELATIONS We consider the special case of the density matrix (4) which contains the main properties of the two-photon system and which is easier to handle mathematically than the general case that includes all 15 real parameters. Namely, we consider the case where the 15 real parameters are reduced to actually 5.  (1) (1) ρ̂(1,2) = (1/4) Iˆ(1) ⊗ Iˆ(2) + ξ3 σ̂3 ⊗ Iˆ(2) (2) (2) + ξ3 Iˆ(1) ⊗ σ̂3 + X (1) ζii σ̂i (2) ⊗ σ̂i i  , (18)  2 (1) (2) 2 xν = [ ξ3 + νξ3 + (ζ11 − νζ22 ) ]1/2 , (ν = ±). (24) One obtains for the entropy (17) the expression − 1 ≤ ζ11,22 ≤ 1, S = Smax − 1 X 1+νζ33 +xν ln[(1 + νζ33 + xν ) 4ν=± 1+νζ33 −xν × (1 + νζ33 − xν ) (19) (1) (2) (1) (2) (1) (2) − 1 ≤ ξ3 , ξ3 ≤ 1, (25) − 1 ≤ ζ33 ≤ 1 (26) − 1 ∓ ζ33 ≤ x± ≤ 1 ± ζ33 . (27) and Note that the general expression for entropy (25) is a function of the three variables ζ33 , x− , and x+ . For definiteness, we consider ζ33 ≥ 0. Entropy (25) assumes its maximum value 2 ln 2 when (28) (completely unpolarized state) and it assumes the value of zero (pure state of two photon polarization) when ζ33 = 1, x− = 0, x+ = 2. |ξ3 + ξ3 | − 1 ≤ ζ33 ≤ |ξ3 − ξ3 | + 1, ]. Entropy (25) depends on the three quantities ζ33 , x− , and x+ . The requirement that the eigenvalues (23) be real, positive quantities in order to give rise to a real valued entropy implies that ζ33 = x− = x+ = 0 where the 5 parameters satisfy inequalities (6) and (7) (23) where The roots of the quartic equation (14), with coefficients given by (15), are extremely awkward to write and thus the exact expression for the entropy (17) would not be too useful. Accordingly, we consider special cases of (4) that lead to the quartic form (14) being reduced to the product of two quadratic polynomials V. 1 (1 + ζ33 ± x+ ) 4 1 = (1 − ζ33 ± x− ), 4 λ1,2 = i,j (29) (20) The requirement of nonnegative values for the eigenvalues λ1 , · · · λ4 is also satisfied provided (21) 2 1 ≤ p/2 + ζ33 , (30) 4 2 |q| ≤ p/2 + ζ33 − 1, (31) where q is defined by q = ξ 3 (1) ξ 3 (2) − ζ33 − ζ11 ζ22 . (32) The parameter q also describes the purity of the two photon polarization state given by the density matrix (18), which is equal to zero for pure polarized states of the pair of photons [18]. A. Non exotic states in two-photon correlations Consider the correlated density matrix  (1) (2) (1) (2) ρ̂(1,2) = (1/4) Iˆ(1) ⊗ Iˆ(2) + ζ[σ̂1 ⊗ σ̂1 − σ̂2 ⊗ σ̂2 ] (1) (2) + ζ33 σ̂3 ⊗ σ̂3  , (33) where the positivity of the eigenvalues requires that − 1 ≤ ζ33 ≤ 1 (34) − (1 + ζ33 )/2 ≤ ζ ≤ (1 + ζ33 )/2. (35) and The von Neumann entropy (25) is S(ζ, ζ33 ) = Smax − − 1 ln(1 − ζ33 )1−ζ33 2 1 ln[(1 + ζ33 + 2ζ)1+ζ33 +2ζ (1 + ζ33 − 2ζ)1+ζ33 −2ζ ]. (36) 4 The plot of the entropy (36) is shown in Fig. 1 where it is evaluated for different values of ζ33 . Note that the range of values for ζ is restricted by the reality condition for the von Neumann entropy, viz., 0 ≤ ζ ≤ (1 + ζ33 )/2. The decrease of the entropy for increasing values of ζ33 , for fixed values of ζ, is to be expected since increasing the value of ζ33 means that the state of the two photons becomes less chaotic and approaches the entropy associated with the reduced entropy (12). Note that from the separability condition (3), it does not follow that states that satisfy S ≥ S1 are necessarily separable, In fact, in Fig. 1, we have non-exotic (S > S1 ) entangled states. B. Exotic to non-exotic transition in single- and two-photon correlations The previous example and the one to follow below given by (40) are in agreement with our common understanding of entropy as a measure of the disorder of a (1) (2) FIG. 1: Plot of the entropy (36) for ξ3 = ξ3 = 0, ζ11 = −ζ22 = ζ, which gives x+ = 2|ζ| and x− = 0. Inequality (27) becomes 0 ≤ ζ33 ≤ 1 and 0 ≤ ζ ≤ (1 + ζ33 )/2. The values for ζ33 are as follows: ζ33 = 0 (solid), ζ33 = 0.66 (dashdot), ζ33 = 0.85 (dot), and ζ33 = 1.0 (single photon entropy (12))(dash). system. In both these cases, the entropy is a monotonically decreasing function of the polarization. However, the system in this following second example gives rise to a very different behavior of the entropy as a function of polarization. Suppose that two of the eigenvalues in (23) are set equal to zero, viz., λ2 = λ4 = 0, and with ζ11 = ζ22 = ζ, then the density matrix (18) becomes  (2) (1) (1) (2) ρ̂(1,2) = (1/4) Iˆ(1) ⊗ Iˆ(2) + ξ3 σ̂3 ⊗ Iˆ(2) + ξ3 Iˆ(1) ⊗ σ̂3 + q (1) (2) (1) (2) (1) (2) (1 − ξ3 )(1 − ξ3 )[σ̂1 ⊗ σ̂1 + σ̂2 ⊗ σ̂2 ] (37) (1) (2) (1) (2) +(ξ3 + ξ3 − 1)σ̂3 ⊗ σ̂3  . Entropy (25) for the density matrix (37) is (1) (2) S(ξ3 , ξ3 ) = − (1) (2) (1) (2) ξ3 + ξ3 2 (1) (1) ln( (2) ξ3 + ξ3 ) 2 (2) ξ + ξ3 ξ3 + ξ3 (2) (1) ) ln(1 − 3 ) = S1 (ξ3 + ξ3 ). 2 2 (38) Note that the dependence of entropy (38) on the Stokes (1) (2) parameters ξ3 and ξ3 is via their sum while such is not the case for the density matrix (37). (1) (2) The case ξ3 = ξ3 = ξ, shown in Fig. 2 by the solid plot, gives for the entropy (38) − (1 − S(ξ) = −ξ ln(ξ) − (1 − ξ) ln(1 − ξ), (39) 5 FIG. 2: Plot of the two photon entropy (38) as a function (2) (1) of ξ3 for different values of ξ3 . The values are as follows: (2) (2) (2) (2) (1) ξ3 = ξ3 (solid), ξ3 = 0 (dashdot), ξ3 = 0.1 (dot), ξ3 = (1) (2) (2) 0.2 (longdash), ξ3 = 0.4 (spacedot), ξ3 = 1−ξ−ξ3 (dash). The dash plot corresponds to the single photon entropy (12) (1) (2) which intersects the other graphs at ξ3 = (1 − ξ3 )/2. (1) (2) FIG. 3: Plot of the entropy (41) for ξ3 = p ξ3 = ξ, ζ11 = −ζ22 = ζ and ζ33 = 1 , which gives x+ = 2 ξ 2 + ζ 2 ≤ 2 and x− = 0. The values for ζ are as follows: ζ = 0 (single photon entropy (12))(dash), ζ = 0.6 (dot), ζ = 0.8 (dashdot), and ζ = 0.9 (solid). (1) (2) (1) (2) (1) (2) + ζ[σ̂1 ⊗ σ̂1 − σ̂2 ⊗ σ̂2 ] + σ̂3 ⊗ σ̂3 which is actually the binary entropy function h(ξ) introduced by Wootters [15] in the definition of the entanglement of formation (EOF). Also, one obtains the reduced single photon entropy (12), dash plot in Fig. 2, (1) (2) for ξ3 + ξ3 = 1 − ξ. Fig. 2 shows the reduced single photo entropy (12), dash graph, together with the two photon entropy (38) (1) as a function of the Stokes parameter for photon 1, ξ3 , for various fixed values of the Stokes parameter for pho(2) ton 2, 0 ≤ ξ3 < 1. The points of intersection between the dash plot and the other plots represent the transi(1) (2) (1) tion points whereby S(ξ3 , ξ3 ), as a function of ξ3 , goes from the region where S1 > S (exotic states) to the region where S > S1 (non-exotic states), that is, where the quantum conditional entropy (1) changes sign from negative to positive. C. Exotic states in single- and two-photon correlations In order to the find the role of the polarization states of the individual photons in the entropy of the two-photon system, we consider the case where the Stokes parameters (1) (2) ξ3 = ξ3 ≡ ξ 6= 0 and the photon correlation parameters ζ11 = −ζ22 ≡ ζ, and ζ33 = 1. The latter choice of parameters will allow the pure state to be realized when ζ = 0 for ξ = 1 in the entropy (41) given below. The corresponding density matrix is  (1) (2) ρ̂1,2 = (1/4) Iˆ(1) ⊗ Iˆ(2) + ξ[σ̂3 ⊗ Iˆ(2) + Iˆ(1) ⊗ σ̂3 ]  . (40) The entropy is 1 2+x 2−x S(ξ, ζ) = Smax − ln [(2 + x+ ) + (2 − x+ ) + ], (41) 4 where x+ = 2 p ξ 2 + ζ 2 ≤ 2, (42) and 0 ≤ ξ ≤ 1. (43) As can be seen in Fig. 3, the two-photon entropy S(ξ, ζ) mimics that of the single photon entropy S1 (ξ), that is, the single photon entropy (12) decreases with increasing values of ξ, while the two photon entropy (41) decreases for given value of ζ with increasing values of ξ or conversely. These results indicate that once again one has exotic, p entangled states since S1 (ξ) > S(ξ, ζ) for 0 ≤ ξ ≤ 1 − ζ 2 , that is, the conditional entropy is negative for these values of the parameters. VI. ENTROPY AND MEASUREMENT In this section, we consider the effect of photon polarization measurements with the aid of an efficiency matrix and the resulting reduction of the two-photon density matrix. Of course, the change of the entropy of the two-photon system depends crucially on the particular measurement that is actually performed [1]. 6 Three types of polarization measurements can be carried out on the two-photon system. I. A standard measurement of two independent analyzers is performed with the aid of the efficiency matrix of the polarization filter [29] given by the direct product of the Stokes matrices of the analyzers ǫ̂I = ρ̂1 ⊗ ρ̂2 , where ρ̂i = 12 (Iˆ(i) + ni · σ̂ (i) ) and ni is a unit vector (i = 1, 2). After the measurement, one has a separable polarization state of the pair of photons. The probability of reduction or correlation parameter is then  1 X  ζij n1i n2j . wI = Tr ǫ̂I ρ̂(1,2) = 1+n1 ·ξ (1) +n2 ·ξ(2) + 4 i,j (44) The probability wI is actually less than 1, owing to inequalities (6) and (7), which means that this type of measurement disturbs the system and reduction of the initial quantum state, either a pure entangled or mixed state, takes place into a pure polarization state and so the total entropy is zero. That is to say, the entropy of the system decreases owing to the measurement. II. Measurement with a two-photon analyzer where the efficiency matrix of the polarization filter is coincident with the density matrix (4) with 15 filter parameters for f , a pure polarization state, viz., ξ1 , ξ 2 , and ζij  ǫ̂II = (1/4) Iˆ(1) ⊗ Iˆ(2) + ξ 1 · σ̂ (1) ⊗ Iˆ(2) ǫ̂III given by ǫ̂III = +I ⊗ ξ2 · σ̂ (2) + X i,j f (1) σ̂i ζij ⊗ (2) σ̂j  . ′ ρ̂2 = Tr ǫ̂III ρ̂(1,2) (46) In contrast to the probability wI , which is always less than one, probability wII could even reach the value of one. If the initial two photon state is in a pure polarization state, then the measurement does not disturbs the system and so the entropy does not change and remains equal to zero. If, however, the initial two-photon state is in a mixed state, then the measurement actually forces the system from an initial finite value of the entropy to zero entropy. Accordingly, as was the case in the previous measurement, this measurement also has the effect of reducing the entropy of the two-photon system after the polarization of the system has been measured. III. This third measurement can be performed by one analyzer with efficiency matrix of the polarization filter  (48) with Stokes parameters (2)′ ξj −1 i h X (2) . ζij ni 1 + n · ξ (1) = ξj + (49) i Therefore, with the aid of the expression for the entropy for a single photon, the entropy of photon 2 becomes after the measurement of photon 1 ′ (2)′ ′ (2)′  1  ln (1 − ξ (2) )1−ξ (1 + ξ (2) )1+ξ , 2 (50) where the general expression for the magnitude of the ′ Stokes vector ξ (2) after the measurement is S(n) = ln(2) − ξ (2)′ q (2)′ (2)′ (2)′ = (ξ1 )2 + (ξ2 )2 + (ξ3 )2 q 2 + n2 ζ 2 + (ξ (2) + n ζ )2 n21 ζ11 3 33 2 22 3 (1) 1 + n3 ξ3 (45) This two-photon analyzer reduces the initial two photon polarization state to that of a pure polarization state for the two photon system determined by the 15 filter parameters. One obtains for the probability wII of reducing the initial state to the filtered state  1 X f  wII = Tr ǫ̂II ρ̂(1,2) = 1+n1 ·ξ(1) +n2 ·ξ(2) + ζij ζij . 4 i,j (47) Photon 2 get polarized by this measurement on photon 1 and photon 2 is now described by the Stokes matrix [18] = ˆ(1) 1 ˆ(1) ˆ (I + n · σ̂ (1) ) ⊗ I. 2 , (51) where the second expression in (51) follows for the 5parameter density matrix (18). The analyzer ǫ̂III depends on the unit vector n and the final state of photon 2 depends also on the initial values of the Stokes parameters of photons 1 and 2. In what follows, we show that depending on the vector n and the initial states of photons 1 and 2, the effect of the measurement on photon 1 will result in the increase or decrease of the entropy of photon 2. A. Entropy of reduced density with only two-photon correlations The correlated density matrix (33) yields for the magnitude of the Stokes vector (51) ′ ξ (2) = q 2 . (1 − n23 )ζ 2 + n23 ζ33 (52) Notice that (52) is an even function of n3 . Fig. 4 shows the behavior of the reduced entropy S(ζ, ζ33 , n3 ) of particle 2 for various values of ζ33 and n3 . There is both “cooling” (S < S1 ) and “heating” (S > S1 ) of photon 2 after the measurement of photon 1. 7 FIG. 4: Plot of the photon reduced entropy (50) with mag′ nitude (52) for ξ (2) . The values for ζ33 and n3 are as follows: ζ33 = 0, n3 = 0.5 (spacedash), single photon entropy (12) (dash), ζ33 = 0.66, n3 = 0.5 (dashdot), and ζ33 = 0.95, n3 = 0.5 (dot). B. FIG. 5: Plot of the photon reduced entropy (50) with magni′ tude (53) for ξ (2) . The values of the Stokes parameters are (2) (1) set as follows ξ3 = ξ3 = ξ. The values for n3 are as follows: n3 = 1 (dashdot), n3 = 0.8 (spacedash), n3 = 0.5 (longdash), and the single photon entropy (12) (dash). Entropy of reduced density with unequal single correlation and two-photon correlations The correlated density matrix (37) yields for the magnitude of the Stokes vector (51) ′ ξ (2) = × 1 (1) 1 + n3 ξ3 (53) r i2 h (1) (2) (1) (2) (2) . (1 − n23 )(1 − ξ3 )(1 − ξ3 ) + n3 (ξ3 + ξ3 − 1) + ξ3 Note that (53) is not an even function of n3 and so negative values may be considered. Fig. 5 shows the behav(2) (1) ior of the reduced entropy S(ξ, n3 ) for ξ3 = ξ3 = ξ as a function of ξ for given values of n3 . In this case, the entropy of photon 2, after measurement of photon 1, exhibits “cooling” and “heating” of the unmeasured photon 2. Fig 6 shows the case where n3 assumes a negative value and shows considerable “cooling” of the unmeasured photon 2. C. Entropy of reduced density with equal single correlation and two-photon correlations The correlated density matrix (40) yields for the magnitude of the Stokes vector (51) p (1 − n23 )ζ 2 + (ξ + n3 )2 (2)′ ξ = (54) 1 + n3 ξ Note that (54) is not an even function of n3 and so negative values may be considered. Fig. 7 shows the behavior FIG. 6: Plot of the photon reduced entropy (50) with magni′ (1) tude (53) for ξ (2) . The values for ξ3 and n3 are as follows: (1) ξ3 = 0.1, n3 = −0.3 (dashdot), single photon entropy (12) (1) (1) (dash), and ξ3 = 0.4, n3 = −0.3 (dot), and ξ3 = 0.8, n3 = −0.3 (spacedot). of the reduced entropy S(ζ, ξ, n3 ) as a function of ζ for given values of ξ and n3 . Fig. 8 shows the case where n3 assumes a negative value. In both instances, we have only “cooling.” VII. SUMMARY AND DISCUSSION We have obtained exact results for the joint von Neumann entropy for the polarization states of a two-photon system governed by a 5-parameter polarization density matrix and studied the sign of the quantum conditional 8 entropy. We find that the quantum conditional entropy may assume positive or negative values. The latter indicates the presence of exotic states. We have also studied the resulting reduced density matrix of one of the photons after a measurement is performed on the second photon. We find a sort of “heating” and “cooling” of the unmeasured photon where the final entropy of the unmeasured photon has either increased or decreased. We believe that these results may be of interest in the general area of quantum computation and quantum information theories. FIG. 7: Plot of the photon reduced entropy (50) with mag′ nitude (54) for ξ (2) . The values for ξ and n3 are as follows: ξ = 0, n3 = 0.5 (dashdot), single photon entropy (12) (dash), ξ = 0.4, n3 = 0.5 (dot), and ξ = 0.7, n3 = 0.5 (spacedot). FIG. 8: Plot of the photon reduced entropy (50) with mag′ nitude (54) for ξ (2) . The values for ξ and n3 are as follows: ξ = 0, n3 = −0.7 (dashdot), single photon entropy (12) (dash), ξ = 0.4, n3 = −0.7 (dot), and ξ = 0.7, n3 = −0.7 (spacedot). References [1] A. Peres, Quantum Theory: Concepts and Methods (Kluwer Academic, Dordrecht, 1995). [2] A. K. Ekert, Quantum cryptography based on Bells theorem, Phys. Rev. Lett. 67, 661 (1991). [3] C.H. Bennett and S.J. Wiesner, Communication via oneand two-particle operators on Einstein-Podolsky-Rosen states, Phys. Rev. Lett. 69, 2881 (1992). [4] C. H. Bennett, G. Brassard, C. Crpeau, R. Jozsa, A. Peres, and W. K. Wootters, Teleporting an unknown quantum state via dual classical and Einstein-Podolsky- Rosen channels, Phys. Rev. Lett. 70, 1895 (1993); D. Bouwmeester, J.-W. Pan, K. Mattle, M. Eibl, H. Weinfurter, and A. Zeilinger, Experimental quantum teleportation, Nature (London) 390, 575 (1997). [5] J.-W. Pan, D. Bouwmeester, H. Weinfurter, and A. Zeilinger, Experimental Entanglement Swapping: Entangling Photons That Never Interacted, Phys. Rev. Lett. 80, 3891 (1998). [6] H.-J. Briegel, W. Du r, J. I. Cirac, and P. Zoller, Quantum Repeaters: The Role of Imperfect Local Operations in Quantum Communication, Phys. Rev. Lett. 81, 5932 (1998). 9 [7] P. G. Kwiat, K. Mattle, H. Weinfurter, and A. Zeilinger, New High-Intensity Source of Polarization-Entangled Photon Pairs, Phys. Rev. Lett. 75, 4337 (1995). [8] H. Weinfurter, Europhys. Lett., Experimental Bell-State Analysis, 25, 559 (1994); P. G. Kwiat and H. Weinfurter, Embedded Bell-state analysis, Phys. Rev. A 58, R2623(R) (1998). [9] M. Gao, L.-M. Liang, C.-Z. Li, and Chen-Lin Tian, Robust quantum key distribution with two-photon polarization states, Phys, Letts A 359 , 126 (2006). [10] O.D. Odele, J.M. Lukens, J.A. Jaramillo-Villegas, C. Langrock, M.F. Fejer, D.E. Leaird, and A.M. Weiner, Tunable delay control entangled photons based on dispersion cancellation, Optics Express 23, 21857 (2015). [11] C. Altuzarra, S. Vezzoli, J. Valente, W. Gao, C. Soci, D. Faccio, and C. Couteau, Nonlocal Control of Dissipation with Entangled Photons, arXiv:1701.05357v1. [12] S. Das, S. Khatri, and J.P. Dowling, Robust quantum network architectures and topologies for entanglement distribution, Phys. Rev. A 97, 012335 (2018). [13] H.M. Cammack, P. Kirton, T.M. Stace, P.R. Eastham, J. Keeling, and B. W. Lovett, Coherence protection in coupled quantum systems, Phys. Rev. A 97, 022103 (2018). [14] J. von Neumann, Mathematische Grundlagen der Quantenmechanik (Springer-Verlag, Berlin, 1968) [Mathematical Foundations of Quantum Mechanics (Princeton University Press, Princeton, 1996)]. [15] W.K. Wootters, Entanglement of formation of an arbitrary state of two qubits, Phys. Rev. Lett. 80, 2245 (1998). [16] L. Amico, R. Fazio, A. Osterloh, and V. Vedral, Entanglement in many-body systems, Rev. Mod. Phys. 80, 517 (2008). [17] U. Fano, Pairs of two-level systems, Rev. Mod. Phys. 55, 855 (1983). [18] V.E. Mkrtchian and V.O. Chaltykian, Polarization states of the two-photon system, Opt. Comm. 63, 239 (1987). [19] N. Gigena and R. Rossignoli, Generalized conditional entropy in bipartite quantum systems, J. Phys. A: Math. Theor. 47, 015302 (2014). [20] G. Kulkarni, V. Subrahmanyam, and A. K. Jha, Intrinsic upper bound on two-qubit polarization entanglement predetermined by pump polarization correlations in parametric down-conversion, Phys. Rev. A 93, 063842 (2016). [21] L.-H. Zhang, Q. Yang, M. Yang, W. Song, and Z.-L. Cao, Direct measurement of the concurrence of two-photon polarization-entangled states, Phys, Rev. A 88, 062342 (2013). [22] R.T. Thew and W. J. Munro, Mixed state entanglement: Manipulating polarization-entangled photons, Phys. Rev. A 64 022320 (2001). [23] M.A. Nielsen and I. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, Cambridge, UK, 2000). [24] R. Horodecki, P. Horodecki, M. Horodecki, and K. Horodecki, Quantum entanglement, Rev. Mod. Phys. 81, 865 (2009). [25] N.J. Cerf and C. Adami, Negative entropy and information in quantum mechanics, Phys. Rev. Lett. 79, 5194 (1997). [26] R. Horodecki and P. Horodecki, Quantum redundancies and local realism, Phys. Lett. A 194, 147 (1994). [27] H. Araki and E.H. Lieb, Entropy inequalities, Commun. Math. Phys. 18, 160 (1970). [28] J. Gemmer, M. Michel, and G. Mahler, Quantum thermodynamics, Lect. Notes Phys. 784, 1 (2009). [29] K. Blum, Density Matrix Theory and Applications (Springer, Dordrecht, 2012).
7cs.IT
High-Speed Trajectory Planning for Autonomous Vehicles Using a Simple Dynamic Model arXiv:1704.01003v1 [cs.SY] 4 Apr 2017 Florent Altché2,1 , Philip Polack1 and Arnaud de La Fortelle1 Abstract— To improve safety and energy efficiency, autonomous vehicles are expected to drive smoothly in most situations, while maintaining their velocity below a predetermined speed limit. However, some scenarios such as low road adherence or inadequate speed limit may require vehicles to automatically adapt their velocity without external input, while nearing the limits of their dynamic capacities. Many of the existing trajectory planning approaches are incapable of making such adjustments, since they assume a feasible velocity reference is given. Moreover, near-limits trajectory planning often implies high-complexity dynamic vehicle models, making computations difficult. In this article, we use a simple dynamic model derived from numerical simulations to design a trajectory planner for high-speed driving of an autonomous vehicle based on model predictive control. Unlike existing techniques, our formulation includes the selection of a feasible velocity to track a predetermined path while avoiding obstacles. Simulation results on a highly precise vehicle model show that our approach can be used in real-time to provide feasible trajectories that can be tracked using a simple control architecture. Moreover, the use of our simplified model makes the planner more robust and yields better trajectories compared to kinematic models commonly used in trajectory planning. I. I NTRODUCTION In order to improve safety and energy efficiency and not to surprise other road users, autonomous vehicles are widely expected to drive smoothly; moreover, traffic efficiency concerns will likely lead these vehicles to follow relatively closely the road speed limit. However, such speed limits may not always exist (e.g., on some dirt roads) or they may not be followed safely due to the road topology (e.g., mountain roads with sharp curves) or weather conditions (e.g., wet or icy road). Many trajectory planning algorithms rely on an a-priori knowledge of a target velocity that can either be an explicit parameter of the problem [1], [2] or be implicitly given by requiring a set of target positions at fixed times [3], [4]. Some authors have proposed using the road curvature [5] to provide an upper bound on the velocity, which corresponds to a maximum lateral acceleration; this method can be extended to obstacle avoidance by first planning a collision-free path, then adjusting the velocity consequently [6]. However, as path selection and velocity planning are intrinsically linked, this approach can lead to severe inefficiencies. 1 MINES ParisTech, PSL Research University, Centre for robotics, 60 Bd St Michel 75006 Paris, France [florent.altche, philip.polack, arnaud.de_la_fortelle] @mines-paristech.fr 2 École des Ponts ParisTech, Cité Descartes, 6-8 Av Blaise Pascal, 77455 Champs-sur-Marne, France For this reason, model predictive control (MPC) techniques are often used in the literature, since they allow to simultaneously compute a feasible trajectory and a sequence of control inputs to track it. However, high-speed trajectory planning requires a complex modeling of the vehicle to account for its dynamic limitations, which mainly come from the complex and highly non-linear [7] tire-road interactions. Adding to this difficulty, wheel dynamics are generally much faster (around 1 ms [8]) than changes of the vehicle’s macroscopic state (typically 100 ms). Therefore, the existing literature is generally divided between medium-term (a few seconds) trajectory planning including obstacle avoidance for low-speed applications, mainly relying on simple kinematic models (see, e.g. [9], [10]), and short-term (sub-second) trajectory tracking for high-speed or low-adherence applications using wheel dynamics modeling (see, e.g., [11]–[14]). In the second case, obstacle avoidance is generally not considered (with the notable exception of [15]), and the existence of a feasible collision-free trajectory is not guaranteed in the case of an unexpected obstacle. Note that sampling-based approaches [16] have also been proposed in the literature; however, they do not provide optimality guarantees when a finite number of samples is selected, and may have trouble finding a feasible solution in complex scenarios. In this article, we propose a middle-ground approach to allow trajectory planning over a few seconds in high dynamic situations. This approach relies on the use a simple vehicle model (initially proposed in [17]) derived from a realistic dynamic modeling of the vehicle body and wheels, which accounts for tire slip effects using carefully estimated bounds on the dynamics. Using this model, we design a non-linear trajectory planning framework, which is able to follow a predefined path (e.g., the road centerline) at high speed while avoiding obstacles. Comparison with a more classical kinematic bicycle model shows that our proposed planner provides better trajectories and is more robust. Moreover, our simulations showed that computation time remains below 80 ms on a standard computer and could be further reduced using auto-generation [4], thus allowing real-time use. To the best of the authors’ knowledge, no comparable framework has been published for medium- or long-term planning in high dynamic situations. The rest of this article is structured as follows: in Section II, we present a 9 degrees of freedom dynamic model of the vehicle’s body, that we use throughout the rest of this article. In Section IV, we briefly describe our simplified dynamic model and to formulate a trajectory planner based on Model Predictive Control, which computes an aggressive yet feasible trajectory. This planner is validated and its performance is compared to a classical kinematic bicycle model in Section V using a realistic physics simulation suite; finally, Section VI concludes the study. II. V EHICLE MODEL In this article, we consider a 9 degrees of freedom modeling of the vehicle body, which provides a satisfying balance between accuracy and computational cost. Alongside with the usual 2D state [X, Y, ψ] (with ψ the yaw rotation) of the vehicle, the model takes into account roll and pitch movements, wheel dynamics and coupling of longitudinal and lateral tire slips. Being a chassis model, it does not take into account the dynamics of the car engine or brakes. The control inputs of the vehicle are the torque Ti applied to each wheel i and the steering angle of the front wheels, δ. We use uppercase letters (e.g., X, Y ) to denote coordinates in the ground (global) frame, and lowercase letters for coordinates in the vehicle (local) frame; the x coordinate in the local frame corresponds to the longitudinal component. The notations are given in Table I and illustrated in Figure 1. TABLE I N OTATIONS X, Y , Z θ, φ, ψ Vx , Vy Vxwi ωi ζi δ Tωi Fxwi , Fywi Fxi , Fyi Fzi Faero MT Ix , Iy , Iz Iri lf , lr lw rw ks , ds Position of the vehicle’s CoM (ground frame) Roll, pitch and yaw angles of the car body Longitudinal and lat. vehicle speed (vehicle frame) Longitudinal speed of wheel i (wheel frame) Angular velocity of wheel i Displacement of suspension i Steering angle of the front wheels Total torque applied to wheel i Longitudinal and lateral forces on wheel i (wheel frame) Longitudinal and lat. forces on wheel i (vehicle frame) Normal ground force on wheel i Air drag force on the vehicle Total mass of the vehicle Roll, pitch and yaw inertia of the vehicle Inertia of wheel i around its axis Distance between the front/rear axle and the CoM Half-track of the vehicle Effective radius of the wheels Suspensions stiffness and damping using a slightly more complex vehicle model. Under these hypotheses, the dynamics of the vehicle’s center of mass are written as: (1a) Ẋ = Vx cos ψ − Vy sin ψ (1b) Ẏ = Vx sin ψ + Vy cos ψ 1 MT V̇x = ψ̇Vy + V̇y = − ψ̇Vx + 4 X i=1 (1c) Fxi − Faero 4 1 X Fy , MT i=1 i (1d) where Fxi and Fyi are respectively the longitudinal and lateral tire forces generated on wheel i, expressed in the local vehicle frame (x, y). The yaw, roll and pitch motions of the car body are computed as: Iz ψ̈ = lf (Fy1 + Fy2 ) − lr (Fy3 + Fy4 ) + lw (Fx2 + Fx4 − Fx1 − Fx3 ) (2a) Ix θ̈ = lw (Fz1 + Fz3 − Fz2 − Fz4 ) + Z Iy φ̈ = lr (Fz3 + Fz4 ) − lf (Fz1 + Fz2 ) − Z 4 X i=1 4 X Fyi (2b) Fx i (2c) i=1 where Fzi = −ks ζi (θ, φ) − ds (ζ˙i )(θ, φ), with ζi (θ, φ) the displacement of suspension i for the given roll and pitch angles of the car body. The variation of Fz models the impact of load transfer between tires. Finally, the dynamics of each wheel i can be written as Ir ω̇i = Tωi − rw Fxwi . (3) In general, the longitudinal and lateral forces Fxwi and Fywi depend on the longitudinal slip ratio τi , the side-slip angle αi , the reactive normal force Fzi and the road friction coefficient µ. The slip ratio of wheel i can be computed as ( rw ωi −Vxw i if rw ωi ≥ Vxwi rw ωi (4) τi = rw ωi −Vxwi otherwise. Vxw i The lateral slip-angle αi of tire i is the angle between the wheel’s orientation and its velocity, and can be expressed as Vy + lf ψ̇ Vx ± lw ψ̇ Vy − lr ψ̇ αr = − Vx ± lw ψ̇ αf = δ − Fig. 1. Simulation model of the vehicle in the (x, y) plane We make the assumptions that the body of the vehicle rotates around its center of mass, and that the aerodynamic forces do not create a moment on the vehicle. Moreover, we assume that the road remains horizontal, and any slope or banking angle is neglected; this assumption could be relaxed (5) (6) where f and r denote the front and rear wheels respectively. In this article, we use Pacejka’s combined slip tire model (equations (4.E1) to (4.E67) in [7]), which takes into account the interaction between longitudinal and lateral slips, thus encompassing the notion of friction circle [18]. For clarity purposes, we do not reproduce the complete set of equations here. III. C ONSTRAINED SECOND - ORDER INTEGRATOR MODEL Theoretically, it is possible to use the 9 degrees of freedom model inside a model predictive control framework to directly compute an optimal trajectory and the corresponding controls. However, classical optimization tools often struggle to solve problems involving highly nonlinear constraints or cost functions, as it is the case in the model presented in Section II – notably due to disjunction (4) which makes τ non-differentiable. Additionally, wheel dynamics generally occur over very small characteristic times – typically a few milliseconds – which requires choosing a correspondingly small discretization time step, making planning over long horizons impractical at best. For this reason, simplified models are very often preferred. Kinematic bicycle (or singletrack) models [9], [10], [19], or even simpler second-order integrator models [2] are therefore common in the trajectory planning literature. One of the main issues of these simplified models is that they are generally considered to be imprecise when nearing the handling limits of the vehicle. To counter this problem, previous work [17] presented a constrained second-order dynamic model derived from simulation data using the 9 degrees of freedom model of Section II. For lack of space, we only briefly described these previous results here. vx (m/s) : 10 20 30 40 aY (m s−2 ) 0 −5 aX (m s −2 0 2 4 ) (a) Lateral vs. longitudinal aψ (m s−2 ) A[aX , aY , aψ ]T ≤ b (10) amin X , where A is a constant matrix, b a constant vector and depend on vx,0 . For our model vehicle, the experimenamin Y tal data of Figure 2 yield α = 9.4 m s−2 , β = 9.0 m s−2 ,  2.6 1 15.3 ) m s−2 . Figure 4 shows the A = 2.6 −1 and b = ( 15.3 min max variation of aX and aX with the initial longitudinal velocity; a polynomial fit yields amin X (vx,0 ) = −9.3 − (v 0.013vx,0 + 0.00072vx,0 2 and amax x,0 ) = 4.3 − 0.009vx,0 X (with vx,0 expressed in m s−1 ). In the (aY , aψ ) plane, we suppose a linear relation between aψ and aY in the form: aψ = γaY , with γ = 0.56 rad m−1 . Although seemingly restrictive, this approximation provides better results than using a parallelogram acceptable region, and in practice corresponds to minimizing the vehicle slip angle. 5 −10 −8 −6 −4 −2 To allow the use of this model in planning, we approximate the sets shown in Figure 2 as a set of convex linear and nonlinear constraints in the (aX , aY ) plane as shown in Figure 3. These constraints are expressed as:  a 2  a  2 Y X + ≤1 (8) α β max amin (9) X (vx,0 ) ≤ aX ≤ aX (vx,0 ) 50 10 −10 given longitudinal velocity vx,0 and a lateral velocity vy,0 ∈ [−0.2vx,0 , 0.2vx,0 ]. Therefore, only part of this region is actually reachable from an initial vehicle state (corresponding to a determined lateral velocity). In this article, we assume that the lateral dynamics of the vehicle is sufficiently fast to neglect this effect. Simulation results (see Section V) show this assumption seems reasonable. Using these results, we propose a constrained double integrator model for the vehicle dynamics. This model considers a state vector ξ = [X, Y, ψ, vx , vy , vψ ]T and a control u = [ux , uy , uψ ]T , with the same notations and reference frames as presented in Section II. The dynamic equation of the system is ξ˙ = f2di (ξ, u) with   vx cos ψ − vy sin ψ f2di (ξ, u) =  vx sin ψ + vy cos ψ  . (7) [vψ , ux , uy , uψ ]T 5 aY aY 0 aX −5 −10 −5 0 5 aY (m s −2 aX 10 ) (b) Yaw vs. lateral Fig. 2. Envelope of the sets of feasible accelerations for different longitudinal velocities vx,0 and lateral velocity vy,0 ∈ [−0.2vx,0 , 0.2vx,0 ]; notice the slight deformation along the aX axis with increasing vx,0 .. Using a random sampling method, we first compute (offline) an envelope for the set of feasible longitudinal (aX ), lateral (aY ) and angular (aψ ) accelerations, as shown in Figure 2. More specifically, these sets are computed for a (a) Feasible set (blue) and approximation (red) (b) Detail Fig. 3. Convex approximation of the feasible accelerations in the (aX , aY ) plane. The actual region is shown in blue. IV. MPC FORMULATION FOR TRAJECTORY PLANNING We now use the second-order integrator model developed in the previous section to design a trajectory planner based on model predictive control. In this section, we assume that the vehicle tries to follow a known reference path, for instance m s−2 8 −amin X 6 amax X 4 10 20 30 vx,0 (m s −1 40 Obstacle γref 50 CoM ) Fig. 4. Variations of the amin and amax coefficients with the initial X X longitudinal velocity vx,0 ; the dashed lines show the polynomial fit. the centerline of a given lane. The reference path γref is supposed to be given as a set of positions (Xref , Yref ). In this article, we assume that the vehicle has no information on a safe choice of longitudinal speed. Such situations can arise in various scenarios, such as poor adherence conditions where the speed limit cannot be safely followed, or in the absence of speed limits, for instance on dirt roads or for racing. Moreover, we assume that the vehicle also needs to avoid obstacles on the road; for now, we only consider fixed obstacles with known positions and shapes. Additionally, we do not consider varying road adherence, and we suppose that the tire-road friction coefficient µ is constant and equal for all four wheels. Future work will study real-time estimation of this friction coefficient to adapted the planner accordingly. Algorithm 1: Planning and control Data: current state ξ(t0 ), γref , horizon T find xclosest := point of γref closest to (X(t0 ), Y (t0 )) set s0 := curvilinear position of xclosest set hz := [s0 , s0 + vx (t0 )T ] set pX := fitpolynom( Xref |hz , s − s0 , 5) set pY := fitpolynom( Yref |hz , s − s0 , 5) find obs := list of relevant obstacles find κ := max(abs(curvature(p X , pY , hz)))   p set vmax := min vx (t0 ) + aX (B)T, µg/κ compute ξmpc := MPC(ξ(t0 ), pX , pY , vmax , T , obs) apply low level control to track ξmpc The planning and control scheme works in several steps, as presented in Algorithm 1. We first approximate Xref and Yref over the next planning horizon T as fifth order polynomials of the curvilinear position, starting at the point of γref closest to the vehicle’s current position. Using these polynomials, we compute the maximum (in absolute value) of the path curvature over the planning p horizon, noted κ, to determine an upper bound vmax = µg/κ for the speed of the vehicle in order to limit the lateral acceleration to µg (as proposed, e.g., in [5]). Only the relevant obstacles, i.e. those for which a risk of collision exists during the next planning horizon T , are effectively considered for collision avoidance; we note O the set of these obstacles. Generalizing the ideas of [20], we determine a bounding parabola for each obstacle o ∈ O as shown in Figure 5, such that the collision avoidance constraints can be written as po (X, Y ) ≤ 0, with Fig. 5. Modeling of an obstacle a parabola. The vertex and roots of the parabola are chosen with enough margin to ensure that no collision can occur as long as the center of mass is outside of the shaded region containing the obstacle. po a second-order multinomial function. Note that the use of unbounded parabolas is preferred to bounded shapes such as ellipses, since they do not create local minima. At a time t0 corresponding to a vehicle state ξ(t0 ) (with an initial longitudinal speed v0 ), we formulate the motion planning problem using model predictive control with time step duration h and horizon T = Kh as follows:  min J (ξk )k=0...K , (uk )k=0...K−1 (11a) (uk )k=0...K−1 subj. to ξk+1 − ξk = h f2di (ξk , uk ) (11b) (11c) ξ0 = ξ(t0 )  u 2  u 2 Y X + ≤1 α β max amin X (vx,0 ) ≤ aX ≤ aX (vx,0 ) (11d) uψ = γuY (11g) ∀o ∈ O, po (Xk , Yk ) ≤ 0 (11h) T A[uX , uY ] ≤ b (11e) (11f) for k = 0 . . . K − 1. Note that, as it is often the case in the planning literature (see, e.g., [21]), collision avoidance (eq. (11h)) is actually implemented as soft constraints to avoid infeasibility caused by numerical errors. Additionally, note that our formulation can be slightly modified in order to take moving obstacles into account, by using a different parabola pko for each obstacle and at each time step. In this article, we only focus on minimizing the deviation from the reference trajectory. In most of the existing MPC literature where a reference speed is supposed to be known in advance, the cost function J is expressed as: K  X J (ξk ), (uk ) = (Xk − Xkref )2 + (Yk − Ykref )2 . (12) k=0 In these formulations, Xkref and Ykref implicitly encode the speed at which the reference path should be followed. Since we do not assume that a reference speed is known in advance, this method cannot be applied directly. A possible way to handle this difficulty is to express Ykref as a function of Xk (see, e.g, [22]). However, this method cannot be applied to all shapes of reference paths, and is notably not suited to sharp turns even when using local instead of global coordinates. For this reason, we introduce an auxiliary state s to denote the curvilinear position of the vehicle along γref , so that Xkref = pX (sk ) and Ykref = pY (sk ). In this article, we use a simple first-order integrator dynamic for s with ṡ = q vx2 + vy2 . Noting ξ 0 the extended state of the vehicle, we instead use the objective function: J= K−1 X wv vtol 2k + wX Xtol 2k + wY Ytol 2k + wo Otol 2k (13) k=0 where wv , wX , wY and wo are positive weighting terms, and we add the following constraints to problem (11): vtolk ≥ |vmax − vX k | Xtolk ≥ |Xk − pX (sk )| Ytolk ≥ |Yk − pY (sk )| ∀o ∈ O, Otolk ≥ po (Xk , Yk ) (14a) 50 I 0 −50 Proposed Kinematic −150 −100 −50 0 50 100 Fig. 6. Detail of the reference path (black, dotted) and actual path followed by the vehicle while avoiding obstacles (represented as orange circles), using both planners. (14b) (14c) (14d) for k = 0 . . . K − 1. V. S IMULATION RESULTS We used the realistic physics simulator PreScan [23] to validate the proposed MPC trajectory planner. The simulator uses the 9 degrees of freedom model presented in Section II, with the same parameters that were used to obtain the sets of feasible accelerations in Section III. Robustness of the planner to variations of the vehicle parameters is a subject for further study. The MPC problem (11)-(14) is solved using the ACADO Toolkit [24]; due to the inner workings of the simulator, the simulation is paused during resolution. The output of the solver is the set of future target longitudinal and lateral accelerations, as well as target future positions and longitudinal velocities for the vehicle in the horizon T . These outputs are fed into two low-level controllers, one being tasked with velocity tracking and the other with steering. Low-level tracking of the planned trajectory is achieved using PID controllers; the lateral control also uses a τ seconds look-ahead [25]. At time t, the predicted position of the vehicle at t + τ is computed as X̂ = X + τ vx cos(ψ̂) and Ŷ = Y + τ vx cos(ψ̂), with ψ̂ = ψ + 12 τ ψ̇. Instead of tracking the target position at time t, the lateral control uses the error between predicted and desired positions at time t + τ . This method was found to provide better performance and stability than a simple PID in our simulations, with a look-ahead duration of τ = 0.2 s. The lateral control takes into account a limited angular velocity for the steering wheel of 12 rad s−1 , which is in the average of recorded steering velocities for human drivers in obstacle avoidance scenarios [26]. However, we do not consider the dynamics of the engine or brakes, which are supposed to respond instantaneously. The reference path used in our simulations is presented in Figure 6; the path consists of a 60 m straight line, a half circle with radius 20 m, a 200 m straight line, a Bezier arc corresponding to a 135 degrees turn, a 100 m straight line, a half circle with radius 10 m and a final -135 degrees turn Bezier arc. In all simulations, the weights are chosen as wv = 1, wX = wY = 10 and wo = 100. The planning horizon is chosen as T = 3 s and the time step duration of the MPC is h = 200 ms; replanning is performed every 100 ms. To achieve real-time computation speeds, the solver is limited to five SQP iterations, which in our experience is sufficient to achieve a good convergence. Auto-generation techniques can also be used to further reduce computation time [4]. For comparison purposes, we also implemented the same MPC planner with a classical kinematic bicycle model such as presented in [19]; the model is written as follows: Ẋ = v cos (ψ + arctan β) (15a) Ẏ = v sin (ψ + arctan β) v ψ̇ = sin (arctan β) lr v̇ = a (15b) (15c) (15d) lr tan δ the with v the longitudinal velocity and β = lr +l f side slip angle. The control inputs are the longitudinal acceleration a, and the steering angle of the front wheel δ. All other parts of the planning and control algorithm are otherwise equal, including the low-level controller. The maximum and minimum acceleration in the bicycle model (see Figure 3 for the are chosen equal to amin and amax X X notations) respectively. Note that the solver is slightly faster using this formulation; therefore, the maximum number of SQP iterations is set to 6 for the kinematic model to yield comparable computation times, which increases solution quality. A. Planning without obstacles We first consider trajectory planning without obstacles; Figure 7 presents the actual speed of the vehicle during the simulation as a function of its position along the path γref for the two MPC planners, as well as the speed bound v 2 ≤ κg (with κ the path curvature), corresponding to a centripetal acceleration of 1 g used, e.g., in [5]. First, we notice that both planners have similar performance in the straight portions of the road; however, the planner based on our proposed secondorder integrator model systematically achieves higher p speeds in curves. Second, no solver reaches the upper bound g/κ, thus confirming that including a speed selection phase during 30 20 10 0 0 100 200 300 400 500 Longitudinal position (m) 600 Fig. 7. Comparison of achieved vehicle speed with our proposed model (in blue) and for a kinematic bicycle model (in red); the speed for the kinematic model run until convergence is shown in solid black. The dotted curve represents the bound v 2 ≤ µg/κ where κ is the path curvature. TABLE II A BSOLUTE LATERAL POSITIONING ERROR FOR BOTH PLANNERS . Model Proposed Kinematic Proposed Kin. (opt) RMS error (m) Maximum error (m) 0.25 0.16 0.70 0.95 planning (as opposed to tracking a predefined velocity solely computed from path curvature) is relevant to allow proper tracking. The superior performance of the planner based on the second-order integrator model is likely due to the simpler relation between the optimization variables (the input controls) and the objective value (the deviation from the target state) than in the bicycle model, which allows a much faster convergence towards the solution. Indeed, when allowing the solver to run until convergence with the kinematic bicycle model, the resulting velocity becomes comparable to that obtained with the real-time second-order model (but computation time is above 500 ms). Figure 8 shows the lateral error when tracking the reference path, for both MPC planners. Table II presents synthetic data about the lateral error of the complete planning and control architecture in both cases, showing satisfying overall performance for high-speed applications. Note that better precision can be achieved (at the cost of speed) by selecting different values for the weighting coefficients. Moreover, a more precise low-level controller can probably achieve better performance. Lateral error (m) Kinematic 1 0.8 0.6 0.4 0.2 0 0 Kinematic 100 200 300 400 500 Longitudinal position (m) 600 Fig. 8. Lateral positioning error for the proposed model (in blue) and for the kinematic bicycle model (in red), without obstacles. Lateral deviation (m) Speed (m s−1 ) Proposed Proposed Kinematic 2 1 0 0 100 200 300 400 500 Longitudinal position (m) 600 Fig. 9. Lateral deviation for the proposed model (in blue) and for the kinematic bicycle model (in red) while avoiding obstacles (shaded regions). deviation from the reference and a higher average speed of 12.7 m s−1 compared to 10.2 m s−1 using the kinematic bicycle planner (for lack of space, the velocity curves are not shown). More importantly, the kinematic planner is sometimes unable to output a trajectory in less than 100 ms, as shown in Figure 10. This situation happens when approaching obstacles in high-curvature portions of the road; as before, the better behavior of the proposed planner is likely due to the simpler search space since the dynamic model presents much less non-linearity. A more in-depth analysis could provide useful insights on desirable model properties to allow fast and robust convergence. VI. C ONCLUSION In this article, we considered the trajectory planning and control of a vehicle at high velocity near the limits of handling. Instead of using a highly complex model during In this section, we compare the behavior of both planners in the presence of obstacles, modeled as parabolas as explained in Figure 5. Figure 6 shows a detail of the actual path followed by the vehicle using the proposed planner while avoiding obstacles. The attached video file1 shows the corresponding simulation. Figure 9 presents the lateral deviation from the reference trajectory while avoiding obstacles using both planners. Generally speaking, the proposed planner allows a smaller 1 Also available at https://youtu.be/BRpmdIxTz-0 Comp. time (ms) B. Planning with obstacle avoidance 100 50 Proposed 0 0 Kinematic 200 400 Longitudinal position (m) 600 Fig. 10. MPC computation time (with obstacles) for the proposed model, and for a kinematic bicycle model starting from the same state. online resolution, as it is often the case in the literature, we used a simpler vehicle model obtained from precise dynamic simulations. This model was implemented into a novel MPC-based trajectory planner; contrary to most existing algorithms, our formulation does not need a predefined target speed. Instead, the MPC adjusts the vehicle’s speed in real time to track a predefined path (such as the centerline of a road) as fast as possible while maintaining a low tracking error. Using the high fidelity physics simulator PreScan, we demonstrated that the combination of this planner with a simple, PID-based low-level controller is capable of driving along a demanding path at high speed with a low lateral error. Moreover, comparison with a simple and widely used bicycle model shows that the use of our simpler model allows the solver to converge faster towards a better quality solution under real-time constraints. Although this work remains mainly theoretical, it opens several perspectives for future research. First, the good performance of our simple dynamic model even at high speeds allows envisioning longer planning horizons without sacrificing computation speed. Future work should also study the consistency of using fully linear models, that can be coupled with efficient mixed-integer optimization techniques to allow optimal decision-making, for instance for overtaking or lane-change decisions [2]. Second, we believe that the ability of the proposed MPC formulation to automatically adapt the vehicle’s velocity can find practical applications, for instance when driving in low-adherence situations. Therefore, the behavior of the planner with a variable friction coefficient should be studied further. A more precise low-level controller, taking into account the very particular response curve of the tires to precisely track a target force, which would be more consistent with the second order integrator model, can also prove interesting. Finally, implementation of the planner and controller on an actual (scale model) vehicle is a necessary step to validate the suitability of the proposed planner for real-world use. R EFERENCES [1] R. Benenson, S. Petti, T. Fraichard, and M. Parent, “Towards urban driverless vehicles,” International Journal of Vehicle Autonomous Systems, vol. 6, no. 1/2, p. 4, 2008. [2] X. Qian, F. Altché, P. Bender, C. Stiller, and A. de La Fortelle, “Optimal trajectory planning for autonomous driving integrating logical constraints: An MIQP perspective,” in 2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC). IEEE, nov 2016, pp. 205–210. [3] P. Falcone, F. Borrelli, H. E. Tseng, J. Asgari, and D. Hrovat, “A hierarchical Model Predictive Control framework for autonomous ground vehicles,” 2008 American Control Conference, pp. 3719–3724, 2008. [4] J. Frasch, A. Gray, M. Zanon, H. Ferreau, S. Sager, F. Borrelli, and M. Diehl, “An auto-generated nonlinear MPC algorithm for real-time obstacle avoidance of ground vehicles,” European Control Conference (ECC), 2013, pp. 4136–4141, 2013. [5] Y. Koh, K. Yi, H. Her, and K. Kim, “A speed control race driver model with on-line driving trajectory planning,” in The Dynamics of Vehicles on Roads and Tracks: Proceedings of the 24th Symposium of the International Association for Vehicle System Dynamics (IAVSD 2015), Graz, Austria, 17-21 August 2015. CRC Press, 2016, p. 67. [6] D. Kim, J. Kang, and K. Yi, “Control strategy for high-speed autonomous driving in structured road,” in 2011 14th International IEEE Conference on Intelligent Transportation Systems (ITSC). IEEE, oct 2011, pp. 186–191. [7] H. Pacejka, Tire and vehicle dynamics. Elsevier, 2005. [8] C. V. Altrock, “Fuzzy logic technologies in automotive engineering,” in WESCON/94. Idea/Microelectronics. Conference Record, Sep 1994, pp. 110–117. [9] M. A. Abbas, R. Milman, and J. M. Eklund, “Obstacle avoidance in real time with Nonlinear Model Predictive Control of autonomous vehicles,” in 2014 IEEE 27th Canadian Conference on Electrical and Computer Engineering (CCECE). IEEE, may 2014, pp. 1–6. [10] V. Cardoso, J. Oliveira, T. Teixeira, C. Badue, F. Mutz, T. OliveiraSantos, L. Veronese, and A. F. De Souza, “A Model-Predictive Motion Planner for the IARA Autonomous Car,” arXiv preprint arXiv:1611.04552, nov 2016. [11] P. Falcone, F. Borrelli, J. Asgari, H. E. Tseng, and D. Hrovat, “Predictive Active Steering Control for Autonomous Vehicle Systems,” IEEE Transactions on Control Systems Technology, vol. 15, no. 3, pp. 566–580, may 2007. [12] J.-M. Park, D.-W. Kim, Y.-S. Yoon, H. J. Kim, and K.-S. Yi, “Obstacle avoidance of autonomous vehicles based on model predictive control,” Proc. of the Institution of Mechanical Engineers, Part D: Journal of Automobile Engineering, vol. 223, no. 12, pp. 1499–1516, 2009. [13] Y. Gao, T. Lin, F. Borrelli, E. Tseng, and D. Hrovat, “Predictive Control of Autonomous Ground Vehicles With Obstacle Avoidance on Slippery Roads,” in ASME 2010 Dynamic Systems and Control Conference, Volume 1. ASME, 2010, pp. 265–272. [14] A. Liniger, A. Domahidi, and M. Morari, “Optimization-based autonomous racing of 1: 43 scale rc cars,” Optimal Control Applications and Methods, vol. 36, no. 5, pp. 628–647, 2015. [15] J. Liu, P. Jayakumar, J. L. Stein, and T. Ersal, “A Multi-Stage Optimization Formulation for MPC-Based Obstacle Avoidance in Autonomous Vehicles Using a LIDAR Sensor,” in ASME 2014 Dynamic Systems and Control Conference. ASME, oct 2014. [16] J. Jeon, R. V. Cowlagi, S. C. Peters, S. Karaman, E. Frazzoli, P. Tsiotras, and K. Iagnemma, “Optimal motion planning with the half-car dynamical model for autonomous high-speed driving,” in 2013 American Control Conference. IEEE, jun 2013, pp. 188–193. [17] F. Altché, P. Polack, and A. de La Fortelle, “A Simple Dynamic Model for Aggressive, Near-Limits Trajectory Planning,” arXiv preprint arXiv:1703.01225, mar 2017. [18] R. Guntur and S. Sankar, “A friction circle concept for dugoff’s tyre friction model,” International Journal of Vehicle Design, vol. 1, no. 4, pp. 373–377, 1980. [19] J. Kong, M. Pfeiffer, G. Schildbach, and F. Borrelli, “Kinematic and dynamic vehicle models for autonomous driving control design,” in 2015 IEEE Intelligent Vehicles Symposium (IV). IEEE, jun 2015, pp. 1094–1099. [20] X. Qian, A. De La Fortelle, and F. Moutarde, “A hierarchical model predictive control framework for on-road formation control of autonomous vehicles,” in Intelligent Vehicles Symposium (IV), 2016 IEEE. IEEE, 2016, pp. 376–381. [21] A. Gray, Y. Gao, J. K. Hedrick, and F. Borrelli, “Robust Predictive Control for semi-autonomous vehicles with an uncertain driver model,” in 2013 IEEE Intelligent Vehicles Symposium (IV). IEEE, jun 2013, pp. 208–213. [22] F. Borrelli, P. Falcone, T. Keviczky, J. Asgari, and D. Hrovat, “MPC-based approach to active steering for autonomous vehicle systems,” International Journal of Vehicle Autonomous Systems, vol. 3, no. 2/3/4, p. 265, 2005. [23] TASS International. http://www.tassinternational.com/prescan. [24] B. Houska, H. Ferreau, and M. Diehl, “ACADO Toolkit – An Open Source Framework for Automatic Control and Dynamic Optimization,” Optimal Control Applications and Methods, vol. 32, no. 3, pp. 298– 312, 2011. [25] J. Kosecka, R. Blasi, C. Taylor, and J. Malik, “Vision-based lateral control of vehicles,” in Proceedings of Conference on Intelligent Transportation Systems, vol. 46. IEEE, 1997, pp. 900–905. [26] J. Breuer, “Analysis of driver-vehicle-interactions in an evasive manoeuvre - results of “moose test” studies,” Proceedings: International Technical Conference on the Enhanced Safety of Vehicles, vol. 1998, pp. 620–627, 1998.
3cs.SY
A review and comparative study on functional time series techniques Javier Álvarez-Liébana1 arXiv:1706.06288v1 [math.ST] 20 Jun 2017 21st June 2017 1 Department of Statistics and O. R., University of Granada, Spain. E-mail: [email protected] Summary This paper reviews the main estimation and prediction results derived in the context of functional time series, when Hilbert and Banach spaces are considered, specially, in the context of autoregressive processes of order one (ARH(1) and ARB(1) processes, for H and B being a Hilbert and Banach space, respectively). Particularly, we pay attention to the estimation and prediction results, and statistical tests, derived in both parametric and non-parametric frameworks. A comparative study between different ARH(1) prediction approaches is developed in the simulation study undertaken. Key words: ARH processes; Banach spaces; comparative study; empirical eigenvectors; functional linear regression; functional time series; Hilbert spaces; Hilbert-Schmidt autocorrelation operator; stronglyconsistent estimator; trace covariance operators. 1 Introduction Since the beginning, time series analysis has played a key role in the analysis of temporal correlated data. Due to the huge computing advances, data began to be gathered with an increasingly temporal resolution level. Statistical analysis of temporal correlated high-dimensional data has then become a very active research area. This paper presents an overview of the main estimation and prediction approaches, formulated in the context of functional time series. Autoregressive Hilbertian processes of order one (ARH(1) processes) were firstly introduced by Bosq (1991), where a real separable Hilbert space H is considered. The functional estimation problem was addressed by a moment-based estimation of the linear bounded autocorrelation operator, involved in the conditional expectation, providing the least-squares functional predictor (ARH(1) predictor). Projection into the theoretical and empirical eigenvectors of the autocovariance operator is considered in the computation of a consistent moment-based estimator of the autocorrelation operator. The model 1 introduced in Bosq (1991) has been successfully used by Cavallini et al. (1994), on the forecasting of electricity consumption in Bologna (Italy). Central limit theorems, formulated in Merlevède (1996) and Merlevède et al. (1997), were applied to derive the asymptotic properties of ARH(1) parameter estimators and predictors (see, e.g., Bosq, 1999a, 1999b). Close graph Theorem allowed Mas (1999) to derive a truncated componentwise estimator of the adjoint of the autocorrelation operator. A central limit theorem for the formulated estimator was also derived. Enhancements to the model firstly established in Bosq (1991), under the Hilbert-Schmidt assumption of the autocorrelation operator, were presented in the comprehensive monograph by Bosq (2000). Specifically, the asymptotic properties of the formulated truncated componentwise parameter estimator of the autocorrelation operator, and of their associated plug-in predictors, are derived, from the asymptotic behaviour of the empirical eigenvalues and eigenvectors of the autocovariance operator. Improvements of the above-referred results were also provided in Mas (2000), where an extra regularity condition on the inverse of the autocovariance operator was imposed, to obtain the so-called resolvent class estimators. Efficiency of the componentwise estimator of the autocorrelation operator proposed in Bosq (2000) was studied in Guillas (2001). Mas & Menneateau (2003a) proved some extra asymptotic results for the empirical functional second-order moments. Mas & Menneateau (2003b) applied the perturbation theory, in the derivation of the asymptotic properties of the proposed estimators. Asymptotic behaviour of the ARH(1) estimators was obtained in Mas (2004, 2007) under weaker assumptions (in particular, under the assumption of compactness of the autocorrelation operator). Menneateau (2005) formulated some laws of the iterated logarithm for an ARH(1) process. Weak-consistency results, in the norm of Hilbert-Schmidt operators, have been recently proposed in Álvarez-Liébana et al. (2017), when the covariance and autocorrelation operators admit a diagonal spectral decomposition, in terms of a common eigenvectors system, under the Hilbert-Schmidt assumption of the autocorrelation operator. Alternative ARH(1) estimation techniques are presented in Besse & Cardot (1996), where a spline-smoothed-penalized functional principal component analysis (spline-smoothed-penalized FPCA), with rank constraint, was performed. A spline-smoothed-penalized FPCA estimator of the autocorrelation operator of an ARH(p) process was obtained in Cardot (1998), proving its consistency. A robust spline-smoothed-penalized FPCA estimator of the autocorrelation operator, for a class of ARH(1) processes, was discussed in Besse et al. (2000). Statistical tests for the lack of dependence, in the context of linear processes in function spaces, were derived in Kokoszka et al. (2008). Change point analysis was applied to test the stability and stationarity of an ARH(1) process, in Horváth et al. (2010) and Horváth et al. (2014), respectively. A practical survey about how the ARH(1) framework can be applied to forecasting electricity consumption was presented in Andersson & Lillestøl (2010). The asymptotic normality of the empirical autocovariance operator, and its associated eigenelements, was studied in Kokoszka & Reimherr (2013a), in the context of non-linear 2 and weakly dependent functional time series. Consistency results of componentwise parameter estimators addressed in Hörmann & Kidziński (2015), in the context of a general functional linear regression, can be particularized to the ARH(1) framework, under weaker assumptions than those ones assumed in Bosq (2000). The case of the autocorrelation operator depending on an unknown real-valued parameter has been also considered (see Kara-Terki & Mourid, 2016). This scenario can be applied to the prediction of an Ornstein-Uhlenbeck process in the ARH(1) framework, as developed in Álvarez-Liébana et al. (2016). An extension of the classical ARH(1) to ARH(p) processes, with p greater than one, was established in Bosq (2000). The crucial choice of the lag order p was discussed in Kokoszka & Reimherr (2013b). An extended class of ARH(1) processes, by including exogenous variables in their dependence structure, was formulated in Guillas (2000). An ARH(p) model, with p greater than one, to modelling the exogenous random variables, was subsequently proposed by Damon & Guillas (2002). Indeed, Damon & Guillas (2005) derived a Markovian representation by its reformulation as a H p -valued ARHX(1) process. Marion & Pumo (2004) considered the first derivatives of an ARH(1) process, as the exogenous variables to be included in the model, by introducing the so-called ARHD(1) process. The ARHD(1) process was characterized as a particular ARH(1) model in Mas & Pumo (2007). Conditional autoregressive Hilbertian processes of order one (CARH(1) processes, also known as doubly stochastic Hilbertian process of order one), were introduced in Guillas (2002), aimed to include exogenous information in a non-additive way (see also Cugliary, 2013, where an underlying multivariate process was considered). Mourid (2004) considers the randomness of the autocorrelation operator by conditioning to each element of the sample space. ARH(p) processes with random coefficients (RARH(p) processes) were then defined. Some asymptotic results for the already mentioned RARH(p) processes are provided in Allam & Mourid (2014). Weakly dependent processes were analysed in Hörmann & Kokoszka (2010). Hilbertian periodically correlated autoregressive processes of order one (PCARH(1) processes) have been defined by Soltani & Hashemi (2011), and later extended to the Banach-valued context by Parvardeh et al. (2017). Spatial extension of the classical ARH(1) models was firstly proposed in Ruiz-Medina (2011). Their moment-based estimation was detailed in Ruiz-Medina (2012). An extension, to the context of processes in function spaces, of the well-known real-valued ARCH model, has been derived in Hörmann et al. (2013). Recently, Ruiz-Medina & Álvarez-Liébana (2017a) derived the asymptotic efficiency and equivalence of both, classical and Beta-prior-based Bayesian diagonal componentwise ARH(1) parameter estimators and predictors, when the autocorrelation operator is not assumed to be a compact operator, in the Gaussian case. Ruiz-Medina & Álvarez-Liébana (2017b) provide sufficient conditions for the strongconsistency, in the trace norm, of the autocorrelation operator of an ARH(1) process, when it does not admit a diagonal spectral decomposition in terms of the eigenvectors of the autocovariance operator. A two-level hierarchical Gaussian model is applied in Kowal et al. (2017) on the forecasting of ARH(p) 3 processes. Concerning alternative bases, Grenander’s theory of sieves (see Grenander, 1981) was adapted by Bensmain & Mourid (2001), for the estimation of the autocorrelation operator of an ARH(1) process, from a Fourier-basis-based decomposition in a finite dimensional subspace. An integral form of the autocorrelation operator was assumed in Laukaitis & Rac̆kauskas (2002), who consider smoothing techniques based on B-spline and Fourier bases. Antoniadis & Sapatinas (2003) suggested three linear wavelet-based predictors, two of them are built from the componentwise and resolvent estimators of the autocorrelation operator, already established in Bosq (2000) and Mas (2000), respectively. Hyndman & Ullah (2007) formulated a prediction approach of the mortality and fertility rates based on a real-valued ARIMA forecasting of the FPC scores, for each non-parametric smoothed sample curve. Focusing on the predictor, the idea of replacing the FPC with the directions more relevant to forecasting, by searching a reducedrank approximation, was firstly exhibited in Kargin & Onatski (2008) (see also Didericksen et al., 2012, where approaches by Bosq, 2000, and Kargin & Onatski, 2008, were compared). As an extension of the work by Hyndman & Ullah (2007), a weighted version of the FPLSR and FPCA approaches was established in Hyndman & Shang (2009), with a decreasing weighting over time, as often, e.g., in demography. For the purpose of taking into account the information coming from the dynamic dependence, which is usually ignored in the FPCA literature, a dynamic functional principal components approach was simultaneously introduced by Panaretos & Tavakoli (2013) and Hörman et al. (2015). The main difference between them lies in the explicit construction of the dynamic scores performed in Hörman et al. (2015), while a functional process of finite rank was built in Panaretos & Tavakoli (2013). As discussed in Aue et al. (2015), a multivariate VARMA approach can be used to improve the curve-by-curve approaches above-referred by Hyndman & Ullah (2007) and Hyndman & Shang (2009). Moving-average Hilbertian processes (MAH processes) and ARMAH processes can be defined as a particular case of Hilbertian general linear processes (LPH). From the previous above-referred works by Bosq (1991) and Mourid (1993), sufficient conditions for the invertibility of LPH were provided in Merlevède (1995, 1996). A Markovian representation of a stationary and invertible LPH, as well as a consistent plug-in predictor, was derived in Merlevède (1997). A few new asymptotic results were derived by Bosq (2000) from the previous theoretical properties. The conditional central limit theorem (see Dedecker & Merlevède, 2002) was extended to functional stochastic processes in Dedecker & Merlevède (2003), allowing its application to LPH. The weak convergence for the empirical autocovariance and cross-covariance operators of LPH was proved in Mas (2002). Further results, that those one formulated in Bosq (2000) for LPH, were obtained by Bosq (2007) and Bosq & Blanke (2007), where the study of a consistent predictor of MAH processes was addressed. Componentwise estimation of a MAH(1) process 4 was studied in Turbillon et al. (2008), under properly assumptions. Tools proposed in Hyndman & Shang (2008) can be used in the outlier detection of an observed ARMAH(p,q) process. Wang (2008) proposed a real-valued non-linear ARMA model in which functional MA coefficients were considered (see also Chen et al., 2016, where MA coefficients were given by smooth functions). Tensorial products of ARMAH processes have been analysed in Bosq (2010), when innovations are assumed to be a martingale differences sequence. An extensive literature has been also developed concerning the Banach-valued time series framework. Strong-consistency results on the estimation of a Banach-valued autoregressive process of order one (ARB(1) process) were presented in Pumo (1992, 1998), when B = C([0, 1])) (so-called ARC(1) process). Its natural extension to ARC(p) models, with p greater than one, and the characterization of the Ornstein-Uhlenbeck process as an ARC(1) process, was addressed in Mourid (1993, 1996), respectively. The notion of non-causality was developed in Guillas (2000) for Banach-valued stochastic processes, while the suitable periodicity of the ARB representation was determined by Benyelles & Mourid (2001). Kuelb’s Lemma (see Kuelbs, 1976) played a key role in this Banach-valued framework, since it provides a dense and continuous embedding B ֒→ H, where H is the completation of B under a weaker topology (see Labbas & Mourid, 2002, where a componentwise estimation of the autocorrelation operator of an ARB(1) process is achieved in a general real separable Banach space). Non-plug-in ARC(1) prediction is achieved in Mokhtari & Mourid (2003), applying the theory of Reproducing Kernel Hilbert Spaces (RKHSs). Dehling & Sharipov (2005) addressed the asymptotic properties of both empirical mean and empirical autocovariance operator, for an ARB process with weakly dependent innovation process. A wide monograph concerning the estimation of ARB processes, by using the already mentioned sieve estimators, was developed by Rachedi (2005). Recently, for D = D([0, 1]) space (the space of rightcontinuous functions with left limits), El Hajj (2011, 2013) have derived the asymptotic properties of the parameter estimators and predictors of ARD(1) processes. The intensity of jumps for these D-valued processes was later analysed in Blanke & Bosq (2014). Stationarity of ARMAB processes was studied in Spangenberg (2013), under suitable conditions. Central limit theorems for PCARB(1) processes have been recently derived in Parvardeh et al. (2017). A great amount of authors have been developed alternative non-parametric prediction techniques in both functional time series and functional regression frameworks, where the main goal is to forecast the predictable part of the paths by applying non-parametric methods. Besse et al. (2000) formulated a functional non-parametric kernel-based predictor of an ARH(1) process. Their work can be seen as a functional extension of the methodology adopted in Poggi (1994), where a non-parametric kernelbased forecasting of the electricity consumption was performed in a multivariate framework. Non- 5 parametric methods were proposed in Cuevas et al. (2002), in the estimation of the underlying linear operator of a functional linear regression, where both explanatory and response variables are valued in a function space. A two-steps prediction approach, based on a non-parametric kernel-based prediction of the scaling coefficients, with respect to a wavelet basis decomposition of a stationary stochastic process with values in a function space, was firstly exhibited in Antoniadis et al. (2006). This method, also so-called kernel wavelet functional (KWF) method, was used, and slightly modified, in Antoniadis et al. (2012), on the forecasting of French electricity consumption, when the hypothesis of stationarity is not held. Improvements in the KWF approach were suggested in Cugliari (2011), where continuous wavelet transforms are also considered. A functional version of principal component regression (FPCR), and partial least-squares regression (FPLSR), was formulated by Reiss & Ogden (2007). In the case where the response is a Hilbert-valued variable, and the explanatory variable takes its values in a general function space, equipped with a semi-metric, Ferraty et al. (2012) obtained a non-parametric kernel estimator of the underlying regression operator. The outline of this paper is as follows. References detailed in Sections 2-7 are divided by thematic areas in a chronicle. Section 2 is devoted to the study of the different ARH(1) componentwise estimation frameworks, as well as related results, based on the projections into the theoretical and empirical eigenvectors of the autocovariance operator. Section 3 deals improvements of the classical ARH(1) framework. Parametric forecasting of functional time series, based on the projection into alternative bases, such as Fourier, B-spline or wavelet bases, will be presented in Section 4. Section 5 studies MAH processes, as a particular case of LPH. The Banach-valued context is detailed in Section 6. Non-parametric techniques, in the context of functional time series and functional linear regression, are described in Section 7. Section 8 will introduce the main elements involved in the particular context of the ARH(1) diagonal componentwise estimation. In Section 9, a comparative study is undertaken for illustration of the performance of some of the most used estimation and prediction ARH(1) methodologies. Specifically, the approaches presented in Álvarez-Liébana et al. (2017), Antoniadis & Sapatinas (2003), Besse et al. (2000), Bosq (2000) and Guillas (2001) are compared. Proof details and useful theoretical results are provided in the Supplementary Material (see Sections S.1-S.3), where the numerical results obtained in the simulation and comparative studies are outlined as well (see Sections S.4-S.5). 2 ARH(1) componentwise estimator, based on the eigenvectors of the autocovariance operator ARH(1) processes introduced by Bosq (1991) seek to extend the classical AR(1) model to functional data. In that work, a continuous-time stochastic process ξ = {ξt , t ≥ 0} is turned into a set of H-valued 6 random variables X = {Xn (t) = ξnδ+t , n ∈ Z}, with 0 ≤ t ≤ δ. In the sequel, let us consider zero-mean stationary processes, being H a real separable Hilbert. The ARH(1) process was defined by Xn = ρ (Xn−1 ) + εn , Xn , εn ∈ H, n ∈ Z, ρ ∈ L(H), (1) where L(H) is the space of bounded linear operators on H. If ε = {εn , n ∈ Z} is assumed to be a H∞ X 2 ρj L(H) < ∞ is required to the stationarity valued strong white noise (and uncorrelated with X0 ), j=0 condition. From the central limit theorems formulated in Merlevède (1996) and Merlevède et al. (1997), the following asymptotic results for the autocovariance operator C = E {Xn ⊗ Xn }, for n ∈ Z, under n o 4 E kX0 kH < ∞ (so-called Assumption A3) and kX0 kH < ∞, were obtained in Bosq (1999a, 1999b): Zi = Xi ⊗ Xi − C = R (Zi−1 ) + Ei , being Cn = 1 n n−1 X i=0 ∗ R(z) = ρzρ ∈ S(H), kCn − CkS(H) = O  ln(n) n 1/2 ! a.s., (2) Xi ⊗ Xi , for each n ≥ 2, {En , n ∈ Z} a martingale difference sequence and S(H) the class of Hilbert-Schmidt operators on H. Since C is compact, from the close graph Theorem, ρ∗ = C −1 D is bounded of the domain of C −1 , which is a dense subspace in H. Then, the autocorrelation operator ∗∗  can be built as ρ = Ext DC −1 = DC −1 . Mas (1999) provided the asymptotic normality of the n o 2 formulated estimator of ρ∗ , under E C −1 ε0 H < ∞, by projecting into Hkn = sp (φ1 , . . . , φkn ), when the eigenvectors {φj , j ≥ 1} of C are assumed to be known. Assumption C1 > . . . > Cj > . . . > 0 (Assumption A1) was also imposed, where {Cj , j ≥ 1} denote the eigenvalues of C. The asymptotic results formulated in Merlevède (1996) and Merlevède et al. (1997) are crucial in the derivation of some extra asymptotic properties for C and D = E {Xn ⊗ Xn+1 } by Bosq (2000). n−2 X 1 In particular, under Assumption A3, if Dn = n−1 Xi ⊗ Xi+1 denotes the empirical estimator of i=0 the cross-covariance operator D, the almost sure convergence to zero of 1/4 n (ln(n))β n1/4 (ln(n))β sup kCn − CkS(H) and j≥1 sup kDn − DkS(H) , for any β > 1/2, was proved. Bosq (2000) also checked that stationarity comes j≥1 down actually to the existence of an integer j0 ≥ 1, with ρj0 L(H) < 1. Under Assumptions A1 and A3, as well as the Hilbert-Schmidt assumption of ρ, when a spectral decomposition of Cn is achieved in terms of {Cn,j , j ≥ 1} and {φn,j , j ≥ 1}, the strong-consistency of the following non-diagonal estimator was derived in the above-referred work: ρen = π e kn Dn Cn−1 π ekn  , ρen (x) = kn X l=1 ρen,l (x)φn,l , ρen,l (x) = kn X j=1 −1 Cn,j n−2 1 X e e Xi,j Xi+1,l n − 1 i=0 ! hx, φn,j iH , (3) ei,j = hXi , φn,j iH , for any j ≥ 1 and i ∈ Z, being assuming that {φj , j ≥ 1} are unknown, with X e kn = sp (φn,1 , . . . , φn,kn ), for a suitable truncation parameter kn . π ekn the orthogonal projector into H 7 In the estimation approach formulated in equation (3), the non-diagonal autocorrelation operator and covariance operator of the error term are defined as follows: ρ (X) (t) = Cε = Z b ψ (t, s) X(s)ds, ψ (t, s) = a ∞ X ∞ X j=1 h=1 ∞ X ∞ X j=1 h=1 2 σj,h φj ⊗ φh ≃ M X M X j=1 h=1 ρj,h φj (t)φh (s) ≃ M X M X ρj,h φj (t)φh (s), (4) j=1 h=1 2 σj,h φj ⊗ φh , (5) for M large enough. Besides the componentwise estimator of ρ∗ , Mas (2000) proposed to approximate C by a linear o n p operator smoothed by a family of functions bn,p (x) = (x+bx )p+1 , p ≥ 0, n ∈ N , which converge to 1/x n point-wise, being {bn , n ∈ N} a strictly positive sequence decreasing to zero. The formulated estimators (so-called resolvent class estimators) of ρ∗ were given by Mas (2000) as follows: ρb∗n,p = bn,p (Cn ) Dn∗ , −(p+1) bn,p (Cn ) = (Cn + bn I) Cnp , p ≥ 0, n ∈ N, (6) in a manner that bn,p (Cn ) is a compact operator, for each p ≥ 1 and n ∈ N, with deterministic norm equal to bn−1 . Under the non-diagonal scenario in equations (4)-(5), a similar philosophy was adopted by Guillas (2001), in the derivation of the efficiency of the componentwise estimator of ρ formulated in Bosq (2000), in ways that Cn was regularized by a sequence u = {un , n ≥ 1}, with 0 < un ≤ βCkn , for −1 0 < β < 1. Hence, let us defined Cn,j,u = 1/ max (Cn,j , un ), for any j ≥ 1, n ≥ 2. An efficient estimator, when {φj , j ≥ 1} are unknown, and under Assumptions A1 and A3, was stated in Guillas (2001) by ρen,u (x) = kn X l=1 ρen,l,u (x)φn,l , ρen,l,u (x) = kn X j=1 −1 Cn,j,u n−2 1 X e e Xi,j Xi+1,l n − 1 i=0 ! hx, φn,j iH , (7) for a well-suited truncation parameter, providing the mean-square convergence. Remark that in equation (7), Hilbert-Schmidt condition over ρ is not needed. We may also cite Mas (2004), where the asymptotic properties, in the norm of L(H), of the estimator of ρ∗ formulated in Mas (1999), were derived, such that the weaker condition of compactness of ρ was assumed. Assumptions A1 and A3, and conditions set in Mas (1999), were also required. This compactness condition, jointly with C −1/2 ρ L(H) < ∞ (i.e., ρ should be, at least, as smooth as C 1/2 ), was also imposed in Mas (2007), where the weak-convergence  1/4  n of the estimator of ρ∗ was addressed, under the convexity of the spectrum of C, when kn = o ln(n) . Álvarez-Liébana et al. (2017) recently established a weakly-consistent diagonal componentwise estimator of ρ, in the norm of S(H), when C and ρ admit a diagonal spectral decomposition in terms of {φj , j ≥ 1}. The mean-square convergence of the following estimator of ρ, when eigenvectors of C are assumed to be 8 known and ρ is a symmetric operator, was proved, for a well-suited truncation parameter kn : ρbkn = kn X j=1 ρbn,j φj ⊗ φj , ρbn,j b n,j n D = = b n−1 Cn,j n−2 X Xi,j Xi+1,j i=0 n−1 X 2 Xi,j i=0 , bn,j 6= 0 a.s., C n ≥ 2, (8) under the strictly positiveness of C and extra mild assumptions. A similar diagonal scenario will be developed in Section 8, where strongly-consistent estimators are provided, when eigenvectors of C are known and unknown. Alternative ARH(1) estimation parametric techniques, based on a modified version of the functional principal component analysis (FPCA) framework above-referred, have been developed. A splinesmoothed-penalized FPCA, with rank constraint, was presented in Besse & Cardot (1996) (and later applied by Besse et al., 2000, on the forecasting of climatic variations). In that work, the paths were previously smoothed solving the following non-parametric optimization problem:  p   1 n−1 2 XX b q,ℓ (tj ) + ℓ D2 X b q,ℓ min Xi (tj ) − X i i b q,ℓ ∈Hq  np X i i=0 j=1 2   L2 ([0,1])  n , Hq ⊂ f : D2 f 2 L2 ([0,1]) o < c, c > 0 , (9) being ℓ the penalized parameter and {tj , j = 1, . . . , p} the set of knots. The q-dimensional subspace Hq is spanned by {A (ℓ) vj , j = 1, . . . , q}, being A (ℓ) the smoothing hat-matrix and {vj , j = 1, . . . , q} the eigenvectors associated to the first q-largest eigenvalues of the matrix S = 1/2 1 n A (ℓ) b −1 , with C bq,ℓ b q,ℓ C Estimator of ρ was then built in Besse & Cardot (1996) by ρbq,ℓ = D q,ℓ b q,ℓ = and D 1 n−1 n−2 X i=0 b q,ℓ X i b q,ℓ . ⊗X i+1 1/2 X ′ In XA (ℓ) . n−1 X q,ℓ b ⊗X b q,ℓ = n1 X i i i=0 See also Cardot (1998), where a spline-smoothed-penalized FPCA was achieved into the Sobolev space W 2,2 ([0, 1]), providing a consistent componentwise truncated estimator of ρ of an ARH(p) process, keeping in mind the regularized paths. Condition max (tj − tj+1 ) = j=1,...,p−1  O p−1 , as well as the strictly positiveness of the eigenvalues of the autocovariance operator of the regularized trajectories, was assumed under a suitable choice for the truncation parameter. It is also worth noting the work by Mas & Menneatau (2003a), in relation to asymptotic results for the empirical functional second-order moments. Based on the perturbation theory, Mas & Menneateau (2003b) proved how the asymptotic behaviour of a self-adjoint random operator is equivalent to that of its associated eigenvectors and eigenvalues. The results derived in Mas & Menneateau (2003a) are completed by Menneateau (2005), focusing on the law of the iterated logarithm, under the above-referred ARH(1) framework. In a more general framework, the lack of dependence of the functional linear model Yn = Ψ (Xn ) + εn , for each n ∈ Z, was tested in Kokoszka et al. (2008), under Assumptions A1, A3 and the asymptotic properties of Cn derived in Bosq (2000). As discussed in Kokoszka et al. (2008), their 9 approach can be adapted to the ARH(1) framework, and therefore, the nullity of the autocorrelation operator can be tested. In the above-referred works, the null hypotheses of the constancy of ρ and the stationarity condition have been implicitly assumed. Horváth et al. (2010) suggested a testing method on the stability of the autocorrelation operator of an ARH(1) process (against change point alternative), based on the componentwise context above-mentioned, while Horváth et al. (2014) derived testing methods on the stationarity of functional time series (against change point alternative and the so-called two alternatives integrated and deterministic trend). ARH(1) forecasting of the electricity consumption was addressed in Andersson & Lillestøl (2010) (see also Cavallini et al., 1994). The asymptotic normality of the empirical principal components of a wide class of functional stochastic processes (even non-linear weakly dependent functional time series) was derived in Kokoszka & Reimherr (2013a). In the context of linear regression, when both explanatory and response variables are valued in a function space, consistent forecasting of an ARH(1) process was achieved in Hörmann & Kidziński (2015), when the explanatory variables are allowed to be dependent. In the case of ρ depends on an unknown real parameter θ, the Ornstein-Uhlenbeck process (O.U. process) was characterized by Álvarez-Liébana et al. (2016) as an stationary ARH(1) process Xn = ρθ (Xn−1 ) + εn , for any n ∈ Z and θ > 0 (see also Kara-Terki & Mourid, 2016, where the asymptotic normality of an ARH(1) process, with ρ = ρθ , is studied). 3 Extensions of the classical ARH(1) model Enhancements to the classical ARH(1) model have been developed during the last decades. A great amount of them will be detailed in this Section, arranging the references in chronicle by blocks. From the previous asymptotic results developed by Mourid (1993, 1996) in the Banach-valued context (see more details in Section 6), the natural extension of ARH(1) to ARH(p) processes, with p greater than p X ρk (Xn−k )+εn , for each n ∈ Z, and ρk ∈ L(H), for any k = one, was presented in Bosq (2000) as Xn = k=1 1, . . . , p, being ρp a non-null operator on H. By its Markovian properties, ARH(p) model was rewritten by Bosq (2000) as the H p -valued ARH(1) process Yn = ρ′ (Yn−1 ) + ε′n , with Yn = (Xn , . . . , Xn−p+1 ) ∈ H p , ε′n = (εn , 0, . . . , 0) ∈ H p and  ρ1   IH  . ρ′ =   ..  0H ρ2 ... ρp−1 0H .. . ... .. . 0H .. . 0H ... IH ρp    0H   ..  .   0H ∈ L(H p ), −→ p-th row h(X1 , . . . , Xp ) , (Y1 , . . . , Yp )ip = p X hXk , Yk iH , k=1 where H p denotes the cartesian product of p copies of H, being a Hilbert space endowed with h·, ·ip . 10 In the equation above, IH and 0H denote the identity and null operators on H, respectively. The crucial choice of the lag order p was discussed in Kokoszka & Reimherr (2013c), when ρk ∈ S(H), for any k = 1, . . . , p and kρ′ kL(H) < 1. The following multistage testing procedure was proposed in the mentioned work, based on the estimation of the operators ρk , for each k = 1, . . . , p: H0 Hp−1 : X is an i.i.d. sequence vs Hp−1 : X is an ARH(1) process, : X is an ARH(p-1) process vs Hp : X is an ARH(p) process, in a manner that the method continues while a null hypothesis is not be rejected. Aimed to include exogenous information in the dependence structure, ARH(1) processes with exogenous variables (ARHX(1) processes) were introduced in Guillas (2000) and Damon & Guillas (2002) as follows: Xn = ρ (Xn−1 ) + p X n ∈ Z, ak (Zn,k ) + εn , k=1 ak , ρ ∈ L(H), k = 1, . . . , p. (10) being Z = {Zn,k , n ∈ Z, k = 1, . . . , p} the exogenous variables. Guillas (2000) initally proposed an AR(1) dependence structure in Z (i.e., ak = 0H , for any k = 2, . . . , p), while the ARH(p) structure displayed in (10) was subsequently established in Damon & Guillas (2002). See also Damon & Guillas (2005), where a Markovian representation of (10) is adopted to reformulate it as a H p -valued ARHX(1) process. The first derivatives of the random paths of an ARH(1) process were included by Marion & Pumo (2004) as the exogenous variables (so-called ARHD(1) process), when the trajectories belong to the  ′ + εn for each Sobolev space W 2,1 ([0, 1]). The ARH(1) process was given by Xn = ρ (Xn−1 ) + Ψ Xn−1 n ∈ Z, with ρ, Ψ ∈ K(H), and was reformulated by Mas & Pumo (2007) as the ARH(1) process: Xn = A (Xn−1 ) + εn , with hf, giW = Z 0 A = Φ + ΨD ∈ K(H), kAkL(H) < 1, 1 f (t)g(t)dt + Z 0 1 n o 4 E kXkW < ∞, D (f ) = f ′ , (11) f ′ (t)g ′ (t)dt, for any f, g ∈ W 2,1 ([0, 1]). After pointing out some extensions, where exogenous information has been additively incorporated, Guillas (2002) proposed an i.i.d. sequence of Bernoulli variables I = {In , n ∈ Z} to condition an ARH(1) process, in a non-additive way. A conditional autoregressive Hilbertian process of order one (CARH(1) process, also known as doubly stochastic Hilbertian process of order one) was then formulated: Xn = ρIn (Xn−1 ) + εn =    ρ0 (Xn−1 ) + εn , if In = 0   ρ1 (Xn−1 ) + εn , otherwise 11 , ρ0 , ρ1 ∈ L(H), n ∈ Z. (12) An extension of (12), where the latent process was considered as a continuous multivariate process V = {Vn , n ∈ Z}, was established in Cugliari (2013). Mourid (2004) proposed to consider the randomness of ρ by defining it from a basic probability space (Ω, A, P) into L(H); i.e., ρω ∈ L(H), for each ω ∈ Ω. ARH(p) processes with random coefficients (RARH(p) processes) were then introduced. Its asymptotic properties, in the Hilbert-Schmidt norm, were subsequently derived in Allam & Mourid (2014). In addition, weakly-dependent functional time series, based on a moment-based m-dependence, as the most direct relaxation of independence, were studied in Hörmann & Kokoszka (2010). The estimation of an ARH(1) process, in which ρ is periodically correlated (PCARH(1) processes), was addressed in Soltani & Hashemi (2011). In that work, the model Xn = ρn (Xn−1 ) + εn , with ρn = ρn+T , for each n ∈ Z, was assumed (periodically correlated with period T > 0). A new branch in the field of functional time series, when the data is gathered on a grid assuming a spatial interaction, was firstly introduced by Ruiz-Medina (2011). In that work, a novel family of spatial stochastic processes (SARH(1) processes), which can be seen as the Hilbert-valued extension of spatial autoregressive processes of order one (SAR(1) processes), was defined as follows: Xi,j = R + ρ1 (Xi−1,j ) + ρ2 (Xi,j−1 ) + ρ3 (Xi−1,j−1 ) + εi,j , (i, j) ∈ Z2 , R ∈ H, ρh ∈ L(H), h = 1, 2, 3, (13) based on the so-called Markov property of the three points for a spatial stochastic process. In (13), ρh is assumed to be decomposed in terms of the eigenvalues {λk,h , k ≥ 1} and the biorthonormal systems of left and right eigenvectors, {ψk , k ≥ 1} and {φk , k ≥ 1}, respectively, for each h = 1, 2, 3. The  spatial innovation process εi,j , (i, j) ∈ Z2 is imposed to be a two-parameter martingale difference se- quence, with E {εi,j ⊗ εi,j } not depending on the coordinates (i, j) ∈ Z2 . Ruiz-Medina (2011) derived an unique stationary solution to the SARH(1) state equation (13), providing its inversion. The definition of SARH(1) processes, from the tensorial product of ARH(1) processes, is provided as well. Extended classes of models of functional spatial time series are also formulated in that paper. Moment-based estimators of the functional parameters involved in the SARH(1) equation were proposed in Ruiz-Medina (2012), where their performance is illustrated with a real data application, for spatial functional prediction of ocean surface temperature.  2 , for each n ∈ Z, A functional version of ARCH model, given by Xn = εn σn , with σn2 = δ + ρ Xn−1 was analysed in Hörmann et al. (2013). A new set of sufficient conditions was provided in Ruiz-Medina & Álvarez-Liébana (2017a) for the asymptotic efficiency of diagonal componentwise estimators of the autocorrelation operator of a stationary ARH(1) process under both, classical and Beta-prior-based Bayesian, scenarios. In particular, under Assumption A1, ρ is assumed to be linear bounded and self-adjoint operator, while the usual Hilbert-Schmidt condition is not imposed. Stronger assumptions 12  for the eigenvalues σj2 , j ≥ 1 of Cε = E {εn ⊗ εn } were considered, to offset the slower decay rate r ∞ X σ2 ρj φj ⊗ φj , conditions ρj = 1 − Cjj and of the eigenvalues {ρj , j ≥ 1} of ρ. Specifically, if ρ = j=1 σj2 Cj ≤ 1, with σj2 Cj   = O j −1−γ , for any γ > 0 and σj2 = E hεn , φj i2H , for each j ≥ 1, were assumed. The asymptotic equivalence of the estimators was also provided, as well as of the their associated plug-in predictors. The Beta-prior-based Bayesian estimator of ρ was derived in Ruiz-Medina & Álvarez-Liébana (2017a) as follows: ρen = ∞ X j=1 ρen,j φj ⊗ φj , ρen,j with αn,j = n−1 X i=0 1 = 2βn,j   q 2 2 (αn,j + βn,j ) − (αn,j − βn,j ) − 4βn,j σj (2 − (aj + bj )) , (14) Xi,j Xi+1,j and βn,j = n−1 X i=0 2 Xi,j , for each j ≥ 1 and n ∈ Z, being (aj , bj ) the Beta parameters such that ρj ∼ B (aj , bj ), for any j ≥ 1. We may also cite Ruiz-Medina & Álvarez-Liébana (2017b), where sufficient conditions for the strong-consistency, in the trace norm, of the above-formulated diagonal componentwise estimator of the autocorrelation operator of an ARH(1) process, are provided. Note that, in that paper, ρ is not assumed to admit a diagonal spectral decomposition with respect to the eigenvectors of the autocovariance operator C. See also Kowal et al. (2017), where a two-level hierarchical model has been recently proposed on the forecasting of an ARH(p) process, by using a Gibbs sampling algorithm. Their purpose is applied to the forecasting of the U.S. Treasury nominal yield curve. 4 ARH estimation approaches based on alternative bases In this section, we pay attention to the ARH(1) estimation, based on the projection into alternative bases to the eigenvectors of C. The sieves method introduced by Grenander (1981) was adapted by Bensmain & Mourid (2001) for the estimation of the autocorrelation operator of an ARH(1) process. A novel consistent estimator was derived under both scenarios, when ρ is a bounded linear operator, and under the Hilbert-Schmidt condition. Specifically, ρ was estimated considering different subsets (so-called sieves) {Θm , m ∈ N} of the parametric space Θ, where ρ takes its values, equipped with a S metric d, such that Θm is a compact set, with Θm ⊂ Θm+1 and m∈N Θm is dense in Θ. In particular, in the former case, when ρ is assumed to be a bounded linear operator ρ (f ) (t) = Z 1 K (t − s) Xn−1 (s) ds + εn (t). The K (t − x) f (x)dx, depending on a kernel K (·), then Xn (t) = 0 √ √0  Fourier basis φ0 (t) = I[0,1] , φ2k (t) = 2 cos (2πkt) , φ2k+1 (t) = 2 sin (2πkt) , k ≥ 1 was considered, Z 1 13 being I[0,1] the identity function over the interval [0, 1]. The ARH(1) state equation was developed as    a0 (Xn ) = a0 (K) a0 (Xn−1 ) + a0 (εn ) , ak (Xn ) = (ak (K) ak (Xn−1 ) − bk (K) bk (Xn−1 )) /2 + ak (εn )   bk (Xn ) = (ak (K) bk (Xn−1 ) + bk (K) ak (Xn−1 )) /2 + bk (εn ) (15) for each n ∈ Z and k ≥ 1, being {ak (Xn ) , ak (εn ) , ak (K) , k ≥ 1} and {bk (Xn ) , bk (εn ) , bk (K) , k ≥ 1} the Fourier coefficients respect to cosine and sine functions, respectively. Bensmain & Mourid (2001) assumed that bk (t) = 0, for each t ∈ [0, 1] and k ≥ 0, in a manner that (15) becomes xn,0 = c0 xn−1,0 + εn,0, xn,k = 1 ck xn−1,k + εn,k , 2 xn,k = ak (Xn ) , ck = ak (K) , k ≥ 1, n ∈ Z. (16) Estimation of ρ was then reached by forecasting the Fourier coefficients {ck , k ≥ 0} in the sieve Θ mn = ( 2 K ∈ L ([0, 1]) : K(t) = c0 I[0,1] + mn X √ ck 2 cos (2πkt) , mn X k 2 c2k k=1 k=1 n→∞ ≤ mn , mn −→ ) ∞ , (17) providing, with mn −→ ∞ as n → ∞, c0 = b n X xi,0 xi−1,0 i=1 , n X 2 xi−1,0 i=1 ck = b n X n X 1 i=1 2 x2i−1,k 2 n X xi,k xi−1,0     i=1  = mn . (18)  under k  n  X 1   k=1 x2i−1,k + n2λk 2 i=1 xi,k xi−1,k i=1  mn X , + n2λk 2 The non-diagonal componentwise estimator formulated in Bosq (2000) was used in Laukaitis & Rac̆kauskas (2002), by considering regularized paths in terms of a B-spline basis. In that work, the forecasting of the intensity of both cash withdrawal in cash machines (so-called automatic teller machines or ATM) and transactions in points of sale (so-called POS), depending on Vilnius Bank, was achieved. Antoniadis & Sapatinas (2003) discussed how the prediction of functional stochastic processes can be seen as a linear ill-posed inverse problem, providing a few approaches about the regularization techniques required. In the context of 1-year-ahead forecasting of the climatological ENSO time series, they also proposed three linear wavelet-basis-based ARH(1) predictors, one of which is based on the resolvent estimators of ρ formulated in Mas (2000). From the componentwise estimation framework developed in Bosq (2000), they derived regularized wavelet estimators, by means of a previously wavelet-basis-based smoothing method: n−1 X e bM − 1 e bM , Yei,λbM = X X i,λ n i=0 i,λ e bM = X i,λ j0 2X −1 14 k=0 i φ αd j0 k j0 k + j −1 J−1 X 2X j=j0 k=0 i βc jk ψjk , i ∈ Z, (19)  bM =  with smoothing parameter λ ρen,λbM (Xn−1 ) = ρen,λbM ,j (Xn−1 ) = M X j=1   M X σj2   Cj  /N . The plug-in predictor was given by kn X j=1 j=1 ρen,λbM ,j (Xn−1 ) φeM j , k n−2 n X 1 X 1 e e bM Ye bM , X bM ,k Yi,λ n−1,λ ,k i+1,λ ,j e n−1 C M b n,λ ,k k=1 i=0 (20) eM e e bM = hφeM , Ye bM iH , for each j = 1, . . . , kn and i = with X bM ,j = hφj , Xn−1 iH and Yi+1,λ j n−1,λ ,j i+1,λ n o n o M e e 0, . . . , n−1, where Cn,λbM ,j , j ≥ 1 and φj , j ≥ 1 denote the eigenvalues and eigenvectors, respectn−1 n o X j0 i , φ e bM = 1 Yei,λbM ⊗ Yei,λbM . Values αd ively, of the empirical estimator C j0 k , k = 0, . . . , 2 − 1 j0 k n,λ n n o i=0 c j i and βjk , ψjk , j ≥ j0 , k = 0, . . . , 2 − 1 , for i = 0, . . . , n − 1, in equation (19), denote the scaling coefficients, at J − j0 resolutions levels, for a primary resolution level j0 < J. Assumptions A1 and A3 were imposed, along with k nCk4n → ∞, n 1X bj → 0, as n → ∞, n j=1 Cj2   bj = max (Cj−1 − Cj )−1 , (Cj − Cj+1 )−1 . (21) Hyndman & Ullah (2007) detailed an alternative robust version of FPCA, to avoid the instability induced by outlying observations. Forecasting of mortality and fertility rates, as continuous curves, was performed in Hyndman & Ullah (2007): yt (xi ) = ft (xi )+σt (xi )εt,i , {εt,i , t = 1, . . . , n, i = 1, . . . , p} i.i.d. sequence of standard normal, (22) where {xi , i = 1, . . . , p} denotes the ages covered, being {yt (xi ), i = 1, . . . , p, t = 1, . . . , n} the log-rates of mortality (or fertility) for age xi in year t. Curves are decomposed in terms of ft (x) = K X βt,k ψk (x) + et (x), k=1 et (x) ∼ N (0, v(x)) , t = 0, 1, . . . , n, (23) being {ψk , k = 1, . . . , K} an orthonormal basis, with the coefficients {βt,k , k = 1, . . . , K} being predicted by using a real-valued ARIMA process. A weighted version of the approach presented in Hyndman & Ullah (2007) considering the largest weights for the most recent data (required in fields such as demography), was developed in Hyndman & Shang (2009). Instead of the curve-by-curve forecasting established in Hyndman & Ullah (2007) and Hyndman & Shang (2009), a multivariate VARMA model was applied by Aue et al. (2015), to avoid the loss of information invoked by the uncorrelated assumption of the FPC scores, imposed in those works. Kargin & Onatski (2008) focused on the predictor of an ARH(1) process, instead of on the operators 15 ρ and C themselves. They proposed to replace the functional principal components with directions more relevant to forecasting, by searching a reduced-rank approximation (see also Didericksen et al., 2012, where a comparative study, between approaches in Bosq, 2000, and Kargin & Onatski, 2008, was undertaken). Their method, so-called predictive factor decomposition, is built under the searching of n o 2 a minimal operator ρ ∈ Rp , aimed to minimize E kXn − ρ (Xn−1 )kH , being Rp the set of p-rank operator. The predictor was then given by bn = X p X l=1 bα hXn−1 , bbα l iH Dn bl , bbα = αb xα l l + K X hb xα , φn,j iH l 1/2 j=1 Cn,j φn,j , l = 1, . . . , p, (24) being {b xα l , l = 1, . . . , p} a linear combination of the eigenvectors {φn,j , j = 1, . . . , p} of the empirical autocovariance operator. Kargin & Onatski (2008) proposed to fix α = 0.75. A dynamic functional principal components analysis (DFPCA) approach was formulated by Panaretos & Tavakoli (2013), based on an harmonic decomposition (so-called Cramér-Karhunen-Loève decomposition) of the paths by using a set of spectral density operators {Fω , ω ∈ [−π, π]}. These are defined as the X 1 discrete-time Fourier transform Fω = 2π e−iωh Ch of the covariance operators Ch = E {Xn ⊗ Xn+h }, h∈Z for each h ∈ Z. The formulated predictor is given by a stochastic integral, depending on a finite sum of tensorial products of eigenvectors of the spectral density operators, as an extension of the Brillinger’s information theory. See also Hörman et al. (2015), where a DFPCA was also established, by replacing the usual FPC scores hXn , φj iH , for each j ≥ 1 and n ∈ Z, with an explicitly construction of dynamic X FPC scores Yn,j = hXn−1 (·) , ψj (·, l)iH : l∈Z 1 ψj (·, l) = 2π 5 Z π ϕj (u, ω)e −ilω −π dω, ∞ X 1 X −iωh λj (ω)h·, ϕj (·, ω)iH ϕj (·, ω). (25) Fω (·) = e Ch (·) = 2π j=1 h∈Z Hilbert-valued moving-average and general linear processes This section is devoted to describe the main contributions in the field of Hilbertian moving-average processes (MAH processes), including the general case of Hilbertian general linear processes (LPH). The ∞ X case of ARMAH processes is considered as well. From the Wold decomposition Xn = εn + ak (εn−k ) of k=1 a LPH, for each n ∈ Z and ak ∈ L(H), for any k ≥ 1, the stationarity is held as long as ε = {εn , n ∈ Z} ∞ X 2 is a H-valued SWN and kak kL(H) < ∞. Building on the early works by Bosq (1991) and Mourid k=1 (1993), the invertibility of LPH was proved in Merlevède (1995) if and only if 1 − for |z| < 1. Asymptotic properties were subsequently derived in Merlevède (1996). ∞ X j=1 z j kaj kL(H) 6= 0, Merlevède (1997) provided a Markovian representation of stationary and invertible LPH in a subspace 16 Hβ = ( X : kXkHβ = ∞ X k=1 2 βk kXk kH ) < ∞ , being β = {βk , k ≥ 1} a strictly positive decreasing and summable sequence. Let us define the Hβ -random variables Yn = (Xn , Xn−1 , . . . , Xn−p−1 , Xn−p , . . .)′ ′ and en = (εn , 0, 0, . . .) , for each n ∈ Z. A strongly-consistent plug-in predictor was derived in Merlevède (1997), by estimating the operator  ρ1   IH   .  . R = .   0H  .. . ρ2 ... ρp ... 0H .. . ... .. . 0H .. . 0H .. . ... .. . IH .. .    ...  ..  .    . . .  −→ p-th row  .. . o n 4 under kRkL(Hβ ) < 1 and E kY0 kHβ < ∞. Mas (2002) studied the weak-convergence for the empirn o 4 ical autocovariance and cross-covariance operators of LPH. In particular, under E kε0 kH < ∞ and ∞ X kak kL(H) < ∞, k=1  Cn,0 − C0       √  Cn,1 − C1   n  −→w N (0, Σ) , ..   .     Cn,h − Ch Ch = E {X0 ⊗ Xh } , Cn,h = n−h−1 X 1 Xi ⊗ Xi+h , n − h i=0 h ∈ N. (26) MAH(q) and ARHMAH(p,q) processes, with p and q greater than one, as a particular case of LPH, were defined in Bosq & Blanke (2007) as Xn = εn + q X lk (εn−k ) , k=1 lk ∈ L(H), klk kL(H) < 1, (27) lk , ρj ∈ L(H), klk kL(H) < 1, kρj kL(H) < 1, (28) and Xn = εn + p X j=1 ρj (Xn−j ) + q X k=1 lk (εn−k ) , respectively, for each n ∈ Z and k = 1, . . . , q, j = 1, . . . , p. LPH in a wide sense, when {aj , j ≥ 1} are allowed to be unbounded, were studied in Bosq (2007) and Bosq & Blanke (2007). In that framework, linear closed subspaces of L2H (Ω, A, P) (see Fortet, 1995) are crucial to extend aspects as Wold decomposition, orthogonality and Markovianess. Unlike the estimation of an ARH(1) process, troubles in the estimation of the operator l of a MAH(1) process arise from the non-linear behaviour of the 17 moment equation. We may cite Turbillon et al. (2008), where the estimation of the MAH(1) model Xn = εn + l (εn−1 ), being l ∈ K(H) under DC −1 L(H) < 1/2 and D∗ C −1 L(H) < 1/2, was reached. A special framework was introduced in Wang (2008), where a real-valued non-linear ARIMA(p,d,q) model was modified, in a manner that functional MA coefficients were included: Xn + p X ρj Xn−j = εn + j=1 q X fk (Xn−k−d ) εn−k , k=1 n ∈ Z, (29) being {fk , k ≥ 1} a set of arbitrary univariate functions. Forecasting of the Chinese Consumer Price Index, which monthly collects prices paid by middle-class consumers for a standard basket of goods and services (e.g., fuel, oil, milk, drugs, etc), was achieved in Chen et al. (2016), adopting smooth functions as functional MA coefficients in equation (29). Furthermore, a survey about the asymptotic properties of LPH, derived in the above-referred works by Merlevède (1995, 1996, 1997), was achieved in Bosq (2000) and Bosq & Blanke (2007). Dedecker & Merlevède (2003) extended the conditional central limit theorem (see Dedecker & Merlevède, 2002) to LPH. Useful tools proposed by Hyndman & Shang (2008), such as visualization and outlier detection, can be applied to observed ARMAH processes, obeying a functional linear model. Outlier detection in French male age-specific mortality data was also achieved in that work. Bosq (2010) addressed the structure of tensorial products for ARMAH models, when the innovations are assumed to be martingale difference functional sequences, by using the linear close subspace theory. 6 Banach-valued autoregressive processes The study of functional time series, with values in a real separable Banach space B, is reviewed in this Section. The Kuelb’s Lemma (see Kuelbs, 1976) plays a crucial role on the derivation of the estimation results in this framework. Given a real separable Banach space (B, k·kB ), the Kuelb’s Lemma proves that there exists an inner product h·, ·i0 on B, with its associated norm k·k0 weaker than k·kB , providing a dense and continuous embedding B ֒→ H, where H is the completation of B under k·k0 . Specifically, in the ARB(1) context, the componentwise estimation of the autocorrelation operator is achieved in Labbas & Mourid (2002), by considering the corresponding orthonormal basis, in the Hilbert space H associated with B by a continuous embedding. Strong-consistency of the formulated estimator, in the norm of bounded linear operators on H, was also derived. Simultaneously to the early work by Bosq (1991), Pumo (1992, 1998) considered a particular case of the referred framework, adopting the Banach space of continuous functions on the interval [0, 1], so-called 18 C = C ([0, 1])). Particularly, the ARC(1) process was formulated as follows: Xn = ρ (Xn−1 ) + εn , Xn , εn ∈ C, ρ(X)(t) = Z 1 0 r(s, t)X(s)ds, X ∈ C, Pumo (1992, 1998) consider the real separable Hilbert space H = L2 krkC([0,1]2 ) < 1, n ∈ Z. (30)  [0, 1], β[0,1] , λ , where λ denotes the Lebesgue measure, and the corresponding continuous extension of ρ to ρ′ , defined on  L2 [0, 1], β[0,1], λ , such that kρ′ kL(L2 ([0,1],β[0,1] ,λ)) < 1. Specifically, an ARH(1) process X ′ , associated with the ARB(1) process X, is defined, from projection into an orthonormal basis {ej , j ≥ 1} of  L2 [0, 1], β[0,1], λ . The restriction to C of the componentwise estimator of ρ′ , computed in terms of the eigenvectors of the autocovariance operator of X ′ , provides an estimator of ρ, under strongly-mixing and Cramer conditions. Strong-consistency of the formulated estimator, in the norm of bounded linear operators on C, was derived in Bosq (2000). The natural extension of ARC(1) to ARC(p) processes, with p greater than one, was firstly proposed in Mourid (1993, 1996). In that works, the characterization of some continuous time processes (such as Ornstein-Uhlenbeck processes) as ARC(1) processes, was also provided. As commented in Section 2, a continuous-time stochastic process ξ = {ξt , t ≥ 0} is turned into a set of functional random variables X = {Xn (t) = ξnδ+t , n ∈ Z}, with Xn (t) taking values in the interval [0, δ], for each n ∈ Z and δ > 0. A method to estimate the periodicity δ for an ARC(p) process was developed by Benyelles & Mourid (2001), by using the work by Martin (1982). In the particular Banach space C, a non-plug-in predictor of a stationary ARC(1) process X, based on the projection into an orthonormal basis of the Reproducing Kernel Hilbert space, associated with the autocovariance operator of X ′ , was derived in Mokhtari & Mourid (2003) via Parzen’s approach  (see also Parzen, 1961). In the case of the eigenvalues Cj′ , j ≥ 1 of the autocovariance operator of  ′ , j ≥ 1 the eigenvalues X ′ are unknown, they assumed that Cn,1 > . . . > Cn,kn > 0 a.s., being Cn,j of the empirical estimator of the autocovariance operator of X ′ , for a suitable truncation parameter kn . Under mild assumptions over the eigenvectors of the empirical estimator of the autocovariance operator of X ′ , Mokhtari & Mourid (2003) derived a consistent non-plug-in predictor. As discussed in that work, the spectral decomposition of cross-covariance operator D is not needed in the Parzen-approach-based framework, as required in Pumo (1992, 1998). The equivalence of the asymptotic behaviour of both approaches is also derived. When the space D = D ([0, 1]) (defined as the space of right continuous functions with left limits on [0, 1]) is adopted, El Hajj (2011, 2013) deeply addressed the estimation and prediction of ARD(1) processes, when D is equipped with the Skorokhod topology. While D is a non-separable Banach space under the supremum norm, the Skorokhod topology provides the separability property to the metric space. The asymptotic properties of this special class of functional autoregressive processes were provided in El Hajj (2011). When the autocorrelation operator takes values in C, by considering the continuous 19  embedding into L2 [0, 1], β[0,1], λ already commented, the estimation and prediction of ARD(1) and M AD(1) processes was addressed by El Hajj (2013). Additionally, some general results, useful for the development of the theory of linear processes in Banach spaces, are now noted. Guillas (2000) generalized some notions about non-causality to Banachvalued context. Extending the results by Bosq (2000), Dehling & Sharipov (2005) provided the asymptotic properties of functional second-order moments of an ARB process, allowing weakly dependent innovation processes. The sieves method already detailed in Section 4, and initially proposed on the ARH(1) forecasting by Bensmain & Mourid (2001), was applied in Rachedi (2005), on the estimation and prediction of an ARB(1) process, based on the dual space of B. Rates of convergences of the formulated estimator were provided in the mentioned work, when ρ is assumed to be a p-summable operator; i.e., for each X0 , . . . , Xn−1 on B, there exist p ∈ (1, ∞) and constant c > 0 such that n−1 X i=0 kρ (Xi )k p !1/p ≤ c sup kX ∗ k≤1 n−1 X i=0 ∗ |(X , Xi )| p !1/p , X ∗ ∈ B∗, (31) providing the p-integrable norm πp (ρ), as the minimum value of constant c which verifies the equation (31). If Πp (B) is the set of p-summable operators on B, when H is a Hilbert space, then Π2 (B) coincides with the space of Hilbert-Schmidt operators on H, with the Hilbert-Schmidt norm π2 . A decomposition of ρ in terms of so-called Schauder and Markushevich bases, was also obtained. In the Skorokhod space D studied in El Hajj (2011, 2013), Blanke & Bosq (2014) analysed the intensity of jumps of D-valued linear processes, providing some limit theorems for ARM AD(1, 1) processes, when both fixed and random number of jumps are regarded. As discussed in Blanke & Bosq (2014), the estimation of these jumps can be used in the prediction of compound Poisson processes, which are used, e.g., for forecasting the payments, at fixed instants, refunded to the holders of an insurance policy. An extension of ARMA processes to general complex separable Banach spaces was proposed in Spangenberg (2013). Firstly, the stationarity of the ARMAB(1,q) process Xn = εn + ρ1 (Xn−1 ) + q X lk (εn−k ) , k=1 ρ1 , lk ∈ L(B), k = 1, . . . , q, (32) was proved, under the hyperbolic property over ρ1 (i.e., σ (ρ1 ) ∩ S = {∅}, being S the unit circle and σ (ρ1 ) the spectrum of ρ1 ) and log+ -moment conditions. Stationarity of ARMAB(p,q) processes was subsequently derived by a B p -valued ARMA(1,q) representation. From results in Soltani & Hashemi (2011), where PCARH(1) processes were introduced, Parvardeh et al. (2017) derived the asymptotic properties for Banach-valued autoregressive periodically correlated processes of order one (PCARB(1) processes). 20 7 Non-parametric functional time series framework Let us see the main references in the context of non-parametric functional time series and functional linear regression, when both explanatory and response variables take values in a space of functions. As a functional extension of the multivariate-based electricity consumption forecasting approach developed by Poggi (1994), a non-parametric kernel-based predictor was formulated in Besse et al. (2000): n−2 X i=0 b hn = ρbhn (Xn−1 ) , X n ρbhn (Xn−1 ) =  b  Xi − Xn−1 b  Xi+1 K  hn  b n−2 X  Xi − Xn−1  K hn i=0 2  2 L2 ([a,b])    L2 ([a,b])     , bi = argmin DX bi X 2 L2 ([a,b]) (33) being K the usual Gaussian kernel and D a d-th order differential operator. Forecasting of climatological time series, so-called ENSO time series, was therein achieved. Cuevas et al. (2002) addressed the strongconsistency estimation of the underlying linear operator of a linear regression, when both explanatory and response variables are assumed to be H-valued random variables, with H = L2 ([a, b]). In particular, the design is given by the triangular array {Xi,n (t) , 1 ≤ i ≤ n}, providing the model Yi,n = Ψ (Xi,n ) + εi,n ,  with Xi,n ∈ L2 ([a, b]) and Yi,n ∈ L2 ([c, d]), under Ψ ∈ L L2 ([a, b]) , L2 ([c, d]) . Antoniadis et al. (2006) introduced the two-steps prediction approach so-called kernel wavelet func- tional (KWF) method, where strongly-mixing conditions are imposed. An expansion of strictly stationary  functional time series into a discrete wavelet basis ψkJ , k = 0, . . . , 2J − 1 , at scale J, is achieved, and bn = E {Xn |Xn−1 , . . . , X0 }, for each n ∈ Z, was then performed by the forecasting of X b J (·) = X n J 2X −1 k=0 J ξbn,k ψkJ (·) , bn = Ξ n−2 X K (D (P (Ξn ) , D (P (Ξi ))) /hn ) Ξi+1 i=0 1/n + n−2 X , (34) K (D (P (Ξn ) , D (P (Ξi ))) /hn ) i=0 n o b n = ξbJ : k = 0, 1, . . . , 2J − 1 denotes, for each n ∈ Z, the set of predicted scaling coefficients, where Ξ n,k at scale J, being P (Ξi ) the set of wavelet coefficients derived by the so-called pyramid algorithm (see Mallat, 1989), for any i = 0, 1, . . . , n − 1. Distance D (·, ·) in (34), for a two set of discrete wavelet 21 , n o i coefficients θj,k , i = 1, 2 , at scale j = j0 , . . . , J − 1 and location k = 0, . . . , 2j − 1, is given by D θ1 , θ  2 = J−1 X 2−j/2 dj θ1 , θ j=j0  2 , dj θ1 , θ  2  j 2X −1 = k=0 2 1/2 1 2  θj,k − θj,k . (35) Pointwise prediction intervals were also built. See also Cugliari (2011), where a continuous wavelet transform (CWT) is also considered. Slightly modifications have been also proposed in the French electricity consumption forecasting addressed by Antoniadis et al. (2012), when the hypothesis of stationarity is not held. We may also cite the work by Antoniadis et al. (2009), in which a method on the selecting the properly bandwidth hn , for kernel-based forecasting of functional time series, was developed. Functional versions of partial least-squares regression and principal component regression (FPLSR and FPCR, respectively) were formulated in Reiss & Ogden (2007). In this work, a functional smoothingbased approach to signal regression was adopted, where decompositions in terms of B-spline bases and roughness penalties are involved. Let us consider a general functional linear regression model, when Hilbert-valued response and F -valued explanatory variables are considered, when F is defined as a general functions space, equipped with a semi-metric d and its associated topology TF (X, t) = {X1 ∈ F : d (X1 , X) ≤ t}. In this framework, a non-parametric kernel-based estimator of the underlying regression operator was derived in Ferraty et al. (2012) as follows, for each i = 0, 1, . . . , n − 1: Yi = Ψ (Xi ) + ε, cn = Ψ b hn (Xn ) , Y   d (Xi , Xn−1 ) Xi+1 K hn i=0 b Ψhn (Xn ) = n−2   , X d (Xi , Xn−1 ) K hn i=0 n−2 X (36) being K a Gaussian kernel (see Ferraty & Vieu, 2006, about the choice of a semi-metric d). 8 ARH(1) strongly-consistent diagonal componentwise parameter estimators In this section, we restrict our attention to the case where C and ρ admit a diagonal spectral decomposition in terms of the common eigenvectors system {φj , j ≥ 1}, since in that case, an important dimension reduction is achieved. This spectral diagonalization can be reached under a wide range of scenarios, leading to a sparse representation of kernels of the associated integral operators (see, e.g., Meyer & Coifman, 1997, for the case of spectral diagonalization of Calderón-Zygmund operators in terms of wavelet bases, in Besov spaces). As discussed in Álvarez-Liébana et al. (2017), this particular scenario is naturally obtained when ρ and C are linked by a continuous function. Both scenarios, when {φj , j ≥ 1} are 22 known and unknown, are now covered, providing the corresponding strong-consistency results, for the formulated diagonal componentwise estimators of ρ, in the norm of bounded linear operators. Proof details are provided in Sections S.1-S.2 of the Supplementary Material. Under a non-diagonal scenario, an almost sure upper-bound for the S(H) norm of the error associated with the diagonal componentwise estimator of ρ, when eigenvectors of C are unknown, is provided in Section S.3 of the Supplementary Material. 8.1 ARH(1) model: diagonal framework Let H be a real separable Hilbert space, and let X = {Xn , n ∈ Z} be a zero-mean stationary ARH(1) process on the basic probability space (Ω, A, P ), satisfying: Xn = ρ (Xn−1 ) + εn , ρ ∈ L(H), kρkL(H) < 1, n ∈ Z, (37) when H-valued innovation process ε = {εn , n ∈ Z} is assumed to be SWN, and to be uncorrelated with  X0 , with σε2 = E kεn k2H < ∞, for all n ∈ Z. In addition, let us consider the following assumptions: Assumption A1. The autocovariance operator C = E {Xn ⊗ Xn } , for every n ∈ Z, is a strictly positive and self-adjoint operator, in the trace class, with Ker (C) = {∅}. Its eigenvalues {Cj , j ≥ 1} then satisfy ∞ X j=1 Cj < ∞, C1 > . . . > Cj > Cj+1 > . . . > 0, C(f )(g) = ∞ X j=1 Cj hφj , f iH hφj , giH , ∀f, g ∈ H. (38) Assumption A2. The autocorrelation operator ρ is a self-adjoint and Hilbert-Schmidt operator, admitting the following diagonal spectral decomposition: ρ(f )(g) = ∞ X j=1 ρj hφj , f iH hφj , giH , ∞ X j=1 ρ2j < ∞, ∀f, g ∈ H, (39) where {ρj , j ≥ 1} is the system of eigenvalues of ρ, with respect to the orthonormal system {φj , j ≥ 1}. Under Assumptions A1-A2, the cross-covariance operator D = ρC = E {Xn ⊗ Xn+1 }, for each n ∈ Z, can be also diagonally decomposed, with regard to the eigenvectors of C, providing a set of eigenvalues {Dj = ρj Cj , j ≥ 1}. Moreover, projections of (37) into {φj , j ≥ 1} lead to the stationary zero-mean AR(1) representation, under kρkL(H) = sup |ρj | < 1: j≥1 Xn,j = ρj Xn−1,j +εn,j , Xn,j = hXn , φj iH , εn,j = hεn , φj iH , 23 ρj ∈ R, |ρj | < 1, j ≥ 1, n ∈ Z. (40) 8.2 Diagonal strongly-consistent estimator when the eigenvectors of C are known In the following of this subsection, Assumption A3 will be imposed, jointly with hX0 , φj iH 6= 0 a.s. for any j ≥ 1 (so-called Assumption A4). In the case of {φj , j ≥ 1} are assumed to be known, and under Assumptions A1-A2, the following estimators of C and D, based on the empirical moment-based estimation of their eigenvalues, is developed, for any n ≥ 2 and j ≥ 1: bn = C ∞ n−1 n−2 X 1 X 1X 2 b b b b b Dn,j φj ⊗ φj , Dn,j = Cn,j φj ⊗ φj , Cn,j = X , Dn = Xi,j Xi+1,j . n i=0 i,j n − 1 i=0 j=1 j=1 ∞ X (41) From Assumption A4, let us consider the diagonal componentwise estimator of ρ ρbkn kn X = j=1 ρbn,j φj ⊗ φj , ρbn,j b n,j D n = = b n − 1 Cn,j n−2 X Xi,j Xi+1,j i=0 n−1 X 2 Xi,j i=0 j ≥ 1, n ≥ 2. , (42) Under Assumptions A1-A4, the following proposition provides the strong-consistency, in the norm of L(H), of the estimator (42), as well as of its associated ARH(1) plug-in predictor, in the underlying Hilbert space. Proof details are provided in Sections S.1-S.2 in the Supplementary Material. Proposition 1 Under Assumptions A1–A4, for a truncation parameter kn < n, with lim kn = ∞, n→∞ n1/4 (ln(n)) β kb ρkn − ρkL(H) −→a.s. 0, k (b ρkn − ρ) (Xn−1 )kH −→a.s. 0, n → ∞. (43) 8.3 Diagonal strongly-consistent estimator when the eigenvectors of C are unknown In the case of {φj , j ≥ 1} are unknown, as is often in practice, Cn = 1 n n−1 X i=0 Xi ⊗ Xi admits a diagonal spectral decomposition in terms of {Cn,j , j ≥ 1} and {φn,j , j ≥ 1}, satisfying, for each n ≥ 2: Cn (φn,j ) Cn = Cn,j φn,j , = 1 n n−1 X i=0 j ≥ 1, Xi ⊗ Xi = Cn,1 ≥ · · · ≥ Cn,n ≥ 0 = Cn,n+1 = Cn,n+2 = . . . ∞ X j=1 Cn,j φn,j ⊗ φn,j , Cn,j = 1 n n−1 X i=0 e 2 , j ≥ 1. X i,j (44) (45) ei,j = hXi , φn,j iH and φ′ = sgn hφn,j , φj i φj , for each i ∈ Z, j ≥ In the remainder, we will denote X n,j H 1 and n ≥ 2, where sgnhφn,j , φj iH = 1hφn,j ,φj iH ≥0 − 1hφn,j ,φj iH <0 . Since {φn,j , j ≥ 1} is a complete n−2 X 1 Xi ⊗ Xi+1 admits the orthonormal system of eigenvectors, for each n ≥ 2, operator Dn = n−1 i=0 24 following non-diagonal spectral representation: Dn = ∞ X ∞ ∞ X ∞ n−2 n−2 X X 1 X e e 1 X ∗ Xi ⊗ Xi+1 = Dn,j,l φn,j ⊗ φn,l = Xi,j Xi+1,l φn,j ⊗ φn,l , (46) n − 1 i=0 n − 1 i=0 j=1 j=1 l=1 ∗ where Dn,j,l = hDn (φn,j ) , φn,l iH = l=1 1 n−1 n−2 X i=0 ei+1,l , for each j, l ≥ 1 and n ≥ 2. In particular, we ei,j X X ∗ will use the notation Dn,j = Dn,j,j = hDn (φn,j ) , φn,j iH . The following assumption is here deemed: Assumption A5. Cn,kn > 0 a.s, where kn is a suitable truncation parameter kn < n, with lim kn = ∞. n→∞ From Assumption A5, the following diagonal componentwise estimator of ρ is outlined: ρekn = kn X j=1 ρen,j φn,j ⊗ φn,j , ρen,j Dn,j n = = Cn,j n−1 n−2 X ei+1,j ei,j X X i=0 n−1 X i=0 , e2 X i,j j ≥ 1, n ≥ 2. (47) Under Assumptions A1-A3 and A5, the strong-consistency of the diagonal estimator ρekn is reached in Proposition 2, and proved in Sections S.1-S.2 of the Supplementary Material. The large-sample behaviour of (47) is illustrated in Section S.4 of the Supplementary Material, under diagonal scenarios. Proposition 2 Let {kn , n ∈ N} a sequence of integers such that, for n e0 sufficiently large, and β > 12 ,   = o n1/4 (ln(n))β−1/2 , Λkn   −β = O n1/4 (ln(n)) , kn 1 X aj Ckn j=1 where Λkn = −1 sup (Cj − Cj+1 ) 1≤j≤kn e0 , kn Ckn < 1, n ≥ n √ √ 1 , a1 = 2 2 C1 −C and aj = 2 2 max 2 any 2 ≤ j ≤ kn . Then, under Assumptions A1-A3 and A5, ke ρkn − ρkL(H) −→a.s. 0,  (48) (49)  1 1 , for , Cj−1 − Cj Cj − Cj+1 k (e ρkn − ρ) (Xn−1 )kH −→a.s. 0, n → ∞. (50) When ρ does not admit a diagonal spectral representation, an almost sure upper bound for the error ke ρkn − ρk2S(H) is provided in Section S.3 of the Supplementary Material, under Assumption A5 and conditions imposed in Lemma 2 (see Section S.2 of the Supplementary Material). 9 Comparative study: an evaluation of the performance A comparative study is undertaken to illustrate the performance of the ARH(1) predictor formulated in Section 8, and those ones given by Antoniadis & Sapatinas (2003), Besse et al. (2000), Bosq (2000) and 25 Guillas (2001), under different diagonal, pseudo-diagonal and non-diagonal scenarios, when {φj , j ≥ 1} are unknown. Additionally to the figures displayed in this Section, more details of the numerical results obtained can also be found in the tables included in Section S.5 of the Supplementary Material. In all of the scenarios considered, autocovariance operator C is given by C(f )(g) = ∞ X j=1 Cj hφj , f iH hφj , giH , φj (x) = r 2 sin b−a  πjx b−a  , f, g ∈ H = L2 ((a, b)), x ∈ (a, b). (51) In the remaining, we fix (a, b) = (0, 4) and, under Assumption A1, Cj = c1 j −δ1 , for any j ≥ 1, being c1 a positive constant. Different rates of convergence to zero of the eigenvalues of C are studied, corresponding to the values of the shape parameter δ1 ∈ (1, 2). Table 1 and Figure 1 below show the scenarios considered in the illustration of the performance of the componentwise estimators of ρ compared (see equations (4)-(5) above). Table 1: Parameters involved in the definition of ρ and Cε (see equations (4)-(5) above), under different diagonal, pseudo-diagonal and non-diagonal Gaussian generations, for any j, h ≥ 1, M = 50, δ2 = 11/10 and different shape parameters δ1 detailed below equation (51) (see Tables 2-5). 2 σj,j Framework ρj,j ρj,h , with j 6= h Diagonal Pseudo-diagonal Non-diagonal c2 j −δ2 c2 j −δ2 c2 j −δ2 0 e−|j−h|/W , W = 0.2 1 1 1 K |j−h|2 +1 , W = 0.2, K = 0.275  Cj 1 − ρ2j,j  Cj 1 − ρ2j,j  Cj 1 − ρ2j,j 2 σj,h , with j 6= h 0 2 e−|j−h| /W , W = 0.2 2 e−|j−h| /W , W = 0.2 In Table 1 above, c2 is a constant which belongs to the interval (0, 1), such that ρ is a Hilbert-Schmidt operator. 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 −1 −1 −2 −2 −3 4 3.43 2.86 2.29 1.71 1.14 0.57 0 0 0.57 1.14 1.71 2.29 2.86 3.43 4 −3 4 3.43 2.86 2.29 1.71 1.14 0.57 0 0 0.57 1.14 1.71 2.29 2.86 3.43 Figure 1: Operator ψ (·, ·) associated with the autocorrelation operator ρ, valued at the grid [a, b]×[a, b], for pseudo-diagonal (on left) and non-diagonal (on right) scenarios (see Table 1). Discretization step ∆t = 0.06 and shape parameter δ1 = 3/2 are adopted. 26 4 9.1 Large-sample behaviour of the ARH(1) plug-in predictors Large-sample behaviour of the ARH(1) plug-in predictor formulated in Section 8.3, as well as those ones in Bosq (2000) and Guillas (2001) (see equations (3) and (7) above, respectively), will be illustrated. Remark that the ARH(1) plug-in predictor established in Section 8.3 will be only considered under diagonal scenarios. Strong-consistency results for the estimator ρekn , in the trace norm, when ρ is a positive and trace operator, which does not admit a diagonalization in terms of the eigenvectors of C, have been recently provided in Ruiz-Medina & Álvarez-Liébana (2017b). See also Section S.3 of the Supplementary Material, where an almost sure upper bound for ke ρkn − ρk2S(H) is theoretically derived, when ρ is not assumed to admit a diagonal spectral representation, nor to be a trace operator, but it is assumed to be a Hilbert-Schmidt operator. As commented earlier (see equation (3) above), Assumptions A1, A3 and A5, jointly with the boundedness of X0 and the Hilbert-Schmidt assumption of ρ, are required in the strong-consistency results by Bosq (2000). Condition (49) was also imposed in that work. From Bosq (2000, Example 8.6), conditions therein considered are held under any scenario in which the truncation parameter kn = ⌈log(n)⌉ is adopted, under Assumptions A1-A3 and A5 (it can be proved as condition (48) is also verified when kn = ⌈log(n)⌉). In the formulation of mean-square convergence, Guillas also considered Assumptions A1, A3 and A5. From Guillas (2001, Theorem 2, Example 4), if the regularization sequence above-referred (see equation (7)) verifies α Ckγn nǫ ≤ un ≤ βCkn , for 0 < β < 1 and α > 0, with γ = 1 and ǫ = 0, then the mean-square consistency is achieved under a suitable truncation parameter. In particular, if kn = ⌈e′ n1/(8δ1 +2) ⌉, with e′ = 17/10, the rate of convergence in quadratic mean is of order of n−δ1 /(4δ1 +1) . Remark that, since ⌈(17/10) n1/(8δ1 +2) ⌉ < ⌈ln(n)⌉ for n large enough, conditions (48)-(49) are also verified when kn = ⌈e′ n1/(8δ1 +2) ⌉, with e′ = 17/10, is fixed. For sample sizes nt = 35000 + 40000 (t − 1) , t = 1, . . . , 10, and a suitable truncation parameter kn , F (kn , nt , β) = N X 1(ξn l=1 ) t ,β ,∞  ρ − ρlkn  l Xn−1  kn H  ! /N, (52) will be displayed (see Figures 2-4 below), being 1(ξn ,β ,∞) the indicator function over the interval t  kn  l (ξnt ,β , ∞), where ξnt ,β numerically fits the almost sure rate of convergence of ρ − ρlkn Xn−1 H (see Tables 2-3 below). When the data is generated in the diagonal framework, ρ − ρlkn  l Xn−1  kn H v u uZ u =t a b   kn X j=1 l ρj Xn−1,j φj (t) − kn X j=1  2 l φln,j (t) dt, ρln,j Xn−1 (53)  l is computed, being ρlkn Xn−1 the predictors defined in (44)-(47), (3) and (7), respectively, for any e l = hX l , φl iH , for l = 1, . . . , N , j = 1, . . . , kn , and based on the lth generation of the values X i,j i n,j 27 with N = 500 simulations. The following parameter values will be considered, when the diagonal data generation is assumed: Table 2: Diagonal scenarios considered (see Figure 2 below, and Table 4 in the Supplementary Material), with δ2 = 11/10, nt = 35000 + 40000(t − 1), t = 1, . . . , 10, and ξnt ,β = (ln(nt ))β , for β = 65/100. 1/2 nt Scenario δ1 kn 1 2 3 4 3/2 24/10 3/2 24/10 ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈e′ n1/(8δ1 +2) ⌉, e′ = 17/10 ⌈e′ n1/(8δ1 +2) ⌉, e′ = 17/10 As discussed, conditions formulated in Bosq (2000) and Proposition 2 of the current paper are held for scenarios 1-2 in Table 2, while in scenarios 3-4, the conditions assumed in Proposition 2 and the approaches by Bosq (2000) and Guillas (2001), are verified (but not in an optimal sense). 0.06 0.014 0.012 0.05 0.01 0.04 0.008 0.03 0.006 0.02 0.004 0.01 0 0 0.002 0.5 1 1.5 2 2.5 3 3.5 0 0 4 0.5 1 1.5 2 2.5 3 5 3.5 4 5 x 10 x 10 Figure 2: F (kn , nt , β) values, for scenario 2 (on left) and scenario 4 (on right), for our approach (blue star dotted line) and those one presented in Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond β t )) dotted line). The curve ξnt ,β = (ln(n , with β = 65/100, is adopted. 1/2 nt Under pseudo-diagonal and non-diagonal frameworks, the following truncated norm is then computed, instead of (53): ρ − ρlkn  l Xn−1  kn H v u uZ u =t a b   Z a b   kn X j,k=1  ρj,k φj (t)φk (s) ds − kn X j=1  2 l φln,j (t) dt. ρln,j Xn−1 (54) Pseudo-diagonal and non-diagonal scenarios, for approaches formulated in Bosq (2000) and Guillas (2001), are outlined in Table 3. Scenarios 5-6 and 9-10 verify conditions required in Bosq (2000), while scenarios 7-8 and 11-12 are included in both setting of conditions, proposed in Bosq (2000) and Guillas (2001). 28 Table 3: Pseudo-diagonal and non-diagonal scenarios considered (see Figures 3-4 below, and Tables 5-6 in the Supplementary Material), with δ2 = 11/10, nt = 35000 + 40000(t − 1), t = 1, . . . , 10, and ξnt ,β = Scenario 5 6 7 8 Pseudo-diagonal scenarios δ1 kn 3/2 24/10 3/2 24/10 ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈(17/10)n1/(8δ1 +2) ⌉ ⌈(17/10)n1/(8δ1 +2) ⌉ β Scenario 3/10 3/10 3/10 3/10 9 10 11 12 0.06 0.06 0.05 0.05 0.04 0.04 0.03 0.03 0.02 0.02 0.01 0.01 0 0 0.5 1 1.5 2 2.5 3 3.5 0 0 4 (ln(nt ))β 1/3 nt Non-diagonal scenarios δ1 kn 3/2 24/10 3/2 24/10 0.5 1 β ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈(17/10)n1/(8δ1 +2) ⌉ ⌈(17/10)n1/(8δ1 +2) ⌉ 1.5 2 2.5 . 125/100 125/100 125/100 125/100 3 3.5 4 5 5 x 10 x 10 Figure 3: F (kn , nt , β) values, for scenario 6 (on left) and scenario 8 (on right), for approaches presented in Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = with β = 3/10, is adopted. 0.14 (ln(nt ))β 1/3 nt , 0.09 0.08 0.12 0.07 0.1 0.06 0.08 0.05 0.06 0.04 0.03 0.04 0.02 0.02 0 0 0.01 0.5 1 1.5 2 2.5 3 3.5 0 0 4 0.5 1 1.5 2 2.5 3 3.5 4 5 5 x 10 x 10 Figure 4: F (kn , nt , β) values, for scenario 10 (on left) and scenario 12 (on right), for approaches presented in Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = with β = 125/100, is adopted. (ln(nt ))β 1/3 nt , Results obtained in the diagonal scenarios 1-4, which are reflected in Table 2, have been applied to the three componentwise ARH(1) plug-in predictor approaches. As expected, the amount of values  kn  l ρ − ρlkn Xn−1 , which lie within the band [0, ξnt ,β ), is greater as long as the decay rate of the H eigenvalues of C is faster. Since a diagonal framework is considered in scenarios 1-2, a better performance of the approach formulated in Section 8.3 can be noticed in comparison with those ones by Bosq (2000) 29 and Guillas (2001), where errors appear, when sample sizes are not sufficiently large, in the estimation of the non-diagonal componentwise coefficients of ρ, which must be zero. This possible effect of the non-diagonal design, under a diagonal scenario, is not observed, for truncation rules selecting a very small number of terms, in relation to the sample size. This fact occurs in the truncation rule adopted in Guillas (2001). In the pseudo-diagonal and non-diagonal scenarios outlined in Table 3, methodologies in Bosq (2000) and Guillas (2001) are compared, such that the curve ξnt ,β = (ln(nt ))β , 1/3 nt for β = 3/10 and β = 125/100, numerically fits their almost sure rate of convergence. As observed (see also Tables 4-6 in Section S.5 of the Supplementary material), the sample-size dependent truncation rule, according to the rate of convergence to zero of the eigenvalues of C, plays a crucial role in the observed performance of both approaches. 9.2 Small-sample behaviour of the ARH(1) plug-in and non-plug-in predictors Smaller sample sizes must be adopted in this subsection, since computational limitations arise when regularized wavelet plug-in predictor formulated in Antoniadis & Sapatinas (2003) (see equations (19)(21) above), as well as penalized predictor and non-parametric kernel-based predictor applied in Besse et al. (2000) (see equations (9) and (33), respectively), are included in the comparative study. See also Section S.5 of the Supplementary Material, where extra numerical results are provided. As above, the diagonal componentwise estimator here formulated will be only considered under diagonal scenarios. On the one hand, Assumptions A1 and A3, and conditions in (21), are required when regularizedwavelet-based prediction approach is applied. In particular, since Cj = c1 j −δ1 , for any j ≥ 1, if kn = ⌈n1/α ⌉ is adopted, then 1 − 4δ1 α > 0, leading to α > 4δ1 . Additionally to kn = ⌈ln(n)⌉, the truncation parameter kn = ⌈n1/α ⌉ will be adopted (see Table 4-5), with α = 6.5 and α = 10, for δ1 = 3/2 and δ1 = 24/10, respectively. Furthermore, F (kn , nt , β) values defined in (52)-(54) are computed for n o the wavelet-based approach just replacing {φn,j , j ≥ 1} by φeM j , j ≥ 1 (see equations (19)-(21)). As before, since ⌈n1/α ⌉ < ⌈ln(n)⌉ and ⌈n1/α ⌉ < ⌈(17/10)n1/(8δ1 +2) ⌉, for α = 6.5 and α = 10, conditions imposed for the estimator formulated in Section 8, as well as in Bosq (2000) and Guillas (2001), are verified when the truncation parameter kn = ⌈n1/α ⌉, with α = 6.5 and α = 10, is studied. On the other hand, let us also compare with the techniques presented in Besse et al. (2000), and detailed in equations (9) and (33), based on penalized prediction and non-parametric kernel-based prediction, respectively. In those techniques, they assume that the functional values of the stationary process are in the Sobolev space W 2,2 ([0, 1]). When the referred methodologies in Besse et al. (2000) are implemented, the following alternative norm replaces the norm reflected in (53)-(54), for values 30 F (kn , nt , β): ρ− ρlkn  l Xn−1  = H s Z b a  2  l l (t) dt, (t) − ρlkn Xn−1 ρ Xn−1 l = 1, . . . , N. (55) Hence, the following diagonal scenarios are regarded: Table 4: Diagonal scenarios considered (see Figure 5 below, and Tables 9-10 in the Supplementary Material), with M = 50, q = 10, δ2 = 11/10, nt = 750 + 500(t − 1), t = 1, . . . , 13, and ξnt ,β = Scenario δ1 kn hn 13 14 15 16 3/2 24/10 3/2 24/10 ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈n1/α ⌉, α = 6.5 ⌈n1/α ⌉, α = 10 0.15, 0.25 0.15, 0.25 (ln(nt ))β 1/2 nt , β = 65/100. Remark that, since both approaches formulated in Besse et al. (2000) not depend on the truncation parameter kn adopted, we only perform them for scenarios 13-14, where different rates of convergence to zero of the eigenvalues of C are considered, and conditions imposed in that paper are verified. Conditions formulated in Bosq (2000) and Proposition 2 of the current paper are held for all scenarios, while the conditions assumed in Antoniadis & Sapatinas (2003) and Guillas (2001) are only verified under scenarios 15-16. 0.16 0.05 0.045 0.14 0.04 0.12 0.035 0.1 0.03 0.08 0.025 0.02 0.06 0.015 0.04 0.01 0.02 0 0 0.005 1000 2000 3000 4000 5000 6000 0 0 7000 1000 2000 3000 4000 5000 6000 7000 Figure 5: F (kn , nt , β) values, for scenario 14 (on left) and scenario 16 (on right), for our approach (blue star dotted line) and those one presented in Antoniadis and Sapatinas (2001) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 0.15 and hn = 0.25, respectively), β t )) , Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = (ln(n 1/2 nt with β = 65/100, is drawn (light green dotted line). Pseudo-diagonal and non-diagonal scenarios are detailed in Table 5. As noted before, approaches formulated in Besse et al. (2000) are only tested for scenarios 17-18 and 21-22, and conditions in Bosq (2000) are verified for all scenarios. Scenarios developed by Antoniadis & Sapatinas (2003) and Guillas (2001) are only held when the truncation parameter proposed in Antoniadis & Sapatinas (2003) is adopted. 31 Table 5: Pseudo-diagonal and non-diagonal scenarios considered (see Figures 6-7 below, and Tables 11-14 in the Supplementary Material), with δ2 = 11/10, nt = 750 + 500(t − 1), t = 1, . . . , 13, and ξnt ,β = Scenario 17 18 19 20 Pseudo-diagonal scenarios δ1 kn β 3/2 24/10 3/2 24/10 ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈n1/α ⌉, α = 6.5 ⌈n1/α ⌉, α = 10 3/10 3/10 3/10 3/10 hn Scenario 1.2, 1.7 1.2, 1.7 21 22 23 24 0.4 (ln(nt ))β Non-diagonal scenarios δ1 kn β 3/2 24/10 3/2 24/10 ⌈ln(n)⌉ ⌈ln(n)⌉ ⌈n1/α ⌉ ⌈n1/α ⌉ 125/100 125/100 125/100 125/100 1/3 nt . hn 1.2, 1.7 1.2, 1.7 0.1 0.09 0.35 0.08 0.3 0.07 0.25 0.06 0.2 0.05 0.04 0.15 0.03 0.1 0.02 0.05 0 0 0.01 1000 2000 3000 4000 5000 6000 0 0 7000 1000 2000 3000 4000 5000 6000 7000 Figure 6: F (kn , nt , β) values, for scenario 18 (on left) and scenario 20 (on right), for approaches presented in Antoniadis & Sapatinas (2003) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 1.2 and hn = 1.7, respectively), Bosq (2000) (red circle dotted line) and β t )) Guillas (2001) (black diamond dotted line). The curve ξnt ,β = (ln(n , with β = 3/10, is drawn (light green 1/3 nt dotted line). 0.8 0.12 0.7 0.1 0.6 0.08 0.5 0.4 0.06 0.3 0.04 0.2 0.02 0.1 0 0 1000 2000 3000 4000 5000 6000 0 0 7000 1000 2000 3000 4000 5000 6000 7000 Figure 7: F (kn , nt , β) values, for scenario 22 (on left) and scenario 24 (on right), for approaches presented in Antoniadis & Sapatinas (2003) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 1.2 and hn = 1.7, respectively), Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = dotted line). (ln(nt ))β 1/3 nt , with β = 125/100, is drawn (light green When smaller sample sizes are adopted, and approaches formulated in Antoniadis & Sapatinas (2003) and Besse et al. (2000) are included in the comparative study, scenarios 13-24 have been considered and 32 reflected in Tables 4-5. As expected, the larger sample are used, the better performance is obtained for the empirical-eigenvector-based componentwise approaches tested in the previous subsection. Note that even when small sample sizes are studied, a good performance of the ARH(1) plug-in predictor given in equations (44)-(47) is observed. As well as the regularized wavelet-based approach detailed in Antoniadis & Sapatinas (2003) becomes the best methodology for small sample sizes, in comparision with the componentwise techniques above mentioned. Note that the good performance observed corresponds to the truncation rule proposed by these authors, with a small number of terms. While, when a larger number of terms is considered, according to the alternative truncation rules tested, the observed outperformance does not hold. While the penalized prediction approach proposed in Besse et al. (2000) has been shown as the more accurate, is, however, less affected by the regularity conditions imposed on the autocovariance kernel (see Tables 9-14 in Section S.5 of the supplementary material). The non-parametric kernel-based purpose by Besse et al. (2000) requires to solve the selection problem associated with the bandwidth parameter. Furthermore, a drawback of both approaches in Antoniadis & Sapatinas (2003) and Besse et al. (2000) is that they require large computational times in their implementations. The underlying dependence structure, given by the covariance operators and their spectral decompositions, cannot be provided in those approaches. Acknowledgments This work has been supported in part by project MTM2015–71839–P (co-funded by Feder funds), of the DGI, MINECO, Spain. References [1] Allan, A. & Mourid, T. (2014). Covariance operator estimation of a functional autoregressive process with random coefficients. Statist. Probab. Lett., 84, 1–8. [2] Álvarez-Liébana, J., Bosq, D. & Ruiz-Medina, M. D. (2016). Consistency of the plug-in functional predictor of the Ornstein-Uhlenbeck process in Hilbert and Banach spaces. Statist. Probab. Lett., 117, 12–22. [3] Álvarez-Liébana, J., Bosq, D. & Ruiz-Medina, M. D. (2017). Asymptotic properties of a componentwise ARH(1) plug-in predictor. J. Multivariate Anal., 155, 12–34. [4] Andersson, J. & Lillestøl, J. (2010). Modeling and forecasting electricity consumption by functional data analysis. The Journal of Energy Markets, 3, 3–15. [5] Antoniadis, A., Brosat, X., Cugliari, J. & Poggi, J. M. (2012). Prévision d’un processus à valeurs fonctionnelles en présence de non stationnarités. Application à la consommation d’électricité. J. SFdS, 153, 52–78. [6] Antoniadis, A., Paparoditis, E. & Sapatinas, T. (2006). A functional wavelet-kernel approach for time series prediction. J. R. Stat. Soc. Ser. B. Stat. Methodol., 68, 837–857. [7] Antoniadis, A., Paparoditis, E. & Sapatinas, T. (2009). Bandwidth selection for functional time series prediction. Statist. Probab. Lett., 79, 733–740. 33 [8] Antoniadis, A. & Sapatinas, T. (2003). Wavelet methods for continuous-time prediction using Hilbert-valued autoregressive processes. J. Multivariate Anal., 87, 133–158. [9] Aue, A., Norinho, D. & Hörmann, S. (2015). On the prediction of stationary functional time series. J. Amer. Statist. Assoc., 110, 378–392 . [10] Bensmain, N. & Mourid, T. (2001). Estimateur “sieve” de l’opérateur d’un processus ARH(1). C. R. Acad. Sci. Paris Sér. I Math., 332, 1015–1018. [11] Benyelles, W. & Mourid, T. (2001). Estimation de la période d’un processus à temps continu à représentation autorégressive. C. R. Acad. Sci. Paris Sér. I Math., 333, 245–248. [12] Besse, P.C. & Cardot, H. (1996). Approximation spline de la prévision d’un processu fonctionnel autoregréssif d’ordre 1. Canad. J. Statist., 24, 467–487. [13] Besse, P. C., Cardot, H. & Stephenson, D. B. (2000). Autoregressive forecasting of some functional climatic variations. Scand. J. Stat., 27, 673–687. [14] Blanke, D. & Bosq, D. (2014). Exponential bounds for intensity of jumps. Math. Methods Statist., 23, 239–255. [15] Bosq, D. (1991). Modelization, non-parametric estimation and prediction for continuous time processes. Nonparametric functional estimation and related topics, NATO, ASI Series, 335, 509–529. [16] Bosq, D. (1999a). Autoregressive representation for the empirical covariance operator of an ARH(1). C. R. Acad. Sci. Paris Sér. I Math., 329, 531–534. [17] Bosq, D. (1999b). Autoregressive Hilbertian Processes. Annales de l’ISUP, 43, 25–55. [18] Bosq, D. (2000). Linear Processes in Function Spaces. Springer, New York. [19] Bosq, D. (2007). General linear processes in Hilbert spaces and prediction. J. Stat. Planning and Inference, 137, 879–894. [20] Bosq, D. (2010). Tensorial products of functional ARMA processes. J. Multivariate Anal., 101, 1352–1363. [21] Bosq, D. & Blanke, D. (2007). Inference and Predictions in Large Dimensions. Wiley, Chichester. [22] Cardot, H. (1998). Convergence du lissage spline de la prévision des processus autorégressifs fonctionnels. C. R. Acad. Sci. Paris Sér. I Math., 326, 755–758. [23] Cavallini, A., Montanari, G. C., Loggini, M., Lessi, M. & Cacciari, M. (1994). Nonparametric prediction of harmonic levels in electrical networks. Proceed. IEEE ICHPS VI Bologna, 165–171. [24] Chen, S. X., Lei, L. & Tu, Y. (2016). Functional coefficient moving average model with applications to forecasting chinese CPI. Statist. Sinica, 26, 1649–1672. [25] Cuevas, A., Febrero, M. & Fraiman, R. (2002). Linear functional regression: the case of fixed design and functional response. Canad. J. Statist., 30, 285–300. [26] Cugliari, J. (2011). Prévision non paramétrique de processus à valeurs fonctionnelles. Application à la consommation d’électricité. PhD thesis, University of Paris-Sud 11, Paris. [27] Cugliari, J. (2013). Conditional Autoregressive Hilbertian processes. arXiv:1302.3488. [28] Damon, J. & Guillas, S. (2002). The inclusion of exogenous variables in functional autoregressive ozone forecasting. Environmetrics, 13, 759–774. 34 [29] Damon, J. & Guillas, S. (2005). Estimation and simulation of autoregressive processes with exogenous variables. Stat. Inference Stoch. Process., 8, 185–204. [30] Dedecker, J. & Merlevède, F. (2002). Necessary and sufficient conditions for the conditional central limit theorem. Ann. Probab., 30, 1044–1081. [31] Dedecker, J. & Merlevède, F. (2003). The conditional central limit theorem in Hilbert spaces. Stochastic Process. Appl., 108, 229–262. [32] Dehling, H. & Sharipov, O. S. (2005). Estimation of mean and covariance operator for Banach space valued autoregressive processes with dependent innovations. Stat. Inference Stoch. Process., 8, 137–149. [33] Didericksen, D., Kokoszka, P. & Zhang, X. (2012). Empirical properties of forecast with the functional autoregressive model. Comput. Stat., 27, 285–298. [34] Ferraty, F., Van Keilegom, I. & Vieu, P. (2012). Regression when both response and predictor are functions. J. Multivariate Anal., 109, 10–28. [35] Ferraty, F. & Vieu, P. (2006). Nonparametric functional data analysis: Theory and practice. Springer, Berlin. [36] Fortet, R. (1995). Vecteurs, fonctions et distributions aleatoires dans les espaces de Hilbert. Hermes, Paris. [37] Grenander, U. (1981). Abstract Inference. Wiley, New York. [38] Guillas, S. (2000). Noncausality and functional discretization, limit theorems for an ARHX(1) process. C. R. Acad. Sci. Paris Sér. I Math., 331, 91–94. [39] Guillas, S. (2001). Rates of convergence of autocorrelation estimates for autoregressive Hilbertian processes. Statist. Probab. Lett., 55, 281–291. [40] Guillas, S. (2002). Doubly stochastic Hilbertian processes. J. Appl. Probab., 39, 566–580. [41] El Hajj, L. (2011). Limit theorems for D[0, 1]-valued autoregressive processes. C. R. Acad. Sci. Paris Sér. I Math., 349, 821–825. [42] El Hajj, L. (2013). Inférence statistique pour des variables fonctionnelles à Sauts. PhD thesis, University Paris VI, Paris. [43] Hörmann, S., Horváth, L. & Reeder, R. (2013). A functional version of the ARCH model. Econometric Theory, 29, 267–288. [44] Hörmann, S., Kidziński, L. & Hallin, M. (2015). Dynamic functional principal components. J. R. Stat. Soc. Ser. B. Stat. Methodol., 77, 319–348. [45] Hörmann, S. & Kidziński, L. (2015). A Note on Estimation in Hilbertian Linear Models. Scand. J. Stat., 42, 43–62. [46] Hörmann, S. & Kokoszka, P. (2010). Weakly dependent functional data. Ann. Statist., 38, 1845–1884. [47] Horváth, L., Husková, M. & Kokoszka, P. (2010). Testing the stability of the functional autoregressive process. J. Multivariate Anal., 101, 352–367. [48] Horváth, L., Kokoszka, P. & Rice, G. (2014). Testing stationarity of functional time series. J. Econometrics, 179, 66–82. [49] Hyndman, R. J. & Shang, H. L. (2008). Bagplots, Boxplots and Outlier Detection for Functional Data. In: Functional and Operatorial Statistics. Contributions to Statistics. Physica-Verlag HD. 35 [50] Hyndman, R. J. & Shang, H. L. (2009). Forecasting functional time series. J. Korean Statist. Soc., 38, 199–211. [51] Hyndman, R. J. & Ullah, Md. S (2007). Robust forecasting of mortality and fertility rates: A functional data approach. Comput. Statist. Data Anal., 51, 4942–4956. [52] Kara-Terki, N. & Mourid, T. (2016). Local asymptotic normality of Hilbertian autoregressive processes. C. R. Acad. Sci. Paris Sér. I, 354, 634–638. [53] Kargin, V. & Onatski, A. (2008). Curve forecasting by functional autoregression. J. Multivariate Anal., 99, 2508–2526. [54] Kokoszka, P., Maslova, I., Sojka, J. & Zhu, L. (2008). Testing for lack of dependence in the functional linear model. Canad. J. Statist., 36, 207–222. [55] Kokoszka, P. & Reimherr, M. (2013a). Asymptotic normality of the principal components of functional time series. Stochastic Process. Appl., 123, 1546–1562. [56] Kokoszka, P. & Riemherr, M. (2013b). Determining the order of the functional autoregressive model. J. Time Series Anal., 34, 116–129. [57] Kowal, D. R., Matteson, D. S. & Ruppert, D. (2017). Functional autoregression for sparsely sample data. J. Bus. Econom. Statist., to appear. [58] Kuelbs, J. (1976). A strong convergence theorem for Banach valued random variables. Ann. Prob., 4, 744– 771. [59] Labbas, A. & Mourid, T. (2002). Estimation et prévision d’un processus autorégressif Banach. C. R. Acad. Sci. Paris Sér. I, 335, 767–772. [60] Laukaitis, A. & Rac̆kauskas, A. (2002). Functional data analysis of payment systems. Nonlinear Anal. Model. Control, 7, 53–68. [61] Mallat, S. G. (1989). A theory of multiresolution signal decomposition: the wavelet representation. IEEE Trans. Pattn. Anal. Mach. Intell., 11, 674–693. [62] Marion, J.-M. & Pumo, B. (2004). Comparison of ARH(1) and ARHD(1) models on physiological data. Ann. I.S.U.P., 48, 29–38. [63] Martin, D. E. K. (1982). Estimation of the minimal period of periodically correlated sequences. Ph. D. Thesis. University of Maryland, Maryland. [64] Mas, A. (1999). Normalité asymptotique de l’estimateur empirique de l’opérateur d’autocorrélation d’un processus ARH(1). C. R. Acad. Sci. Paris Sér. I Math., 329, 899–902. [65] Mas, A. (2000). Estimation d’opérateurs de corrélation de processus fonctionnels: lois limites, tests, déviations modérées. Ph. D. Thesis. University of Paris VI, France. [66] Mas, A. (2002). Weak convergence for the covariance operators of a Hilbertian linear process. Stochastic Process. Appl., 99, 117–135. [67] Mas, A. (2004). Consistance du prédicteur dans le modèle ARH(1): le cas compact. Ann. I.S.U.P., 48, 39–48. [68] Mas, A. (2007). Weak-convergence in the functional autoregressive model. J. Multivariate Anal., 98, 1231– 1261. 36 [69] Mas, A. & Menneteau, L. (2003a). Large and moderate deviations for infinite dimensional autoregressive processes. J. Multivariate Anal., 87, 241–260. [70] Mas, A. & Menneteau, L. (2003b). Perturbation approach applied to the asymptotic study of random operators. Progress in Probability, 55, 127–134. [71] Mas, A. & Pumo, B. (2007). The ARHD model. J. Statist. Plann. Inference, 137, 538–553. [72] Menneteau, L. (2005). Some laws of the iterated logarithm in Hilbertian autoregressive models. J. Multivariate Anal., 92, 405–425. [73] Merlevède, F. (1995). Sur l’inversibilité des processus linéaires à valeurs dans un espace de Hilbert. C. R. Acad. Sci. Paris, Sér. I, 321, 477–480. [74] Merlevède, F. (1996). Central limit theorem for linear processes with values in a Hilbert space. Stochastic Process. Appl., 65, 103–114. [75] Merlevède, F. (1997). Résultats de convergence presque sûre pour l’estimation et la prévision des processus linéaires hilbertiens. C. R. Acad. Sci. Paris, Sér. I, 324, 573–576. [76] Merlevède, F., Peligrad, M. & Utev, S. (1997). Sharp Conditions for the CLT of Linear Processes in a Hilbert Space. J. Theoret. Probab. , 10, 681–693. [77] Meyer, Y. & Coifman, R. (1997). Wavelets, Calderón-Zygmund and Multilinear Operators. Cambridge University Press, Cambridge. [78] Mokhtari, F. & Mourid, T. (2003). Prediction of continuous time autoregressive processes via the Reproducing Kernel Spaces. Stat. Inference Stoch. Process., 6, 247–266. [79] Mourid, T. (1993). Processus autorégressifs banachiques d’ordre supérieur. C. R. Acad. Sci. Paris Sér. I Math., 317, 1167–1172. [80] Mourid, T. (1996). Représentation autorégressive dans un espace de Banach de processus réels à temps continu et équivalence des lois. C. R. Acad. Sci. Paris Sér. I Math., 322 , 1219-1224. [81] Mourid, T. (2004). Processus autorégressifs hilbertiens à coefficients aléatoires. Ann. I.S.U.P., 48, 79–85. [82] Panaretos, V. M. & Tavakoli, S. (2013). Cramér-Karhunen-Loève representation and harmonic principal component analysis of functional time series. Stoch. Processes Appl., 123, 2779–2807. [83] Parvardeh, A., Mohammadi, N., Mahmoodi, S. & Soltani, A. R. (2017). First order autoregressive periodically correlated model in Banach spaces: existence and central limit theorem. J. Multivariate Anal., 449, 756–768. [84] Parzen, E. (1961). An approach to time series analysis. Ann. Math. Statist., 32, 951–989. [85] Poggi, J. M. (1994). Prévision non paramétrique de la consommation électrique. Revue de Statistique Appliquée, 42, 93–98. [86] Pumo, B. (1992). Estimation et prévision de processus autorégressifs fonctionnels. PhD thesis, Université de Paris 6, Paris. [87] Pumo, B. (1998). Prediction of continuous time processes by C[0,1] -valued autoregressive process. Stat. Inference Stoch. Process. , 1, 297–309. [88] Rachedi, F. (2005). Estimateurs cribles des processus autorégressifs Banachiques. PhD Thesis, Université Pierre et Marie Curie - Paris VI, Paris. 37 [89] Reiss, P. T. & Ogden, T. (2007). Functional principal component regression and functional partial leastsquares. J. Amer. Statist. Assoc., 102, 984–996. [90] Ruiz-Medina, M. D. (2011). Spatial autoregressive and moving average Hilbertian processes. J. Multivariate Anal., 102, 292–305. [91] Ruiz-Medina, M. D. (2012). Spatial functional prediction from spatial autoregressive Hilbertian processes. Environmetrics 23, 119–128. [92] Ruiz-Medina, M. D. & Álvarez-Liébana, J. (2017a). Classical and Bayesian componentwise predictors for non-ergodic ARH(1) processes. REVSTAT, in press. [93] Ruiz-Medina, M. D. & Álvarez-Liébana, J. (2017b). Consistent diagonal componentwise ARH(1) prediction. Submitted. [94] Soltani, A. R. & Hashemi, M. (2011). Periodically correlated autoregressive Hilbertian processes. Stat. Inference Stoch. Process., 14, 177–188. [95] Spangenberg, F. (2013). Strictly stationary solutions of ARMA equations in Banach spaces. J. Multivariate Anal., 121, 127–138. [96] Turbillon, C., Bosq, D., Marion, J. M. & Pumo, B. (2008). Estimation du paramètre des moyennes mobiles hilbertiennes. C. R. Acad. Sci. Paris Sér. I Math., 346, 347–350. [97] Wang, H.B. (2008). Nonlinear ARMA models with functional MA coefficients. J. Time Series Anal., 29, 1032–1056. 38 Supplementary Material: A review and comparative study on functional time series techniques Javier Álvarez-Liébana1 arXiv:1706.06288v1 [math.ST] 20 Jun 2017 21st June 2017 1 Department of Statistics and O.R., University of Granada, Spain. E-mail: [email protected] Summary This document provides, as Supplementary Material to the paper entitled A review and comparative study on functional time series techniques, the proof details of the propositions stated in Section 8 of the mentioned paper, as well as the auxiliary results required (see Sections S.1-S.2). Under a non-diagonal framework, Section S.3. provides a theoretical almost sure upper bound for the error in the norm of S(H) associated with the diagonal componentwise estimator of the autocorrelation operator considered in Section 8.3, when the eigenvectors of the autocovariance operator are unknown. A simulation study is undertaken in Section S.4 to illustrate the large sample behaviour of the formulated estimator in Section 8.3. Tables displaying more detailed numerical results, corresponding to Figures in Section 9, are provided in Section S.5 of the current document. S.1. Preliminaries Let H be a real separable Hilbert space, and let X = {Xn , n ∈ Z} be a zero-mean stationary ARH(1) process on the basic probability space (Ω, A, P ), satisfying: Xn = ρ (Xn−1 ) + εn , ρ ∈ L(H), kρkL(H) < 1, n ∈ Z, (1) when H-valued innovation process ε = {εn , n ∈ Z} is assumed to be SWN, and to be uncorrelated with  X0 , with σε2 = E kεn k2H < ∞, for all n ∈ Z. Under the above-setting of conditions, involved in the introduction of equation (1), X admits the following MAH(∞) representation (see Bosq, 2000): Xn = ∞ X ρk (εn−k ) , k=0 n ∈ Z, (2) that provides the unique stationary solution to equation (1). In addition, let us consider the following assumptions: 1 Assumption A1. The autocovariance operator C = E {Xn ⊗ Xn } , for every n ∈ Z, is a strictly positive and self-adjoint operator, in the trace class, with Ker (C) = {∅}. Its eigenvalues {Cj , j ≥ 1} then satisfy ∞ X j=1 Cj < ∞, C1 > . . . > Cj > Cj+1 > . . . > 0, C(f )(g) = ∞ X j=1 Cj hφj , f iH hφj , giH , ∀f, g ∈ H. (3) Assumption A2. The autocorrelation operator ρ is a self-adjoint and Hilbert-Schmidt operator, admitting the following diagonal spectral decomposition: ρ(f )(g) = ∞ X j=1 ρj hφj , f iH hφj , giH , ∞ X j=1 ρ2j < ∞, ∀f, g ∈ H, (4) where {ρj , j ≥ 1} is the system of eigenvalues of ρ, with respect to the orthonormal system {φj , j ≥ 1}. n o 4 Assumption A3. The random initial condition in (1), X0 , satisfies E kX0 kH < ∞. Under Assumptions A1-A2, the cross-covariance operator D = ρC = E {Xn ⊗ Xn+1 }, for each n ∈ Z, can be also diagonally decomposed, respect to the eigenvectors of C, providing the set of eigenvalues {Dj = ρj Cj , j ≥ 1}: D(f )(g) = ρC(f )(g) = ∞ X j=1 ρj Cj hφj , f iH hφj , giH = ∞ X j=1 Dj hφj , f iH hφj , giH , f, g ∈ H. (5) Moreover, projections of (1) into {φj , j ≥ 1} lead to the stationary zero-mean AR(1) representation, under kρkL(H) = sup |ρj | < 1: j≥1 Xn,j = ρj Xn−1,j + εn,j , Xn,j = hXn , φj iH , εn,j = hεn , φj iH , ρj ∈ R, |ρj | < 1, j ≥ 1, n ∈ Z. (6) S.1.1. Diagonal strongly-consistent estimator when the eigenvectors of C are unknown When the eigenvectors {φj , j ≥ 1} of C are known, and under Assumption A2, the following estimators of the covariance operators, based on the estimation of the eigenvalues of their spectral decomposition, will be considered, for each n ≥ 2: bn C bn D = ∞ X j=1 = ∞ X j=1 bn,j φj ⊗ φj , C b n,j φj ⊗ φj , D n−1 X bn,j = 1 C X2 , n i=0 i,j b n,j = D j ≥ 1, n−2 1 X Xi,j Xi+1,j , n − 1 i=0 (7) j ≥ 1, (8) n o bn,j , j ≥ 1 and where {φj , j ≥ 1} is the complete orthonormal eigenvectors system of C, with C n o b n,j , j ≥ 1 being the eigenvalues of operators C bn and D b n , respectively, for each n ≥ 2. D 2 Remark 1 Under definitions in equations (7)-(8), the diagonal componentwise estimator, introduced in equation (12) below, for the autocorrelation operator ρ, naturally arises, which is different from the componentwise estimator approaches based on the projection of the natural empirical covariance operators Cn and Dn , given by Cn = n−1 1X Xi ⊗ Xi , n i=0 Dn = n−2 1 X Xi ⊗ Xi+1 , n − 1 i=0 n ≥ 2, (9) into the eigenvectors {φj , j ≥ 1}, in the case where they are known. For the derivation of the subsequently results, we will also need the following assumption: 2 Assumption A4. X0,j = hX0 , φj i2H > 0, a.s., for every j ≥ 1. Remark 2 From Cauchy-Schwarz’s inequality, for any j ≥ 1 and n ≥ 2, n−2 1 X Xi,j Xi+1,j n − 1 i=0 ≤ 2 n−1 1X 2 X n i=0 i,j ! , (10) which implies, for each j ≥ 1, under Assumption A4, 1 n−1 n−2 X i=0 n−1 X 2 1 Xi,j n i=0 1 n 2 Xi,j Xi+1,j ≤ 1 n n−1 X 2 Xi,j i=0 n−1 X ! = 2 a.s. (11) 2 Xi,j i=0 From Assumption A4, let us consider the diagonal componentwise estimator of ρ ρbkn = kn X j=1 ρbn,j φj ⊗ φj , ρbn,j b n,j D n = = b n−1 Cn,j n−2 X Xi,j Xi+1,j i=0 n−1 X 2 Xi,j i=0 , j ≥ 1, n ≥ 2. (12) Remark 3 Note that, under Assumption A1, the eigenvalues of C are strictly positive, with multiplicity one, and C(H) = H, where C(H) denotes the range of C. For f, g ∈ C(H), there exist ϕ, ψ ∈ H such that f = C (ϕ) and g = C (ψ) , and the following identities hold: hf, giC(H) 2 kf kC(H) = hC −1 C (ϕ) , C −1 C (ψ)iH = hϕ, ψiH < ∞, 2 = hC −1 C (ϕ) , C −1 C (ϕ)iH = kϕkH < ∞. 2 Note that, from Parseval’s identity, for every x ∈ C(H), kxkC(H) = 3 (13) ∞ 2 X [hx, φj iH ] j=1 Cj2 < ∞. Thus, the range of C can be also defined by   C(H) = x ∈ H :  ∞ X hx, φj i2 H Cj2 j=1   <∞ .  (14) Under Assumptions A1-A4, the following proposition provides the strong-consistency, in the norm of L(H), of the estimator (12) of the autocorrelation operator, as well as of its associated ARH(1) plugin predictor, in the underlying Hilbert space. Asymptotic properties derived in Section S.2 below are required. Proposition 1 Under Assumptions A1–A4, for a truncation parameter kn < n, with lim kn = ∞, n→∞ n1/4 (ln(n)) β k (b ρkn − ρ) (Xn−1 )kH −→a.s. 0, kb ρkn − ρkL(H) −→a.s. 0, n → ∞. (15) Proof. Under Assumption A1, C(H) = H, as a set of functions. Then, for every x ∈ C(H) = H, under Assumptions A2 and A4, from Parseval’s identity and Remark 2, k(b ρkn − ρ)(x)k2H = + ≤ × " #2 kn kn ∞ X b n,j 2 X  2 X  Dj − D ρj hx, φj iH ≤ (b ρn,j − ρj ) hx, φj iH + hx, φj iH Cj j=1 j=1 j=kn #2 " kn ∞ X X bn,j  2 Cj − C ρbn,j hx, φj iH + ρj hx, φj iH Cj j=1 j=kn " # 2 2 b b sup Dj − Dn,j + 2 sup Cj − Cn,j 1≤j≤kn kn  X j=1 1≤j≤kn hx, φj iH Cj 2 + ∞ X  2 ρj hx, φj iH , a.s. (16) j=kn Thus, taking the square root in booth sides of (16), and the supremum in x ∈ H = C(H), with kxkH = 1, at the left-hand side, we obtain kb ρkn − ρkL(H) ≤ sup x∈H, kxkH =1 × " sup 1≤j≤kn 2 kn  X hx, φj i H j=1 Cj + b n,j Dj − D ∞ X  j=kn 2 + 2 sup 1≤j≤kn 2 1/2 ρj hx, φj iH  bn,j Cj − C a.s. 2 # (17) Furthermore, from Assumptions A1-A2 and Remark 3, for every x ∈ C(H) = H, lim n→∞ 2 kn  X hx, φj i H j=1 Cj = kxk2C(H) < ∞, 4 lim n→∞ ∞ X  j=kn ρj hx, φj iH 2 = 0. (18) Under Assumptions A1-A3, from Corollary 1 (see equations (48)-(49) in the Section S.2 below), as n → ∞, n1/4 (ln(n)) β sup 1≤j≤kn bn,j →a.s. 0, Cj − C n1/4 (ln(n)) β sup 1≤j≤kn b n,j →a.s. 0. Dj − D (19) Finally, from equations (17)–(19), as n → ∞, n1/4 (ln(n)) β kb ρkn − ρkL(H) →a.s. 0. (20) Strong-consistency of the associated plug-in predictor is directly derived keeping in mind that ρkn − ρkL(H) kXn−1 kH , k(b ρkn − ρ) (Xn−1 )kH ≤ kb kXn−1 kH < ∞ a.s. (21)  S.1.2. Diagonal strongly-consistent estimator when the eigenvectors of C are unknown In the case of {φj , j ≥ 1} are unknown, as is often in practice, Cn = 1 n n−1 X i=0 Xi ⊗ Xi admits a diagonal spectral decomposition in terms of {Cn,j , j ≥ 1} and {φn,j , j ≥ 1}, satisfying, for each n ≥ 2: Cn (φn,j ) Cn j ≥ 1, = Cn,j φn,j , = 1 n n−1 X i=0 Xi ⊗ Xi = Cn,1 ≥ · · · ≥ Cn,n ≥ 0 = Cn,n+1 = Cn,n+2 = . . . ∞ X j=1 Cn,j φn,j ⊗ φn,j , Cn,j = 1 n n−1 X i=0 2 ei,j X , j ≥ 1. (22) (23) ei,j = hXi , φn,j iH and φ′ = sgn hφn,j , φj i φj , for each i ∈ Z, j ≥ In the remainder, we will denote X n,j H 1 and n ≥ 2, where sgnhφn,j , φj iH = 1hφn,j ,φj iH ≥0 − 1hφn,j ,φj iH <0 . Since {φn,j , j ≥ 1} is a complete n−2 X 1 orthonormal system of eigenvectors, for each n ≥ 2, operator Dn = n−1 Xi ⊗ Xi+1 admits the i=0 following non-diagonal spectral representation: Dn = ∞ X ∞ ∞ X ∞ n−2 n−2 X X 1 X e e 1 X ∗ Xi ⊗ Xi+1 = Dn,j,l φn,j ⊗ φn,l = Xi,j Xi+1,l φn,j ⊗ φn,l , n − 1 i=0 n − 1 i=0 j=1 j=1 l=1 ∗ where Dn,j,l = hDn (φn,j ) , φn,l iH = 1 n−1 (24) l=1 n−2 X i=0 ei+1,l , for each j, l ≥ 1 and n ≥ 2. In particular, we ei,j X X ∗ will use the notation Dn,j = Dn,j,j = hDn (φn,j ) , φn,j iH . The following assumption is here deemed: Assumption A5. Cn,kn > 0 a.s, where kn is a suitable truncation parameter kn < n, with lim kn = ∞. n→∞ 5 From Assumption A5, the following diagonal componentwise estimator of ρ is outlined: ρekn = kn X j=1 ρen,j φn,j ⊗ φn,j , ρen,j n Dn,j = = Cn,j n−1 n−2 X ei+1,j ei,j X X i=0 n−1 X i=0 j ≥ 1, n ≥ 2. , e2 X i,j (25) Under Assumptions A1-A3 and A5, the strong-consistency of the diagonal componentwise estimator ρekn of ρ is reached in Proposition 2 (see auxiliary results in Section S.2 below). Proposition 2 Let kn a sequence of integers such that, for certain n e0 sufficiently large, and β > 12 , kn   1 X aj = O n1/4 (ln(n))−β , Ckn j=1   Λkn = o n1/4 (ln(n))β−1/2 , where Λkn = −1 sup (Cj − Cj+1 ) 1≤j≤kn √ √ 1 , a1 = 2 2 C1 −C and aj = 2 2 max 2 any 2 ≤ j ≤ kn . Then, under Assumptions A1-A3 and A5,   1 1 , for , Cj−1 − Cj Cj − Cj+1 k (e ρkn − ρ) (Xn−1 )kH −→a.s. 0, ke ρkn − ρkL(H) −→a.s. 0, e0 , (26) kn Ckn < 1, n ≥ n n → ∞. (27) In particular, the following upper bound can be derived: ke ρkn − ρkL(H) ≤ sup 1≤j≤kn ρen,j − kn X Dn,j Dn,j |Dn,j | + sup φn,j − φ′n,j − ρj + 2 Cj Cj C j 1≤j≤kn j=1 H + sup |ρj | . j>kn (28) Proof. Under Assumptions A1-A2 and equation (25), for every x ∈ H, ke ρkn (x) − ρ(x)kH ≤ + kn X j=1 kn X j=1 ρen,j hφn,j , xiH φn,j − ρj hφj , xiH φj − ∞ X j=1 kn X j=1 ρj hφj , xiH φj H ρj hφj , xiH φj = akn (x) + bkn (x). (29) H Clearly, under Assumption A2, lim bkn (x) = 0. Let us now study the behavior of the term akn (x). n→∞ From equations (22)-(25), and under Assumption A5, akn (x) ≤ + kn  X Dn,j j=1 kn X j=1 Cn,j − Dn,j Cj  hφn,j , xiH φn,j H kn X ′ ′ Dn,j ρj hφn,j , xiH φn,j hφn,j , xiH φn,j − Cj j=1 6 = akn ,1 (x) + akn ,2 (x), H (30) ′ ′ ′ where hφj , xiH φj = hφn,j , xiH φn,j , with, as before, φn,j = sgnhφn,j , φj iH φj , and sgnhφn,j , φj iH = 1hφn,j ,φj iH ≥0 − 1hφn,j ,φj iH <0 , for each j ≥ 1 and n ≥ 2. From equation (30), akn ,1 (x) ≤ kn X j=1 |Dn,j | kn |Cj − Cn,j | 1 X Dn,j |hφn,j , xiH | kφn,j kH ≤ kC − Cn kL(H) |hφn,j , xiH | . (31) Cn,j Cj Ckn j=1 Cn,j Thus, from Cauchy-Schwarz’s inequality, in a similar way to Remark 2, akn ,1 (x) ≤ kC − Cn kL(H)  1/2  1/2 kn ∞ 2 X X D 1  n,j   hφn,j , xi2H  2 Ckn j=1 Cn,j j=1 ≤ 2 kC − Cn kL(H) From equation (26), for n ≥ n e 0 , kn < 1 1/2 k kxkH a.s. Ckn n 1 Ckn (32) , which implies that, from Remark 4 (see Section S.2 below), ≤ akn ,1 (x) −3/2 2 kC − Cn kL(H) Ckn −1/2 kxkH < 2 kC − Cn kL(H) kxkH Ckn kn X aj a.s. (33) j=1 From condition (26), there also exists a positive real number M < ∞ and an integer n0 such that, for certain β > 1 2 and n ≥ n0 , with n0 large enough, −1/2 Ckn kn X aj < Ck−1 n kn X j=1 j=1 aj ≤ M n1/4 (ln(n)) −β . (34) 1/4 n From equations (33)-(34), for n ≥ max(e n0 , n0 ), akn ,1 (x) < 2M (ln(n)) β kC − Cn kL(H) kxkH , with kxkH < ∞, since x ∈ H. Hence, under Assumption A3, from Theorem 1 (see Section S.2 below), akn ,1 (x) →a.s. 0, n → ∞. (35) Let us see now a bound for akn ,2 (x) in (30): akn ,2 (x) ≤ + kn X Dn,j  j=1 kn X j=1 Cj  ′ hφn,j , xiH − hφn,j , xiH φn,j  ′ Dn,j ′ hφn,j , xiH φn,j − φn,j Cj 7  + H H kn  X Dn,j j=1 Cj  ′ ′ − ρj hφn,j , xiH φn,j . H (36) In a similar way to Remark 2, under Assumptions A1-A2, we get akn ,2 (x) ≤ 2 sup |Cn,j | Ck−1 n j≥1 + 2 sup |Cn,j | Ck−1 n j≥1 + sup |Dn,j − j≥1 kn X ′ hφn,j − φn,j , xiH kφn,j kH j=1 kn X ′ ′ hφn,j , xiH j=1 kn X Dj | Ck−1 n j=1 φn,j − φn,j ′ ′ hφn,j , xiH φn,j H a.s. (37) H Hence, from Cauchy-Schwarz’s inequality, akn ,2 (x) ≤ 2 sup |Cn,j | kxkH Ck−1 n j≥1 + 2 sup |Cn,j | kxkH Ck−1 n j≥1 kn X j=1 kn X ′ φn,j − φn,j ′ φn,j j=1 H ′ φn,j − φn,j H H . (38) + sup |Dn,j − Dj | kxkH Ck−1 n j≥1 Since, for n sufficiently large, from Theorem 1 under Assumption A3, Cn admits a diagonal decomposition in terms of {Cn,j , j ≥ 1}, ≤ akn ,2 (x) 4 kCn kL(H) kxkH Ck−1 n kn X j=1 ′ φn,j − φn,j a.s. + sup |Dn,j − Dj | kxkH Ck−1 n (39) a.s. aj + sup |Dn,j − Dj | kxkH Ck−1 n (40) H j≥1 From results in Bosq (2000, Lemma 4.3), akn ,2 (x) kn X ≤ 4 kCn kL(H) kxkH kCn − CkL(H) Ck−1 n j=1 j≥1 On the one hand, from equation (26), there exists a positive real number M < ∞ and an integer n0 large enough such that, for certain β > akn ,2 (x) 1 2 and n ≥ n0 , ≤ 4M kCn kL(H) kxkH kCn − CkL(H) n1/4 (ln(n)) β a.s. + sup |Dn,j − Dj | kxkH Ck−1 n On the other hand, applying Remark 4 below, with n1 large enough, for certain β > < Ck−1 Ck−1 n n kn X (41) j≥1 1 2 and n ≥ n1 , aj , (42) j=1 leading to akn ,2 (x) <   M kxkH 4 kCn kL(H) kCn − CkL(H) + sup |Dn,j − Dj | j≥1 8 n1/4 (ln(n))β a.s., (43) for certain 0 < M < ∞. Hence, since kCn kL(H) < ∞ and kxkH < ∞, from Theorem 1 and Corollary 2 below, from conditions (26) and under Assumptions A1-A3, akn ,2 (x) →a.s. 0, n → ∞. (44) Taking supremum in x ∈ H, with kxkH = 1, at the left-hand side of equation (29), from equations (30)–(44), we obtain the desired result on the almost surely convergence to zero of ke ρkn − ρkL(H) , as n → ∞. Strong-consistency of the associated plug-in predictor is obtained in analogous way as done in Proposition 1. The upper-bound in (28) can be directly obtained from bkn (x), akn ,1 (x) and akn ,2 (x), reflected in equations (29)-(30) and (36).  S.2. Asymptotic properties of the empirical eigenvalues and eigenvectors. This section presents the auxiliary results needed on the formulation of the theoretical results derived in Section S.1. The asymptotic properties of the eigenvalues involved in the spectral decomposition bn , D b n , Cn and Dn will be obtained in Corollary 1 below. Corollary 2 provides the asymptotic of C properties of the diagonal coefficients of Dn ,with respect to the eigenvectors of Cn . In the derivation of these results, the following theorem plays a crucial role (see Theorem 4.1, Corollary 4.1 and Theorem 4.8 in Bosq, 2000). Theorem 1 Under Assumption A3, for any β > 21 , as n → ∞, n1/4 (ln(n)) β n1/4 kCn − CkS(H) →a.s. 0, (ln(n)) β kDn − DkS(H) →a.s. 0, (45) and, if kX0 kH is bounded, kCn − CkS(H) = O  ln(n) n 1/2 ! a.s., kDn − DkS(H) = O  ln(n) n 1/2 ! a.s., (46) where k·kS(H) denotes the norm of the Hilbert-Schmidt operators on H. From Theorem 1, we obtain the following corollary on the asymptotic properties of the eigenvalues n o n o bn,j , j ≥ 1 and D b n,j , j ≥ 1 of C bn and D b n , respectively, as well as of the eigenvalues {Cn,j , j ≥ 1} C 9 e n,j = Dn (φen,j )(φen,j ), j ≥ 1, with, for n of the empirical estimator Cn and the diagonal coefficients D sufficiently large, e n,j φen,j , Dn (φen,j ) = D j ≥ 1. (47) Corollary 1 Under Assumptions A1-A3, the following identities hold, for any β > 12 : n1/4 (ln(n))β n1/4 (ln(n)) β bn,j − Cj sup C j≥1 b n,j − Dj sup D j≥1 ≤ ≤ n1/4 (ln(n))β n1/4 β (ln(n)) kCn − CkS(H) →a.s. 0, (48) kDn − DkS(H) →a.s. 0, (49) where, as before, {Cj , j ≥ 1} and {Dj , j ≥ 1} are the systems of eigenvalues of C and D, respectively; n o n o bn,j , j ≥ 1 and D b n,j , j ≥ 1 are given in (8). C In addition, for n sufficiently large, n1/4 (ln(n))β n1/4 (ln(n)) β sup |Cn,j − Cj | ≤ j≥1 sup Dn (φen,j )(φen,j ) − Dj j≥1 where {Cn,j , j ≥ 1} are introduced in (23), and bn , with Proof. Since C Assumptions A1-A2, n1/4 (ln(n)) ∞ X ≤ n1/4 (ln(n))β n1/4 (ln(n)) β kCn − CkS(H) →a.s. 0, (50) kDn − DkS(H) →a.s. 0, (51) n o e n,j , j ≥ 1 are given in (47). D n−1 ∞ n−1 XX 1X 2 2 bn,j = 1 C Xi,j = kXi kH , is in the trace class, then, under n n j=1 i=0 j=1 i=0 bn − CkS(H) kC β = ≤ n1/4 β (ln(n)) n sX j≥1 1/4 β (ln(n)) bn,j − Cj |2 = |C sX j,l≥1 n1/4 (ln(n)) β sX j≥1 |Cn (φk )(φl ) − δj,l Cj |2 = |Cn (φj )(φj ) − Cj |2 n1/4 (ln(n)) β kCn − CkS(H) , (52) where δj,l denotes the Kronecker delta function. From (52), applying Theorem 1 under Assumption A3, n1/4 (ln(n)) β bn,j − Cj | ≤ sup |C j≥1 n1/4 (ln(n)) β bn − CkS(H) ≤ kC n1/4 (ln(n)) β kCn − CkS(H) →a.s. 0, (53) as we wanted to prove. Equation (49) is obtained in a similar way to equation (48), under Assumptions ∞ ∞ X X bn,j a.s., b n,j ≤ 2 b n is, a.s., in the trace class, with C D A2-A3, and keeping in mind that D j=1 n1/4 (ln(n)) β b n,j − Dj | ≤ sup |D j≥1 n1/4 (ln(n)) β b n − DkS(H) ≤ kD 10 n1/4 (ln(n)) β j=1 kDn − DkS(H) →a.s. 0. From Theorem 1 and under Assumption A3 for n sufficiently large, Cn is a Hilbert-Schmidt operator, and in particular, it is a compact operator. Thus, applying Bosq (2000, Lemma 4.2) and Theorem 1, for n ≥ n0 , with n0 sufficiently large, we obtain n1/4 β (ln(n)) sup |Cn,k − Ck | ≤ k≥1 n1/4 β (ln(n)) kCn − CkL(H) ≤ n1/4 (ln(n)) kCn − CkS(H) →a.s. 0. β (54) Finally, in a similar way to the derivation of (50), equation (51) is obtained, under Assumptions A2-A3, from Theorem 1 and applying Bosq (2000, Lemma 4.2).  The following lemma, which contains some assertions from Bosq (2000, Corollary 4.3), provides information on the asymptotic properties of the empirical eigenvectors. Lemma 1 Assume that kX0 kH is bounded, and if {kn } is a sequence of integers such that Λkn =  1/2  n , as n → ∞, with o log n Λkn = sup (Cj − Cj+1 )−1 , 1≤j≤kn 1 ≤ j ≤ kn , (55) then, under Assumption A1, sup kφ′n,j − φn,j kH →a.s. 0, 1≤j≤kn n → ∞, (56) where {φ′n,j , j ≥ 1} are introduced in Section S.1.2. above. Let us now consider the following lemma to obtain the strong-consistency of {Dn,j , j ≥ 1} (see Corollary 2 below). Lemma 2 Assume that kX0 kH is bounded, and if {kn } is a sequence of integers such that Λkn =  o n1/4 (ln(n))β−1/2 , as n → ∞, where Λkn is defined in equation (55) under Assumptions A1 and A3. The following limit then holds, for any β > 1/2, n1/4 (ln(n)) β sup kφ′n,j − φn,j kH →a.s. 0, 1≤j≤kn n → ∞, (57) for any β > 1/2, where {φ′n,j , j ≥ 1} defined above. Proof. From Bosq (2000, Lemma 4.3), for any n ≥ 2 and 1 ≤ j ≤ kn , φ′n,j − φn,j H √ ≤ aj kCn − CkL(H) ≤ 2 2Λkn kCn − CkS(H) , 11 (58) which implies that P sup 1≤j≤kn kφ′n,j − φn,j kH ≥ η !   η . ≤ P kCn − CkS(H) ≥ √ 2 2Λkn (59) Thus, since kX0 kH is bounded, from Bosq (2000, Theorem 4.2), and under Assumption A3, for any η > 0, and β > 1/2, P n1/4 (ln(n)) β sup kφ′n,j − φn,j kH ≥ η 1≤j≤kn ! ≤ ≤ (ln(n)) η P kCn − CkS(H) ≥ √ 2 2Λkn n1/4   η 2 (ln(n))2β n 2   8Λkn n1/2   4 exp − β   (ln(n))  η γ1 + δ 1 √ 2 2Λkn n1/4   2 O n ! η − = β γ1 +ηδ1 1/2 ( ln(n) n ) , n → ∞. (60) Thus, taking η 2 > γ1 + δ1 η, sequence (60) is summable, and applying Borel-Cantelli Lemma we arrive to the desired result.  Corollary 2 Under the conditions of Lemma 2, considering now Assumptions A1-A3, for β > 1 2, and n sufficiently large, n1/4 (ln(n)) sup |Dn,j − Dj | →a.s. 0, β j≥1 n → ∞, (61) where {Dn,j , j ≥ 1} are defined in equation (25). Proof. From Theorem 1, under Assumption A3, there exists an n0 such that for n ≥ n0 , Dn is a Hilbert-Schmidt operator. Then, for n ≥ n0 , for every j ≥ 1, applying orthonormality of the empirical eigenvectors {φn,j , j ≥ 1}, under Assumptions A1-A2, n1/4 (ln(n)) β |Dn,j − Dj | = n1/4 β (ln(n)) n 1/4 |Dn (φn,j )(φn,j ) − Dn (φn,j )(φj ) + Dn (φn,j )(φj ) −D(φn,j )(φj ) + D(φn,j )(φj ) − D(φj )(φj )| [kDn (φn,j )kH kφn,j − φj kH + k(Dn − D)(φn,j )kH kφj kH β (ln(n)) +kD(φn,j − φj )kH kφj kH ] 1/4  n ≤ kDn kL(H) kφn,j − φj kH + kDn − DkL(H) β (ln(n))  +kDkL(H) kφn,j − φj kH . (62) ≤ 12 From Theorem 1, under Assumption A3, n1/4 (ln(n)) β kDn − DkL(H) ≤ n1/4 (ln(n)) β kDn − DkS(H) →a.s. 0, (63) and, for n sufficiently large, kDn kL(H) < ∞. Furthermore, from Lemma 2 (see equation (57)), n1/4 (ln(n)) β sup kφn,j − φj kH →a.s. 0. (64) 1≤j≤kn Hence, from equations (63)-(64), taking the supremum in j at the left-hand side of equation (62), we obtain equation (61).  Remark 4 Let us now consider the sequence {aj , j ≥ 1} given by √ a1 = 2 2 1 , C1 − C2 √ aj = 2 2 max  1 1 , Cj−1 − Cj Cj − Cj+1  , j ≥ 2, If Cj > Cj+1 , when 1 ≤ j ≤ kn , hence aj > 0 for any 1 ≤ j ≤ kn , and then akn < (65) kn X aj , for a j=1 truncation parameter lim kn = ∞, with kn < n. Moreover, there exists an integer j0 large enough such n→∞ that, for any j ≥ j0 , aj > 1. In particular, if kn is large enough, k n X 1 1 aj , < akn < < Ckn Ckn − Ckn +1 j=1 kn X aj > 1. (66) j=1 S.3. One-sided upper a.s. asymptotic estimate of the S(H) norm of the error associated with ρekn In this section, ρ does not admit a diagonal spectral decomposition in terms of the eigenvectors of C, being ρ not positive, nor trace operator, but it is a Hilbert-Schmidt operator. In this more general framework, an asymptotically almost surely one-sided upper estimate of the S(H) norm of the error associated with ρbkn is derived. See Ruiz-Medina & Álvarez-Liébana (2017b), where sufficient conditions for the strong-consistency, in the trace norm, of the autocorrelation operator of an ARH(1) process, when it is a positive trace operator which does not admit a diagonal spectral decomposition, are provided. Proposition 3 Let us assume that ρ is a Hilbert-Schmidt, but not positive nor trace operator. Under Assumption A5, and conditions imposed in Lemma 2, ke ρkn − 2 ρkS(H) ≤ 2 kρkS(H) − ∞ X 2 (ρ (φj ) (φj )) = j=1 2 ∞  X D (φj ) (φk ) j6=k 13 Cj < ∞. (67) In particular, for n sufficiently large, 2 ke ρkn − ρkS(H) ≤ 2 ∞  X Dn (φn,j )(φn,k ) a.s. Cn,j j6=k (68) Proof. Let us consider the eigenvectors {φn,j , j ≥ 1} of Cn . Applying Parseval’s identity, we obtain 2 ke ρkn − ρkS(H) ρkn − ρ)k1 = = k(e ρkn − ρ)∗ (e = ∞ X j=1 k(e ρkn − ρ)(φn,j )k2H = ∞ X h(e ρkn j=1 ∞ X ∞ X j=1 k=1  − ρ)(φn,j ), (e ρkn − ρ)(φn,j )iH he ρkn (φn,j ), φn,k iH − hρ(φn,j ), φn,k iH ∞ X ∞ ∞ X ∞ X 2 X   2 = he ρkn (φn,j ), φn,k iH + hρ(φn,j ), φn,k iH j=1 k=1 − + = + ∞ X ∞ X j=1 k=1 ∞ X ∞ X 2 he ρkn (φn,j ), φn,k iH hρ(φn,j ), φn,k iH ≤ [ DC −1 (φn,j ), φn,k H ]2 − 2 kn ∞ X X ∞ X   DC −1 (φn,j ), φn,k DC −1 (φn,j ), φn,k j6=k H H 2 2 = ∞ X j=1 kn ∞ X X −1 2 δj,k [Dn,j Cn,j ] j=1 k=1 −1 δj,k Dn,j Cn,j C −1 (φn,j ), D∗ (φn,k ) H j=1 k=1 −1 2 −1 [Dn,j Cn,j ] − 2Dn,j Cn,j DC −1 (φn,j ), φn,j j6=k + j=1 k=1 j=1 k=1 ∞ X j=1 ∞ X 2 H + ∞ X  DC −1 (φn,j ), φn,j H j=1 2 −1 [Dn,j Cn,j − DC −1 (φn,j )(φn,j )]2 , (69) where δj,k denotes the Kronecker delta function, and k·k1 represents the trace operator norm. From Theorem 1, under Assumption A3, kDn Cn−1 − DC −1 kS(H) = kDn Cn−1 − DCn−1 + DCn−1 − DC −1 kS(H) ≤ kDn Cn−1 − DCn−1 kS(H) + kDCn−1 − DC −1 kS(H) = k(Dn − D)Cn−1 kS(H) + kD(Cn−1 − C −1 )kS(H) , (70) leading to lim n→∞ ∞ X j=1 −1 − DC −1 (φn,j )(φn,j )]2 = 0 a.s. [Dn,j Cn,j 14 (71) From equations (69) and (71), and from Lemma 2, lim ke ρkn − ρk2S(H) n→∞ = = ρkn − ρ)k1 = lim lim k(e ρkn − ρ)∗ (e lim n→∞ − ≤ n→∞ n→∞ ∞ X j6=k ∞ X j6=k lim n→∞  ∞ X  DC −1 (φn,j ), φn,k j6=k H 2 DC −1 (φn,j )(φn,k ) − DC −1 (φn,j )(φk ) + DC −1 (φn,j )(φk ) 2 DC −1 (φj )(φk ) + DC −1 (φj )(φk ) ∞ X  j6=k kDC −1 (φn,j )kH kφn,k − φk kH ∞ 2 X +kDC −1 kL(H) kφn,j − φj kH + DC −1 (φj )(φk ) = [DC −1 (φj )(φk )]2 j6=k ≤ kρk2S(H) a.s (72) Therefore, when ρ is not positive, nor trace operator, but it is Hilbert-Schmidt operator, the norm of the error associated with ρekn , in the space of Hilbert-Schmidt operators, is a.s. asymptotically upper bounded by the following quantity: kρk2S(H) − ∞ X 2 [ρ(φj )(φj )] = j=1 2 ∞  X D(φj )(φk ) j6=k Cj < ∞. (73) Equation (73) can be approximated by the empirical quantity: 2 ∞  X Dn (φn,j )(φn,k ) Cn,j j6=k . Thus, for n sufficiently large, ke ρkn − 2 ρkS(H) ≤ 2 ∞  X Dn (φn,j )(φn,k ) Cn,j j6=k a.s. (74)  S.4. Simulation study: large-sample behavior of ρekn when eigenvectors of C are unknown A brief simulation study is undertaken to illustrate the theoretical results on the strong-consistency of the formulated diagonal componentwise estimator of ρ in Section 8.3 of the main paper, when {φj , j ≥ 1} are unknown and a Gaussian diagonal data generation is achieved. An almost sure rate of convergence 15 is fitted as well. The zero-mean Gaussian ARH(1) process X generated here has covariance operator C given by C(f )(g) = ∞ X j=1 Cj hφj , f iH hφj , giH , φj (x) = r 2 sin b−a  πjx b−a  f, g ∈ H = L2 ((a, b)), x ∈ (a, b). , (75) In the remaining, we fix (a, b) = (0, 4) and, under Assumption A1, Cj = c1 j −δ1 , being c1 a positive constant, for any j ≥ 1. Different rates of convergence to zero of the eigenvalues of C are studied, corresponding to the values of the shape parameter δ1 ∈ (1, 2). In a diagonal context, autocorrelation operator and covariance operator of the error term are approximated as follows, for M = 50: ρ (X) (t) ≃ M X j=1 ρj,j hφj , XiH φj (t), Cε (X) (t) ≃ M X j=1 2 hφj , XiH φj (t), σj,j (76) 2 = Cj (1 − ρj,j ), for any j ≥ 1, being δ2 ∈ (1/2, 2), and c2 a constant which where ρj,j = c2 j −δ2 and σj,j belongs to [0, 1]. Thus, ρ is a diagonal self-adjoint Hilbert-Schmidt operator, with kρkL(H) = sup |ρj | < 1, j≥1 under Assumption A2. Simulations are then performed under Assumptions A1–A3 and A5, and the empirical version of the upper-bound derived in (28) is considered: U B (kn , l) = sup 1≤j≤kn ρeln,j − kn l l l X Dn,j Dn,j Dn,j + sup − ρj + 2 Cj Cj Cj 1≤j≤kn j=1 φln,j − φ′,l n,j H + sup |ρj | , (77) j>kn for kn = ⌈ln(n)⌉, for which conditions in Proposition 2 are held (see Example 8.6 in Bosq, 2000). In equation (77), superscript l denotes the estimator computed based on the lth generation of the values e l = hX l , φl i, for l = 1, . . . , N , j = 1, . . . , kn and i = 0, . . . , n − 1. Here, N = 500 realizations X i,j i n,j have been generated, with shape parameters δ1 = 61/60, 3/2, 9/5 and δ2 = 11/10. Discretization step ∆t = 0.06 has been adopted. For sample sizes nt = 35000 + 40000 (t − 1) , t = 1, . . . , 10, E (kn , nt , β) = N X l=1 1(ξn t ! (U B (kn , l)) /N, ,β ,∞) β ξnt ,β = (ln(nt )) 1/3 nt , (78) values are reflected in Table 1, in which the curve ξnt ,95/100 is fitted as the almost sure rate of convergence. In equation (78), 1(ξn ,β ,∞) denotes the indicator function over the interval (ξnt ,β , ∞). t 16 Table 1: E (kn , nt , β) values defined in (78), for β = 95/100 and N = 500 realizations, with δ2 = 11/10, and δ1 = 61/60, 3/2, 9/5, considering nt = 35000 + 40000(t − 1), t = 1, . . . , 10, and kn = ⌈ln(n)⌉. nt kn δ1 = 61/60 δ1 = 3/2 δ1 = 9/5 35000 10 33 500 28 500 20 500 75000 11 19 500 15 500 11 500 115000 11 10 500 8 500 5 500 155000 11 4 500 3 500 2 500 195000 12 5 500 4 500 2 500 235000 12 3 500 1 500 1 500 275000 12 3 500 0 0 315000 12 0 1 500 0 355000 12 1 500 0 0 395000 12 0 0 0 The convergence to zero of the empirical mean of kb ρkn − ρkL(H) is numerically illustrated in Figure 1 below, which displays the empirical mean of values U B (kn , l), against the curve ξnt ,95/100 , for each l = 1, . . . , N realizations, with N = 500 and kn = ⌈ln(n)⌉. 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 0.5 1 1.5 2 2.5 3 3.5 4 ×10 5 Figure 1: Empirical mean of U B (kn , l), for l = 1, . . . , N , with N = 500, δ2 = 11/10, nt = 15000 + 20000(t − 1), t = 1, . . . , 20, and kn = ⌈ln(n)⌉. Shape parameters δ1 = 61/60, 3/2, 9/5 are considered (blue diamond, red β t )) , with β = 95/100, is also drawn star and yellow circle dotted lines, respectively). The curve ξnt ,β = (ln(n 1/3 nt (green dotted line). A theoretical almost sure rate of convergence for the diagonal componentwise estimator ρekn has not been derived in Proposition 2. However, when a diagonal data generation is performed, under different rates of convergence to zero of the eigenvalues of C, the curve ξnt ,95/100 = (ln(n))95/100 n1/3 is numerically fitted, when large samples sizes are considered. As expected, for the largest shape parameter value δ1 , 17 corresponding to the fastest decay velocity of the eigenvalues of the autocovariance operator, we obtain the fastest convergence to zero of ke ρkn − ρkL(H) . From results displayed in Figure 1, the empirical mean of the upper bound in (77), computed from N = 500 realizations, is showed that can be upper bounded by the curve ξnt ,95/100 = (ln(n))95/100 , n1/3 for the parameters adopted. S.5. Comparative study: numerical results Tables 4-6 and 9-14 of this section reflect, in more detail, the numerical results obtained in the comparative study performed in Section 9, where a summary of such results is displayed in Figures 2-7. Details about the comparative study, and about which conditions are held under any scenario for each approach considered, can be found in the referred Section 9. As remarked at the beginning of Section 9, the ARH(1) diagonal componentwise plug-in predictor established in Section 8.3 will be only considered under diagonal scenarios. Strong-consistency results for the estimator ρekn , in the trace norm, when ρ is a positive and trace operator, which does not admit a diagonalization in terms of the eigenvectors of C, have been recently provided in Ruiz-Medina & Álvarez-Liébana (2017b). The large-sample behaviour of the empirical-eigenvector-based componentwise plug-in predictor formulated in Section 8, as well as those ones in Bosq (2000) and Guillas (2001), will be firstly displayed in Tables 4-6. For sample sizes nt = 35000 + 40000 (t − 1) , t = 1, . . . , 10, the following values are computed F (kn , nt , β) = N X 1(ξn l=1 ) t ,β ,∞  ρ− ρlkn  l Xn−1  kn H  ! /N, being ξnt ,β the curve which numerically fits the almost sure rate of convergence of (79) ρ − ρlkn When the data is generated in the diagonal framework ρ − ρlkn  l Xn−1  kn H v u uZ u =t a b   kn X j=1 l ρj Xn−1,j φj (t) − kn X j=1  2  l Xn−1 l φln,j (t) dt, ρln,j Xn−1  kn . H (80)  l is computed, being ρlkn Xn−1 the corresponding predictors, for any j = 1, . . . , kn , and based on the lth e l = hX l , φl iH , for l = 1, . . . , N , with N = 500 realizations. The following generation of the values X i,j i n,j scenarios will be considered, when the diagonal data generation is assumed: 18 Table 2: Diagonal scenarios considered (see Table 4 below), with δ2 = 11/10, nt = 35000 + 40000(t − 1), t = 1, . . . , 10, and ξnt ,β = (ln(nt ))β 1/2 nt , for β = 65/100. Scenario δ1 kn 1 3/2 ⌈ln(n)⌉ 2 24/10 ⌈ln(n)⌉ 3 3/2 ⌈e′ n1/(8δ1 +2) ⌉, e′ = 17/10 4 24/10 ⌈e′ n1/(8δ1 +2) ⌉, e′ = 17/10 In the case of pseudo-diagonal and non-diagonal frameworks, the following truncated norm is then computed: ρ − ρlkn  l Xn−1  kn H v u uZ u =t a b   Z a b   kn X j,k=1  ρj,k φj (t)φk (s) ds − kn X j=1  2 l φln,j (t) dt. ρln,j Xn−1 (81) Pseudo-diagonal and non-diagonal scenarios are outlined as follows: Table 3: Pseudo-diagonal and non-diagonal scenarios considered (see Tables 5-6 below), with δ2 = 11/10, nt = 35000 + 40000(t − 1), t = 1, . . . , 10, and ξnt ,β = (ln(nt ))β 1/3 nt . Pseudo-diagonal scenarios Non-diagonal scenarios Scenario δ1 kn β Scenario δ1 kn β 5 3/2 ⌈ln(n)⌉ 3/10 9 3/2 ⌈ln(n)⌉ 125/100 6 24/10 ⌈ln(n)⌉ 3/10 10 24/10 ⌈ln(n)⌉ 125/100 7 3/2 ⌈(17/10)n1/(8δ1 +2) ⌉ 3/10 11 3/2 ⌈(17/10)n1/(8δ1 +2) ⌉ 125/100 8 24/10 ⌈(17/10)n1/(8δ1 +2) ⌉ 3/10 12 24/10 ⌈(17/10)n1/(8δ1 +2) ⌉ 125/100 19 Table 4: F (kn , nt , β) values in (79)-(80), for scenarios 1-4. O.A. denotes the approach detailed in Section 8; B denotes the approach in Bosq (2000); G denotes the approach in Guillas (2001). Scenario 1 Scenario 2 Scenario 3 nt kn O.A. B G O.A. B G kn O.A. 35000 10 11 500 68 500 70 500 4 500 24 500 28 500 3 75000 11 9 500 62 500 66 500 3 500 18 500 25 500 115000 11 6 500 59 500 62 500 3 500 16 500 155000 11 4 500 57 500 60 500 2 500 195000 12 6 500 60 500 64 500 235000 12 4 500 58 500 275000 12 3 500 315000 12 355000 395000 Scenario 4 B G kn O.A. B G 13 500 12 500 10 500 2 7 500 7 500 4 500 3 9 500 9 500 6 500 2 4 500 3 500 2 500 22 500 3 6 500 5 500 5 500 2 3 500 3 500 2 500 12 500 19 500 3 5 500 4 500 4 500 2 3 500 2 500 1 500 4 500 15 500 21 500 4 6 500 4 500 3 500 3 4 500 2 500 1 500 61 500 0 14 500 17 500 4 4 500 3 500 2 500 3 2 500 1 500 1 500 51 500 58 500 0 13 500 16 500 4 3 500 2 500 1 500 3 2 500 1 500 0 3 500 50 500 55 500 1 500 12 500 14 500 4 2 500 1 500 1 500 3 1 500 0 0 12 2 500 47 500 53 500 0 12 500 13 500 4 2 500 1 500 0 3 1 500 0 0 12 2 500 44 500 51 500 0 11 500 13 500 4 2 500 0 0 3 1 500 0 0 Table 5: F (kn , nt , β) values in (79) and (81), for scenarios 5-8. B denotes the approach in Bosq (2000); G denotes the approach in Guillas (2001). Scenario 5 Scenario 6 Scenario 7 Scenario 8 nt kn B G kn B G kn B G kn B G 35000 10 32 500 33 500 10 25 500 29 500 3 28 500 26 500 2 27 500 24 500 75000 11 29 500 31 500 11 21 500 23 500 3 26 500 24 500 2 22 500 19 500 115000 11 26 500 28 500 11 18 500 20 500 3 23 500 21 500 2 18 500 15 500 155000 11 24 500 26 500 11 14 500 17 500 3 19 500 17 500 2 16 500 12 500 195000 12 19 500 21 500 12 10 500 13 500 4 14 500 12 500 3 11 500 9 500 235000 12 16 500 16 500 12 12 500 14 500 4 15 500 10 500 3 13 500 10 500 275000 12 12 500 13 500 10 8 500 10 500 4 9 500 7 500 3 7 500 6 500 315000 12 9 500 15 500 12 5 500 7 500 4 5 500 4 500 3 4 500 3 500 355000 12 8 500 11 500 12 3 500 5 500 4 3 500 3 500 3 2 500 2 500 395000 12 6 500 9 500 12 3 500 5 500 4 2 500 1 500 3 1 500 0 20 Table 6: F (kn , nt , β) values in (79) and (81), for scenarios 9-12. B denotes the approach in Bosq (2000); G denotes the approach in Guillas (2001). Scenario 9 Scenario 10 Scenario 11 Scenario 12 nt kn B G kn B G kn B G kn B G 35000 10 67 500 71 500 10 59 500 62 500 3 55 500 47 500 2 44 500 40 500 75000 11 44 500 50 500 11 38 500 45 500 3 36 500 31 500 2 34 500 30 500 115000 11 47 500 52 500 11 32 500 40 500 3 30 500 21 500 2 27 500 20 500 155000 11 51 500 55 500 11 27 500 34 500 3 27 500 25 500 2 23 500 17 500 195000 12 39 500 44 500 12 22 500 29 500 4 21 500 14 500 3 16 500 13 500 235000 12 40 500 42 500 12 29 500 33 500 4 18 500 16 500 3 12 500 9 500 275000 12 35 500 37 500 12 24 500 28 500 4 19 500 13 500 3 9 500 5 500 315000 12 24 500 28 500 12 17 500 19 500 4 11 500 8 500 3 6 500 3 500 355000 12 21 500 25 500 12 12 500 15 500 4 7 500 4 500 3 5 500 2 500 395000 12 18 500 21 500 12 9 500 12 500 4 6 500 3 500 3 4 500 2 500 ρ − ρlkn The rate of convergence of the empirical mean of  l Xn−1  kn , H for l = 1, . . . , N , with N = 500 realizations, can be also numerically fitted (see Figures 2-4 below). 0.025 0.025 0.02 0.02 0.015 0.015 0.01 0.01 0.005 0.005 0 0 0 0.5 1 1.5 2 2.5 3 3.5 4 ×10 0 5 0.5 1 1.5 2 2.5 3 3.5 4 ×10 kn 5 l ρ − ρlkn Xn−1 , for scenario 1 (on left) and scenario 3 (on right), for H our approach (blue star dotted line) and those one presented in Bosq (2000) (red circle dotted line) and Guillas Figure 2: Empirical mean of   (2001) (black diamond dotted line). The curve ξnt ,β = (ln(nt ))β 21 1/2 nt , with β = 65/100, is drawn (green dotted line). 0.07 0.07 0.06 0.06 0.05 0.05 0.04 0.04 0.03 0.03 0.02 0.02 0.01 0 0.01 0.5 1 1.5 2 2.5 3 3.5 0 0 4 0.5 1 1.5 2 2.5 3 3.5 5 x 10 4 5 x 10 kn l ρ − ρlkn Xn−1 , for scenario 5 (on left) and scenario 7 (on right), for H approaches presented in Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The  Figure 3: Empirical mean of curve ξnt ,β = (ln(nt ))β 1/3 nt  , with β = 3/10, is drawn (green dotted line). 0.65 0.55 0.6 0.5 0.55 0.45 0.5 0.4 0.45 0.35 0.4 0.3 0.35 0.25 0.3 0.25 0 0.5 1 1.5 2 2.5 3 3.5 0.2 0 4 0.5 1 1.5 2 2.5 3 5 x 10 ρlkn Figure 4: Empirical mean of l Xn−1   3.5 4 5 x 10 kn ρ− , for scenario 9 (on left) and scenario 11 (on right), for H approaches presented in Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The β t )) curve ξnt ,β = (ln(n1/3 , with β = 125/100, is drawn (green dotted line). nt When approaches formulated in Antoniadis & Sapatinas (2003) and Besse et al. (2000) are included, smaller sample sizes must be considered due to computational limitations. Hence, a small-sample comparative study is shown in Tables 9-14. The following alternative norm replaces the norm reflected in (80)-(81), for values F (kn , nt , β), when approaches in Besse et al. (2000) are compared: ρ − ρlkn  l Xn−1  H = s Z a b  2  l l (t) dt, ρ Xn−1 (t) − ρlkn Xn−1 Hence, the following diagonal scenarios are regarded: 22 l = 1, . . . , N. (82) Table 7: Diagonal scenarios considered (see Tables 9-10 below), with M = 50, q = 10, δ2 = 11/10, nt = 750 + 500(t − 1), t = 1, . . . , 13, and ξnt ,β = (ln(nt ))β 1/2 nt , β = 65/100. Scenario δ1 kn hn 13 3/2 ⌈ln(n)⌉ 0.15, 0.25 14 24/10 ⌈ln(n)⌉ 0.15, 0.25 15 3/2 16 24/10 1/α ⌈n ⌉, α = 6.5 ⌈n1/α ⌉, α = 10 Remark that, since both approaches formulated in Besse et al. (2000) not depend on the truncation parameter kn adopted, we only performed them for scenarios 13 and 14, where different decay rates are considered. Pseudo-diagonal and non-diagonal scenarios are detailed as follows: Table 8: Pseudo-diagonal and non-diagonal scenarios considered (see Tables 11-14 below), with δ2 = 11/10, β t )) . nt = 750 + 500(t − 1), t = 1, . . . , 13, and ξnt ,β = (ln(n 1/3 nt Pseudo-diagonal scenarios Non-diagonal scenarios Scenario δ1 kn β hn Scenario δ1 kn β hn 17 3/2 ⌈ln(n)⌉ 3/10 1.2, 1.7 21 3/2 ⌈ln(n)⌉ 125/100 1.2, 1.7 18 24/10 ⌈ln(n)⌉ 3/10 1.2, 1.7 22 24/10 ⌈ln(n)⌉ 125/100 1.2, 1.7 19 3/2 20 24/10 1/α ⌈n ⌉, α = 6.5 3/10 23 3/2 ⌈n1/α ⌉, α = 10 3/10 24 24/10 23 1/α ⌈n ⌉ 125/100 ⌈n1/α ⌉ 125/100 Table 9: F (kn , nt , β) values in (79)-(80), for scenarios 13-16. O.A., B, G and AS denote the approaches detailed in Section 8, Bosq (2000), Guillas (2001) and Antoniadis & Sapatinas (2003), respectively. Scenario 13 Scenario 14 G AS O.A. B Scenario 15 G AS nt kn O.A. B kn O.A. B G AS 750 6 42 500 83 500 90 500 84 500 31 500 76 500 79 500 72 500 2 30 500 33 500 34 500 21 500 1 19 500 24 500 24 500 14 500 1250 7 28 500 74 500 88 500 76 500 29 500 74 500 78 500 76 500 2 27 500 29 500 30 500 20 500 2 17 500 21 500 22 500 13 500 1750 7 27 500 70 500 84 500 75 500 28 500 71 500 73 500 70 500 2 25 500 25 500 27 500 17 500 2 16 500 19 500 21 500 11 500 2250 7 26 500 66 500 81 500 71 500 25 500 68 500 67 500 65 500 3 24 500 23 500 26 500 15 500 2 13 500 17 500 20 500 9 500 2750 7 28 500 68 500 82 500 70 500 24 500 63 500 62 500 59 500 3 21 500 21 500 26 500 12 500 2 12 500 15 500 18 500 8 500 3250 8 25 500 66 500 76 500 72 500 21 500 58 500 59 500 55 500 3 20 500 20 500 25 500 10 500 2 10 500 14 500 17 500 7 500 3750 8 23 500 60 500 72 500 72 500 21 500 53 500 54 500 54 500 3 17 500 18 500 24 500 9 500 2 9 500 11 500 14 500 7 500 4250 8 23 500 59 500 70 500 71 500 20 500 49 500 51 500 48 500 3 14 500 16 500 18 500 9 500 2 8 500 10 500 11 500 6 500 4750 8 21 500 56 500 67 500 69 500 18 500 47 500 49 500 45 500 3 13 500 13 500 15 500 8 500 2 7 500 8 500 9 500 5 500 5250 8 18 500 55 500 65 500 68 500 15 500 47 500 48 500 44 500 3 12 500 10 500 13 500 8 500 2 7 500 7 500 7 500 3 500 5750 8 20 500 58 500 66 500 68 500 16 500 45 500 50 500 47 500 3 11 500 9 500 11 500 7 500 2 6 500 7 500 6 500 2 500 6250 8 16 500 57 500 62 500 67 500 11 500 42 500 47 500 52 500 3 9 500 8 500 10 500 7 500 2 5 500 5 500 5 500 2 500 6750 8 14 500 54 500 59 500 67 500 9 500 41 500 45 500 42 500 3 7 500 8 500 8 500 6 500 2 3 500 4 500 4 500 0 24 kn O.A. B Scenario 16 G AS Table 10: F (kn , nt , β) values in (79) and (82), for scenarios 13-14. B0.15 and B0.25 denotes the kernel-based approach in Besse et al. (2000), for hn = 0.15, 0.25, respectively. Bq denotes its penalized prediction approach. Scenario 13 Scenario 14 nt B0.15 B0.25 Bq B0.15 B0.25 Bq 750 85 500 88 500 6 500 76 500 80 500 3 500 1250 80 500 79 500 6 500 75 500 73 500 3 500 1750 76 500 71 500 5 500 73 500 67 500 2 500 2250 78 500 60 500 4 500 72 500 57 500 3 500 2750 73 500 57 500 4 500 70 500 53 500 3 500 3250 75 500 53 500 2 500 67 500 51 500 2 500 3750 70 500 49 500 2 500 67 500 43 500 1 500 4250 72 500 44 500 1 500 65 500 41 500 0 4750 68 500 39 500 3 500 63 500 38 500 1 500 5250 65 500 496 500 3 500 62 500 33 500 2 500 5750 62 500 34 500 2 500 60 500 31 500 2 500 6250 60 500 33 500 3 500 60 500 28 500 1 500 6750 59 500 33 500 3 500 57 500 24 500 1 500 25 Table 11: F (kn , nt , β) values in (79) and (81), for scenarios 17-20. B and G denote the approaches in Bosq (2000) and Guillas (2001), respectively; AS denotes the approach in Antoniadis & Sapatinas (2003). Scenario 17 G AS Scenario 18 kn B G AS Scenario 19 nt kn B G AS 750 6 135 500 146 500 176 500 6 123 500 129 500 180 500 2 62 500 48 500 41 500 1 50 500 39 500 38 500 1250 7 124 500 130 500 166 500 7 117 500 120 500 175 500 2 60 500 42 500 37 500 2 47 500 36 500 33 500 1750 7 113 500 122 500 159 500 7 104 500 110 500 168 500 2 53 500 36 500 34 500 2 41 500 30 500 31 500 2250 7 89 500 115 500 153 500 7 86 500 91 500 164 500 3 49 500 31 500 29 500 2 35 500 28 500 30 500 2750 7 80 500 100 500 133 500 7 76 500 83 500 149 500 3 44 500 28 500 27 500 2 32 500 28 500 28 500 3250 8 99 500 104 500 139 500 8 71 500 78 500 153 500 3 40 500 26 500 26 500 2 27 500 27 500 25 500 3750 8 67 500 78 500 136 500 8 62 500 67 500 142 500 3 35 500 24 500 25 500 2 24 500 26 500 23 500 4250 8 65 500 74 500 129 500 8 60 500 63 500 133 500 3 30 500 23 500 22 500 2 22 500 22 500 19 500 4750 8 61 500 63 500 127 500 8 55 500 60 500 126 500 3 28 500 19 500 20 500 2 20 500 16 500 13 500 5250 8 48 500 51 500 125 500 8 46 500 49 500 122 500 3 25 500 17 500 16 500 2 17 500 12 500 10 500 5750 8 4 500 49 500 122 500 8 39 500 42 500 113 500 3 20 500 14 500 13 500 2 15 500 7 500 5 500 6250 8 38 500 45 500 118 500 8 33 500 35 500 108 500 3 19 500 13 500 10 500 2 13 500 7 500 3 500 6750 8 36 500 40 500 114 500 8 29 500 31 500 101 500 3 13 500 12 500 9 500 2 10 500 8 500 3 500 26 kn B G AS Scenario 20 kn B Table 12: F (kn , nt , β) values in (79) and (82), for scenarios 17-18. B1.2 and B1.7 denotes the kernel-based approach in Besse et al. (2000), for hn = 1.2, 1.7, respectively. Bq denotes its penalized prediction approach. Scenario 17 Scenario 18 nt B1.2 B1.7 Bq B1.2 B1.7 Bq 750 174 500 233 500 18 500 167 500 180 500 10 500 1250 158 500 214 500 10 500 151 500 169 500 7 500 1750 149 500 199 500 9 500 133 500 155 500 6 500 2250 146 500 185 500 7 500 130 500 146 500 4 500 2750 131 500 190 500 6 500 127 500 140 500 3 500 3250 129 500 193 500 5 500 119 500 135 500 3 500 3750 125 500 162 500 6 500 115 500 130 500 4 500 4250 138 500 160 500 4 500 109 500 121 500 2 500 4750 133 500 162 500 2 500 108 500 117 500 2 500 5250 120 500 154 500 1 500 107 500 114 500 1 500 5750 118 500 156 500 2 500 104 500 111 500 1 500 6250 116 500 144 500 1 500 99 500 103 500 0 6750 111 500 135 500 0 94 500 100 500 0 27 Table 13: F (kn , nt , β) values in (79) and (81), for scenarios 21-24. B and G denote the approaches in Bosq (2000) and Guillas (2001), resp.; AS denotes the approach in Antoniadis & Sapatinas (2003). Scenario 21 G AS Scenario 22 kn B G AS Scenario 23 nt kn B G AS 750 6 86 500 90 500 88 500 6 80 500 84 500 83 500 2 73 500 66 500 75 500 1 55 500 42 500 60 500 1250 7 81 500 84 500 86 500 7 78 500 81 500 85 500 2 69 500 64 500 71 500 2 48 500 39 500 51 500 1750 7 77 500 80 500 85 500 7 73 500 87 500 86 500 2 64 500 60 500 70 500 2 46 500 32 500 50 500 2250 7 73 500 77 500 86 500 7 68 500 72 500 84 500 3 59 500 56 500 63 500 2 41 500 31 500 46 500 2750 7 70 500 73 500 83 500 7 55 500 70 500 80 500 3 50 500 54 500 55 500 2 37 500 27 500 45 500 3250 8 65 500 68 500 82 500 8 47 500 60 500 78 500 3 47 500 50 500 51 500 2 35 500 25 500 41 500 3750 8 54 500 59 500 80 500 8 43 500 53 500 75 500 3 45 500 43 500 48 500 2 31 500 24 500 37 500 4250 8 51 500 57 500 77 500 8 39 500 46 500 72 500 3 42 500 38 500 40 500 2 27 500 21 500 35 500 4750 8 45 500 51 500 79 500 8 37 500 41 500 73 500 3 35 500 33 500 38 500 2 23 500 17 500 32 500 5250 8 40 500 49 500 73 500 8 33 500 36 500 72 500 3 37 500 35 500 41 500 2 24 500 19 500 34 500 5750 8 38 500 43 500 74 500 8 32 500 34 500 59 500 3 33 500 32 500 37 500 2 19 500 13 500 29 500 6250 8 34 500 37 500 70 500 8 27 500 30 500 69 500 3 30 500 30 500 36 500 2 16 500 10 500 25 500 6750 8 30 500 33 500 68 500 8 25 500 29 500 66 500 3 29 500 25 500 35 500 2 12 500 9 500 21 500 28 kn B G AS Scenario 24 kn B Table 14: F (kn , nt , β) values in (79) and (82), for scenarios 21-22. B1.2 and B1.7 denotes the kernel-based approach in Besse et al. (2000), for hn = 1.2, 1.7, respectively. Bq denotes its penalized prediction approach. Scenario 21 Scenario 22 nt B1.2 B1.7 Bq B1.2 B1.7 Bq 750 449 500 281 500 7 500 377 500 222 500 5 500 1250 434 500 225 500 5 500 355 500 209 500 4 500 1750 436 500 164 500 5 500 330 500 196 500 4 500 2250 426 500 142 500 4 500 309 500 162 500 3 500 2750 422 500 123 500 3 500 292 500 130 500 3 500 3250 417 500 105 500 3 500 281 500 107 500 2 500 3750 376 500 97 500 3 500 269 500 83 500 2 500 4250 358 500 80 500 2 500 252 500 72 500 1 500 4750 345 500 71 500 1 500 241 500 69 500 0 5250 313 500 61 500 0 230 500 56 500 1 500 5750 262 500 55 500 1 500 215 500 45 500 1 500 6250 240 500 52 500 1 500 203 500 37 500 0 6750 230 500 46 500 0 195 500 32 500 0 As above, the empirical mean of ρ − ρlkn  l Xn−1  kn , H for l = 1, . . . , N , with N = 500 realizations, for small-sample scenarios considered, will be illustrated in Figures 5-7 below. 0.14 0.14 0.12 0.12 0.1 0.1 0.08 0.08 0.06 0.06 0.04 0.04 0.02 0 0 1000 2000 3000 4000 5000 6000 0.02 0 7000 1000 2000 3000 4000 5000 6000 kn 7000 l l ρ − ρlkn Xn−1 and ρ − ρlkn Xn−1 , for scenario 13 (on left) and H H scenario 15 (on right), for our approach (blue star dotted line) and those one presented in Antoniadis and Sapatinas (2001) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 0.15 and hn = 0.25, respectively), Bosq (2000) (red circle dotted line) and Guillas (2001) (black Figure 5: Empirical mean of diamond dotted line). The curve ξnt ,β =   (ln(nt ))β 1/2 nt   , with β = 65/100, is drawn (light green dotted line). 29 0.7 0.28 0.26 0.6 0.24 0.5 0.22 0.2 0.4 0.18 0.3 0.16 0.14 0.2 0.12 0.1 0.1 0 0 1000 2000 3000 4000 5000 6000 0.08 0 7000 1000 2000 3000 4000 5000 6000 7000 kn l l ρ − ρlkn Xn−1 and ρ − ρlkn Xn−1 , for scenario 17 (on left) and H H scenario 19 (on right), for approaches presented in Antoniadis & Sapatinas (2003) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 1.2 and hn = 1.7, respectively), β t )) Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = (ln(n , 1/3  Figure 6: Empirical mean of    nt with β = 3/10, is drawn (light green dotted line). 1.6 1.2 1.4 1.1 1.2 1 1 0.9 0.8 0.8 0.6 0.7 0.4 0.6 0.2 0 1000 2000 3000 4000 Figure 7: Empirical mean of 5000 6000 ρlkn  l Xn−1 0.5 0 7000 1000 ρlkn  2000  l Xn−1 3000  4000 5000 6000 7000 kn ρ− and ρ − , for scenario 21 (on left) and H H scenario 23 (on right), for approaches presented in Antoniadis & Sapatinas (2003) (pink square dotted line), Besse et al. (2000) (cyan blue plus dotted line for penalized prediction; dark green upward-pointing triangle and purple downward-pointing triangle dotted lines, for kernel-based prediction, for hn = 1.2 and hn = 1.7, respectively), β t )) Bosq (2000) (red circle dotted line) and Guillas (2001) (black diamond dotted line). The curve ξnt ,β = (ln(n , 1/3 nt with β = 125/100, is drawn (light green dotted line). Results displayed in Tables 4-6 and 9-14, and Figures 2-7, are discussed in Section 9 of the main paper. Acknowledgments This work has been supported in part by project MTM2015–71839–P (co-funded by Feder funds), of the DGI, MINECO, Spain. 30 References [1] Antoniadis, A. & Sapatinas, T. (2003). Wavelet methods for continuous-time prediction using Hilbert-valued autoregressive processes. J. Multivariate Anal., 87, 133–158. [2] Besse, P. C., Cardot, H. & Stephenson, D. B. (2000). Autoregressive forecasting of some functional climatic variations. Scand. J. Stat., 27, 673–687. [3] Bosq, D. (2000). Linear Processes in Function Spaces. Springer, New York. [4] Guillas, S. (2001). Rates of convergence of autocorrelation estimates for autoregressive Hilbertian processes. Statist. Probab. Lett., 55, 281–291. [5] Ruiz-Medina, M. D. & Álvarez-Liébana, J. (2017b). Consistent diagonal componentwise ARH(1) prediction. Submitted. 31
10math.ST
Market based embedded Real Time Operation for Distributed Resources and Flexibility Bertrand Travacca, Greg Rybka, Kenji Shiraishi May 5, 2017 arXiv:1802.08929v1 [cs.SY] 24 Feb 2018 1 Abstract We build upon previous work out of UC Berkeley’s energy, controls, and applications laboratory (eCal) that developed a model for price prediction of the energy day-ahead market (DAM) and a stochastic load scheduling for distributed energy resources (DER) with DAM based objective [3]. In similar fashion to the work of Travacca et al., in this project we take the standpoint of a DER aggregator pooling a large number of electricity consumers - each of which have an electric vehicle and solar PV panels - to bid their pooled energy resources into the electricity markets. The primary contribution of this project is the optimization of an aggregated load schedule for participation in the California Independent System Operator (CAISO) real time (15-minute) electricity market. The goal of the aggregator is to optimally manage its pool of resources, particularly the flexible resources, in order to minimize its cost in the real time market. We achieves this through the use of a model predictive control scheme. A critical difference between the prior work in [3] is that the structure of the optimization problem is drastically different. Based upon our review of the current and public literature, no similar approaches exist. The main objective of this project were building methods. Nevertheless, to illustrate a simulation with 100 prosumers was realized. The results should therefore be taken with a grain of salt. We find that the Real Time operation does not substantially decrease or increase the total cost the aggregator faces in the RT market, but this is probably due to parameters that need further tuning and data, that need better processing. 2 2.1 Introduction Motivation and background As a global leader in climate change policy, California has one of the highest renewable energy target in the world; 50% of electricity supply will be from renewable electricity sources (RES) by 2030. 1 Most of the RES that California uses are variable and intermittent such as wind and solar power. The need to ramp up or ramp down controllable, often non-renewable, generation sources due to the variability of the RES is a current and increasing challenge for power system operators and policy makers. Historically, supply-side resources have followed the load. Load, in general, has been considered to be inelastic, as the prices that are observed by retail customers do not correspond to 1 In early 2017, California Senate leader Kevin de León put forth a bill that would mandate the State to use 100% renewable power by 2045. So this issue of addressing intermittent resources is unlikely to be resolved through lower legislated goals, but rather increased goals only tightening existing system constraints. 1 wholesale electricity prices. With the increase in variable supply resources there is increasing interest in the use of demand-side resources to participate in the wholesale markets as a mechanism to resolve some of the supply-demand imbalances that could otherwise occur. In this context, both demand response and energy storage are considered possible mitigating measures and technologies that can provide flexibility to the grid. This helps to address problems associated with the famous ”duck curve” and the power ramping problem in the late afternoon. The potential net benefits of the use of demand response and energy storage have not been well studied based on real data. The California Independent System Operator (CAISO) operates three distinct markets, a day-ahead market, real-time market, and ancillary services. Ancillary services, such as congestion revenue rights and convergence bidding, is also a set of markets that the ISO operates though they will not be addressed in this analysis. The day-ahead market (DAM) has three separate processes. The first is to assess whether the bidders may be able to exert market power, the second is to forecast the level of supply needed to meet the demand, finally the additional plants that must be ready to generate are determined. Bids and schedules can be submitted up to seven days in advance, but the market closes at noon the day before and the results are distributed at 1pm. As a part of this market, bilateral trading occurs weeks in advance. These are then scheduled at noon, prior to the ISO publishing the results of the optimization being run. About 70% of energy in CAISO goes through the market as self schedule or as a price taker. The real-time market (RTM) offers an opportunity for the CAISO to procure supply closer to when the demand occurs, thus the forecast is less uncertain. The market opens at 1pm the day prior to the trading day (i.e. after the DAM results are published) and closes 75 minutes prior to each trading hour, with the results being distributed 45 minutes prior to the hour. The dispatch occurs in 15 and 5 minute intervals, depending on the plant. 2.2 Relevant Literature A growing body of literature addresses optimal plug-in electric vehicles (PEV) population charging and residential demand response [1], [2], [5], [6], [7]. Within the literature that we examined, we found studies that explored either optimization in the DAM, the RTM, or TOU (Time-of Use scheduling). Market bidding strategies and market uncertainty for aggregated PEVs have been studied in several research groups and results can be found in the following publications: [10], [11], [12]. These studies analyzed both bidding in the DAM and RTM separately. In this paper, we construct a tailored optimization method for real time operation of electricity resources in the Real Time Market using our aggregated resources. It is important to note, that it is no longer simple scheduling as in [3]. 2.3 Notation and Nomenclature For (x, y) ∈ Rd , < x, y >= xT y refers to the euclidean scalar product of x and y, k.k22 refers to the corresponding euclidean norm. x ≤ y refers to element-wise inequality. denotes the d element-wise vector product (a.k.a hadamard product). For a vector v ∈ R , v(a : b) ∈ Rb−a+1 , with a and b integers, denotes the vector consisting of the vj , j ∈ {a, ...b}. 2 The following notation is used in this paper. Uppercase letters refer to variables with units of power (kW ) while lower case letters refer to variables with units of energy (kW h). Symbol xt refers to the value taken by variable x at time t. In the absence of the exponent we will consider the variable x as a vector ∈ R24 . Symbol xi refers to a local variable i ∈ {1, ...N }. Finally, x (respectively x) refers to an upper (lower) bound of the variable x. For more clarity, current decision variables are highlighted in orange. Table 1: Nomenclature N Number of prosumers ∆t Time-step for Real Time Market: 15 min T Time-Horizon (hours) TH Model Predictive Control Time-Horizon (hours) λDA , λRT respectively DA and RT risk aversion parameters All of the following variables are ∈ RT pDA Day-Ahead Market price Li Uncontrollable residential load of prosumer i Si Solar PV production of prosumer i EVi Day Ahead Charging rate of PEV i Gi Day Ahead Power imported from the grid for prosumer i All of the following variables are ∈ R4T pRT Real-Time Market price ∆EVi Real Time Charging rate of PEV i deviation from DA schedule ∆Gi Real Time Power imported from the grid for prosumer i deviation from DA schedule CDA DA covariance matrix for DAM price prediction error, ∈ RT ×T CRT RT covariance matrix for RTM price prediction error, ∈ R4TH ×4TH PN PN We also introduce the following aggregated variables: G = Gi , EV = i=1 i=1 EVi , PN PN ∆G = i=1 ∆Gi , ∆EV = i=1 ∆EVi , keeping in mind that all of these variables are ∈ RT . These equalities will be considered as constraints in the following optimization schemes. 3 3 Technical Description We do not present results from the Day Ahead Market in CAISO in this report, for more information on results from that market it is recommended to refer to [3]. 3.1 Description of the Real Time Market in CAISO The real-time market in California (CAISO) has multiple market instruments in which generators can participate. There are three types of generators: (1) internal generators, ones that operate inside of the CAISO balancing area (BA) authority; (2) import and export generators, those that produce power in the BA but for use outside of the BA or those that produce power outside the BA but for use inside the BA; and, (3) dynamic resources, those generators located outside the BA that have telemetry and controls for power delivery inside the BA. The two time periods that are of most relevance are the 15-minute market and the 5-minute market. Supply-side bids are submitted, at the latest, 75 minutes prior to the start Trading Hour (T-75). For each hour there are four bids submitted, one for each 15-minute period. For generators that are able to participate in the 5-minute market (i.e. generators internal to the BA and dynamic resources)2 , the bids that are submitted for the 15-minute period will apply to the 5-minute periods within that same time period. So a generator will provide four bids per hour and there will be three prices for each bid, thus 12 prices per hour. The two real-time markets (i.e. 15-minute and the 5-minute) operate with the use of separate optimizations. The market prices are published 45 minutes and 22.5 minutes prior to close of the 15-minute and 5-minute markets, respectively. Those prices are published on a rolling basis, so for each 15 or 5 minute period it is 45 minutes and 22.5 minutes prior to the start of that trading period. It is important to note that real time markets can be positive and negative, but on average, we should expect: E(pRT ) = pDA . Nevertheless, in practice we observe, E(pRT ) ∼ 0.93pDA . Based on conversations with CAISO management, this is explained by some renewable generators schedule their production in real time which has a tendency to lower prices (because they have zero marginal cost). Since not all resources participate in both the DAM and RTM, there being a price difference is not surprising especially considering that the many of the low cost renewable resources are self scheduled and participate only in the RTM. Nevertheless, while empirically there exists a price difference between the two markets, we can discard this by considering the following conditions to be true for any given time period: • pRT > pDA ⇒ electricity System is Short: day ahead supplied schedule is lower than real time demand. • pRT < pDA ⇒ electricity System is Long: too much supply was scheduled compared to real time demand The prices are received through a program called the California Market Results Interface. Figure 3 displays the Real Time Market timeline. Two hours are depicted (hour h and hour h+1) for illustrative purposes to indicate that the the bids are rolling. For both hours, the 2 With the introduction of the Energy Imbalance Market (EIM), there are now generators that participate in the real-time market that are located outside of CAISO, i.e. type 2 generators and type 3 generators. The majority of these generators can only submit bids for the 15-minute market (type 2 generators), but a subset also participates in the 5-minute market (type 3 generators). 4 day-ahead market bids are shown with dotted lines and labeled as ”DAM Bid”. The real-time (15-minute) bids are submitted at T-75 and the results are published at T-45. Those bids, which were accepted are then depicted with solid lines. The difference, ∆, between the DAM and RTM is also shown. Figure 1: Graphical Depiction of the Real Time Market Process 3.2 Market Hypothesis Only the 15 min market interval will be considered in this project. Note that the Smart Meters in California allow to give information every 30 min. Therefore, it is already uncertain how the settlement will be made with CAISO (i.e. proof that what was said to be consumed and produced was indeed). While there is a good likelihood that CAISO does require its own metering system, separate from Smart Meters, to participate in the markets in order to verify performance before any settlement. In any case, this would not fundamentally alter the methodology taken in this project, as an aggregator would want to optimize both the 15-minute market and the 5-minute markets provided it can participate it both. 3.3 Relation between the DAM and the Real Time Market At first, it seems to be a good idea to create an interaction between the Real time Market and the DAM. Indeed, as an aggregator, one can increase their revenue by predicting what is going to happen in the real time market. This consists in betting on the fact that the CAISO forecast of CAISO demand is either short or long for a given hour. Nevertheless we argue that in the CAISO market, doing so is the role of Virtual Bidding. Virtual bids must be virtual, i.e. not associated with physical bids, and the practice of using physical assets to make virtual bids is 5 forbidden by CAISO. Therefore, we argue that the DAM and the real time market optimization should, or must, be independent: the real time market must take the results of the DAM as an exogenous input. This does not mean that the real time market does not give insight into the way to deal with the DAM. On the contrary, it can help to tune parameters and understand which constraints are important and should be kept in the DAM scheduling optimization. Moreover, doing so with physical assets would consists in exerting Market Power. All bids are assessed for whether market power is being exerted, whether intentional or not, through a Market Power Mitigation (MPM) process. The MPM occurs prior to the optimization. In the case that bids are deemed to be an exertion of market power, then those bids are rejected and the optimization is run without those bids. 3.4 Price prediction and estimation of covariance matrix As shown in Figure 2, price fluctuation of the RTM (right figure) is much larger than that of the DAM (left figure). The DAM price was always between 0 USD/MWh and 100 USD/MWh throughout the year. In contrast, the RTM price spikes relatively frequently and went up to 1,000 USD/MWh and down to -150 USD/MWh. Figure 2: Comparison of price fluctuations between the Day-ahead Market and the Real-time Market In the RTM, generation capacity tends to be constrained and supply curve (Short-term Marginal Cost: STMC) of electricity becomes more vertical (more inelastic). As a result, a small change in demand could cause price spikes in either a positive and a negative direction. Such situations are shown in Figure 3. The figure on the left shows a change where the supply is relatively elastic and thus the price difference between PRT and PDA is small. In contrast to the figure on the right, where the demand moves from the elastic portion of the supply curve to the inelastic portion of the supply curve and the price difference between the DAM and RTM spikes. Nevertheless, all the questions are not answered as for now: as the price in RT are 7% lower on average, it does seem to be a good idea for an aggregator to buy in RT only. 6 Figure 3: Mechanism of price fluctuation in the RTM This price fluctuation of the RTM price poses a challenge in price prediction and also requires caution in dealing with the prediction uncertainty in the following step. In the stochastic optimization, we not only minimize the cost but also incorporate the uncertainty of the price prediction in the objective function. We estimate the covariance matrix that represents the uncertainty of the prediction. We used random forest regression to predict both the DAM and RTM prices. For the DAM price prediction, we used year, date, and hour as features (regressors). In addition to these features for the real-time forecast we use, DAM demand forecast, DAM prices, and RTM demand forecast, and operating intervals (0 min, 15 min, 30 min, and 45 min). We assumed multivariate normal distribution around the expected price both for RTM and DAM price prediction: p∼N (p̂, C) Zero mean, normally distributed prediction error in day d is denoted as d ∈ R24 . Mean squared error is then denoted as: 1 Nd Σ k T N k=1 k It revealed to be difficult to produce an online prediction model for RTM prices, therefore we kept a ’static’ one for RTM prediction. For coherence we did the same for DAM price prediction. We used the same data that we train to predict (which is not the best thing to do in practice, because it leads to over fitting, nevertheless random forest is usually doing good at avoiding that). As a consequence, the prediction we get can be seen as the best prediction we could probably get in practice: for DAM prediction we get a RMSE of 2$ whereas we get 15$ RMSE for the RTM. Given electricity price data, we can estimate the concave precision matrix using classic maximum likelihood estimation. This covariance matrices represent price prediction uncertainty and is used as an input for the following stochastic optimization model to incorporate risk aversion characteristics. We incorporate risk management using the classic Markovitz Portfolio Optimization setting (cf. following section). Note: we used Python to create this prediction model MSE = 7 Figure 4: Covariance matrix Heatmap for DA market, ∈ RT timesT 3.5 Figure 5: Covariance matrix Heatmpap for RT market, ∈ RTH timesTH Day-Ahead Market and Real-Time Market Optimization Objectives JDA and JRT denote the DA and RT objectives respectively. The choice of the quantity G or ∆G can be considered as a portfolio problem where the assets is the flexibility, the returns are the DAM prices, and the budget constraint is the flexibility constraints [4]. The choice of the portfolio G involves a trade-off between the expected price and the corresponding variance. For the Day-Ahead: DA Risk JDAM = z }| { λDA T + G CDA G 2 pTDA G | {z } (1) DA total cost Now, for the RT at hour h, with no penalties for deviations increasing system shortness or longness, similarly: RT Risk h JRT z }| { λRT T T = pRT (h : h + 4TH − 1) ∆G + ∆G CRT ∆G | {z } 2 (2) RT total cost If the objective function for DAM is easy to understand, the Real Time objective is a little more subtle (erratum with respect to the presentation given in class, mistake that nevertheless inspired what will follow ). Let us take a concrete example to understand why (2) is the right objective function. This example is worked out in table 2. 8 Table 2: Why this cost function for RTM? ∆G = +1M W ≥ 0 ∆G = −1M W ≤ 0 pRT = 40 > pDA = 30$/M W (SYSTEM SHORT) ∆G increases the strain on the system. The aggregator has to pay for this extra quantity at RT market price: 30 $/MW. Had this extra demand been scheduled in the DA, the cost would have been 10 $/MW lower ∆G decreases the strain on the system. The aggregator is paid as if it was providing 1MW of power supply: $40. Had this demand reduction been included in the DA, the aggregator would have had a cost $10 higher pRT = 20 < pDA = 30$/M W (SYSTEM LONG) ∆G decreases the strain on the system. The aggregator has to pay for this extra quantity at RT market price: 30 $/MW. Had this extra demand been scheduled in the DA, the cost would have been 10 $/MW higher ∆G increases the strain on the system. The aggregator is paid as if it was providing 1MW of power supply: $20. Had this demand reduction been included in the DA, the aggregator would have had a $10 lower cost pRT = −10 > pDA = 30$/M W (SYSTEM ULTRA LONG) ∆G decreases the strain on the system. The aggregator is paid for extra quantity at RT market price: -30 $/MW! Had this extra demand been scheduled in the DA, the cost would have been 40 $/MW higher ∆G increases the strain on the system. The aggregator has to pay as if was providing 1MW of power supply: $40. Had this demand reduction been included in the DA, the aggregator would have had a cost $40 lower! Let us stop being ’california-centric’ for a minute. In Germany and the UK, the aggregator would have to face constant imbalance prices. Let δ+ be the positive imbalance price and δ− be the negative imbalance price: the aggregator is paid δ+ for beneficial deviations (e.g. system long and ∆G ≥ 0) and has to pay δ− for bad deviation (e.g. system long and ∆G ≤ 0). In the UK, the Imbalance market is symmetric (i.e. δ− = δ+ ), whereas in Germany δ+ < δ− . Let us introduce this specificities in our Real-Time objective function for which there are four cases to consider: 1) System Short and ∆G ≥ 0: Imbalance Cost1 = δ− sgn(pRT − pDA ) + 1 2 max{∆G, 0} sgn(pRT − pDA ) + 1 2 max{−∆G, 0} sgn(pRT − pDA ) − 1 2 max{∆G, 0} sgn(pRT − pDA ) − 1 2 max{−∆G, 0} 2) System Short and ∆G ≤ 0: Imbalance Cost2 = −δ+ 3) System Long and ∆G ≥ 0 Imbalance Cost3 = δ+ 4) System Long and ∆G ≤ 0 Imbalance Cost4 = −δ− 9 To wrap ones mind around these formulas, reading the worked out example from table 2 is useful. We add all of these imbalance costs (1-4) to the RT objective function described by equation (2). The new objective function is still convex (but is no longer quadratic convex), indeed X ∈ Rd → max(X, 0) is a convex function, and convexity is preserved trough affine composition: X ∈ Rd → max(CX + D, 0) is convex, with C, D matrices of appropriate sizes. There is nevertheless a way to transform the objective to make it a QP as described in the presentation, but we find this approach more elegant as it does not require to add new decision variables to the problem and deal with a quadratic non convex equality constraint (although we can show that it can be removed). 3.6 Local Model for Prosumers Here we only display the local model for the real time model. The DAM model is thoroughly described in [3], or can be understood regardless with what follows. Let i ∈ {1, ...N }. We denote EVi∗ and G∗i the optimal schedules from DA. In the real time optimization, these variables are considered as exogenous inputs. 3.6.1 Local Power Balance The power balance (3) establishes the link between the control variables ∆EVi and ∆Gi . Li + EVi∗ + ∆EVi = Si + G∗i + ∆Gi 3.6.2 (3) Local Grid Constraints At any given node in the distribution network, there is a limit on power import or export (4). Typically, for residential customers, Gi ' 10 kW . Gi ≤ G∗i + ∆Gi ≤ Gi 3.6.3 (4) Local PEV constraints Here, a model equivalent to the one developed in [14] is used. The PEV dynamics and state of energy constraints can be summarized as follow: ev i ≤ ∆tA · (EVi∗ + ∆EVi ) ≤ ev i (5) With A, trigonal inferior matrix with ones. For more information please refer to [3]. Finally, the PEVs charging power constraint is given by (6). EV i ≤ EVi∗ + ∆EVi ≤ EV i (6) t Note that when the PEV is un-plugged at a given time t ∈ {1, ...T }, then EV ti = EV i = 0 is required. For the purpose of conciseness, the set of local constraints (3), (4), (5) and (6) are hereby referred to as locali . 3.7 Model Predictive Control Scheme Scheme for Real-Time Operation Note: as stated by Michael C.Grant, one of the creators of CVX, it is not possible to impose an initial guess onto CVX. Therefore creating our own solver in the future is of particular interest (or using quadprog in Matlab). We can see here the limitations to CVX. 10 Algorithm 1 Model Predictive Control 1: Initialization: No warm start possible with CVX 2: for h from 1 to T do: do h ∆EV ∗ , ∆G∗ = argmin JRT (∆EV, ∆G, ∆EVi , ∆Gi ) s.t. locali Only implement the decision for the first hour: ∆EV ∗ = ∆EV ∗ (1 : 4), ∆G∗ = ∆G∗ (1 : 4), etc. 3: End For 4 Data For price prediction and covariance matrix estimation, we collected CAISO’s DAM (hourly) and RTM (15 minutes) price and demand forecast data in PG&E area from January 2013 to March 2017. For stochastic optimization, we used high resolution data in San Francisco. We used mobility data from 2,000 full electric vehicle’s in the bay area. A single solar PV generation data was generated using PVsim (SunPower). The load was modeled taking aggregate load data from CAISO in the PG&E region and adding random noise to it to create heterogeneity between prosumers (idem for prosumer PV production). Most of the data was concatenated in the same CSV file using R. 5 Simulation and Results Note: the code can be made available upon request (Python program, Matlab scripts and files, R program for data cleaning) We used Matlab to illustrate our method and theory. Given the time frame, it was difficult to realize more than a one day simulation: the main reason is the fact that the way the constraint bounds (eq. 6) are generated from data is complex, and it was tailored for one day simulations only. Nevertheless, this one day simulation allows us to see the behavior of our scheduling and real time operation method. We made a simulation for 100 prosumers, the parameters that were chosen for this simulation are provided in table 3. Table 3: Parameter Values N 100 TH 3 hours G 10 kW η 90% (charging efficiency) delta− , delta+ 0 λDA , λRT 1 11 Figure 6: Local uncontrollable load consumptions (black curves), Average (red dashed curve) Figure 7: Local solar PV production (black curves), Average solar PV production (red dashed curve) Figure 8: Aggregated uncontrollable load consumption and solar production: difference between RT and DA Figure 9: Real-Time prices for the chosen day of simulation 12 Figure 10: DA Schedule and RT operation results: G∗ , black dashed curve, ∆G∗ solid black dashed curve, EV ∗ red dashed curve and ∆EV ∗ solid red curve First, figures 6 and 7 provide a visualization of the average uncontrollable load and PV production as well as the heterogeneity inside the pool for DA (i.e. 1 hour time step). Figure 8 provides a visualization of the difference between the DA and RT aggregated load an PV production. This difference is only known in the RT operation process. Finally, Figure 9 shows the real time price for the day. The results are provided in figure 10. This figure shows the difference between the schedules and real time operation. In the DA we predict that our clearing price will be $68.7 for the next day. In reality, when the DA market clears, the aggregator realizes that its cost will be $71.1. In the RTM, the total supplementary cost over the day is $0.30. This means that the aggregator is not able to leverage any value in the RT market. Nevertheless, our scheme gives us a way to do real time operation over our pool. It is difficult to determine what costs the aggregator would incur for its real time operation without this scheme, moreover the price spike only appears for 15 min. Based on our simulations, the aggregator does not take advantage of this price surge. This is due to the fact that our MPC horizon is too small and there is no available flexibility by the time we reach spike time (around operating interval 70). When the risk aversion parameter for Real Time λRT is set to zero, the total cost is -$0.90, which means the aggregator leveraged the RTM to reduce its cost. Nevertheless, based on the simulation, the aggregator is still not able to take advantage of the surge price. 6 Summary and Future Works This project involved advancing existing research, through developing a forecast model for the day-ahead market and real-time markets using random forest regression technique (although 13 not the primary objective), we then propose a two-step method for managing a pool of prosumers with local production and flexibility. In a first step, the aggregator schedules its total load to CAISO, and in a second step, the aggregator operates the pool in the RTM using a Model Predictive Control Technique to decide how it should deviate from the DAM schedule. A lot of effort was put in producing a model and a method to tackle scheduling and operations for DERs and flexibility. Nevertheless, a large number of questions remain unanswered and a lot is yet to be done. First, an online prediction should be built. If random forest regression performs well for DAM price prediction, it does not seem to be the case for RT. We should dive into the vast literature of real-time surge pricing in RT market. Second, we need to produce some simulations for several days to be able to tune parameters (e.g. risk aversion and time horizon). Third, we need to test the method we developed for European real-time imbalance markets. We concede that this list is far from being exhaustive. References [1] Zhi Chen, Lei Wu, Yong Fu. ”Real-Time Price-Based Demand Response Management for Residential Appliances via Stochastic Optimization and Robust Optimization,” IEEE transactions on smart grid, vol. 3, no. 4, pp. 1822-1831. [2] Juan M. Lujano-Rojasa, Cláudio Monteirob, Rodolfo Dufo-Lópeza, José L. Bernal-Agustı́n. ”Optimum residential load management strategy for real time pricing (RTP) demand response programs,” Energy Policy, vol. 45, 671–679. [3] Bertrand Travacca, Jiacheng Wu, Sangjae Bae, Scott Moura. [Unpublished ]Stochastic Dayahead Load Scheduling for Aggregated Distributed Energy Resources. Tech. UC Berkeley: n.p., 2017. [4] Boyd, Stephen, and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004. [5] K. Clement, E. Haesen and J. Driesen, ’”Coordinated charging of multiple plug-in hybrid electric vehicles in residential distribution grids,”, pp. 1-7. [6] E. Sortomme, M.M. Hindi, S.J. MacPherson and S. Venkata, ’”Coordinated charging of plug-in hybrid electric vehicles to minimize distribution system losses,” IEEE transactions on smart grid, vol. 2, no. 1, pp. 198-205. [7] C. Le Floch, F. Di Meglio and S. Moura, ’”Optimal charging of vehicle-to-grid fleets via pde aggregation techniques,”, pp. 3285-3291. [8] C. Le Floch, F. Belletti and S. Moura, ’”Optimal Charging of Electric Vehicles for Load Shaping: A Dual-Splitting Framework With Explicit Convergence Bounds,” IEEE Transactions on Transportation Electrification, vol. 2, no. 2, pp. 190-199. [9] P. Richardson, D. Flynn and A. Keane, ’”Local versus centralized charging strategies for electric vehicles in low voltage distribution systems,” IEEE Transactions on Smart Grid, vol. 3, no. 2, pp. 1020-1028. [10] S.I. Vagropoulos and A.G. Bakirtzis, ’”Optimal bidding strategy for electric vehicle aggregators in electricity markets,” IEEE Trans.Power Syst., vol. 28, no. 4, pp. 4031-4041. 14 [11] M.G. Vayá and G. Andersson, ’”Optimal bidding strategy of a plug-in electric vehicle aggregator in day-ahead electricity markets under uncertainty,” IEEE Trans.Power Syst., vol. 30, no. 5, pp. 2375-2385. [12] R.J. Bessa, M.A. Matos, F.J. Soares and J.A.P. Lopes, ’”Optimized bidding of a EV aggregation agent in the electricity market,” IEEE Transactions on Smart Grid, vol. 3, no. 1, pp. 443-452. [13] Meyn, Sean, et al. ”Ancillary service to the grid from deferrable loads: The case for intelligent pool pumps in Florida.” 52nd IEEE Conference on Decision and Control. IEEE, 2013. [14] H. Zhang, Z. Hu, Z. Xu and Y. Song, ’”Evaluation of Achievable Vehicle-to-Grid Capacity Using Aggregate PEV Model,” IEEE Trans.Power Syst., vol. 32, no. 1, pp. 784-794. 15
3cs.SY
ITEP/TH-33/17 IITP/TH-20/17 HOMFLY for twist knots and exclusive Racah matrices in representation [333] A.Morozov ITEP, Moscow 117218, Russia Institute for Information Transmission Problems, Moscow 127994, Russia National Research Nuclear University MEPhI, Moscow 115409, Russia arXiv:1711.09277v2 [hep-th] 29 Nov 2017 ABSTRACT Next step is reported in the program of Racah matrices extraction from the differential expansion of HOMFLY polynomials for twist knots: from the double-column rectangular representations R = [rr] to a triple-column and triple-hook R = [333]. The main [21] new phenomenon is the deviation of the particular coefficient f[332] from the corresponding skew dimension, what opens a way to further generalizations. 1 Introduction Calculation of Racah matrices is the long-standing, difficult and challenging problem in theoretical physics [1]. It is further obscured by the basis-dependence of the answer in the case of generic representations, but this ”multiplicity problem” is absent in the case of rectangular representations. The modern way [2]- [7] to evaluate R , the most important ”exclusive” matrices S̄µν     S̄ (R ⊗ R̄) ⊗ R −→ R −→ R ⊗ (R̄ ⊗ R) −→ R is based on the combination of two very different expressions for R-colored HOMFLY polynomials [8] of the double-braid knots, coming one from the arborescent calculus of [9] and another from the differential expansion theory [10–12] in the case of rectangular R = [rs ] with s columns of length r: p X X Dµ Dν R m n χ∗ (N + r)χ∗λ (N − s) X fλµ fλν (m,n) n = HR (1) S̄µν Λµ Λν = · χ∗λtr (r)χ∗λ (s) · {q}2|λ| · λ · Λm µ Λν (1) dR χ∗λ (N )2 F µ,ν⊂R λ⊂R ❲ µ,ν∈λ 2n ❆ ❑❆ ✁ ✁ ✕ ☛✁ ✁ ❆ ❆❯ ... ❍✟ 2m .. . ✟❍ ❥❍ ✯✟❍ ✟ 1 ✗ λ Here the sums go over sub-diagrams of the Young diagram R, and χ∗ (N ) denote the corresponding dimensions k } for the algebra slN , i.e. the values of Schur functions χ{pk } at the topological locus pk = p∗k = {A with {qk } −1 N {x} = x − x and A = q . The other ingredients of the formula come from the evolution method [11, 13] applied to the family of twist knots (double braids with n = 1): as functions of the ”evolution parameter” m knot polynomials are then decomposed into sums of representation µ ∈ R ⊗ R̄ (which for rectangular R can be labeled by sub-diagrams of the R itself) with dimensions Dµ , and m-dependence is then provided by m-th power of the ”eigenvalue” Λµ of the R-matrix, a q-power of the Casimir or cut-and-join operator [13]. In arborescent calculus the weights are made from the elements of Racah matrix S̄ while in the theory of differential expansions they are composed into amusing generating functions [11] X µ cλ (m) fλ (q, A) · Λm (2) Fλ (q, A) = Q µ α−β } (α,β)∈λ {A q µ⊂λ with fλ∅ = 1. Each term in the sum has a non-trivial denominator, however the full sum is a Laurent polynomial in A and q for all m. Moreover, it vanishes for m = 0 (unknot), equals one for m = −1 (figure eight knot 41 ) and is a monomial at m = 1 (trefoil). According to [3] and [5] the F -functions are best described in a peculiar hook parametrization of Young diagrams: a 3-hook Young diagram (a1 , b1 |a2 , b2 |a3 , b3 ) = [a1 + 1, a2 + 2, a3 + 3, 3b3 , 2b2 −b3 −1 , 1b1 −b2 −1 ] a1 a2 of the size a1 + a2 + a3 + b1 + b2 + b3 + 3 a3 b3 b2 b1 In particular, Λµ = Λ(i1 ,j1 |i2 ,j2 |...) = Y (A · q ik −jk )2(ik +jk +1) (3) k=1 the overall coefficients cλ = c(a1 ,b1 |a2 ,b2 |...) = Y k=1 (A · q ak −bk 2 )(ak +bk +1) (4) and (−1) Fλ = 1, (0) Fλ = δλ,∅ , (1) Fλ P = (−) k (ak +bk +1) c2λ (5) Clearly, cλ drops away from the r.h.s. of (1). The shape of the coefficients fλµ strongly depends on the number of hooks in λ and µ. Currently they are fully known for λ = (a1 , b1 |a2 , 0) – what is enough to get the Racah matrices S̄ for the case R = [r, r] (actually, for this purpose b1 = 0, 1 is sufficient). • As already mentioned, for the empty diagram µ always (6) fλ∅ = 1 • For the single-hook λ and thus single-hook µ ⊂ λ expressions are still relatively simple and fully factorized: (i,j) (i,j) (i,j) f(a,b) = g(a,b) · K(a,b) = (−)i+j+1 · with and (i,j) [a]! [b]! [a + b + 1] Da !Di ! D̄b !D̄j ! D2i+1 D−2j−1 · · · · · [a − i]![i]! [b − j]![j]! [i + j + 1] Da+i+1 ! D̄b+j+1 ! D0 Di−j g(a,b) = (−)i+j+1 · D2i+1 D̄2j+1 (Da !)2 (D̄b !)2 · · D0 Di−j Da+i+1 ! Da−i−1 ! D̄b+j+1 ! D̄b−j−1 ! Kλµ (N ) = χ∗λ/µ (N ) χ∗µ (N ) χ∗λ (N ) 2 (7) (8) (9) This K involves skew characters, defined by X χλ/µ {p′k } · χµtr {p′′k } = χλ {p′k + p′′k } (10) µ⊂λ and satisfying the sum rule X µ⊂λ (−)|µ| · χλ/µ · χµtr = δλ,∅ (11) which follows from (10) and the transposition law χµ {−pk } = (−)|µ| χµtr {pk }, and can be considered as a prototype of (5). The other notation in (7) and (8) is: Da = {Aq a } = {q} · [N + a], D̄b = {A/q b } = {q} · [N − b] (12) and Da ! = a Y k=0 a+1 Dk = {q} · [N + a]! , [N − 1]! D̄b ! = b Y k=0 b+1 D̄k = {q} · [N ]! [N − b − 1]! (13) (note that these products start from k = 0 and include respectively a + 1 and b + 1 factors). • For two-hook λ = (a1 , b1 |a2 , b2 ) the formulas are far more involved, and they are different for different number of hooks in µ: (i ,j ) (a ,b ) (i ,j ) (i ,j ) (i ,j ) (i ,j ) f(a11 ,b11 |a2 ,b2 ) = f(i11,j11) · ξ(a11 ,b11 |a2 ,b2 ) = g(a11 ,b11 ) · K(a11 ,b11 ) (N ) · ξ(a11 ,b11 |a2 ,b2 ) (i ,j |i ,j ) f(a11 ,b11 |a22 ,b22 ) = [N + i1 + i2 + 1][N − j1 − j2 − 1] (i1 ,j1 ) (i2 ,j2 ) (i ,j |i ,j ) (i ,j ) (i ,j ) · g(a1 ,b1 ) g(a2 ,b2 ) · K(a11 ,b11 ) (N )K(a22 ,b22 ) (N ) · ξ(a11 ,b11 |a22 ,b22 ) [N + i1 − j2 ][N + i2 − j1 ] {z } | (i ,j ) (14) (15) (i ,j ) f(a1 ,b1 ) f(a2 ,b2 ) 1 1 2 2 Non-trivial are the correction factors, true for a2 · b2 = 0: [N + a2 − j1 ][N − b2 + i1 ] (i ,j ) · K(a11 ,b11 |a2 ,b2 ) (N + i1 − j1 ) · δi1 ·j1 + [N + a2 + i1 + 1][N − b2 − j1 − 1]   (i ,j ) + K(a11 ,b11 |a2 ,b2 ) N + (i1 + 1)δb2 − (j1 + 1)δa2 · (1 − δi1 ·j1 ) (i ,j ) ξ(a11 ,b11 |a2 ,b2 ) = (16) and   (i ,j |i ,j ) (i ,j |i ,j ) ξ(a11 ,b11 |a22 ,b22 ) = K(a11 ,b11 |a22 ,b22 ) N + (i1 + i2 + 2) · δb2 − (j1 + j2 + 2) · δa2 where δx =  1 for 0 for x=0 x 6= 1 (17) and (i ,j ) (i ,j ) K(a11 ,b11 |a2 ,b2 ) (N ) = K(a11 ,b11 |a2 ,b2 ) (N ) (i ,j ) K(a11 ,b11 ) (N ) (18) (i ,j |i ,j ) (i ,j |i ,j ) K(a11 ,b11 |a22 ,b22 ) (N ) = K(a11 ,b11 |a22 ,b22 ) (N ) (i ,j ) (i ,j ) K(a11 ,b11 ) (N ) · K(a22 ,b22 ) (N ) (19) Thus corrections involve a natural modification of K-factors and somewhat strange shifts of the argument N , i.e. multiplicative shift of A by powers of q. These formulas were found in [3, 5] for the case when a2 · b2 = 0 (i.e. when either b2 = 0 or a2 = 0). Sufficient for all the simplest non-symmetric rectangular representations R = [r, r] and R = [2r ] are respectively b2 = 0 and a2 = 0. Note that underlined expression are the arguments of K-functions – not additional algebraic factors. Boxes contain projectors on sectors with particular values of i1 and j1 . Our goal in this paper is to make the first step towards lifting the restriction a2 · b2 = 0. Namely, we consider the case of the simplest 3-hook R = [333], which has 20 Young sub-diagrams, of which there are two, λ = [332] = (2, 2|1, 1) and λ = [333] = (2, 2|1, 1|0, 0) with a2 · b2 6= 0. 3 (m) (m) The new function F(22|11) = F[332] 2 The diagram [332] = (22|11) is still two-hook, but both a2 = b2 = 1 are non-vanishing. If we apply just the same formulas (14)-(19) in this case, the answer will be non-polynomial. However, one can introduce additional correction factors ηλµ for all the items in the sum over µ and adjust them to cancel all the singularities. Of 19 factors non-trivial (different from unity) are just 8 (we omit the subscript λ = (22|11) to simplify the formulas): η ∅ = η (00) = η (01) = η (10) = η (02) = η (20) = η (22) = 1 η η (11|00) = (11) [4]3 D1 D−1 [5][2] D2 D−2 , (11) K(22|11) (N ) = D2 D02 D−2 , D3 D1 D−1 D−3 (12) η (12) = K(22|11) (N + 2) η (12|00) = η (12|01) = (12) K(22|11) (N ) D2 D0 , D3 D−1 (21) , η (21) = K(22|11) (N − 2) (21) K(22|11) (N ) η (21|00) = η (21|10) = D0 D−2 D3 D−1 η (22|00) = η (22|01) = η (22|10) = η (22|11) = 1 (20) and the resulting expression is 1 [4][2] · Λm (00) + D3 D2 D1 D02 D−1 D−2 D−3   · A (q 4 + 2q 2 + 2 + q −2 + q −4 ) − A−1 (q 4 + q 2 + 2 + 2q −2 + q −4 ) · Λm (01) + 2 D D3 D22 D1 D0 D−1 −2 D−4   · A (q 4 + q 2 + 2 + 2q −2 + q −4 ) − A−1 (q 4 + 2q 2 + 2 + q −2 + q −4 ) · Λm (10) − 2 D D4 D2 D12 D0 D−1 D−2 −3 (m) A−8 F(22|11) = + + − [4] [2] [4] [2] [5][4] [3] D3 D22 D1 D0 D−2 D−3 D−4 · Λm (02) − 2 D D2 D12 D02 D−1 −2 − [4]3 [2] [3] 2 D D4 D22 D02 D−2 −4 [5][4] [3] · Λm · Λm (20) − (11) + 2 D D4 D3 D2 D0 D−1 D−2 −3   [5] · A (q 4 + q 2 + 2 + q −2 ) − A−1 (q 2 + 2 + q −2 + q −4 ) + · Λm (12) + 2 D D4 D22 D1 D0 D−1 −3 D−4   [5] · A (q 2 + 2 + q −2 + q −4 ) − A−1 (q 4 + q 2 + 2 + q −2 ) + · Λm (21) − 2 D D4 D3 D12 D0 D−1 D−2 −4 [5][4]2 [4]2 [2]2 · Λm · Λm − (22) + (11|00) − 2 2 D4 D3 D1 D0 D−1 D−3 D−4 D4 D3 D1 D0 D−1 D−3 D−4 [5][4] [5][4] − · Λm · Λm (12|00) − (21|00) + 2 D D4 D3 D1 D0 D−1 D−2 D4 D22 D1 D0 D−1 D−3 D−4 −4 [5][4] [3][2] + 2 D2 D D4 D3 D0 D−1 −2 −3 − · Λm (12|01) + [5][4] [3][2] 2 2 D3 D2 D1 D0 D−3 D−4 · Λm (21|10) + [4]2 [2]2 [3] 2 2 D D4 D2 D02 D−2 −4 · Λm (22|00) − [4] [4] · Λm · Λm (22|01) − (22|10) + 2 2 D4 D2 D1 D0 D−1 D−2 D−3 D3 D2 D1 D0 D−1 D−2 D−4 1 · Λm + (22|11) 2 D3 D2 D1 D0 D−1 D−2 D−3 (21) It nicely satisfies the sum rules (5). 3 Extension to F(a1 b1 |11) We can now develop the success with F(22|11) and extend it to other 2-hook diagrams with a2 · b2 6= 0. We actually restrict our attention to the case of a2 · b2 = 1, i.e. a2 = b2 = 1. 4 µ In the next case of F(33|11) the correction factors are (again we write just η µ instead of η(33|11) ): η ∅ = η (00) = η (01) = η (10) = η (02) = η (20) = η (30) = η (03) = η (22) = η (32) = η (23) = η (33) = 1 η (11) = (12) u(33) (11) K(33|11) (N ) η (12) = , (21) K(33|11) (N + 2) η (21) = (12) K(33|11) (N ) (13) η (13) = K(33|11) (N − 2) (21) K(33|11) (N ) (31) K(33|11) (N + 2) η (13) K(33|11) (N ) (31) = K(33|11) (N − 2) (31) K(33|11) (N ) D2 D02 D−2 D3 D1 D−1 D−3 D0 D−2 = η (31|00) = η (31|10) = D3 D−1 η (11|00) = η (12|00) = η (12|01) = η (13|00) = η (13|01) = D2 D0 D3 D−1 η (21|00) = η (21|10) η (22|00) = η (22|01) = η (22|10) = η (22|11) = η (23|00) = η (23|01) = η (23|10) = η (23|11) = η (32|00) = η (32|01) = η (32|10) = η (32|11) = η (33|00) = η (33|01) = η (33|10) = η (33|11) = 1 (22) This implies a simple extension of (16) and (17) to arbitrary diagrams (a1 , b1 |1, 1), i.e. true for a2 · b2 = 0, 1 are: [N + a2 − j1 ][N − b2 + i1 ] (i ,j ) · K(a11 ,b11 |a2 ,b2 ) (N + i1 − j1 ) · δi1 ·j1 + [N + a2 + i1 + 1][N − b2 − j1 − 1]  (1−δa2 ·b2 )·δi1 ·j1 −1    u (a1 ,b1 |a2 ,b2 )  (i ,j ) + K(a11 ,b11 |a2 ,b2 ) N + (i1 + 1)δb2 − (j1 + 1)δa2 + 2(1 − δa2 ·b2 ) δi1 −1 − δj1 −1 · (1 − δi1 ·j1 ) ·  (1|1) K(a1 ,b1 |a2 ,b2 ) (i ,j ) ξ(a11 ,b11 |a2 ,b2 ) = with u(a1 ,b1 |1,1) =   D1 D02 D−1 [a1 + 2] [b1 + 2] [3][2]2 {q}2 (1,1) · · K(a1 ,b1 |1,1) − 2 [a1 ] [b1 ] D0 D3 D2 D−2 D−3 (23) and   D D δi1 −1 ·(1−δa1 ·b1 )  D D δj1 −1 ·(1−δa1 ·b1 )  2 0 0 −2 (i ,j |i ,j ) (i ,j |i ,j ) ξ(a11 ,b11 |a22 ,b22 ) = K(a11 ,b11 |a22 ,b22 ) N + (i1 + i2 + 2) · δb2 − (j1 + j2 + 2) · δa2 · · D3 D−1 D1 D−3 (11) Formula (23) means that the coefficient fλ is no longer proportional to the skew character χ∗λ/(11) . Interpretation of this deviation remains to be found. Note that for a2 · b2 = 0 we have just (1,1) u(a1 ,b1 |a2 ,b2 ) = K(a1 ,b1 |a2 ,b2 ) for a2 · b2 = 0 (24) instead of (23) – as one more manifestation of discontinuity of the formulas, expressed in terms of hook variables. 4 (m) (m) The new function F[333] = F(22|11|00) This F -factor is the first, associated with the triple-hook diagram λ. To get an explicit formula we impose µ the polynomiality requirement on the correction factors η(22|11|00) to the naive analogue of (14)-(19) for 3-hook diagrams: (i ,j ) (a ,b ) (i ,j ) (i ,j ) (i ,j ) (i ,j ) f(a11 ,b11 |a2 ,b2 |a3 ,b3 ) = f(i11,j11) · ξ(a11 ,b11 |a2 ,b2 ) = g(a11 ,b11 ) · K(a11 ,b11 ) (N ) · ξ(a11 ,b11 |a2 ,b2 |a3 ,b3 ) (i ,j |i ,j ) f(a11 ,b11 |a22 ,b22 |a3 ,b3 ) = [N + i1 + i2 + 1][N − j1 − j2 − 1] (i1 ,j1 ) (i2 ,j2 ) (i ,j ) (i ,j ) (i ,j |i ,j ) · g(a1 ,b1 ) g(a2 ,b2 ) · K(a11 ,b11 ) (N )K(a22 ,b22 ) (N ) · ξ(a11 ,b11 |a22 ,b22 |a3 ,b3 ) [N + i1 − j2 ][N + i2 − j1 ] | {z } (i ,j ) (i ,j ) f(a1 ,b1 ) f(a2 ,b2 ) 1 5 1 2 2 (i ,j |i ,j |i ,j ) f(a11 ,b11 |a22 ,b22 |a3 3 ,b3 3 ) = [N + i1 + i2 + 1][N − j1 − j2 − 1] [N + i1 + i3 + 1][N − j1 − j3 − 1] [N + i2 + i3 + 1][N − j2 − j3 − 1] · · · [N + i1 − j2 ][N + i2 − j1 ] [N + i1 − j3 ][N + i3 − j1 ] [N + i2 − j3 ][N + i3 − j2 ] (i ,j ) (i ,j ) (i ,j |i ,j |i ,j ) (i ,j ) (i ,j ) (i ,j ) (i ,j ) · g(a11 ,b11 ) g(a22 ,b22 ) g(a33 ,b33 ) · K(a11 ,b11 ) (N )K(a22 ,b22 ) (N )K(a33 ,b33 ) (N ) · ξ(a11 ,b11 |a22 ,b22 |a3 3 ,b3 3 ) {z } | (i ,j ) (i ,j ) (25) (i ,j ) f(a1 ,b1 ) f(a2 ,b2 ) f(a3 ,b3 ) 1 1 2 2 3 3 In the first approximation the correction factors in the 3-hook case are (they are never literally true, before η-factors are introduced):  (i ,j ) (i ,j ) ξ(a11 ,b11 |a2 ,b2 |a3 ,b3 ) = K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) N · (1 − δi1 ·j1 ) + + [N + a3 − j1 ][N − b3 + i1 ] [N + a2 − j1 ][N − b2 + i1 ] (i ,j ) · · K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) (N + i1 − j1 ) · δi1 ·j1 [N + a2 + i1 + 1][N − b2 − j1 − 1] [N + a3 + i1 + 1][N − b3 − j1 − 1] (i ,j |i ,j ) (i ,j |i ,j ) ξ(a11 ,b11 |a22 ,b22 |a3 ,b3 ) = K(a11 ,b11 |a22 ,b22 |a3 ,b3 ) N  (26) (note that a2 > 0 and b2 > 0 for 3-hook diagrams thus the shifts like N −→ N + (i1 + 1)δb2 − (j1 + 1)δa2 ) do not matter) and   (i ,j |i ,j |i ,j3 ) (i ,j |i ,j |i ,j ) − (j + j + j + 3) · δ N + (i + i + i + 3) · δ ξ(a11 ,b11 |a22 ,b22 |a3 3 ,b3 3 ) = K(a11 ,b11 |a22 ,b22 |a3 3 ,b 1 2 3 a 1 2 3 b 3 3 3) with (i ,j ) (i ,j ) K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) (N ) = K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) (N ) (i ,j ) K(a11 ,b11 ) (N ) (i ,j |i ,j ) K(a11 ,b11 |a22 ,b22 |a3 ,b3 ) (N ) (i ,j |i ,j ) K(a11 ,b11 |a22 ,b22 |a3 ,b3 ) (N ) = (i ,j ) (i ,j ) K(a11 ,b11 ) (N ) · K(a22 ,b22 ) (N ) (i ,j |i ,j |i ,j ) (i ,j |i ,j |i ,j3 ) (N ) K(a11 ,b11 |a22 ,b22 |a3 3 ,b 3) = K(a11 ,b11 |a22 ,b22 |a3 3 ,b3 3 ) (N ) (i ,j ) (i ,j ) (27) (i ,j ) K(a11 ,b11 ) (N ) · K(a22 ,b22 ) (N ) · K(a33 ,b33 ) (N ) µ Correction factors η(22|11|00) appear to be η (00) = η (01) = η (10) = η (20) = η (02) = η (22) = 1 η (11) D1 D02 D−1 = 2 D22 D−2 (12) η (12) K(22|11|00) (N + 2) D02 = = (12) D2 D−2 K(22|11|00) (N ) (21) η (21) K(22|11|00) (N − 2) D02 = = (21) D2 D−2 K(22|11|00) (N ) η (11|00) = D04 D3 D1 D−1 D−3 (12|00) η (12|00) = K(22|11|00) (N + 1) D12 D2 D04 · = 2 (12|00) D3 D1 D−1 D−2 D3 D−1 K(22|11|00) (N ) (21|00) η (21|00) 2 K(22|11|00) (N − 1) D−1 D04 D−2 = · = 2 (21|00) D2 D1 D−1 D−3 D1 D−3 K(22|11|00) (N ) (12|01) η (12|01) = K(22|11|00) (N + 1) D03 D12 = · (12|01) D3 D−1 D−2 D3 D−1 K(22|11|00) (N ) (12|10) η (21|10) 2 K(22|11|00) (N − 1) D−1 D03 = = · (12|01) D2 D1 D−3 D1 D−3 K(22|11|00) (N ) η (22|00) = η (22|01) = η (22|10) = D02 D1 D−1 η (22|11) = η (22|11|00) = 1 6 (28) and the answer for the F -function is = (m)   [3]2 1 m − 1 − Λ (22|11|00) 2 D D2 D12 D03 D−1 D3 D2 D1 D03 D−1 D−2 D−3 −2 [4][3]2 [2] + 2 D D3 D22 D1 D0 D−1 −2 D−4 [5][4] [2] − 2 2 D3 D2 D1 D0 D−2 D−3 D−4   m Λm (01) − Λ(22|10) +   m Λm − Λ (02) (21|10) − [4][3]2 [2] 2 D D4 D2 D12 D0 D−1 D−2 −3 [5][4] [2] 2 D2 D D4 D3 D2 D0 D−1 −2 −3 A−9 · F(22|11|00) =   m − Λ Λm (22|11) + (00)   m Λm (10) − Λ(22|01) −   m Λm − Λ (20) (12|01) −   [4]2 [2]2 m m − Λ Λ (22|00) + (11) 2 D D4 D22 D03 D−2 −4     [5][3]2 m m Λm Λm (12) − Λ(21|00) + (21) − Λ(12|00) − 2 2 D4 D3 D1 D0 D−1 D−2 D−4 − + [5][3]2 2 D D4 D22 D1 D0 D−1 −3 D−4 [4]2 [3]2 [2]2 − 3 D4 D3 D1 D0 D−1 D−3 D−4   m − Λ Λm (11|00) (22) (29) This is actually a Laurent polynomial at all m, satisfying (5). 5 Extension to F(a1 b1 |11|00) Again, we can easily extend this result to arbitrary a1 and b1 : the substitute of (23), true for a2 · b2 = 1, a3 · b3 = 0, δi1 ·j1 −1  is   u (i ,j ) (i ,j )  ξ(a11 ,b11 |a2 ,b2 |a3 ,b3 ) = K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) N + 2(δi1 −1 − δj1 −1 ) ·  (i ,j ) · (1 − δi1 ·j1 ) + 1 1 K(a1 ,b1 |a2 ,b2 |a3 ,b3 ) [N + a3 − j1 ][N − b3 + i1 ] [N + a2 − j1 ][N − b2 + i1 ] (i ,j ) · · K(a11 ,b11 |a2 ,b2 |a3 ,b3 ) (N + i1 − j1 ) · δi1 ·j1 + [N + a2 + i1 + 1][N − b2 − j1 − 1] [N + a3 + i1 + 1][N − b3 − j1 − 1] (i ,j |i ,j ) ξ(a11 ,b11 |a22 ,b22 |a3 ,b3 ) = δi1 −1  2 δj1 −1  2δi1 ·j1 −1 +(1−δi1 −1 )·(1−δj1 −1 ))·δi2 ·j2 D−1 D02 · · D1 D3 D1 D−1   (i ,j |i ,j |i ,j3 ) (30) = K(a11 ,b11 |a22 ,b22 |a3 3 ,b − (j + j + j + 3) · δ N + (i + i + i + 3) · δ 1 2 3 a 1 2 3 b 3 3 3) (i ,j |i ,j ) K(a11 ,b11 |a22 ,b22 |a3 ,b3 ) (i ,j |i ,j |i ,j ) ξ(a11 ,b11 |a22 ,b22 |a3 3 ,b3 3 )    N + δi1 ,1 − δj1 ,1 · D12 D3 D−1 The shift N −→ N + (i1 + i2 + i3 + 3) · δb3 − (j1 + j2 + j3 + 3) · δa3 in the last line is not actually tested by (i j |11|00) these formulas, because the associated K(a11 b11 |11|00) do not depend on A. The quantity u(a1 b1 |11|00) is given by a literal analogue of (23): u(a1 ,b1 |1,1|0,0) 6   D1 D02 D−1 [a1 + 2] [b1 + 2] [3][2]2 {q}2 (1,1) · · = K(a1 ,b1 |1,1|0,0) − [a1 ] [b1 ] D02 D3 D2 D−2 D−3 (31) Racah matrix S̄ for representation R = [333] [333] Coming back to the case of R = [333] we can now use (1) to get the matrix elements S̄µν . For this purpose n it is technically convenient to substitute the expansion in Λm µ Λν by that in Λµ Λ̄ν with independent Λ̄ and λ instead of arbitrary m and n. To get a 20 × 20 matrix we need to enumerate the subdiagrams of R = [333], which are also in one-to-one correspondence with the 20 irreducible representations in R ⊗ R̄ = [333] ⊗ [333]: 1 2 3 4 5 6 7 8 9 10 ∅ [1] [11] [111] [2] [21] [211] [22] [221] [222] ∅ (00) (01) (02) (10) (11) (12) 7 (11|00) (12|00) (12|01) 11 12 13 14 15 16 17 18 19 20 [3] [31] [311] [32] [321] [322] [33] [331] [332] [333] (20) (21) (22) (21|00) (22|00) (21|10) (22|01) (22|10) (22|11) (22|11|00) Dimensions Dµ of these representations are obtained from the terms with ν = ∅ in (1), because S̄µ∅ = in obvious notation Dµ = d2R · coeff(HR , Λµ Λ̄∅ ) After that √ Dµ dR : (32) dR S̄µν = p · ·coeff(HR , Λµ Λ̄n u) Dµ Dν (33) The simplest test of the result is that S̄ is orthogonal matrix, 20 X (34) S̄µν S̄µ′ ν = δµµ′ ν=1 It is also symmetric. The second exclusive matrix S [333] is then the diagonalizing matrix of T̄ S̄ T̄ [9]: T̄ S̄ T̄ = ST −1 S † (35) with the known diagonal T and T̄ , made from the q-powers of Casimir. This is actually a linear equation for S,   T̄ S̄ T̄ S = S T −1 (36) [333] which is practically solvable, though explicit calculation is somewhat tedious. The resulting matrix Sµν should be orthogonal – what fixes the normalization of the solution to (36). In variance with S̄, this S is not symmetric. A typical example of the matrix element is [333] [333] S̄7,15 = S̄[211],[321] = − [5] · {q} · D4 D22 D0 D−2 D−4 s D5 D3 · D1 D−1  · A6 q −2 − A4 (2q 8 + 3q 6 + 2q 4 + q 2 − 3 − 5q −2 − 2q −4 + 2q −6 + 2q −8 + 3q −10 + q −12 )+  +A2 q 18 + 3q 16 + 4q 14 + 4q 12 − 6q 8 − 9q 6 − 5q 4 + 2q 2 + 12 + 13q −2 + 5q −4 − 4q −6 − 9q −8 − 7q −10 − q −12 + 4q −14 + 4q −16 + 3q −18 + q −20 − 2 −2 22 20 18 16 14 12 10 8 6 4 2 −2 −4 −6 −8 −10 −12 −14 −16 −18 −20 −22 −(q +q )(q +3q +3q −q −8q −9q +q +14q +19q +6q −13q −22−13q +6q +19q +14q +q −9q −8q −q +3q +3q +q )− +A−2 (q −18 +3q −16 +4q −14 +4q −12 −6q −8 −9q −6 −5q −4 +2q −2 +12+13q 2 +5q 4 −4q 6 −9q 8 −7q 10 −q 12 +4q 14 +4q 16 +3q 18 +q 20 )−  −A−4 (2q −8 + 3q −6 + 2q −4 + q −2 − 3 − 5q 2 − 2q 4 + 2q 6 + 2q 8 + 3q 10 + q 12 ) + A−6 q 2 The polynomial in brackets reduces to D(0)6 = {A}6 at q = 1pand to − ([4][3][2])3 {q}6 at A = 1. A better quantity for practical calculations is unnormalized σ̄µν = S̄µν · Dµ Dν , which does not contain square roots. 7 Conclusion The main result of the present letter is explicit expression for the two previously unknown F -functions (11) (m) (m) F(22|11) and F(22|11|00) . Most important is the deviation from the coefficient f(22|11) from the skew dimension, even shifted – what is expressed by eq.(23), see also (31). This new phenomenon explains the failure of previous naive attempts to write down an explicit general expression for F in arbitrary representation: an adequate substitute of the skew characters and appropriate generalization of the corresponding conjecture in [5] is needed for this. The next step in this study should be further extension to a2 · b2 > 1. The two newly-found functions, if combined with the other 18, associated with 0,1,2-hook diagrams λ with the property a2 · b2 = 0, provide explicit expression for [333]-colored HOMFLY for all twist and double braid knots. Moreover, from (1) one can read all the elements of the Racah matrix S̄ [333] , while S [333] is then found from (36). Thus this paper solves the long-standing problem to evaluate S̄ [333] and S [333] . Explicit expressions 8 for these Racah matrices as well as for the [333]-colored HOMFLY for the simplest twist and double-braid knots are available at [14]. It still remains to evaluate the twist-knot polynomials and Racah matrices for generic rectangular representations – the new step, made in the present paper, provides the essential new knowledge about this problem which can help to overcome the existing deadlock. For additional peculiarities of non-rectangular case see [6]. The main point there is that representations in R⊗ R̄ are no longer in one-to-one correspondence with the sub-diagrams of non-rectangular R. Still, factorization of the coefficients in the differential expansion for double braids persists, and thus the Racah matrices S̄ can still be extracted from knot polynomials – though the procedure becomes more tedious [7]. Acknowledgements This work was performed at the Institute for the Information Transmission Problems with the support from the Russian Science Foundation, Grant No.14-50-00150. References [1] G. Racah, Phys.Rev. 62 (1942) 438-462 E.P. Wigner, Manuscript, 1940, in: Quantum Theory of Angular Momentum, pp. 87133, Acad.Press, 1965; Group Theory and Its Application to the Quantum Mechanics of Atomic Spectra, Acad.Press, 1959 L.D. Landau and E.M. Lifshitz, Quantum Mechanics: Non-Relativistic Theory, Pergamon Press, 1977 J. Scott Carter, D.E. Flath, M. Saito, The Classical and Quantum 6j-symbols, Princeton Univ.Press, 1995 S. Nawata, P. Ramadevi and Zodinmawia, Lett.Math.Phys. 103 (2013) 1389-1398, arXiv:1302.5143 A. Mironov, A. Morozov, A. Sleptsov, JHEP 07 (2015) 069, arXiv:1412.8432; Pis’ma v ZhETF, 106 (2017) 607, arXiv:1709.02290 [2] A.Morozov, Nucl.Phys. B911 (2016) 582-605, arXiv:1605.09728 [3] A.Morozov, JHEP 1609 (2016) 135, arXiv:1606.06015 v8 [4] Ya.Kononov and A.Morozov, Theor.Math.Phys. 193 (2017) 1630-1646, arXiv:1609.00143 [5] Ya.Kononov and A.Morozov, Mod.Phys.Lett. A Vol. 31, No. 38 (2016) 1650223, arXiv:1610.04778 [6] A.Morozov, arXiv:1612.00422 [7] A.Morozov, Phys.Lett. B 766 (2017) 291-300, arXiv:1701.00359 [8] J.W.Alexander, Trans.Amer.Math.Soc. 30 (2) (1928) 275-306 V.F.R.Jones, Invent.Math. 72 (1983) 1 Bull.AMS 12 (1985) 103 Ann.Math. 126 (1987) 335 L.Kauffman, Topology 26 (1987) 395 P.Freyd, D.Yetter, J.Hoste, W.B.R.Lickorish, K.Millet, A.Ocneanu, Bull. AMS. 12 (1985) 239 J.H.Przytycki and K.P.Traczyk, Kobe J Math. 4 (1987) 115-139 A.Morozov, Theor.Math.Phys. 187 (2016) 447-454, arXiv:1509.04928 [9] A.Mironov, A.Morozov, An.Morozov, P.Ramadevi, V.K. Singh, JHEP 1507 (2015) 109, arXiv:1504.00371 S.Nawata, P.Ramadevi and Vivek Kumar Singh, arXiv:1504.00364 A.Mironov and A.Morozov, Phys.Lett. B755 (2016) 47-57, arXiv:1511.09077 A. Mironov, A. Morozov, An. Morozov, P. Ramadevi, V.K. Singh and A. Sleptsov, J.Phys. A: Math.Theor. 50 (2017) 085201, arXiv:1601.04199 [10] H. Itoyama, A. Mironov, A. Morozov and An. Morozov, JHEP 2012 (2012) 131, arXiv:1203.5978 [11] A. Mironov, A. Morozov and An. Morozov, AIP Conf. Proc. 1562 (2013) 123, arXiv:1306.3197 [12] S.Arthamonov, A.Mironov, A.Morozov, Theor.Math.Phys. 179 (2014) 509-542, arXiv:1306.5682 S.Arthamonov, A.Mironov, A.Morozov, An.Morozov, JHEP 04 (2014) 156, arXiv:1309.7984 Ya.Kononov and A.Morozov, JETP Letters 101 (2015) 831-834, arXiv:1504.07146 C. Bai, J. Jiang, J. Liang, A. Mironov, A. Morozov, An. Morozov, A. Sleptsov, arXiv:1709.09228 [13] P.Dunin-Barkowski, A.Mironov, A.Morozov, A.Sleptsov, A.Smirnov, JHEP 03 (2013) 021, arXiv:1106.4305 [14] http://knotebook.org 9
4math.GR
Biomedical Question Answering via Weighted Neural Network Passage Retrieval arXiv:1801.02832v1 [cs.IR] 9 Jan 2018 Ferenc Galkó and Carsten Eickhoff Department of Computer Science, ETH Zurich, Switzerland [email protected] Abstract. The amount of publicly available biomedical literature has been growing rapidly in recent years, yet question answering systems still struggle to exploit the full potential of this source of data. In a preliminary processing step, many question answering systems rely on retrieval models for identifying relevant documents and passages. This paper proposes a weighted cosine distance retrieval scheme based on neural network word embeddings. Our experiments are based on publicly available data and tasks from the BioASQ biomedical question answering challenge and demonstrate significant performance gains over a wide range of state-of-the-art models. Keywords: Biomedical Question Answering, Passage Retrieval 1 Introduction Biomedical question answering is a key task in catering to clinical decision support and personal health information needs. Finding useful information in the extensive collections of scholarly biomedical articles poses a challenge to highly trained practitioners and patients alike [5]. Biomedical questions phrased by experts are usually more specific than common Web search queries, making them difficult to satisfy using general-purpose retrieval models. A typical expert question (for example “Which enzymes synthesize catecholamines in adrenal glands? ”) shows specific domain knowledge and aims at more than just a general overview about adrenal glands [15]. Instead, the expert is looking for a narrow set of documents or snippets that help answering a specific relation of the queried entities. Since many question answering systems rely heavily on document and passage retrieval, an increased performance in these tasks tends to propagate into significant QA performance gains [13,16]. While the task of wholedocument retrieval for QA is well understood, passage-level retrieval approaches have received comparably less attention [4,8,10,13]. This paper describes a piece of work in progress, focusing on passage-level retrieval for biomedical question answering on the basis of weighted combinations of neural network word embeddings. It makes the following contributions: (1) We propose a novel approach for weighting query embedding vectors for the cosine 2 distance text matching scheme and show that it outperforms traditional models. (2) We demonstrate significant performance improvements over state-of-the-art neural network retrieval models on a sizable publicly available benchmarking dataset. The remainder of this paper is structured as follows: Section 2 formally introduces the problem domain as well as the proposed method. Section 3 empirically evaluates the merit of our method on the basis of publicly available data and tasks created in the context of the BioAsq biomedical question answering challenge. Finally, Section 4 concludes with a summary and an outlook on future directions. 2 Method Let us assume a textual question Q consisting of individual terms, where each term is represented by a fixed-length vector. To satisfy Q, we rely on a large collection of biomedical documents organized in passages. In order to represent and retain the semantic content of the terms, we project them into semantically meaningful vector spaces, such as induced by Word2Vec [6] or GloVe [11]. In this way both the question Q = q1 , q2 , . . . , qi and each passage P = p1 , p2 , . . . , pj can be represented as a sequence of fixed-length vectors. In this high-dimensional space, we can now relate individual terms to each other by means of distance functions. A commonly employed measure of relatedness is the cosine of the angle between word vectors as expressed by the cosine distance. cos(q, p) = 1 − qp kqk2 kpk2 Given such a representation as well as measure of similarity, we can now perform a variety of operations ranging from clustering to retrieval [1,3]. In order to represent multi-term units such as entire queries and passages, several authors recommend uniform averaging of word vectors before finally returning a ranked top-k list of closest passages to the query. P 1 P ( |Q| qi )( |P1 | pj ) P CD(Q, P ) = 1 − 1 P 1 qi k2 k |P | pj k 2 k |Q| 2.1 Weighted cosine distance One serious issue with the well-known cosine distance retrieval approach introduced above is that the uniform average vector is a poor semantic representation for general texts. This is due to the presence and abundance of stop words such as “the”, “a”, or “is” that carry little meaning. By assigning uniform weights to all words, we water down the semantic content of informative words such as “neurodegenerative”. To address this problem, non-uniform weighting schemes such as idf can be used. A term’s collection-wide inverse document frequency (idf) captures its uniqueness and assigns larger weights to rarer words on a 3 logarithmic scale. By assigning idf instead of uniform weights to the words, a substantial increase in performance can be achieved as we will show in Section 3. P P idf (qi )qi )( P idf1 (pj ) idf (pj )pj ) ( P idf1 (qi ) P P CDidf (Q, P ) = 1 − 1 1 k P idf (qi ) idf (qi )qi k2 k P idf (pj ) idf (pj )pj k2 While there are alternative approaches for aggregation such as position encoding [14], that can take into consideration the ordering of words, a series of preliminary studies suggest that idf weights perform best on the biomedical QA task. For the sake of brevity, we do not include these experiments in our empirical performance evaluation. 2.2 Adjusted idf weights The previously presented idf weights depend solely on the distribution of words in the corpus. Incoming queries, on the other hand, may originate from a different distribution. Using idf scores generated from the document collection to weight query terms might result in a poor representation, since words that appear rarely in documents but frequently in questions can receive an unduly large weight. Question words such as “what ”, “when”, “where” are intuitive examples. When idf weights are calculated on a sizable sample of scholarly biomedical articles obtained from PubMed, the weight for “what ” is 5.05, whereas “disease” (2.68), “protein” (2.59) and “artery” (4.16) end up being much less important despite their greater de facto informativeness. As a consequence, passages containing the word “what ” will be estimated to be more similar to the question “What is a degenerate protein? ”, according to our metric, than passages containing the more promising phrase “degenerate protein”. In fact, if we were to perform idf-based stopping and only retain the most important components of a question, our example question “What is a degenerate protein? ” becomes “What degenerate?” with the low-idf component “is”, “a” and “protein” being removed while the desired reduction in this case may have been “degenerate protein? ” which captures the topical essence of the original question much better. We address this issue by generating idf weights from an alternative collection, specifically a mixture of large-scale corpora of biomedical [15] and general questions [12]. Generating idf weights from the combined question set results in smaller weights for general terms such as “what ”, “which”, “when” and larger weights for rarer, domain-specific terminology such as “protein”, “disease”, or “artery”, making it possible to capture the true intention of bio-medical questions and passages. We refer to this method as CDq . 3 Experiments Our empirical performance evaluation is based on documents and questions from the BioASQ 2017 challenge’s document and snippet retrieval tasks [7]. The goal 4 in this task is to return the 10 most relevant passages from a collection of 12.8M PubMed abstracts for a specific biomedical question. A training set of 1799 manually curated questions along with relevant passages are provided by the challenge organizers. The test set is comprised of a separate set of 500 questions organized in five equally-sized batches. 3.1 Baselines To allow for a meaningful system comparison, we include a broad range of traditional as well as state-of-the-art performance baselines, trained and evaluated on the same data and task as our proposed cosine-distance based methods. RND This approach returns a random passage from the reference set of highlyranked documents to create a weak baseline. MLP This approach uses position-encoded sentence embeddings that are concatenated and eventually classified in binary fashion in a multi-layer perceptron [4]. This is a re-implementation of a system participating in a previous BioASQ challenge. MP The Match Pyramid [9] model generates a similarity matrix from the pairwise word interactions between question and candidate passage. We use a fixed 30 by 30 matrix with zero padding and the identity function as a measure of similarity. In a second step, convolutional filters condense the interaction matrix into a final vector representation for classification. DRMM The Deep Relevance Matching Model [2] is based on a similar scheme. It computes pair-wise term interactions between question and candidate passage that are then flattened into fixed-size histograms and discretized and weighted to give the final vector representation. 3.2 Experimental Setup All (machine learning) methods are trained using five-fold cross validation on the training set. Word embeddings for all methods are computed as length50 word2vec vectors on the PubMed document corpus [7]. For each question (training and test), a reference set of highly ranked documents is given by the challenge organizers. We split these documents into individual sentences that will serve as our retrieval unit. Negative training examples for machine learning methods are randomly sampled from arbitrary non-relevant documents. 3.3 Results Table 1 compares the various baselines and cosine distance variants in terms of mean average precision (MAP), Precision, Recall and F1 -scores each at a cut-off rank of 10 retrieved passages. Statistical significance of method differences is determined using a Wilcoxon signed-rank test at α < 0.05-level and significant improvements over all baselines are indicated with an asterisk. While questions were originally grouped in batches, here we forego this structure in the interest of 5 Table 1. Passage retrieval performance for biomedical question answering. Method RND MLP [4] MP [9] DRMM [2] CD CDidf CDq MAP 0.190 0.226 0.344 0.348 0.341 0.344 0.377∗ Precision 0.190 0.236 0.323 0.344 0.339 0.348 0.374∗ Recall 0.289 0.352 0.470 0.510 0.484 0.487 0.519 F1 0.229 0.282 0.383 0.411 0.399 0.406 0.434∗ brevity. Batch-level scores showed some variance but displayed the same relative method ranking as the aggregate overview. Due to the limited length of the reference document list as well as each individual abstract, random sentence selection does surprisingly well and sets a lower limit to method performance. All compared approaches yield meaningful results and significantly outperform this baseline. MLP is the weakest machine learning approach with substantially lower performance scores than those achieved by MP and DRMM. Cosine distance rankings are clearly improved by idf term weighting, lifting their results on a level comparable to that of MP and DRMM. Our adjusted term-weighting scheme following statistics of a separate, more representative, question corpus introduces another improvement in result quality, leading to the best overall results and a significant improvement over all contesting methods. 4 Conclusion This paper presents a piece of work in progress towards passage retrieval for biomedical question answering via weighted cosine distances. In place of highly parametric end-to-end ranking networks, we devise a number of lean non-parametric weighting schemes that account for the differences in term distribution between document and question corpora. Our experiments on publicly available BioASQ data demonstrate significant improvements over a range of ranking networks. Especially in academic settings where datasets are often not sufficiently large to robustly fit multitudes of neural network parameters, such light-weight architectures are of increased interest. While we noted the significant difference in term distributions between corpora at a biomedical example, the solution, as such, is not specific to the biomedical domain. In the future, we aim to investigate more formally rigorous ways of accounting for such differences as well as to evaluate them on a wider range of topical domains. References 1. Georgios-Ioannis Brokos, Prodromos Malakasiotis, and Ion Androutsopoulos. Using centroids of word embeddings and word mover’s distance for biomedical doc- 6 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. ument retrieval in question answering. In Proceedings of the 15th ACL Workshop on Biomedical Natural Language Processing, 2016. Jiafeng Guo, Yixing Fan, Qingyao Ai, and W Bruce Croft. A deep relevance matching model for ad-hoc retrieval. In CIKM 2016. ACM. Anna Huang. Similarity measures for text document clustering. In Proceedings of the sixth new zealand computer science research student conference (NZCSRSC2008), Christchurch, New Zealand, pages 49–56, 2008. Hyeon-gu Lee, Minkyoung Kim, Harksoo Kim, Juae Kim, Sunjae Kwon, Jungyun Seo, Jungkyu Choi, and Yi-reun Kim. Ksanswer: Question-answering system of kangwon national university and sogang university in the 2016 bioasq challenge. ACL 2016, page 45, 2016. Prodromos Malakasiotis, Ion Androutsopoulos, Agiatis Bernadou, Nephelie Chatzidiakou, Eliza Papaki, Panos Constantopoulos, Ioannis Pavlopoulos, Anastasia Krithara, Yannis Almyrantis, Dimitris Polychronopoulos, Aris Kosmopoulos, Georgios Balikas, Ioannis Partalas, George Tsatsaronis, and Norman Heino. Challenge evaluation report 2 and roadmap. European Commission Report, 2014. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013. Anastasios Nentidis, Konstantinos Bougiatiotis, Anastasia Krithara, Georgios Paliouras, and Ioannis Kakadiaris. Results of the fifth edition of the bioasq challenge. In BioNLP 2017, pages 48–57, Vancouver, Canada,, August 2017. Association for Computational Linguistics. Zi Yang Yue Zhou Eric Nyberg. Learning to answer biomedical questions: Oaqa at bioasq 4b. ACL 2016, page 23, 2016. Liang Pang, Yanyan Lan, Jiafeng Guo, Jun Xu, Shengxian Wan, and Xueqi Cheng. Text matching as image recognition. CoRR, abs/1602.06359, 2016. Eirini Papagiannopoulou, Yiannis Papanikolaou, Dimitris Dimitriadis, Sakis Lagopoulos, Grigorios Tsoumakas, Manos Laliotis, Nikos Markantonatos, and Ioannis Vlahavas. Large-scale semantic indexing and question answering in biomedicine. In Proceedings of the Fourth BioASQ workshop, pages 50–54, 2016. Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the Conference on Empirical Methods on Natural Language Processing (EMNLP), 2016. Frederik Schulze, Ricarda Schüler, Tim Draeger, Daniel Dummer, Alexander Ernst, Pedro Flemming, Cindy Perscheid, and Mariana Neves. Hpi question answering system in bioasq 2016. In Proceedings of the Fourth BioASQ workshop at the Conference of the Association for Computational Linguistics, pages 38–44, 2016. Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in neural information processing systems, pages 2440–2448, 2015. George Tsatsaronis, Georgios Balikas, Prodromos Malakasiotis, Ioannis Partalas, Matthias Zschunke, Michael R Alvers, Dirk Weissenborn, Anastasia Krithara, Sergios Petridis, Dimitris Polychronopoulos, et al. An overview of the bioasq largescale biomedical semantic indexing and question answering competition. BMC bioinformatics, 16(1):138, 2015. Ellen M Voorhees. The TREC question answering track. Natural Language Engineering, 7(4):361–378, 2001.
2cs.AI
arXiv:1112.3717v3 [math.AC] 14 Oct 2015 SEQUENTIALLY COHEN–MACAULAYNESS OF BIGRADED MODULES AHAD RAHIMI Abstract. Let K be a field, S = K[x1 , . . . , xm , y1 , . . . , yn ] be a standard bigraded polynomial ring and M a finitely generated bigraded S-module. In this paper we study sequentially Cohen–Macaulayness of M with respect to Q = (y1 , . . . , yn ). We characterize the sequentially Cohen–Macaulayness of L ⊗K N with respect to Q as an S-module when L and N are non-zero finitely generated graded modules over K[x1 , . . . , xm ] and K[y1 , . . . , yn ], respectively. All hypersurface rings that are sequentially Cohen–Macaulay with respect to Q are classified. Introduction In [13] Stanley introduced the notion of sequentially Cohen–Macaulayness for graded modules. This concept has been then studied by several authors, we refer to [3], [4], [6], [8], [9], [12], [14]. In this paper we define sequentially CohenMacaulayness for bigraded modules, and introduce some new algebraic invariants which it makes sense to study in this case. We let S = K[x1 , . . . , xm , y1, . . . , yn ] be a standard bigraded polynomial ring over a field K, M a finitely generated bigraded S-module. We set Q = (y1 , . . . , yn ). In [10], M is called to be Cohen–Macaulay with respect to Q if grade(Q, M) = cd(Q, M), where cd(Q, M) denotes the cohomological dimension of M with respect to Q. We call a finite filtration F : 0 = M0 M1 · · · Mr = M of M by bigraded submodules M a Cohen–Macaulay filtration with respect to Q if (a) Each quotient Mi /Mi−1 is Cohen–Macaulay with respect to Q; (b) 0 ≤ cd(Q, M1 /M0 ) < cd(Q, M2 /M1 ) < · · · < cd(Q, Mr /Mr−1 ). If M admits a Cohen–Macaulay filtration with respect to Q, then we say that M is sequentially Cohen–Macaulay with respect to Q. The usual notion of sequentially Cohen-Macaulayness results from our definition if we assume P = 0. A finite filtration D : 0 = D0 D1 ··· Dr = M of M by bigraded submodules, is called the dimension filtration of M with respect to Q if Di−1 is the largest bigraded submodule of Di for which cd(Q, Di−1 ) < cd(Q, Di ), for all i = 1, . . . , r. In the preliminary section we show that if M is sequentially Cohen– Macaulay with respect to Q, then the filtration F is uniquely determined and it is just the dimension filtration of M with respect to Q, that is, F = D. We explicitly describe the structure of the submodules Di in [8]. In the same section, 2000 Mathematics Subject Classification. 16W50, 13C14, 13D45, 16W70. The author was in part supported by a grant from IPM (No. 900130058). Key words and phrases. Dimension filtration, Sequentially Cohen–Macaulay, Cohomological dimension, Bigraded modules, hypersurface rings. 1 it is also shown that if M is sequentially Cohen–Macaulay with respect to Q with grade(Q, M) > 0 and |K| = ∞, then there exists a bihomogeneous M-regular element y ∈ Q of degree (0, 1) such that M/yM is sequentially Cohen–Macaulay with respect to Q, too. An example is given to show that the converse does not hold in general. Let K[x] = K[x1 , . . . , xm ] and K[y] = K[y1 , . . . , yn ]. In Section 2, we consider L ⊗K N as S-module where L and N are two non-zero finitely generated graded modules over K[x] and K[y], respectively. We characterize the sequentially Cohen– Macaulayness of L ⊗K N with respect to Q as follows: L ⊗K N is a sequentially Cohen–Macaulay with respect to Q if and only if N is sequentially Cohen–Macaulay K[y]-module. In the last section, we let f ∈ S be a bihomogeneous element of degree (a, b) and consider the hypersurface ring R = S/f S. Notice that if a, b > 0, we have grade(Q, R) = n − 1 and cd(Q, R) = n; hence R is not Cohen–Macaulay with respect to Q. Thus, it is natural to ask whether R is sequentially Cohen–Macaulay with respect to Q. We classify all hypersurface rings that are sequentially Cohen– Macaulay with respect to Q. In fact, we show: R is sequentially Cohen–Macaulay with respect to Q if and only if f = h1 h2 where deg(h1 ) = (a, 0) with a ≥ 0 and deg(h2 ) = (0, b) with b ≥ 0. 1. Preliminaries Let K be a field and S = K[x1 , . . . , xm , y1, . . . , yn ] be a standard bigraded polynomial ring over K. In other words, deg xi = (1, 0) and deg yj = (0, 1) for all i and j. We set P = (x1 , . . . , xm ) and Q = (y1 , . . . , yn ). Let M be a finitely generated bigraded S-module. We denote by cd(Q, M) the cohomological dimension of M with respect to Q which is the largest integer i for which HQi (M) 6= 0. Notice that 0 ≤ cd(Q, M) ≤ n. Definition 1.1. We say M is Cohen–Macaulay with respect to Q if we have only one non vanishing local cohomology module with respect to Q. This was previously called under a different name in [10]. Namely, relative Cohen–Macaulay with respect to Q, which for simplicity’s sake, we omit the word ”relative”. We recall the following facts which will be used in the sequel. Fact 1.2. Let M be a finitely generated bigraded S-module. Then (a) cd(P, M) = dim M/QM and cd(Q, M) = dim M/P M, see [10, Formula 3]. (b) grade(Q, M) ≤ dim M − cd(P, M), and the equality holds if M is Cohen– Macaulay, see [10, Formula 5]. (c) The exact sequence 0 → M ′ → M → M ′′ → 0 of finitely generated bigraded S-modules yields cd(Q, M) = max{cd(Q, M ′ ), cd(Q, M ′′ )}, see the general version of [2, Proposition 4.4]. (d) cd(Q, M) = max{cd(Q, S/p) : p ∈ Ass(M)}, see the general version of [2, Corollary 4.6]. Definition 1.3. We call a finite filtration F : 0 = M0 M1 · · · Mr = M of M by bigraded submodules a Cohen–Macaulay filtration with respect to Q if 2 (a) Each quotient Mi /Mi−1 is Cohen–Macaulay with respect to Q; (b) 0 ≤ cd(Q, M1 /M0 ) < cd(Q, M2 /M1 ) < · · · < cd(Q, Mr /Mr−1 ). If M admits a Cohen–Macaulay filtration with respect to Q, then we say M is sequentially Cohen–Macaulay with respect to Q. Observe that the ordinary definition of sequentially Cohen–Macaulay modules results from our definition if we assume P = 0. Remark 1.4. By applying Fact 1.2(a) to the exact sequences 0 → Mi−1 → Mi → Mi /Mi−1 → 0 one immediately has cd(Q, Mi ) = cd(Q, Mi /Mi−1 ) for i = 1, . . . , r. Example 1.5. Cohen–Macaulay modules with respect to Q are obvious examples of sequentially Cohen–Macaulay modules with respect to Q. Any module M such that cd(Q, M) ≤ 1 is sequentially Cohen–Macaulay with respect to Q. To see this, we may assume that M is not Cohen–Macaulay with respect to Q. Thus grade(Q, M) = 0 and cd(Q, M) = 1. The filtration 0 = M0 M1 M2 = M where M1 = HQ0 (M) is a Cohen-Macaulay filtration with respect to Q. In the following, we show that the filtration F given in Definition 1.3 is unique. To do so we need some preparation. Lemma 1.6. There is a unique largest bigraded submodule N of M for which cd(Q, N) < cd(Q, M). P Proof. Let be the set of all bigraded submodules L of M such that cd(Q, L) < P cd(Q, M). As M is a Noetherian S-module, has a maximal P element with respect to inclusion, say N. Let T be an arbitrary element in . Fact 1.2(c) implies cd(Q, T + N) < cd(Q, M), hence the maximality of N yields T ⊆ N.  Definition 1.7. A filtration D: 0 = D0 D1 · · · Dr = M of M by bigraded submodules is called the dimension filtration of M with respect to Q if Di−1 is the largest bigraded submodule of Di for which cd(Q, Di−1 ) < cd(Q, Di ) for all i = 1, . . . , r. The dimension filtration introduced by Schenzel [12] is thus a dimension filtration with respect to the maximal ideal m = P + Q. A filtration D as in Definition 1.7 is unique by Lemma 1.6. In order to prove the uniqueness of an F as in Definition 1.3, we will show that F = D. In [7], M is called to be relatively unmixed with respect to Q if cd(Q, M) = cd(Q, S/p) for all p ∈ Ass(M). Lemma 1.8. Let N be a non-zero bigraded submodule of M. If M is Cohen– Macaulay with respect to Q, then cd(Q, N) = cd(Q, M). Proof. Since M is Cohen–Macaulay with respect to Q, it follows from [7, Corollary 1.11] that M is relatively unmixed with respect to Q, i.e., cd(Q, M) = cd(Q, S/p) for all p ∈ Ass(M). As N is a non-zero submodule of M we have Ass(N) 6= ∅ and Ass(N) ⊆ Ass(M). Thus, Fact 1.2(d) implies cd(Q, N) = max{cd(Q, S/p) : p ∈ Ass(N)} = cd(Q, M), as desired.  3 Proposition 1.9. Let F be a Cohen–Macaulay filtration of M with respect to Q and D be the dimension filtration of M with respect to Q. Then F = D. Proof. Let F : 0 = M0 M1 ··· Mr = M and D: 0 = D0 D1 ··· Ds = M; we will show that r = s and Mi = Di for all i. By Remark 1.4 we have cd(Q, Mi−1 ) < cd(Q, Mi ) for all i = 1, . . . , r. Hence, Definition 1.7 says that Mr−1 ⊆ Ds−1 . Assume Mr−1 Ds−1 . Thus Ds−1 /Mr−1 is a non-zero submodule of M/Mr−1 . Since M/Mr−1 is Cohen–Macaulay with respect to Q, it follows from Lemma 1.8 that cd(Q, Ds−1/Mr−1 ) = cd(Q, M/Mr−1 ) = cd(Q, M), where the second equality is yielded by Remark 1.4. Now applying Fact 1.2(c) to the exact sequence 0 → Mr−1 → Ds−1 → Ds−1 /Mr−1 → 0 yields cd(Q, Ds−1 ) = cd(Q, M), a contradiction. Thus Mr−1 = Ds−1 . Continuing in this way, we get r = s and Mi = Di for all i. Therefore, F = D.  We end this section with the following proposition which gives us a class of sequentially Cohen–Macaulay with respect to Q. First we have the following Lemma 1.10. Let M be sequentially Cohen–Macaulay with respect to Q. If M is relatively unmixed with respect to Q, then M is Cohen–Macaulay with respect to Q. Proof. Let 0 = M0 M1 · · · Mr = M be the Cohen–Macaulay filtration with respect to Q. By Fact 2.3 we have grade(Q, M) = grade(Q, M1 ). Since M1 is Cohen– Macaulay with respect to Q, it follows from [7, Corollary 1.11] that M1 is relatively unmixed with respect to Q. Thus grade(Q, M) = grade(Q, M1 ) = cd(Q, M1 ) = cd(Q, S/p) for all p ∈ Ass(M1 ). As M is relatively unmixed with respect to Q and Ass(M1 ) ⊆ Ass(M), we have grade(Q, M) = cd(Q, M), as desired.  Proposition 1.11. Suppose grade(Q, M) > 0 and |K| = ∞. If M is sequentially Cohen–Macaulay with respect to Q, then there exists a bihomogeneous M-regular element y ∈ Q of degree (0, 1) such that M/yM is sequentially Cohen–Macaulay with respect to Q. Proof. We assume that M is sequentially Cohen–Macaulay with respect to Q and let F : 0 = M0 M1 ··· Mr = M be the Cohen–Macaulay filtration with respect to Q. Since grade(Q, M) = grade(Q, M1 ) = cd(Q, M1 ) > 0, it follows that grade(Q, Mi /Mi−1 ) = cd(Q, Mi /Mi−1 ) > 0 for all i. We set Ni = Mi /Mi−1 . Thus by [10, Corollary, 3.5] which is also valid for finitely many modules which are Cohen–Macaulay with respect to Q and have positive cohomological dimension with respect to Q, there exists a bihomogeneous element y ∈ Q of degree (0, 1) such that y is Ni -regular for all i and Ni is Cohen–Macaulay with respect to Q with cd(Q, Ni ) = cd(Q, Ni ) − 1. Here L = L/yL for any S-module L. Consider the exact sequence 0 → Mi−1 → Mi → Ni → 0 for all i. Since y is regular on Ni for all i, it follows that TorS1 (S/yS, Ni ) = 0 for all i. Hence, we get the following exact sequence 0 → Mi−1 → Mi → Ni → 0 for all i. Now the filtration G: 0 = M0 M1 · · · Mr = M/yM is the Cohen–Macaulay filtration for M/yM with respect to Q. In fact, Mi /Mi−1 ∼ = Ni and grade(Q, Ni ) = grade(Q, Ni )−1 = cd(Q, Ni )−1 = cd(Q, Ni ). Hence, grade(Q, Mi /Mi−1 ) = cd(Q, Mi /Mi−1 ). As cd(Q, Mi /Mi−1 ) < cd(Q, Mi+1 /Mi ) for all i, we have cd(Q, Mi /Mi−1 ) < cd(Q, Mi+1 /Mi ) for all i.  4 The following example shows that the converse of Proposition 1.11 does not hold in general. Example 1.12. Consider the hypersurface ring R = K[x1 , x2 , y1, y2 ]/(f ) where f = x1 y1 + x2 y2 . One has grade(Q, R) = 1 and cd(Q, R) = 2. By [10, Lemma 3.4] there exists a bihomogeneous R-regular element y ∈ Q of degree (0, 1) such that cd(Q, R/yR) = cd(Q, R) − 1 = 1 and of course grade(Q, R/yR) = grade(Q, R) − 1 = 0. Hence R/yR is sequentially Cohen–Macaulay with respect to Q. On the other hand, R is not sequentially Cohen–Macaulay with respect to Q. Indeed, Ass(R) = {(f )} and cd(Q, R) = cd(Q, S/(f )) says that R is relatively unmixed with respect to Q. If R is sequentially Cohen–Macaulay with respect to Q, then by Lemma 1.10 R is Cohen–Macaulay with respect to Q, a contradiction. 2. Sequentially Cohen–Macaulayness of L ⊗K N with respect to Q In this section, we characterize the sequentially Cohen–Macaulayness of L ⊗K N with respect to Q as S-module where L and N are two non-zero finitely generated graded modules over K[x] and K[y], respectively. For the bigraded S-module M we define the bigraded Matlis-dual of M to be M ∨ where the (−i, −j)th bigraded components of M ∨ is given by HomK (M(i,j) , K). We set Mk = M(k,∗) = ⊕j M(k,j) and consider it as a finitely generated graded K[y]-module. Lemma 2.1. Let M be a finitely generated bigraded S-module. If M is Cohen– Macaulay with respect to Q with cd(Q, M) = q, then HQq (M)∨ (k,∗) is a finitely generated Cohen–Macaulay K[y]-module of dimension q for all k. Proof. Note that HQi (M)∨  (k,∗) ∼ = HQi (M)(−k,∗) ∨ ∨ i ∼ (M ) = H(y (−k,∗) 1 ,...,yn ) n−i ∼ = ExtK[y] (M(−k,∗) , K[y](−n)). Since M is Cohen–Macaulay with respect to Q with cd(Q, M) = q, it follows from [10, Proposition 1.2] that M(−k,∗) is a Cohen–Macaulay K[y]-module of dimension q, and the conclusion follows immediately.  Lemma 2.2. Let M be sequentially Cohen–Macaulay with respect to Q with Cohen– Macaulay filtration F : 0 = M0 M1 ··· Mr = M with respect to Q. Then q q we have HQqi (M) ∼ = HQi (Mi /Mi−1 ), where qi = cd(Q, Mi ) for i = 1, . . . , r = HQi (Mi ) ∼ and HQk (M) = 0 for k 6∈ {q1 , . . . , qr }. Proof. We proceed by induction on the length r of F . The case r = 1 is obvious. Now suppose r ≥ 2 and that the statement holds for sequentially Cohen–Macaulay modules with respect to Q with filtrations of length less than r. We want to prove it for M which is sequentially Cohen–Macaulay with respect to Q and has the Cohen–Macaulay filtration F of length r. Notice that Mr−1 which appears in the filtration F of M is also sequentially Cohen–Macaulay with respect to Q. Thus q q by the induction hypothesis we have HQqi (Mr−1 ) ∼ = HQi (Mi ) ∼ = HQi (Mi /Mi−1 ) for 5 i = 1, . . . , r − 1 and HQk (Mr−1 ) = 0 for k 6∈ {q1 , . . . , qr−1 }. Now the exact sequence q 0 → Mr−1 → M → M/Mr−1 → 0 yields HQqr (M) ∼ = HQr (Mr /Mr−1 ) and HQt (M) ∼ = HQt (Mr−1 ) for 0 ≤ t < qr . Therefore, the desired result follows.  Fact 2.3. In the proof of Lemma 2.2 one observes that grade(Q, Mi ) = q1 for i = 1, . . . , r. Theorem 2.4. Let L and N be two non-zero finitely generated graded modules over K[x] and K[y], respectively. We set M = L ⊗K N. Then the following statements are equivalent: (a) M is a sequentially Cohen–Macaulay S-module with respect to Q; (b) N is a sequentially Cohen–Macaulay K[y]-module. Proof. (a) ⇒ (b): Let F : 0 = M0 M1 · · · Mr = M be the Cohen–Macaulay filtration with respect to Q . By Lemma 2.2 we have q q H qi (M) ∼ = H i (Mi ) ∼ = H i (Mi /Mi−1 ) Q Q Q where qi = cd(Q, Mi ) = cd(Q, Mi /Mi−1 ) for i = 1, . . . , r and HQk (M) = 0 for q k 6∈ {q1 , . . . , qr }. Note that HQqi (M) ∼ = L ⊗K HQi (N) for i = 1, . . . , r, see also the q proof of [10, Proposition 1.5]. Hence HQqi (M)∨ ∼ = L∨ ⊗K HQi (N)∨ where (−)∨ is the Matlis-dual, see [5, Lemma 1.1]. We conclude that   q ∼ H qi (Mi /Mi−1 )∨ = H i (M)∨ Q Q (k,∗) (k,∗) q ∼ = (L∨ )k ⊗K HQi (N)∨ n−q ∼ = ExtK[y]i (N, K[y])t , where t = dimK (L∨ )k . Since each Mi /Mi−1 is Cohen–Macaulay with respect to Q with cd(Q, Mi /Mi−1 ) = qi , it follows from the above isomorphisms and Lemma i 2.1 that Extn−q K[y] (N, K[y]) is Cohen–Macaulay of dimension qi for i = 1, . . . , r. If k 6∈ {q1 , . . . , qr }, then L ⊗K HQk (N) ∼ = HQk (M) = 0 and hence HQk (N) = 0. Thus n−k ExtK[y] (N, K[y]) = 0 for k 6∈ {q1 , . . . , qr }. Therefore, the result follows from [6, Theorem 1.4]. (b) ⇒ (a): Let N be sequentially Cohen–Macaulay K[y]-module with the Cohen– Macaulay filtration 0 = N0 N1 · · · Nr = N. Consider the filtration 0 = L ⊗K N0 ⊆ L ⊗K N1 ⊆ · · · ⊆ L ⊗K Nr = L ⊗K N. We claim this filtration is the Cohen– Macaulay filtration with respect to Q. First, we note that L ⊗K Ni L ⊗K Ni+1 for all i. Otherwise, we have dim Ni = dim Ni+1 by [11, Corollary 2.3], a contradiction. For all k and i we have the following isomorphisms   H k (L ⊗K Ni )/(L ⊗K Ni−1 ) ∼ = H k (L ⊗K (Ni /Ni−1 ) Q Q ∼ = L ⊗K HQk (Ni /Ni−1 ). The first isomorphism is standard, and for the second one, see the proof of [10, Proposition 1.5]. We set Di = (L ⊗K Ni )/(L ⊗K Ni−1 ) for all i. Thus we have cd(Q, Di ) = dim Ni /Ni−1 for all i. This implies that cd Q, Di−1 ) < cd Q, Di ) 6 for all i. Also each Di is Cohen–Macaulay with respect to Q because Ni /Ni−1 is Cohen–Macaulay for all i.  3. Hypersurface rings which are sequentially Cohen–Macaulay with respect to Q Let f ∈ S be a bihomogeneous element of degree (a, b) and consider the hypersurface ring R = S/f S. We may write X f= cαβ xα y β where cαβ ∈ K. |α|=a |β|=b Notice that R is a Cohen–Macaulay module of dimension m+ n−1. We collect some observations in the following Lemma 3.1. Consider the hypersurface ring R defined above. Then the following statements hold: (a) If a = 0 and b > 0, then R is Cohen–Macaulay with respect to P of cd(P, R) = m and Cohen–Macaulay with respect to Q of cd(Q, R) = n − 1. (b) If a > 0 and b = 0, then R is Cohen–Macaulay with respect to P of cd(P, R) = m − 1 and Cohen–Macaulay with respect to Q of cd(Q, R) = n. (c) If a > 0 and b > 0, then grade(P, R) = m − 1 and cd(P, R) = m, and grade(Q, R) = n − 1 and cd(Q, R) = n. P Proof. In order to proof (a), if a = 0, then we may write f = |β|=b cβ y β . Fact 1.2(a) implies cd(P, R) = dim S/(Q + (f )) = m and cd(Q, R) = dim S/(P + (f )) = n − 1. On the other hand, by Fact 1.2(b), we have grade(P, R) = dim R − cd(Q, R) = m+n−1−(n−1) = m and grade(Q, R) = dim R−cd(P, R) = m+n−1−m = n−1. Thus the conclusions follows. Parts (b) and (c) are proved in the same way.  Notice that if a, b > 0, then R is not Cohen–Macaulay with respect to Q. Thus it is natural to ask whether R is sequentially Cohen–Macaulay with respect to Q. In the following, we classify all hypersurface rings that are sequentially Cohen–Macaulay with respect to Q. We first show the following Proposition 3.2. LetP f ∈ S be a bihomogeneous elementP of degree (a, b) such that f = h1 h2 where h1 = |α|=a cα xα with cα ∈ K and h2 = |β|=b cβ y β with cβ ∈ K, i.e., deg h1 = (a, 0) and deg h2 = (0, b). Consider the hypersurface ring R = S/f S. Then R is sequentially Cohen–Macaulay with respect to P and Q. Proof. We show that R is sequentially Cohen–Macaulay with respect to P . The argument for Q is similar. Consider the filtration F : 0 = R0 R1 R2 = R where R1 = h2 S/f S. We claim that this filtration is the Cohen–Macaulay filtration with respect to P . Observe that R2 /R1 ∼ = S/h2 S is Cohen–Macaulay with respect to P with cd(P, R2 /R1 ) = m, by Lemma 3.1(a) . Now consider the map ϕ: S −→ h2 S/f S given by g 7−→ gh2 + f S. We get the following isomorphism S/h1 S ∼ = = h2 S/f S ∼ R1 /R0 . Thus R1 /R0 is Cohen–Macaulay with respect to P with cd(P, R1/R0 ) = m − 1, by Lemma 3.1(b). Therefore, F is the Cohen–Macaulay filtration of R with respect to P .  7 For the proof of the main theorem, we recall the following results from [8]. Fact 3.3. Let D : 0 = D0 D1 . . . Dr = M be the dimension filtration of M with respect to Q. Then T T (a) Di = pj 6∈Bi,Q Nj for i = 1, . . . , r −1 where 0 = sj=1 Nj is a reduced primary decomposition of 0 in M with Nj is pj -primary for j = 1, . . . , s and Bi,Q = {p ∈ Ass(M) : cd(Q, S/p) ≤ cd(Q, Di )}. (b) Ass(M/Di ) = Ass(M) \ Ass(Di ) for i = 1, . . . , r. (c) grade(Q, M/Di−1 ) = cd(Q, Di ) for i = 1, . . . , r if and only if M is sequentially Cohen–Macaulay with respect to Q. Theorem 3.4. Let f ∈ S be a bihomogeneous element of degree (a, b) and R = S/f S be the hypersurface ring. Then the following statements are equivalent: (a) R is sequentially Cohen–Macaulay with respect to Q; (b) f = h1 h2 where deg h1 = (a, 0) with a ≥ 0 and deg h2 = (0, b) with b ≥ 0. Proof. (a) ⇒ (b): We may that R is not Cohen–Macaulay with respect to Q, Qassume r see Lemma 3.1. Let f = i=1 fi be the unique factorization of f into bihomogeneous P irreducible factors fi with deg fi = (ai , bi ) for i = 1, . . . , r. Note that ri=1 ai = a Pr and i=1 bi = b. Our aim is to show that for each fi we have deg fi = (ai , 0) with ai ≥ 0 or deg fi = (0, bi ) with bi ≥ 0. Assume this is not the case and so there exists 1 ≤ s ≤ r such that deg fs = (as , bs ) with as , bs > 0. Thus we may write that deg fi = (ai , 0) with ai ≥ 0 for i = 1, . . . , s − 1, deg fi = (ai , bi ) with ai , bi > 0 for i = s, s + 1, . . . , t and deg fi = (0, bi ) with bi ≥ 0 for i = t + 1, . . . , r, and t < r. By Fact 3.3(a), R has the dimension Tt filtration F : 0 = (f )/(f ) I/(f ) R = S/(f ) with respect to Q where I = i=1 (fi ). Notice that cd(Q, I/(f )) = n − 1 by Fact 3.3(b) and Fact 1.2(d), and cd(Q, R) = n. As R is sequentially Cohen–Macaulay with respect to Q, we have to have grade(Q, S/I) = cd(Q, R) by Fact 3.3(c). Since S/I is Cohen–Macaulay, it follows from Fact 1.2(b) that grade(Q, S/I) = dim S/I − cd(P, S/I) = (m + n − 1) − m = n − 1, a contradiction. (b) ⇒ (a): follows from Proposition 3.2.  Acknowledgment The author would like to thank Jürgen Herzog for his helpful comments. References [1] W. Bruns and J. Herzog, ”Cohen–Macaulay rings” (Revised edition), Cambridge Studies in Advanced Mathematics 39, Cambridge University Press, 1998. Zbl 0788.13005, MR1251956 [2] M. Chardin, J. P. Jouanolou, A. Rahimi, The eventual stability of depth, associated primes and cohomology of a graded module, J. Commut. Algebra 5(2013), 63-92. Zbl 1275.13014, MR 3084122 [3] N. T. Cuong, L. T. Nhan, Pseudo Cohen–Macaulay and pseudo generalized Cohen–Macaulay modules, J. Algebra 267 (2003), 156–177. Zbl 1068.13009, MR 1993472 (2004f:13012) [4] S. Faridi, Monomial ideals via square-free monomial ideals, Lecture Notes in Pure and Applied Mathematics, 244(2005), 85–114. Zbl 1094.13034, MR 2184792 (2006i:13038) 8 [5] J. Herzog, A. Rahimi, Local duality for bigraded modules, Illinois. J. Math, 51(2007), 137–150. Zbl 1142.13016, MR 2346191 (2008i:13029) [6] J. Herzog, E. Sbarra, Sequentially Cohen–Macaulay modules and local cohomology. In: Tata Inst. Fund. Res. Stud. Math., vol. 16. pp. 327-340. Zbl 1072.13504, MR 1940671 [7] M. Jahangiri, A. Rahimi, Relative Cohen–Macaulayness and relative unmixedness of bigraded modules, J. Commut. Algebra 4(2012), 551-575. Zbl 1266.13011, MR 3053452 [8] L. Parsaei Majd, A. Rahimi, On the structure of sequentially Cohen–Macaulay bigraded modules, Czech. Math. J., to appear. [9] H. Noormohamadi, A. Rahimi, Sequentially generalized Cohen–Macaulayness of bigraded modules, J. Algebra Appl., 15, No. 1 (2016) 1650017–14. [10] A. Rahimi, Relative Cohen-Macaulayness of bigraded modules, J. Algebra 323(2010), 17451757. Zbl 1184.13053, MR 2588136 [11] H. Sabzrou, M. Tousi and S. Yassemi, Simplicial join via tensor product, Manuscripta math 126 (2008), 255-272. Zbl 1165.13003, MR 2403189 (2009c:13021) [12] P. Schenzel, On the dimension filtration and Cohen-Macaulay filtered modules, Commutative algebra and algebraic geometry (Ferrara), Lecture Notes in Pure and Appl. Math., vol. 206, Dekker, New York, (1999), 245-264. Zbl 0942.13015, MR 1702109 [13] R. P. Stanley, Combinatorics and commutative algebra, Second edition, Birkhäuser BostonBasel-Berlin, 1996. Zbl 1157.13302, MR 1453579 [14] M. Tousi, S. Yassemi, Sequentially Cohen–Macaulay modules under base change, Comm. Algebra, 33(2005), 3977-3987. Zbl 1094.13040, MR 2183974 (2006i:13023) Ahad Rahimi, Department of Mathematics, Faculty of Science, Razi University, Baghe abrisham, Kermanshah, Iran and School of Mathematics, Institute for Research in Fundamental Sciences (IPM), P. O. Box: 19395-5746, Tehran, Iran. E-mail address: [email protected] 9
0math.AC